Commit Graph

  • f2bffc4b6b add bindings to query gamepad's face buttons Humza Shahid 2026-01-20 04:19:26 +00:00
  • 6f89fbc89c begin binding gamepad functions from GLFW to SML Humza Shahid 2026-01-19 13:23:47 +00:00
  • c6dee6e9f9 implement function that deletes from both LineGap.t and SearchList, maintaining an exact match between both Humza Shahid 2026-01-18 09:59:00 +00:00
  • 5e3e8b39b1 add function in PersistentVector to insert a match while keeping same absolute indices (to be used when a new match appears after a deletion) Humza Shahid 2026-01-18 08:52:38 +00:00
  • 29d84a9f9f done adding tests for 'PersistentVector.delete' function Humza Shahid 2026-01-18 08:08:45 +00:00
  • 185ef3fc12 done implementing 'PersistentVector.merge', which means that 'PersistentVector.delete' is now complete. (Todo: test 'PersistentVector.delete'.) Humza Shahid 2026-01-18 06:58:41 +00:00
  • 79a0c95a58 implement another case for 'PersistentVector.merge': merge when right depth is greater than left depth Humza Shahid 2026-01-18 06:52:49 +00:00
  • 7b05490812 progress implementing 'PersistentVector.merge' for case where left subtree and right subtree have same depth Humza Shahid 2026-01-18 06:40:22 +00:00
  • 66d672505a fix calculation of number to decrement by in 'PersistentVector.delete', after additional test showed that calculation resulted in incorrect metadata. (Todo: just implement function to merge left and right subtrees.) Humza Shahid 2026-01-18 00:27:03 +00:00
  • 83bb852ae2 add another test for 'PersistentVector.delete Humza Shahid 2026-01-17 23:45:20 +00:00
  • 1c947eab7d add a test for 'PersistentVector.delete' (even though the 'PersistentVector.merge' helper function is unimplemented) Humza Shahid 2026-01-17 23:27:36 +00:00
  • ee58556bde progress implementing 'PersistentVector.delete'. (Todo: implement function to merge left and right vectors.) Humza Shahid 2026-01-17 23:14:05 +00:00
  • b84713a98e add 'PersistentVector.countDepth' function, which is meant to count the depth, and is to be used for deletion Humza Shahid 2026-01-17 22:51:06 +00:00
  • 4280f580a2 add function to decrement persistent-vector.sml. (The plan is to split the left and right, and then decrement the right metadata so that the absolute indices match.) Humza Shahid 2026-01-17 22:46:08 +00:00
  • 98ec1fbee6 fix another size-recalculation mistake in 'PersistentVector.splitRight' function. (When we are splitting in the middle of a BRANCH, we want to subtract the old child size from the remainder, and then add the new child size to the remainder, because this calculation will account for the splitting of preceding elements.) Humza Shahid 2026-01-16 22:40:38 +00:00
  • e52d4856ee amend recalculation of size metadata in 'PersistentVector.splitRIght: we always want to decrement by prevSize in this function. (We will have another function call to decrement so that left split and right split represent the same absolute indices when they are joined, before they are split.) Humza Shahid 2026-01-16 22:31:43 +00:00
  • ddcb0ea56d finish initial implementation for 'PersistentVector.splitRight' Humza Shahid 2026-01-16 22:16:44 +00:00
  • eb316d7be2 begin implementation of PersistentVector.splitRight function Humza Shahid 2026-01-16 21:58:59 +00:00
  • 08abb43e3b added tests for 'PersistentVector.splitLeft' function Humza Shahid 2026-01-16 21:30:56 +00:00
  • 47cf451501 begin adding tests for 'PersistentVector.splitLeft' function Humza Shahid 2026-01-16 21:16:23 +00:00
  • e0bebb6d1a add tests checking that PersistentVector.toList works as expected Humza Shahid 2026-01-15 13:20:45 +00:00
  • 290cc65a52 add tests checking that persistent-vector.sml appends properly, as it is meant to Humza Shahid 2026-01-15 13:03:23 +00:00
  • ac3b987c42 add boilerplate helper functions in persistent-vector-tests.sml to check if list contains indices that are in range, or are not in range Humza Shahid 2026-01-15 12:49:02 +00:00
  • ef43efb680 rename some test files Humza Shahid 2026-01-15 12:32:13 +00:00
  • 2058a57026 add functions for testing persistent-vector.sml Humza Shahid 2026-01-15 07:16:04 +00:00
  • 559b254b0c initial implementation of 'PersistentVector.splitLeft' function Humza Shahid 2026-01-15 06:13:38 +00:00
  • 79fda65f78 begin coding 'PersistentVector.splitLeft' function Humza Shahid 2026-01-15 05:51:22 +00:00
  • 267c0c5d96 change persistent-vector.sml's 'prevMatch' function to use rope-like metadata, and remove dead code Humza Shahid 2026-01-15 05:39:55 +00:00
  • d6da7a3ea3 persistent-vector.sml was in a partial state where some functions use rope-like metadata and some functions do not, so change 'nextMatch' function to use rope-like metatadata (still need to change other functions) Humza Shahid 2026-01-15 05:25:17 +00:00
  • e1077b7780 add tests for 'yk' motion (next: implement 'yj' motion and test it) Humza Shahid 2026-01-14 04:49:41 +00:00
  • 66f1fb0b5e implement 'yk' motion (next: add tests for it) Humza Shahid 2026-01-13 23:54:48 +00:00
  • e37e04a2a2 rename 'NormalDelete.deleteLineBack' function to 'NormalDelete.deleteLineUp' which is clearer ('k' in 'dk' motion means move cursor up one line) Humza Shahid 2026-01-13 23:40:29 +00:00
  • f1dd822d5b add tests for 'yl' motion Humza Shahid 2026-01-07 07:52:06 +00:00
  • 407f78ce7a fix bug in 'NormalYank.yankRight' function. Instead of calling 'Int.max (endOfLineIdx, high)', we should call 'Int.min (endOfLineIdx, high)' because we are trying to get the smaller number, and not the largest. Humza Shahid 2026-01-07 06:55:42 +00:00
  • cc4716f3db refactor fcore/normal-yank.sml a bit (replace repeated logic with a function call) Humza Shahid 2026-01-07 06:49:52 +00:00
  • 8b0031ca71 add tests for 'yh' motion Humza Shahid 2026-01-07 06:33:10 +00:00
  • adb8757ed8 implemented 'yh' motion (yank left) Humza Shahid 2026-01-05 10:39:42 +00:00
  • d2f32c1512 add tests for 'da<symbol>' motion, finishing all delete-tests Humza Shahid 2026-01-03 08:39:41 +00:00
  • 210d535b9f reimplement 'da<symbol>' motion to first check if it is inside a symbol-pair, just like 'di<symbol>' was reimplemented in recent commits Humza Shahid 2026-01-03 08:36:07 +00:00
  • ba6798f476 make implementation of 'di<symbol>' more robust (we check if the cursor is inside a symbol-pair before checking if there is a symbol pair after the cursor), and add tests for 'di<symbol>' motion Humza Shahid 2026-01-03 08:09:08 +00:00
  • bce2a5a22d finish reimplementing 'di<symbol>' and 'da<symbol>' motions so that they align more closely with the behaviour of Vim. (Todo: test them next) Humza Shahid 2026-01-02 20:07:36 +00:00
  • 886f384490 when deleting inside pair, instead of searching either for either chr1 or chr2 and stopping at first match, search instead for openChr and closeChr, and keep an integer tracking what level of nesting we are at. This gives us the behaviour we want, which is to delete the pair at the correct level of nesting. When we encounter openChr, we increment the nesting counter by 1 and continue searching. When we encounter closeChr, if the nesting counter is 0, we return the current index, but if the nesting counter is higher than 0 when encounter closeChr, we decrement the nesting counter by 1 and continue searching. Humza Shahid 2026-01-02 18:50:04 +00:00
  • 37b6f6ab0a implement function which searches for one of two chars (given as arguments) and returns the index, or ~1 if neither char is found Humza Shahid 2026-01-02 18:12:59 +00:00
  • 8fdf2411a8 add tests for 'd/home/humza/Downloads/sml/shf/todo.md' motion Humza Shahid 2026-01-01 18:47:38 +00:00
  • 54ef305314 reimplement d% motion so that it first searches for the next occurrence of a pair-character before trying to match it. (Next: add tests for d% motion.) Humza Shahid 2026-01-01 07:05:06 +00:00
  • 44dbe1ffb0 reimplement '/home/humza/Downloads/sml/shf/todo.md' motion so that it has the same behaviour as Vim. (If the cursor is not at a pair character, then check after the cursor to see if we find a pair-character there. If some location after the cursor has a pair-character, then move the cursor to it and find the pair of the character, if any.) Humza Shahid 2026-01-01 06:58:30 +00:00
  • a65b950b77 add tests for 'daW' motion Humza Shahid 2025-12-31 11:44:42 +00:00
  • 99bb3b257e done with delete-around-word ('daw') tests. Next: delete-around-WORD ('daW') tests. Humza Shahid 2025-12-28 01:37:29 +00:00
  • 6efce2dd67 make 'dW' motion use transition function that is specific for deleting, and add a test to ensure that 'dW' does not delete a newline when it is not on a newline character Humza Shahid 2025-12-27 09:45:11 +00:00
  • 5c5910f748 change vi-caps-word-dfa.sml to regard newlines as final states, as with vi-word-dfa.sml in previous commit Humza Shahid 2025-12-27 09:35:32 +00:00
  • 1df0952f08 implement the difference between the 'w' motion and 'dw' motion using the transition table in vi-word-dfa, rather than convoluted if-branching Humza Shahid 2025-12-27 08:42:54 +00:00
  • 742b571b4e amend 'dw' motion in line with previous commit Humza Shahid 2025-12-27 07:32:22 +00:00
  • 9846750c51 change implementation of 'word' so that we stop at newlines when we press 'w' motion, like in Vim and add tests to verify this behaviour (todo: fix regressions in deletion tests) Humza Shahid 2025-12-27 06:05:36 +00:00
  • 9e809e146a done adding tests for when cursor is on a space, for 'daw' motion Humza Shahid 2025-12-27 02:41:13 +00:00
  • acabbac70a add another test for 'daw' motion Humza Shahid 2025-12-27 02:22:32 +00:00
  • 846a40a0a6 begin adding tests for 'daw' motion Humza Shahid 2025-12-26 22:49:24 +00:00
  • d1b865bda8 implmenet 'daW' motion (next: test it) Humza Shahid 2025-12-13 03:57:21 +00:00
  • 204f549c79 implement 'daw' motion Humza Shahid 2025-12-13 03:40:32 +00:00
  • 7130fe7dda add tests for 'diW' motion, and fix a bug in the implementation (contiguous spaces were not deleted properly) Humza Shahid 2025-12-12 20:08:53 +00:00
  • bf62b35825 add tests for 'diW' motion, including one which fails (need to fix) Humza Shahid 2025-12-12 19:17:00 +00:00
  • 90a103082a after performing delete-inside-word motion, make sure we move cursor back by 1 if cursor is on a newline which is preceded by a non-newline character Humza Shahid 2025-12-12 11:37:52 +00:00
  • 11cb00860b reimplemen 'diw' motion to fix failing test Humza Shahid 2025-12-12 11:32:03 +00:00
  • eb650bfd4b add more tests for 'diw' motion, including one failing test which needs to be fixed. Humza Shahid 2025-12-12 10:45:55 +00:00
  • 1330bcdff9 add a couple of more tests, and revert persistent-vector.sml to how it was before adding rope-like metadata Humza Shahid 2025-12-12 10:30:21 +00:00
  • 2f2d530dae fix calculation for delete function (we needed to fix the calculation of how much to decrement by) Humza Shahid 2025-12-09 13:10:23 +00:00
  • 7a5aca7bf2 add function in persistent-vector.sml to insert Humza Shahid 2025-12-09 12:33:06 +00:00
  • 102f2788a1 add basic tests for PersistentVector.delete Humza Shahid 2025-12-09 12:27:23 +00:00
  • e6bda83309 begin adding tests for persistent-vector.sml, and add bug fix to 'PersistentVector.delete' in light of one of the tests. (We were decrementing by the wrong value previously, but I fixed it and added a comment of how we arrive at the value we want to decrement by Humza Shahid 2025-12-09 11:42:30 +00:00
  • 51bce52ea4 add from/toList conversion functions for testing persistent-vector.sml Humza Shahid 2025-12-09 10:44:43 +00:00
  • cd8958cced implement a function to delete from persistent-vector.sml Humza Shahid 2025-12-09 10:31:31 +00:00
  • 69fcbfc35d add function to decrement indices in persistent-vector.sml Humza Shahid 2025-12-09 10:07:46 +00:00
  • d52c350a90 formatting for persistent-vector.sml (absolutely no changes other than formatting) Humza Shahid 2025-12-08 22:40:38 +00:00
  • 2ba18a38b0 entirely done with first pass implementing persistent-vector.sml's 'prependJoin' helper function. Humza Shahid 2025-12-08 22:37:13 +00:00
  • 0c668c9f14 almost done implementing persistent-vector.sml's 'prependJoin' helper function. (BRANCH case is fully implemented, but I need to implement the LEAF case next.) Humza Shahid 2025-12-08 22:23:01 +00:00
  • b6cad904f9 implement function to join when left has greater depth than right. (I need to implement a function to join when right is greater than left though. Humza Shahid 2025-12-08 10:57:00 +00:00
  • 3aab8698ed begin coding function to join two 'PersistentVector.t's. Humza Shahid 2025-12-07 04:12:39 +00:00
  • 0650b372b2 complete first pass of implementing 'splitRight' in persistent-vector.sml Humza Shahid 2025-12-07 03:43:15 +00:00
  • 3318501c00 in persistent-vector.sml's 'splitRight' function, make sure we decrement the remaining size table that remains after the split. Humza Shahid 2025-12-07 03:22:38 +00:00
  • 470d36f82b delete insert function and helper functions in persistent-vector.sml, due to a simpler approach: for insertion, we will split the vector into left and right halves, then append the new element to the left half, then concat both halves together again. This is similar to the approach for RRB trees. Humza Shahid 2025-12-06 02:19:42 +00:00
  • ca5baf8fd7 progress with ''helpInset' function in persistent-vector.sml: BRANCH case is fully implemented, and need to impelement LEAF case next Humza Shahid 2025-12-06 00:28:29 +00:00
  • db459d59ad progress reimplementing 'helpInsert' in persistent-vector.sml by adding a helper function for creating a vector when the current node is split Humza Shahid 2025-12-05 18:53:02 +00:00
  • 1f5cf157b1 progress reimplementing 'helpInsert' so that it is aware of rope-like metadata Humza Shahid 2025-12-05 13:32:16 +00:00
  • 343951948c begin reimplementing persistent-vector.sml's 'helpInsert' function so that it uses rope-like metadata Humza Shahid 2025-12-05 10:11:06 +00:00
  • 237d9f8a38 formatting for fcore/persistent-vector.sml Humza Shahid 2025-12-03 11:06:08 +00:00
  • 0625c33bec modify next/prev match functions to index using rope-like metadata Humza Shahid 2025-12-03 11:00:02 +00:00
  • 22aa18699e modify PersistentVector.nextMatch and relevant functions so that they index using the roles of rope-like metadata Humza Shahid 2025-12-03 10:18:44 +00:00
  • bd3d5ef54c pull in changes from brolib-sml to receive new version of LineGap module containing bug fixes. These bug fixes special case going to line 0 or convert line 0 to idx 0, as previous implementations did not work correctly when provided with 0 as a value. Humza Shahid 2025-12-03 00:37:27 +00:00
  • e7a08e27af fix compiler error (was using curent module's name to refer to a function from current module, which is not supported in SML) Humza Shahid 2025-12-03 00:34:30 +00:00
  • 7a8961af9c special case LineGap.goToLine, when the line requested to go to is 0. When this happens, we call 'LineGap.goToStart'. Humza Shahid 2025-12-03 00:31:57 +00:00
  • 4925bcd370 for LineGap.lineNumberToIdx function, add a branch at the start checking if we are trying to get the idx corresponding to line number 0. This is needed by the current implementation because the 'lineNumberToIdxLeft' function uses (findLine - 1) in the implementation, and (0 - 1) is an invalid line idx as it is below 0. Humza Shahid 2025-12-02 23:49:29 +00:00
  • 137cbfee19 fix bug when saving search from NORMAL_SEARCH_MODE. Previously, when pressing <Enter> to save the search, the tempSearchList (which searches against a subset of the buffer's text instead of all of it, to ensure we do not spend too much time was spent while the user was entering the regex/search string) was being saved instead of the newly built searchList (which executes the DFA against all of the text) Humza Shahid 2025-12-02 17:55:25 +00:00
  • fde27123cf begin adjusting persistent-vector.sml so that it uses rope-like metadata, meaning relative index offsets to support efficient arbitrary insertion/deletion Humza Shahid 2025-12-02 08:53:23 +00:00
  • 6fba536f6f when insert forces persistent-vector.sml to split, distribute half of nodes to left side and half of nodes to right side. (We avoid repeated tiny vectors this way, which reduces tree height and maintains balance.) Humza Shahid 2025-12-01 14:24:41 +00:00
  • 328a4e76f1 done implementing 'helpInsert' (both leaf and branch caases)for persistent-vector.sml Humza Shahid 2025-12-01 13:51:12 +00:00
  • 17fdeff9ae almost done implementing 'helpInsert' for LEAF case of persistent-vector.sml Humza Shahid 2025-12-01 13:40:53 +00:00
  • 94a3d8eeb4 done implementing 'helpInsert' for BRANCH case (need to imlement the LEAF case next) Humza Shahid 2025-12-01 13:09:46 +00:00
  • 780aefae34 begin implementing function to insert into PersistentVector.t Humza Shahid 2025-12-01 12:24:45 +00:00
  • 8fdc710db4 begin parsing right-arrow in normal mode, for normal mode commands Humza Shahid 2025-11-25 21:37:09 +00:00
  • d60e8bf7aa add todo note to implement yh/yj/yk/yl motions (yank according to h/j/k/l motions) Humza Shahid 2025-11-23 23:44:24 +00:00
  • eefe5221ba begin parsing left arrow in normal mode Humza Shahid 2025-11-23 23:19:31 +00:00