|
|
5d20b81bcc
|
adjust functor to move by dfa so that we cannot go to the last char of the file if (last char is a newline and is preceded by a non-newline), but otherwise we can go to the last char of the file.
|
2025-09-23 11:47:25 +01:00 |
|
|
|
cdc23945a5
|
reimplement vi's 'h' movement, so that we only skip newline characters that immediately follow a non-newline
|
2025-09-21 21:36:59 +01:00 |
|
|
|
d63201ada7
|
reimplement vi's 'l' motion so that we only skip a newline when it is preceded by a non-newline character
|
2025-09-21 17:49:30 +01:00 |
|
|
|
859860b19f
|
reimplement vi's 'j' motion, and remove the original function for this motion which was in cursor.sml
|
2025-09-19 22:33:37 +01:00 |
|
|
|
2c88341c37
|
remove code which became dead after reimplementing vi's 'k' motion
|
2025-09-19 05:27:10 +01:00 |
|
|
|
e4e3961d41
|
in NormalMove.moveToLine function, use new LineGap function, 'LineGap.lineNumberToIdx', to get the index a line is at, and delete the Cursor.getLineStartIdx' function which we no longer need, as that functionality is in brolib-sml itself.
|
2025-09-19 04:45:29 +01:00 |
|
|
|
b6244d4962
|
amend motion to move to a line: if the requested line has a linebreak as the next character after it, stay at the current position, or else add 1 to the linebreak's idx so that we go to the first character of the line
|
2025-09-19 04:03:54 +01:00 |
|
|
|
ad7d103f61
|
rename 'ViLDfa' structure to 'ViHlDfa' since this DFA implements both vi's 'h' motion and vi's 'l' motion
|
2025-09-17 11:02:11 +01:00 |
|
|
|
dbf05ec8dc
|
refactor Cursor.viH to use DFA
|
2025-09-17 10:45:37 +01:00 |
|
|
|
9ddb5f68d7
|
fix bugs in vi-l-dfa (we want to stop looping when the counter is ~1, because the starting character will likely be final/a not-newline, and we want to loop at least once; also, we want to special case 'twoNewlineState' as a final case which causes us to go backwards by 1 instead of treating 'oneNewlineState' as a final/special case). We also modify other code to use the new vi-l implementation in the program.
|
2025-09-17 03:52:31 +01:00 |
|
|
|
c4fedc6434
|
fix 'Cursor.getLineStartIdx' function, which should look at the left nodes if there is no relevant line in this node
|
2025-09-16 22:09:15 +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 |
|
|
|
20a542df29
|
in BinSearch.equalOrMore and BinSearch.equalOrLess, return ~1 if no item is found, for the sake of less ambiguity in usage. Functions that call these have also been adapted.
|
2025-09-13 02:18:14 +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 |
|
|
|
6d9ad9b13b
|
rename a file and a structure because another file with the same name exists, except that one is lowercase and the other is uppercase. Case insensitive filesystems don't like that they had the same name before, except for the case.
|
2025-09-02 02:14:12 +01:00 |
|
|
|
b6960f4c68
|
implemented 'diw' and 'diW' commands for deleting inside a word or WORD
|
2025-08-07 18:33:03 +01:00 |
|
|
|
528aea59a1
|
reimplement vi's '$' motion as a DFA, also eliminating a bug that involves double deleteion in the process
|
2025-08-04 05:37:08 +01:00 |
|
|
|
fe9dd0f034
|
progress functorising
|
2025-08-04 04:24:24 +01:00 |
|
|
|
895c286b4b
|
additional functorisation progress
|
2025-08-04 04:14:17 +01:00 |
|
|
|
55e5778ff7
|
pass env argument in if-character-folder functor, to make it more generic (can access some environment data, which enables more reuse)
|
2025-08-04 04:05:39 +01:00 |
|
|
|
aca8ba44b9
|
functorise some additional functions to reduce boilerplate
|
2025-08-04 03:44:45 +01:00 |
|
|
|
cef8467ff6
|
begin functorising some char iterators which use if-expressions instead of DFAs
|
2025-08-04 03:23:27 +01:00 |
|
|
|
e55a7e2bca
|
add separate folder when deleting end of current word, so that we can fix 'de' and 'dE' motions (the result of the folders for the cursor motion is meant to be decremented by 1, but the result for deleting is not meant to be decremented or incremented at all)
|
2025-08-03 17:35:33 +01:00 |
|
|
|
9662540889
|
remove a couple of unneded functions
|
2025-08-03 14:32:44 +01:00 |
|
|
|
e078ca89d2
|
refactor some code to use looping in DFA (which is faster than looping outside of the data structure)
|
2025-08-03 14:17:25 +01:00 |
|
|
|
af900057b0
|
delete dead code
|
2025-07-20 17:55:43 +01:00 |
|
|
|
d3e54d4102
|
reimplement vi's 'e' command
|
2025-07-20 17:48:45 +01:00 |
|
|
|
146953c25d
|
reimplement vi's 'b' command
|
2025-07-20 17:36:33 +01:00 |
|
|
|
41ca612ca1
|
reimplement vi's 'ge' command (endOfPrevWord)
|
2025-07-20 16:55:42 +01:00 |
|
|
|
8d67c33893
|
reimplement vi's 'w' command to use ViWordDfa
|
2025-07-20 16:04:48 +01:00 |
|
|
|
15fc36c7a4
|
delete some code which is now dead
|
2025-07-20 14:10:35 +01:00 |
|
|
|
90c0d657bc
|
reimplement vi's 'E' command
|
2025-07-20 14:00:59 +01:00 |
|
|
|
6b5a95ff45
|
reimplemented vi's 'B' command (although it needs a little refactoring)
|
2025-07-20 13:09:21 +01:00 |
|
|
|
cf15077480
|
a bit of refactoring
|
2025-07-20 09:56:32 +01:00 |
|
|
|
10b76d98c5
|
functorise some boilerplate code to start a DFA loop
|
2025-07-20 09:39:17 +01:00 |
|
|
|
25fb8bfc5e
|
make DFA for vi next WORD motion, still passing tests
|
2025-07-20 09:12:23 +01:00 |
|
|
|
649bcb66e1
|
a bit of refactoring to allow addition of more tests
|
2025-03-22 05:18:25 +00:00 |
|
|
|
57f012d655
|
reimplement vi0 and helper functions so that they are likely faster (vi0 bring cursor to start of current line; before, this was done by checking each character in the string backwards, but now it is done by looking at the line metadata, which is faster for us by some constant factor)
|
2024-11-26 21:57:02 +00:00 |
|
|
|
eb3eb6c41f
|
fix bug in '^' motion: only move cursor if (chr = /home/humza/Downloads/sml/shf/fcore/cursor.sml' '), not if Char.isSpace (which also returns true if chr is newline or tab) is true
|
2024-11-24 20:32:47 +00:00 |
|
|
|
0bfe549e04
|
add just one more 'word' test, extract steps to delete from search list into a reusable function (don't need to memorise the steps), and fix bug in cursor.sml where we were looking at tl without calculating correct strIdx
|
2024-11-23 05:16:37 +00:00 |
|
|
|
f279dc0937
|
make 'de', 'dE', 'dj' and 'dk' commands work similarly to vi (details are in comments)
|
2024-11-14 08:57:31 +00:00 |
|
|
|
287dc5548d
|
progress implementing searchList data structure
|
2024-11-11 13:23:37 +00:00 |
|
|
|
faff848cb4
|
in cursor.sml's 'helpTillPrevChr' function, properly handle edge case where graphical chr is followed by multiple line breaks
|
2024-11-09 06:33:32 +00: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 |
|
|
|
74822d1541
|
rename cursor.sml's 'clipIdxAfterDelete' function to 'clipIdx', simplify it, and use it in other functions too
|
2024-11-08 20:43:36 +00:00 |
|
|
|
f02a20c6ea
|
clip idx after delete if necessary
|
2024-11-08 18:47:26 +00:00 |
|
|
|
81c516e907
|
fix very minor issue in cursor.sml's 'helpViL' function (previously returned cursorIdx when non-line breaks is followed by non-line break, but now return cursorIdx + 1 instead which is the correct behaviour, because we want to move the cursor rightwards one position in that case
|
2024-11-07 21:07:11 +00:00 |
|
|
|
fdb6e0292a
|
fully done amending 'getCursorColumn' in cursor.sml it seems, because all the inputs I throw at it give the expected results
|
2024-11-07 21:00:56 +00:00 |
|
|
|
63f2945334
|
restore triple-line checking to 'startViK' in cursor.sml, as it seems safer
|
2024-11-07 20:51:02 +00:00 |
|