Spencer Gouw
8a88ae3a68
refac: move SnippetType into snippet.ts
2023-10-08 19:26:36 -05:00
Spencer Gouw
e05c88e941
refac: put extra .ts files into src/
2023-10-08 18:55:01 -05:00
Spencer Gouw
2e1764a3bf
fix: use EditorView (CM) to dispatch changes
2023-10-08 18:54:15 -05:00
Spencer Gouw
eba93321df
fix: stop trimming LHS, instead split by div\n
2023-10-08 03:59:25 -05:00
Spencer Gouw
6b6787a552
feat: rewrite auto-enter logic to make more sense and work with symbols
...
AutoTriggerEnter logic had a few problems. It wasn't generalized at all and very cumbersome.
There is a simple way to think about the snippet-replacement cycle works.
1. You press enter. A newline is emitted *first*.
2. Peek up and to the right (your old position). Try snippet.
3. If didn't trigger, keep the cursor in the new position.
4. If did trigger, the cursor has moved to cursorEnd.
5. Get rid of the extra newline. It should be between the end of the replacement and the line after it.
6. If YesWS, then add a newline right where you are.
This is how the new logic works.
2023-09-23 16:47:52 -05:00
Spencer Gouw
66ba56328c
doc: add comment for return undefined
2023-09-23 16:46:42 -05:00
Spencer Gouw
998489b576
fix: getSnippetType now properly ORs a number
...
The importance of writingn unit tests.
2023-09-23 13:12:02 -05:00
Spencer Gouw
b10ec1ade3
fix: delete only eol with autotrig enter nows
2023-09-22 22:38:05 -05:00
Spencer Gouw
b769bf70be
refac: properly acknowledge __MR snippet type info
...
Does not fix interaction with auto trigger by enter yet.
2023-09-22 02:44:57 -05:00
Spencer Gouw
641fef15df
clean/feat: integrate symbols with main and clean old comments
2023-09-22 02:22:02 -05:00
Spencer Gouw
86ba8bfade
revert a4c6600
...
This doesn't work if the user doesn't add newlines for the snippets. It's also super manual and hacky. Better to have a solution that doesn't require precision.
2023-09-21 21:36:19 -05:00
Spencer Gouw
a17c4d0dd4
clean: some prints removed
2023-09-18 01:23:06 -05:00
Spencer Gouw
2236c94372
clean: some comments cleaned, one print adjusted
2023-09-18 01:21:57 -05:00
Spencer Gouw
a4c6600aaf
feat: allow whitespace at ends of snippets
2023-08-31 00:22:06 -05:00
Spencer Gouw
b8da7a9e10
feat/refac: rewrote snippet detection, added multiline lhs/rhs
2023-08-20 13:12:38 -05:00
Spencer Gouw
0c1ed70b5c
refac: denest triggerSearchSnippet
2023-08-19 08:16:32 -05:00
Spencer Gouw
f3d5309f44
feat: added newline as snippet divider
2023-06-22 05:26:15 -07:00
Spencer Gouw
553b946db8
clean: format
2023-06-22 05:21:01 -07:00
Spencer Gouw
1b86e49dd3
feat: add resize:both; css and scaling adjustments
2023-04-21 18:40:59 -07:00
Spencer Gouw
9f559b93b6
clean: format and add comment
2023-04-20 02:55:19 -07:00
Spencer Gouw
35db28b423
fix: changed !== to === EnabledNoWS...
2023-04-14 15:28:30 -07:00
Spencer Gouw
61b3c930d2
clean: comments, TODOs
2023-04-14 15:11:38 -07:00
Spencer Gouw
787db1af3f
feat: add options for whitespace or not after snippet trigger
2023-04-14 15:03:44 -07:00
Spencer Gouw
dcdb19e27d
fix: triggerOnEnter should no longer undo!!!
2023-04-14 14:57:38 -07:00
Spencer Gouw
5d41cf173e
fix: defaults should be all off
2023-04-14 14:49:24 -07:00
Spencer Gouw
7170e62912
refac: use activeEditor, not getActiveViewOfType
2023-04-14 13:11:29 -07:00
Spencer Gouw
90311f1b32
fix: snippet scans backwards in line to check lhs match
2023-04-13 15:17:24 -07:00
Spencer Gouw
eb7544e211
feat+refac: incorp. triggerOnEnter, use trigger..Automatically function
2023-04-13 14:07:13 -07:00
Spencer Gouw
47b552e918
feat: add setting triggerOnEnter
2023-04-13 13:57:46 -07:00
Spencer Gouw
066cdab341
fix: snippet rhs works with part divider correctly
2023-04-13 03:56:07 -07:00
Spencer Gouw
906a9b3276
fix: refresh search snippets/search functions on change
2023-04-07 03:01:54 -07:00
Spencer Gouw
b9a3f8f466
fix: actually change triggerOnTab
2023-04-07 02:49:45 -07:00
Spencer Gouw
8ebc66e486
removed some prints
2023-03-15 14:21:11 -07:00
Spencer Gouw
06ced0a5a2
remove funding, register keydown for new windows
...
From the feedback from maintainers.
To allow the plugin to work on popup windows, we register an event on
window open that registers the keydown DOM event implementing expand on
Space/Tab.
There may be a better solution.
2023-03-15 14:17:42 -07:00
Spencer Gouw
bc98eadcd2
cleaned comments, imports, names
2023-03-15 04:08:03 -07:00
Spencer Gouw
69f5b21195
changed id in manifest.json, added TODO for mod key setting
2023-03-15 03:45:11 -07:00
Spencer Gouw
42574695e3
comments on trim and newline symbol
2023-03-15 03:40:18 -07:00
Spencer Gouw
21ff4219fc
fix bug introduced by changing trim to trimEnd :(
2023-03-15 03:38:01 -07:00
Spencer Gouw
ac2a0560cb
setting tooltip update for part divider
2023-03-15 03:32:01 -07:00
Spencer Gouw
464469d649
shift+space/tab doesn't trigger; fixed bug with setting line divider
2023-03-15 03:30:52 -07:00
Spencer Gouw
92ea0bf978
changed trim() to trimEnd()
2023-03-15 03:12:40 -07:00
Spencer Gouw
be0ac1532f
added TODO: implement move symbol
2023-03-15 02:32:31 -07:00
Spencer Gouw
c644e9c0a2
renamed function
2023-03-15 02:31:05 -07:00
Spencer Gouw
e8a3ba798d
renamed settings properly, removed traces of sample plugin types
2023-03-15 02:24:34 -07:00
Spencer Gouw
369ff8f06b
FIX: use both first and last match in searchResults in replaceRange
2023-03-15 02:21:16 -07:00
Spencer Gouw
b8b223a9cc
Refactored snippet reload, added settings, trim snippets, add TODOs
2023-03-15 01:50:57 -07:00
Spencer Gouw
a84fdac359
Fixed initializations and raw string example
2023-03-15 00:55:06 -07:00
Spencer Gouw
e2fcef600b
First commit, search snippets done
2023-03-15 00:04:06 -07:00