Commit Graph

72 Commits

Author SHA1 Message Date
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
5ba82ea7e1 if we can fit at least 80 chars in a single line on the screen, centre all visible text on the screen 2025-08-31 01:15:29 +01:00
83e062eb60 fix visual bug resulting from 'TextBuilder.buildTextStringSearch' function. When we have a search string 'abc' and a file 'abcabc', there are two matches and it should also look like there are two matches, but it did not look like there were two matches prior to this commit. This commit fixes that by advancing the search position before adding to the text accumulator. 2025-08-31 00:05:48 +01:00
2b3f0405c6 reimplement search-range functionality to scan range from the string from left to right 2025-08-30 23:31:55 +01:00
de46376e4e reimplement search list functionality (when building whole search list, not from range) to start from index 0, to get rid of edge cases resulting from reading the string backwards 2025-08-30 23:05:11 +01:00
7497dc7e7a add code for clojure-style persistent vectors 2025-08-30 18:12:47 +01:00
0647589f13 handle edge case in searching: when we look for 'abba' in the text 'abbabba', it looks like we should have two matches, but to be consistent with other programs, we only have one match 2025-08-30 17:16:02 +01:00
d4d0236dab amend cursor.sml's 'helpTillNextChr' function to work with new line break scheme, and use it to implement 'delete till' functionality starting with 'dt' (for example, 'dta' deletes till 'a', 'dts'detetes till 's', etc.) 2024-11-09 05:35:32 +00:00
a77003e348 seem to have viK and viJ fixed for the moment, except when I delete from the first or second line with 'x' (deleting from other lines does not seem to make a difference) 2024-11-07 12:59:03 +00:00
b0a37c5c56 new task: rewrite basic cursor.sml functions (h, j, k, l) to look for 'is line break preceded by non-line break?' rather than 'is there a double line break?' because the second question which is already implemented has buggy behaviour on triple line breaks, where cursor does not go to the place user expects. Currently, on Cursor.viL has been rewritten to match the first question. 2024-11-05 13:14:52 +00:00
47f4d452fe amend error in cursor.sml's 'getCursorColumn' function, where we may need to check tail of string to start convert cursorIdx to relative strIdx 2024-10-19 23:04:26 +01:00
19073cb56c improve code to move rightwards in cursor.sml (making it clearer with comments), and improve code to draw cursor at newline in text=builder.sml 2024-10-17 08:40:28 +01:00
0299a9e6b2 draw cursor at newline linebreaks (only \n though and not \r\n) 2024-10-17 06:25:43 +01:00
428e5f2ecd complete implementation of rightwards navigation (viL) 2024-10-17 02:57:26 +01:00