a037211763
add a new test validating that the cursor does not move when cursor is on an empty line
Humza Shahid2025-09-07 21:09:20 +01:00
11212430f4
fix bug with ViDlrDfa.next: we previously did not consider the case of cursor starts on a line containing nothing but a blank \n newline. We consider this now, returning the same index when it occurs.
Humza Shahid2025-09-07 20:59:13 +01:00
b7e0bab04a
modify dedent functionality to support dedenting multiple lines, acting on count parameter
Humza Shahid2025-09-07 15:12:34 +01:00
345801ea08
implement indenting for multiple lines, using the 'count' parameter
Humza Shahid2025-09-07 14:34:00 +01:00
299735f500
only update search list if timestamp for search message is greater than the buffer's modified time
Humza Shahid2025-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.
Humza Shahid2025-09-07 13:24:41 +01:00
9ba3e8464b
add backtract functionality for range search as well
Humza Shahid2025-09-06 23:05:11 +01:00
435c520955
add backtracking functionality to search; when we find a partial but incomplete match, we want to start looking for a match from ('idx + 1'), where 'idx' is the index we started this failed search at.
Humza Shahid2025-09-06 22:53:07 +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.
Humza Shahid2025-09-06 10:05:06 +01:00
42bd641be4
add a function to remove line breaks: the equivalent of Vim's 'J' command.
Humza Shahid2025-09-06 04:39:53 +01:00
6ab3e592ad
add yank-delete motions like 'ydw' and so on
Humza Shahid2025-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)
Humza Shahid2025-09-06 03:43:45 +01:00
5bfafe3987
replace redundant code (which matched semantics of a newly added function) with a function call.
Humza Shahid2025-09-06 03:07:01 +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.
Humza Shahid2025-09-06 02:46:49 +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.
Humza Shahid2025-09-06 01:40:32 +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
Humza Shahid2025-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)
Humza Shahid2025-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
Humza Shahid2025-09-05 23:46:10 +01:00
d135526386
refactoring, and fix bug in 'y^' motion. (When cursor is after first-non-space-character, copy from first-non-space-character to cursor. Otherwise, copy spaces at beginning until first-non-space-character.)
Humza Shahid2025-09-02 12:33:02 +01:00
44441ad26b
add two additional terminal yank operations: '<count-y-n> for copying to next match, and <count-y-N> for copying to prev match
Humza Shahid2025-09-02 11:48:14 +01:00
a90cdf7943
implement a couple of more yank operations
Humza Shahid2025-09-02 11:35:29 +01:00
74f1fb77ab
parse a few additional motions for yanking
Humza Shahid2025-09-02 03:13:01 +01:00
ea38e95e6b
add a few additional motions to be parsed by yank
Humza Shahid2025-09-02 03:07:50 +01:00
298cec88b3
create higher order functions to remove boilerplate code when implementing different yank cases
Humza Shahid2025-09-02 02:55:19 +01:00
b3436b2963
implement function to yank a single line
Humza Shahid2025-09-02 02:37:08 +01:00
72e3b59bb7
because GLFW at this time has clipboard bugs on Wayland (setting clipboard string), we print out whenever the shell receives a 'yank' message indicating for GLFW to copy. This will let us test that the correct string is yanked.
Humza Shahid2025-09-02 02:18:14 +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.
Humza Shahid2025-09-02 02:14:12 +01:00
75916234e6
pull in new version of cozette-sml, which makes '=' glyph better aligned with other glyphs
Humza Shahid2025-09-01 23:10:08 +01:00
60cf6a580f
add r, g, b arguments to equals function (forgot to do this in previous commit)
Humza Shahid2025-09-01 23:07:45 +01:00
8f164faabe
move equals sign up by 1 pixel, for better alignment with the other characters
Humza Shahid2025-09-01 23:05:39 +01:00
e5b45461b4
update shf-test.mlb to make acquire changes in main (tests have not been compiling for a few days, since persistent-vector.sml was added, and that's fine because I was working on unrelated aspects)
Humza Shahid2025-09-01 16:23:16 +01:00
1419843508
add function to convert string to an unescaped string
Humza Shahid2025-09-01 13:46:16 +01:00
1296ce367b
handle resize event and concurrent (permanent and full) search result in NORMAL_SEARCH_MODE
Humza Shahid2025-09-01 12:52:26 +01:00
faac32e0f8
add note about unhandled keys in normal mode
Humza Shahid2025-09-01 12:01:54 +01:00
3e69c41d8f
implement functionality for left and right arrow keys to move cursor left/right when entering searchString in NORMAL_SEARCH_MODE
Humza Shahid2025-09-01 11:33:01 +01:00
a10e56935e
scaffolding for arrow-movement functionality
Humza Shahid2025-09-01 11:23:45 +01:00
53082315ac
draw cursor when in NORMAL_SEARCH_MODE
Humza Shahid2025-09-01 11:04:56 +01:00
ea4dae3c53
implement backspace for normal-search-mode
Humza Shahid2025-09-01 03:34:16 +01:00
b80bc3d93c
add searchCursorIdx field specific to NORMAL_SEARCH_MODE which we will later use to keep track of where to add/remove characters in the in-progress searchString from
Humza Shahid2025-09-01 03:18:45 +01:00
71c77fc6ac
redraw screen when we change from NORMAL_MODE to NORMAL_SEARCH_MODE, so it is visually clear that we have changed modes
Humza Shahid2025-09-01 03:04:39 +01:00
f4a4dd9161
scaffolding for backspace functionality
Humza Shahid2025-09-01 02:52:05 +01:00
3f7009bf09
prefix search string with a / in NORMAL_SEARCH_MODE, just like in Vim
Humza Shahid2025-09-01 02:39:16 +01:00
0f945c9646
create an 'exitToNormalMode' function which exits NORMAL_SEARCH_MODE and creates a message to redraw the screen so that it looks like normal mode
Humza Shahid2025-09-01 02:26:25 +01:00
561e45c556
extract reusable function which can be used when a search string is changed, in NORMAL_SEARCH_MODE
Humza Shahid2025-09-01 02:18:23 +01:00
9bae969511
add function to build a Real32.real vector list for a single line from a string, in text-builder.sml. To be used for building search string area in NORMAL_SEARCH_MODE.
Humza Shahid2025-09-01 01:24:56 +01:00
634bc6f577
add additional constant/unchanging parameters to env record, in text-builder.sml
Humza Shahid2025-09-01 01:07:26 +01:00
95c6af3ec7
in 'TextBuilder.buildWithExisting' function, allow the user to pass a floatWindowWidth and floatWindowHeight which may differ from windowWidth and windowHeight parameters. This enables us to draw text only in a specified area.
Humza Shahid2025-09-01 00:52:27 +01:00
c95ae5eae3
add functionality to return from NORMAL_SEARCH_MODE back to NORMAL_MODE, saving new search string and new search list
Humza Shahid2025-08-31 07:40:31 +01:00
542da2229c
a little additional scaffolding for normal mode
Humza Shahid2025-08-31 02:41:37 +01:00
3b6dff3081
begin scaffolding NormalSearchMode (normal mode, except we are searching)
Humza Shahid2025-08-31 02:10:57 +01:00
1cf33c9dd7
add todo note that text-window.sml needs to be changed so that it acts as if the screen is 80 chars wide if the screen can fit more than 80 chars, the same way text-builder.sml was changed in previous commits
Humza Shahid2025-08-31 01:47:11 +01:00
a9fda7d88b
change text building function in text-builder.sml to use the 'startX' and 'startY' fields added to the environment type
Humza Shahid2025-08-31 01:38:42 +01:00
648346e5ba
fix regression caused by 'TextBuilder.advanceSearchPos' function. We were previously checking if the absIdx is in the search range and advancing based on whether that is true or false, but we should only advance if absIdx is after the search range
Humza Shahid2025-08-31 01:33:20 +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
Humza Shahid2025-08-31 01:15:29 +01:00
7ac676e621
add textLineWidth value to text-constants.sml, which we can use to calculate functionality of centering on screen
Humza Shahid2025-08-31 01:00:31 +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.
Humza Shahid2025-08-31 00:05:48 +01:00
659a1d2585
change buildRange length from 777 to 1111
Humza Shahid2025-08-30 23:36:14 +01:00
2b3f0405c6
reimplement search-range functionality to scan range from the string from left to right
Humza Shahid2025-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
Humza Shahid2025-08-30 23:05:11 +01:00
148b72835b
move buffer to start before creating searchMsg
Humza Shahid2025-08-30 18:21: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
Humza Shahid2025-08-30 17:16:02 +01:00
113c3e67ab
don't show falling frame when dropping
Humza Shahid2025-08-30 01:00:37 +01:00
a1b88b9d3b
add fall sprite for dvd (to be used after a jump)
Humza Shahid2025-08-30 00:24:25 +01:00
cc2eb419ab
use timing information introduced in MAIN_ATTACKING case so that a second attack is required to add a falling enemy to the player's list
Humza Shahid2025-08-29 13:55:46 +01:00
1f726539da
record pressedTime when player is performing mainAttack
Humza Shahid2025-08-29 12:46:41 +01:00
a58953e90d
refactor options to use Time.time to track when key is pressed, instead of using a Real.real value
Humza Shahid2025-08-29 12:33:45 +01:00
91bf6854ea
add enemy to falling list when they are defeated
Humza Shahid2025-08-29 12:01:17 +01:00
1d1fed35cf
restore working collision detection code to player's attack
Humza Shahid2025-08-29 10:14:28 +01:00
22d43dc0c1
figure out reason for the strange player/projectile alignment, and address it (when player is facing left, we want to subtract size of whole projectile so it looks like it starts at the leftmost side; however, when player is facing right, we want to add by the width of the player, so it looks like the projectile starts from the player's rightmost side)
Humza Shahid2025-08-29 03:43:10 +01:00
e3972fab81
figure out a good hardcoded alignment value
Humza Shahid2025-08-29 03:24:17 +01:00
9120460392
a tiny bit of refactoring, extracting a function to get frames when walking which encapsulates logic for calculating which walk frame to use
Humza Shahid2025-08-28 16:03:49 +01:00