Commit Graph

24 Commits

Author SHA1 Message Date
351f7e9bf9 fix edge case with 'd$' motion: if deleting to end of file, we need to append two newlines 2025-09-22 12:28:08 +01:00
6f968ee8e5 in 'dk' motion, make sure we move the cursor to the start of the previous line in all cases 2025-09-22 09:46:43 +01:00
639f71009c done reimplementing 'MakeNormalDelete.deleteLineBack', taking care of cases where we use this motion while on the first line or on the last 2025-09-21 16:40:05 +01:00
3ea44d9725 progress reimplementing 'NormalDelete.deleteLineBack' function 2025-09-21 15:45:14 +01:00
2758b864bc fix bug found by unit test: when deleting leftwards, we should never delete beyond the end of the line 2025-09-20 18:04:59 +01:00
dbf05ec8dc refactor Cursor.viH to use DFA 2025-09-17 10:45:37 +01:00
12478f8ac2 remove references to 'Cursor.clipIdx' and delete that function once it is no longer used 2025-09-16 16:08:01 +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
3d9bf962e7 handle additional deleteLine edge case 2025-09-16 07:40:58 +01:00
70ffea21b3 fix the last MakeNormalDelete.deleteLine bug: if we delete such that the startIdx (prior to deletion) becomes longer than the text in the buffer, we move the cursor to the start of the last line 2025-09-16 07:01:55 +01:00
6507b9d49c adjust MakeNormalDelete.deleteLine implementation slightly, because the previous implementation did not delete the last character when we are at the end of the file 2025-09-16 06:29:35 +01:00
bbe39f90d4 move cursor to low/cursorIdx in helper function 2025-09-13 08:48:00 +01:00
422d6ad9ac fix bugs in implementing and using text buffer. Some functions did not save the drawMsg to the app's state, which we means we didn't draw in those cases. The text builder functions also drew cursors on characters even when the cursor is not at this position. Both of these bugs are fixed. 2025-09-12 23:21:53 +01:00
2ad7623848 fix further compiler errors 2025-09-12 13:47:14 +01:00
8698333f5b refactor to make sure that we count the visual scroll column on move/delete, in normal mode 2025-09-11 23:43:09 +01:00
fd303c0f7d reimplement part of 'deleteToEndOfLine' function in make-normal-delete.sml, so that it doesn't rely on the 'helpRemoveChr' function, and so we can delete the 'helpRemoveChr' function. 2025-09-07 23:24:31 +01:00
494c702ab6 add commends to clarify 'removeChr' logic. 2025-09-07 23:06:52 +01:00
e2acdd90f4 new implementation for removing characters with 'x', which is simpler than previous implementation as well 2025-09-07 22:30:39 +01:00
f3c1905c0c when constructing SEARCH message, include time in the message as well. This will enable us to ignore any messages when we have a 'later' state available. 2025-09-07 13:24:41 +01:00
89c4e85c98 add indent-line functionality 2025-09-07 13:13:00 +01:00
8d241366a1 handle edge cases in line-break removal function ('J' command). If the newline we find is the last character in the file, we don't delete it, because of Unix convention that text files always end with newlines. 2025-09-06 10:05:06 +01:00
764c5367eb remove unneeded todo comment 2025-09-06 04:53:08 +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
caf43d0864 functorise NormalDelete structure so we can use share the same deletion logic and code for NormalDelete and NormalYankDelete (the latter which is not yet implemented) 2025-09-06 03:43:45 +01:00