Commit Graph

1110 Commits

Author SHA1 Message Date
649bcb66e1 a bit of refactoring to allow addition of more tests 2025-03-22 05:18:25 +00:00
a84490c86c use parametric polymorphism for value in gap_map.sml, instead of specifying value via functor. This is more flexible because a type which is defined after the functor can be used with the map. (The key in gap_map.sml is still specified by functor, though, which is necessary because the structure uses comparison functions which work with the key.) 2025-03-12 23:25:29 +00:00
e2da10e908 amend 'removeMiddle' function in gap_map.sml: before, we were leaving element we want to remove in rkhd/rvhd because we started the slice at 'insPos', but now we increment 'insPos' by 1 so we filter that desired element out 2025-02-14 13:02:42 +00:00
5f834ddaa4 add functor to fold over GapMap in gap_map.sml 2025-02-13 12:40:27 +00:00
f3cc41e9a2 add 'env' parameter to gap_map.sml's mapper 2025-02-13 12:06:20 +00:00
9c32e53160 add 'env' parameter to gap_map.sml's mapper 2025-02-13 12:01:40 +00:00
aa127b28fd add 'env' parameter to gap_map.sml's mapper 2025-02-13 12:01:07 +00:00
9749abf1d5 add 'env' parameter to mapper in gap_map.sml 2025-02-13 11:56:12 +00:00
d23396f5d1 cover exhaustive case reported in gap_map.sml (in 'joinSlices' function), and make it possible to map over values by using a functor 2025-02-13 10:52:55 +00:00
ae3238eabe minor adjustments to gap_vector.sml to make functor fit GAP_VECTOR signature 2025-02-13 08:26:48 +00:00
cfce329255 add gap_vector.sml, which is just the same as gap_buffer.sml, except generic through the use of functors 2025-02-13 08:22:55 +00:00
33678f2b0d code 'remove' function for gap_map.sml, completing the functionality I need for GapMap (but warning that, although most functions were edited from gap_set.sml, gap_map.sml is entirely untested) 2025-02-13 03:21:18 +00:00
2c187d0e87 implement 'moveTo' function for gap_map.sml 2025-02-13 02:41:29 +00:00
d3cca23549 implement 'moveToStart' and 'moveToEnd' functions in gap_map.sml 2025-02-12 13:59:27 +00:00
18bd71d608 fix compile errors regarding 'add' function in gap_map.sml (error was that 'joinSlices' helper function returned 'rightVals = rightKeys' instead of 'rightVals = rightVals') 2025-02-12 13:44:34 +00:00
2e03ae9828 add 'min' and 'max' functions to gap_map.sml 2025-02-12 12:45:45 +00:00
55d20a2b82 done with adding/inserting into GapMap 2025-02-12 12:25:35 +00:00
206df031b3 implement 'insRight' function for inserting to the right 2025-02-12 12:25:08 +00:00
0b8b47312a implement 'insRight' function for inserting to the right 2025-02-12 12:12:27 +00:00
ca3e357fde code 'insLeft' function for gap_map.sml 2025-02-12 11:08:05 +00:00
2048c04179 progress implementing 'add' in gap_map.sml 2025-02-12 10:15:36 +00:00
0ba1679e9a begin implementation of gap_map.sml 2025-02-12 01:51:39 +00:00
713d17fdd3 implement removeMany function for gap_set.sml (but it is untested and more complicated than all the other functions) 2025-02-03 06:39:46 +00:00
47c1492136 implement remove function for gap-set.sml (todo: a 'removeMany' function that takes a startToRemove and endToRemove value, and deletes values in that range) 2025-02-02 04:13:18 +00:00
707a62021a implement 'exists' functions on gap-set.sml 2025-02-01 23:56:33 +00:00
43bff91227 add functions to move around in gap set 2025-02-01 23:21:15 +00:00
7780b767a3 code insert function for gap-set.sml 2025-02-01 22:36:37 +00:00
deb24c2063 with cursor movements, instead of passing in functions as parameters (callbacks/higher order functions), functorise the cursor movement functions instead so we can take advantage of defunctorisation and avoid the runtime cost of closures/higher order functions/function pointers 2025-01-09 22:30:51 +00:00
7045b69ce8 eliminate instance of currying/partial application with constant value (a constant mailbox) is shell/shell.sml 2024-12-17 10:55:58 +00:00
90f8732f06 move msgs into AppType.app_type, and refactor AppUpdate.update function to have type (app_type -> app_type) instead of pervious case which was (app_type -> app_type * MailboxType.t list). Reason: no need to allocate/return tuple when can store messages in type directly; previous msg list will be reset after each app update. All tests after refactor are passing. 2024-12-17 10:40:06 +00:00
24cdea7da3 pull in new version of railroad library, and make a one-line change to print exclusively tests that have failed (because terminal output is noisy otherwise) 2024-12-17 09:49:07 +00:00
fa723f27fa basic motion tests done 2024-11-27 10:17:42 +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
db64917416 add tests for 'E' motion 2024-11-26 11:20:32 +00:00
bc856d3470 add tests for 'e' motion 2024-11-26 11:03:52 +00:00
233a21456d add tests for matching pairs 2024-11-26 00:43:02 +00:00
2cc7bebbd7 add tests for caret ^ motion 2024-11-25 22:13:02 +00:00
c28dc429b7 address todo in text-builder.sml by adding prerequisite: always call SearchList.goToNum before calling TextBuilder.build 2024-11-25 04:37:47 +00:00
d399016c1a add 'SearchList.exists' function to fcore/search-list.sml function, and make sure we check if mmatchedIdx exists before inserting or appending (so we maintain set-like semantics where each number exists only once) 2024-11-24 21:38:58 +00:00
c6343cac40 in fcore/search-list.sml, only call 'insMiddle' function if new value is not in middle 2024-11-24 20:42:17 +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
98f8313141 add motion tests for '$' command 2024-11-24 20:15:07 +00:00
7d73146cf4 remove line breaks between tests in test/test.sml, because more code fits on screen that way, and the differing intentation is enough of a visual sign to mark when new test begins (aside from the 'test' keyword itself) 2024-11-24 19:43:06 +00:00
88ef79ad41 add tests for '0' movement motion 2024-11-24 19:35:47 +00:00
73482a7cc2 give different strings for some tests 2024-11-24 13:43:22 +00:00
d76b753fa7 add tests for 'W' move motion 2024-11-24 12:19:43 +00:00
04d4e013e2 ensure that searchList is deleted from when calling delete functions other than 'helpRemoveChr' 2024-11-23 06:10:40 +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
4a09a5716d add more 'w'/'word' motion tests 2024-11-19 22:41:07 +00:00
c48eeb07b3 finish testing motions for 'k', meaning tests for hjkl motions are complete (can test other motions like 'w', '0', 'e', etc. next, and then test delete motions after that) 2024-11-19 13:02:13 +00:00