Commit Graph

63 Commits

Author SHA1 Message Date
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
80078196e0 if 'MakeNormalDelete.deleteLine' deletes to the end of the file such that there is no newline at the end, then append a newline. This makes one of the tests we have pass. 2025-09-24 13:05:13 +01:00
95a4f109bd progress reimplementing 'j' motion to pass new tests 2025-09-23 15:22:49 +01:00
5fded45303 remove redundant test 2025-09-23 11:11:33 +01:00
4f20379219 take care of a few tests after refactoring/making a different design decision 2025-09-23 11:04:47 +01:00
90eeb6e570 restore temp.txt to original version, as it was being edited for testing purposes 2025-09-22 07:46:45 +01:00
5315aff600 reimplement 'j' motion so that newline is skipped only if immediately preceded by char 2025-09-22 05:32:03 +01:00
d871ac451f restore temp.txt to previous state, as it was temporarily being edited for testing 2025-09-19 03:04:10 +01:00
ab2f2cc752 simplify 'vi-hl-dfa's DFA, removing one state 2025-09-19 02:40:14 +01:00
578d3af5ec remove changes to temp.txt which were only for testing 2025-09-16 15:55:16 +01:00
19d2235686 refactor 'MakeNormalDelete.removeLineBreaks' function to remove function call to 'Cursor.clipIdx', instead relying on textLength field in buffer 2025-09-16 15:53:41 +01:00
18d2579605 remove todo-exception from 'G' (NormalMove.goToEnd) command. The todo was a reminder to implement a way to get the scroll line when moving to the end. We have that implemented now. 2025-09-13 18:15:30 +01:00
bbe39f90d4 move cursor to low/cursorIdx in helper function 2025-09-13 08:48:00 +01:00
295bdc35cf fix bug where some lines were not scrolling horizontally properly. The issue was that, when encountering a line break in 'skipToFirstVisualColumn' function, we should have recursively called the 'skipToFirstVisualColumn' function instead of the 'build' function. The reason is that our current column after a line break is 0, but we don't know if the start column to display is necessarily 0 in all cases. 2025-09-13 00:14:07 +01:00
42bd641be4 add a function to remove line breaks: the equivalent of Vim's 'J' command. 2025-09-06 04:39:53 +01:00
58e74afffb add function to yank inside WORD 2025-09-06 01:15:45 +01:00
73ec4e7578 bug fix when yanking or deleting inside a word (we should not clip 'high' value, and we should search for end of word strictly); this handles cases like when we only have one character in the buffer, or an empty buffer 2025-09-06 01:12:59 +01:00