Commit Graph

79 Commits

Author SHA1 Message Date
1f2af6aacd amend implementation of 'yw' so that we do not yank newline following last word in line, if we are trying to yank last word 2026-02-04 10:12:04 +00:00
83c660818e begin adding tests for 'yw' yank motion 2026-02-04 09:26:57 +00:00
e1077b7780 add tests for 'yk' motion (next: implement 'yj' motion and test it) 2026-01-14 04:49:41 +00:00
66f1fb0b5e implement 'yk' motion (next: add tests for it) 2026-01-13 23:54:48 +00:00
8b0031ca71 add tests for 'yh' motion 2026-01-07 06:33:10 +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 2026-01-03 08:09:08 +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. 2026-01-02 18:50:04 +00:00
8fdf2411a8 add tests for 'd/home/humza/Downloads/sml/shf/todo.md' motion 2026-01-01 18:47:38 +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.) 2026-01-01 06:58:30 +00:00
742b571b4e amend 'dw' motion in line with previous commit 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) 2025-12-27 06:05:36 +00:00
204f549c79 implement 'daw' motion 2025-12-13 03:40:32 +00:00
11cb00860b reimplemen 'diw' motion to fix failing test 2025-12-12 11:32:03 +00:00
0625c33bec modify next/prev match functions to index using rope-like metadata 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 2025-12-03 10:18:44 +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 2025-12-02 08:53:23 +00:00
597b5beb3d add tests (some of Which currently fail) for 'dF<char>' motion 2025-10-18 13:37:42 +01:00
09c9a92029 add tests for 'df<char>' motion. Some fail and need the implementation to be fixed. 2025-10-17 15:56:08 +01:00
c2eaa5537c modify 'd$' implementation to pass failing test (we don't want to delete newline at end of line, so we don't do that now) 2025-10-16 11:09:20 +01:00
c190cec868 add failing test for 'd$' motion 2025-10-16 11:04:26 +01:00
066c39c98d done adding tests for 'dge' motion 2025-10-15 08:52:25 +01:00
5206ec555d add a test for 'dge' motion 2025-10-14 16:26:12 +01:00
78a5fdff58 add another test for 'dge' motion 2025-10-14 15:19:24 +01:00
999a35cb8b fix failing test for 'dge' motion: if the deletion takes us to a newliune that follows a non-newline-character, we should decrement the cursor to be on the non-newline-character 2025-10-14 12:31:18 +01:00
03c3bd310b add an additional test for 'dge' motion 2025-10-14 12:16:18 +01:00
8e56eb7628 begin adding tests for 'dge' delete motion (one test currently fails) 2025-10-13 22:03:49 +01:00
88e1ae00a9 progress adding additional tests for 'db' motion 2025-10-12 08:42:05 +01:00
facc5b3761 begin adding tests for 'db' delete motion 2025-10-12 08:27:14 +01:00
478a2e5002 add some more tests from freeCodeCamp tutorial 2025-10-11 14:27:56 +01:00
7f1f1f7bdc at end of char loop, track if length of dstate changed. If it did not, that means that we have encountered a loop that is at the end; thus, we should add the endMarker 2025-10-11 13:39:28 +01:00
b2931753d0 make dfa-gen.sml compile again, with parity before reimplementing it 2025-10-11 13:23:44 +01:00
96f0afc2b2 attempt at fixing dfa-gen to convert properly 2025-10-11 11:32:30 +01:00
90327579d1 find failing test in regex: 'go*' does not match phrase 'gut feeling'. It should match the first character because the 'o' is optional, but the * acts like + instead, expecting at least one 'o' 2025-10-09 22:46:06 +01:00
3197315478 fix failing tests for escaping regex metacharacters 2025-10-09 06:22:21 +01:00
8941ce9f89 reimplement functionality to search forwards using 'n' command 2025-10-08 08:10:51 +01:00
4dfee016eb handle edge case in char-range: in a range like a-z, the second character may be an escape sequence, and we need to handle that case if so 2025-10-07 12:13:41 +01:00
44c2fbb3c7 handle character ranges like a-z in character class and negated character class 2025-10-07 09:48:10 +01:00
71786a494c fix minor bug with escape sequences: we should pattern match on an unescaped char, and we should return an escaped char. For example, it makes sense to pattern match on plain unescaped /home/humza/Downloads/sml/shf/temp.txt"n" and return /home/humza/Downloads/sml/shf/temp.txt"\n". This is because user inputs escape-chars as a two-char sequence, prepended by a backslash \ character 2025-10-06 21:58:50 +01:00
9dd44c8eca fix implementation of ZERO_OR_MORE (Kleene star) in dfa-gen.sml 2025-10-06 14:45:28 +01:00
8d29bfab78 adjust nfa to return all matches in string, instead of just testing for one match and then returning true 2025-09-29 10:28:03 +01:00
64678bf68e add tests for 'dE' motion 2025-09-27 15:40:26 +01:00
0b490b00bb add tests for 'de' motion 2025-09-27 10:02:05 +01:00
8ad5cc77c3 change colour of text in search bar as well 2025-09-27 08:35:52 +01:00
cd31bdd0d5 add tests for 'dW' motion, which are same as tests for 'dw' motion but testing for WORD instead of word where possible 2025-09-27 07:14:26 +01:00
9e0f62d142 add another test for 'dw' motion when deleting in the second of three words (this one passes) 2025-09-26 07:32:35 +01:00
b31d7650a8 change the way we calculate the newCursorIdx when we delete using the 'dk' motion while on the last line. We go to the buffer's last line and find the first column. This more directly expresses what we want and now passes the failing unit test for 'dk'. 2025-09-25 14:59:29 +01:00
1494d5c356 add two new unit tests for 'dk' motion 2025-09-25 13:58:56 +01:00
bf55373f6d fix 'MakeNormalDelete.deleteLineBack' test, which failed because we were using the wrong way to check if cursor is currently at the start of the line. We checked '(endOfLine = cursorIdx) which works in most cases to verify that the current position is a newline, but fails when the cursor is at the last non-newline character of the line. This is fixed by being more precise and calling 'Cursor.isCursorAtStartOfLine' to check directly if the cursor is currently at the end of the line. 2025-09-25 10:49:20 +01:00
594367d6d8 add another failing unit test for 'dk' motion 2025-09-25 10:02:16 +01:00
11015dfa9e add two more test cases for 'dj' motion that were failing when added, and modify 'MakeNormalDelete.deleteLineDown' to handle them 2025-09-25 05:28:13 +01:00