Commit Graph

719 Commits

Author SHA1 Message Date
d9380bcb64 pass regression test by modifying 'SearchList.backtrackRange' function. The modification that worked was swapping two if-statements around: first we check if the string position is 0 (and loop to check the previous string if so); in the else case, we check if the searchPos <= 1 (which signals for us to exit backtracking). Swapping the order of the if-statements means that, when we exit the loop, we always exit with string that is at this position. 2025-09-27 12:40:28 +01:00
39db9c652e add new test where we receive an exception when deleting while there is a search 2025-09-27 12:31:29 +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
5e9872e4d6 better visual positioning for cursor 2025-09-27 08:14:22 +01:00
2c388899ca use different colours for program 2025-09-27 08:00:21 +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
074ba2bcde done adding tests for 'dw' motion 2025-09-26 08:21:54 +01:00
5e1e66a977 add another test for 'dw' motion 2025-09-26 07:58:23 +01:00
88a1489a54 pass failing test case for 'dw'. When we delete to the end of the file and the position the cursor was previously at no longer exists, move cursor to last valid character in file. 2025-09-26 07:46:42 +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
5503b8ebda add failing test for 'dw' motion 2025-09-26 05:27:48 +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
05abecc70d pass a failing test for 'dk' motion by decrementing newCursorLineNumber if the end of the deletion range is on a newline, and it is also the last char in the buffer 2025-09-25 14:44:39 +01:00
1494d5c356 add two new unit tests for 'dk' motion 2025-09-25 13:58:56 +01:00
6b0149162f a bit of formatting 2025-09-25 10:50:02 +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
1f5e933772 add failing test for 'dk' motion, when cursor is on last character of line 2025-09-25 10:38:57 +01:00
c13ef69a9e pass failing test for 'dk' by paying attention to newlines 2025-09-25 10:31:02 +01:00
5610ccf630 more descriptive name for one test 2025-09-25 10:04:37 +01:00
594367d6d8 add another failing unit test for 'dk' motion 2025-09-25 10:02:16 +01:00
1921f87191 handle edge case which deleted newline incorrectly when it shouldn't, passing failing test for 'dk' motion 2025-09-25 09:49:37 +01:00
75b4f11822 add failing test for 'dk' motion 2025-09-25 09:30:07 +01:00
de8f5b7761 add a few more tests for 'dk' motion 2025-09-25 09:19:15 +01:00
02cc5a0e53 make failing test for 'dk' motion pass by appending a newline to the buffer if the buffer becomes empty 2025-09-25 09:09:18 +01:00
2c3eb6a8a1 begin adding tests for 'dk' motion 2025-09-25 09:03:40 +01:00
0255b127a7 fix minor bug in make-dfa-loop.sml: when folding backwards using an if-statement, make sure we start folding from the leftStrings if the cursorIdx < 0 2025-09-25 08:34:23 +01:00
5264cbfac8 add tests for 'dd' motion, and they all pass 2025-09-25 07:15:17 +01:00
1000e74183 pass failing test for 'dj' motion through a different startLine calculation depending on whether cursor is already on a newline or not 2025-09-25 06:34:08 +01:00
cddd03812b implement first pass of 'MakeNormalDelete.deleteLine'; have to add tests for this next 2025-09-25 06:23:12 +01:00
efaadf1337 a bit of refactoring 2025-09-25 06:18:12 +01:00
b73117d075 add failing test for 'dj' motion, and progress reimplementing 'MakeNormalDelete.deleteLine' 2025-09-25 06:11:36 +01:00
d25a06a9ed progress reimplementing 'MakeNormalDelete.deleteLine 2025-09-25 06:04:11 +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
e24230834e rename existing 'MakeNormalDelete.deleteLine' function to 'MakeNormalDelete.deleteLineDown', make 'dj' and 'ydj' commands use the renamed function, and add a new 'MakeNormalDelete.deleteLine' function (which has no implementation yet). We do this because we want to distinguish between 'dd' and 'dj' commands, allowing 'dd' to delete to the end of the file despite any count, while stoppinhg 'dj' from deleting the file when on the last line. 2025-09-25 04:56:25 +01:00
1255238d6c pass failing tests for 'dj' motion 2025-09-24 19:32:31 +01:00
2076d25653 begin reimplementing 'MakeNormalDelete.deleteLine' function 2025-09-24 17:58:37 +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
222a9aa43c fix 'MakeNormalDelete.removeChr' by accounting for case when we are deleting from last line but the last line does not end with its own newline 2025-09-24 09:46:28 +01:00
e70aab8952 add another failing test for 'dl' motion 2025-09-24 09:07:26 +01:00
95393e1e13 amand MakeNormalDelete.removeChr function (which is used by 'x' and 'dh' commands) to pass test, which checks that cursorIdx does not fall on newline-after-chr after deletion 2025-09-24 09:02:33 +01:00
c500704f04 add failing tests for 'dj' motion 2025-09-24 08:54:13 +01:00
a8bc405727 add failing test for 'dl' motion 2025-09-24 07:58:45 +01:00
00ab086257 remove code related to appending newlines in 'MakeNormalDelete', as we have decided that we allow files which do not end in newlines as well as files that do 2025-09-24 07:18:11 +01:00
51a7c358ca found bug in '0' motion, added test for it, and fixed it as well 2025-09-23 16:05:23 +01:00
9a15b1715a pass all tests for 'j' motion 2025-09-23 15:30:28 +01:00
95a4f109bd progress reimplementing 'j' motion to pass new tests 2025-09-23 15:22:49 +01:00
c3ca8dddf4 add additional failing unit test for 'j' motion 2025-09-23 13:30:54 +01:00
109fda187a add a new failing test, and modify 'TestUtils.init' function (which takes a string and returns an AppType.app_type) so that it does not automatically add a newline to the end of strings. (This modification required changing the strings in some tests, as those strings did not have newlines at the end but the test assumes they did.) 2025-09-23 13:18:36 +01:00
2376ae07b5 fix tests which broke due to a design decision (how to handle newlines) 2025-09-23 12:15:14 +01:00