Commit Graph

788 Commits

Author SHA1 Message Date
543453e8bd unescape an escaped search string 2025-09-01 13:56:32 +01:00
1419843508 add function to convert string to an unescaped string 2025-09-01 13:46:16 +01:00
1296ce367b handle resize event and concurrent (permanent and full) search result in NORMAL_SEARCH_MODE 2025-09-01 12:52:26 +01:00
faac32e0f8 add note about unhandled keys in normal mode 2025-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 2025-09-01 11:33:01 +01:00
a10e56935e scaffolding for arrow-movement functionality 2025-09-01 11:23:45 +01:00
53082315ac draw cursor when in NORMAL_SEARCH_MODE 2025-09-01 11:04:56 +01:00
ea4dae3c53 implement backspace for normal-search-mode 2025-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 2025-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 2025-09-01 03:04:39 +01:00
f4a4dd9161 scaffolding for backspace functionality 2025-09-01 02:52:05 +01:00
3f7009bf09 prefix search string with a / in NORMAL_SEARCH_MODE, just like in Vim 2025-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 2025-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 2025-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. 2025-09-01 01:24:56 +01:00
634bc6f577 add additional constant/unchanging parameters to env record, in text-builder.sml 2025-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. 2025-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 2025-08-31 07:40:31 +01:00
a86befdea8 a bit of refactoring 2025-08-31 06:28:05 +01:00
542da2229c a little additional scaffolding for normal mode 2025-08-31 02:41:37 +01:00
3b6dff3081 begin scaffolding NormalSearchMode (normal mode, except we are searching) 2025-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 2025-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 2025-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 2025-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 2025-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 2025-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. 2025-08-31 00:05:48 +01:00
659a1d2585 change buildRange length from 777 to 1111 2025-08-30 23:36:14 +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
148b72835b move buffer to start before creating searchMsg 2025-08-30 18:21:47 +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
9051717213 remove 'gl_samples' parameter (it was used from antialiasing, but we have a bitmap font, so we don't want antialiasing) 2025-08-20 14:01:24 +01:00
cd21f87732 fix compile error in shell/shell.sml (had to pass an additional parameter: 'Time.now ()') 2025-08-20 13:53:31 +01:00
4d77aed6ef done refactoring tests 2025-08-20 13:50:57 +01:00
0dd7a69777 propagate 'time' value throughout normal mode updating 2025-08-20 13:12:07 +01:00
f97a2944ae pass time parameter in normal-delete.sml 2025-08-20 13:00:36 +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
642814fb36 begin adding a 'bufferModifyTime' field to the app_type (lots of refactoring to do now) 2025-08-20 12:17:07 +01:00
cdc8c0c734 more updates from cozette-sml 2025-08-18 03:35:57 +01:00
714558a739 pull in further updates from cozette-sml librarfy 2025-08-18 03:30:28 +01:00
023136516e pull new version of cozette library, which fixes some odd-looking letters (lower-case-t, lower-case-j, upper-case-x) 2025-08-18 02:59:50 +01:00
41153c32a1 create new rect which is adapted to new text, and use it in text-builder.sml 2025-08-18 02:39:56 +01:00
af15b97400 pull in new version of cozette-ascii library, and fix resulting compile errors (which all occurred in text-builder.sml) 2025-08-18 02:17:13 +01:00
850d3b7bcb done refactoring one text builder loop 2025-08-17 19:32:46 +01:00
845605aa48 fix compile error in make-text-builder.sml 2025-08-17 17:30:51 +01:00
3e67d90512 progress functorising text builder 2025-08-17 17:15:15 +01:00
28593486ed refactor command-parsing code for normal mode, so that non-character events (KEY_ESC, RESIZE_EVENT, WITH_SEARCH_LIST) are dealt with at the beginning, and that the remainder of the parsing code looks at the current string and the new character typed. This is safe because pattern matching on the other commands (KEY_ESC, RESIZE_EVENT, WITH_SEARCH_LIST) always calls the same functions. 2025-08-08 23:23:40 +01:00