Commit Graph

26 Commits

Author SHA1 Message Date
5315aff600 reimplement 'j' motion so that newline is skipped only if immediately preceded by char 2025-09-22 05:32:03 +01:00
c29afbdb7c fix minor bug regarding 'NormalMove.moveCursorDown': after a <count-j> that moved the cursor to the last line in the buffer, the cursor would be at the last column too, even if that wasn't the previous column. To address this issue, we take out code that calculates the lineIdx from the 'NormalMove.finishMoveCursorUpDown' function, and have both 'NormalMove.moveCursorUp' and 'NormalMove.moveCursorDown' calculate their own lineIdx in different ways and pass it to the 'NormalMove.finishMoveCursorUpAndDown' function. 2025-09-20 02:58:51 +01:00
090e7ccea2 pass 'maxLength' value to TextScroll function so that we can prevent scrolling past the bottom of the file (unless we want to od so by centtering the screen) 2025-09-19 23:17:28 +01:00
d3fa4d08bf extract reusable function containing common code previously used in both 'NormalMove.moveCursorUp' and 'NormalMove.moveCursorDown' functions, and make them call the reusable function instead 2025-09-19 22:40:29 +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
9ec8891ce5 fix bugs in new function for moving cursor upwards, taking care to calculate column different if on first line (where there is no preceding newline) vs any line other than the first 2025-09-19 05:23:20 +01:00
4c1a76ae67 begin reimplementing motion to move cursor up (vi's 'k' command), although it is in progress and buggy 2025-09-19 04:59:40 +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
1adb74df2c pull in new brolib-sml changes (which just changes one particular function's name to be clearer), and modify code to use the correct name 2025-09-16 22:20:55 +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
148b108062 when using 'G' command to move to end fo file, use the 'textLength' field to calculate the new bufferIdx, which is more sensible than using the LineGap's idx for the same purpose 2025-09-16 07:52:47 +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
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
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
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
a86befdea8 a bit of refactoring 2025-08-31 06:28:05 +01:00
c4f3e921a3 formating 2025-08-20 12:51:31 +01:00
c21d1b8205 progress fixing compile errors resulting from adding 'bufferModifyTime' field (fixed normal-mode move expressions) 2025-08-20 12:50:39 +01:00
1bdf8e457b implement 'deleteInside' motions 2025-08-07 19:12:01 +01:00
14f97ecc57 done refactoring normal mode functions 2025-08-07 18:09:52 +01:00
85c0b09d26 put cursor-movement functions in their own file 2025-08-07 17:57:47 +01:00
bc188b9175 begin refactoring (split app-update into different files) 2025-08-07 17:41:10 +01:00