|
|
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 |
|
|
|
9b34014af1
|
a few bug fixes to NORMAL_SEARCH_MODE: the main one is that we were passing the general searchString to the resize function before, and we were drawing the wrong string because of that; another bug fix is that, on resizing, we have to update the mode to contain the recalculated searchScrollColumn
|
2025-09-14 10:28:42 +01:00 |
|
|
|
0632f7a969
|
add horizontal scrolling functionality to SearchBar
|
2025-09-14 10:07:43 +01:00 |
|
|
|
f1a06f946d
|
add searchScrollColumn to NORMAL_SEARCH_MODE variant, and update and recalculate it where needed
|
2025-09-14 09:50:07 +01:00 |
|
|
|
428208f9bf
|
when text is wide enough to be centered, also centre the search bar
|
2025-09-14 09:14:22 +01:00 |
|
|
|
7a388f2983
|
add TextScroll function for centering line to cursor, and use it in 'NormalFinish.centreToCursor' function
|
2025-09-13 18:23:55 +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 |
|
|
|
9208c47622
|
fix exception caused by resizing in normal mode: we were passing 'buffer' to the TextScroll function previously, but we were meant to be passing 'newBuffer'. We are passing 'newBuffer' in this new commit as we are meant to.
|
2025-09-13 05:31:11 +01:00 |
|
|
|
668dd07699
|
pull in new version of brolib-sml so that we can get bug fixes for LineGap.getLineNumberOfIdx, delete the TextWindow structure (which was previously used to get the start line to draw from), and replace previous usages of TextWindow with TextScroll.getStartLine. This enables us to scroll in a way tailored to the reimplemented TextBuilder (which do not wrap lines or characters)
|
2025-09-13 05:12:17 +01:00 |
|
|
|
a99b6c8df8
|
implement smoother horizontal scrolling. If the new column is already visible without changing the previous scroll column, then don't change. If the new scroll column is prior to the old, then scroll backwards; else, scroll forwards.
|
2025-09-13 01:43:31 +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 |
|
|
|
77a64ae794
|
previously forgot to draw char in text builder, but we do that now
|
2025-09-12 14:02:38 +01:00 |
|
|
|
2ad7623848
|
fix further compiler errors
|
2025-09-12 13:47:14 +01:00 |
|
|
|
052f0efe16
|
fix compiler errors for normal-move.sml
|
2025-09-12 13:23:46 +01:00 |
|
|
|
22752e3602
|
fix compiler errors in normal-search-finish.sml
|
2025-09-12 13:02:32 +01:00 |
|
|
|
504a054df1
|
fix compiler warniungs in normal-mode/normal-finish.sml, which resulted from reimplementing text-builder functionality
|
2025-09-12 12:49:19 +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 |
|
|
|
dfb7ecb867
|
add new function to calculate the startLine
|
2025-09-11 17:30:49 +01:00 |
|
|
|
580f014481
|
fix getScrollColumn calculation: the right calculation is to subtract the column number by how many columns we can fit
|
2025-09-11 17:09:43 +01:00 |
|
|
|
77439acef6
|
add function to get the appropriate scroll column
|
2025-09-11 16:17:56 +01:00 |
|
|
|
e85ac5e806
|
add visualScrollColumn' field to app type, which will record the scroll position for us
|
2025-09-11 15:26:30 +01:00 |
|
|
|
0f78a25382
|
add z-index parameter to cursors, and refactor code to use them
|
2025-09-11 01:53:13 +01:00 |
|
|
|
0a0f723b9b
|
add '<count>yx' function to both yank and delete a specified character
|
2025-09-07 23:39:33 +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 |
|
|
|
a037211763
|
add a new test validating that the cursor does not move when cursor is on an empty line
|
2025-09-07 21:09:20 +01:00 |
|
|
|
b7e0bab04a
|
modify dedent functionality to support dedenting multiple lines, acting on count parameter
|
2025-09-07 15:12:34 +01:00 |
|
|
|
345801ea08
|
implement indenting for multiple lines, using the 'count' parameter
|
2025-09-07 14:34:00 +01:00 |
|
|
|
f7960efab1
|
add dedent functionality
|
2025-09-07 14:03:31 +01:00 |
|
|
|
299735f500
|
only update search list if timestamp for search message is greater than the buffer's modified time
|
2025-09-07 13:37:14 +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 |
|
|
|
6ab3e592ad
|
add yank-delete motions like 'ydw' and so on
|
2025-09-06 03:53:47 +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 |
|
|
|
5bfafe3987
|
replace redundant code (which matched semantics of a newly added function) with a function call.
|
2025-09-06 03:07:01 +01:00 |
|
|
|
0dede58ca0
|
done parsing yank-around
|
2025-09-06 02:59:05 +01:00 |
|
|
|
fb6cab7d0d
|
fix minor bug when deleting around (with motion like da( or da< or da) or da>). The bug was that, if the last character we delete with the highest index is also the last character at the end of this line, we deleted the range properly but placed the cursor at a linebreak. In this case, the cursor is meant to be a single character before the line break, and after this commit, we have this desired behaviour.
|
2025-09-06 02:46:49 +01:00 |
|
|
|
0506cf6176
|
done implementing 'yankInside' functions and functionality.
|
2025-09-06 02:27:01 +01:00 |
|
|
|
9369bbed93
|
in normal mode, when we receive an event which we don't want to handle (like enter), we clear the app's mode and command history instead of simply returning the same app unmodified. This fixes a bug: say we pres 'f' to go to a character and then press enter. Before this commit, pressing a character after that 'enter' will go to that character. This is contrary to Vim, which resets the command history on an invalid command, and now we reset the command history too.
|
2025-09-06 01:40:32 +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 |
|
|
|
b9332bcd94
|
fix bugs related to deleting ('dge' and 'dgE' motions should also delete the letter which the cursor is currently at, and now they do)
|
2025-09-06 00:02:37 +01:00 |
|
|
|
76e14ea491
|
add functions to yank to end-of-previous-character, and to yank from current line to start of buffer
|
2025-09-05 23:46:10 +01:00 |
|