Commit graph

1034 commits

Author SHA1 Message Date
Diegovsky
e808bee352 Format with stylua 2024-09-12 20:30:31 +02:00
Diego Augusto S. C
9d08546168 Add log path getter, time format 2024-09-12 20:30:31 +02:00
L3MON4D3
7ad2eaeaca Format with stylua 2024-08-20 20:21:31 +00:00
L3MON4D3
838b2668c5 remove select_keys, just allow direct access to pre_yank and post_yank. 2024-08-20 22:20:40 +02:00
L3MON4D3
d48c8ed8e1 add new setting for copying the selection (instead of cutting). 2024-08-20 22:20:40 +02:00
L3MON4D3
b84eeb3641 Format with stylua 2024-08-06 21:26:37 +00:00
L3MON4D3
9033373173 feat: allow modifying expand-position in pre_expand-callback (#1219). 2024-08-06 23:23:53 +02:00
L3MON4D3
93d4dcd61f fix bug introduced by 365bebd.
Very stupid, util -> loader_util.
2024-06-28 22:18:37 +02:00
L3MON4D3
93abea587d Format with stylua 2024-06-28 20:12:15 +00:00
L3MON4D3
365bebd79a fix(loaders): trim whitespace around comma and at start/end of "scope".
Closes #1199.
Apparently this is supported by vscode, and its' no biggie, so let's
just do it too.
2024-06-28 22:07:17 +02:00
xudyang1
d890d6d6b9
fix(util): Path.parent now works on windows (#1168) (#1180)
On Windows, both forward slash `/` and backslash `\\` work as the path
separator. Linux and MacOS can have backslash as a valid filename
character.

Unit tests are also provided for each platform because `Path.parent`
depends on the local variable `sep` which depends on `jit.os`.

Fixes #1168
2024-05-24 09:34:09 +02:00
L3MON4D3
20448f4573 fix: stay compatible with old nvim-versions.
they don't have vim.list_contains.
2024-05-18 08:31:20 +02:00
Leiser Fernández Gallo
03c607c2bd
ft_func: translate treesitter-language to filetypes (close #1174).
Sometimes the treesitter-language-name coincides with the filetype (like for cpp), but in other cases, these are wholly different (lang: latex, filetype: tex/sty/cls). So, to be more accomodating and forego the need on the users part to define the correct `ls.filetype_extend`, we resolve language to filetypes in here.
2024-05-17 17:22:18 +02:00
L3MON4D3
6f23556cff fswatch: move-to <=> change (close #1171). 2024-05-16 17:43:02 +02:00
L3MON4D3
2b7395217e vscode-loader: correctly handle symlinked package.json (close #1170). 2024-05-14 12:23:30 +02:00
gokberkgunes
0a4e557017
Exit snippets upon jumping to $0 (close #1161)
This restores the pre-d9cb6ab-behaviour of completely leaving a snippet once $0 is reached, instead of leaving the possibility of jumping back into it.
This behaviour can be turned on or off via `exit_roots`, and, like the other settings that superseded `history`, `exit_roots` will be set s.t. `history` still/again behaves as expected.
2024-04-30 12:38:47 +02:00
L3MON4D3
f8eb1e7d1c vscode-loader: don't error on cleanup (close #1163). 2024-04-21 10:02:18 +02:00
L3MON4D3
c5393cad65 fix: correctly select text beginning with a linebreak (close #1158).
The changes to other test-files are due to slightly changed timing, I
couldn't observe any change in behaviour in real-world usage.
2024-04-16 11:03:46 +02:00
L3MON4D3
c0439defc5 Format with stylua 2024-04-02 14:08:40 +00:00
L3MON4D3
706dc3a570 from_vscode: don't trim empty lines/dedent snippet-body (close #1032). 2024-04-02 16:05:33 +02:00
L3MON4D3
79cc25c398 healthcheck: only warn when jsregexp is missing, fix helptag. 2024-04-01 19:06:58 +02:00
Hawtian Wang
4d840fadd1
fix: sometimes endless recursive (#1145)
fix: `iter_captures` may return nil,x when the iterator is exhausted.
2024-04-01 18:57:56 +02:00
Zane Dufour
85c9b3edaa
add healthcheck (#1149)
add healthcheck
2024-04-01 15:54:06 +02:00
L3MON4D3
97a9742fc0 feat: define callbacks in node-opts.
This circumvents the much more complicated current mechanism of setting
the callback by identifying the node via jump-index in the parent.
2024-02-14 20:22:25 +01:00
L3MON4D3
81d83ec368 Format with stylua 2024-02-14 18:00:34 +01:00
L3MON4D3
92789d4e55 refocus: don't leave the snippet if the active node is an exitNode. 2024-02-14 18:00:34 +01:00
Abhay Raj Singh
04266a90ff add missing key_indexer, shorthand: Update default_config.lua
This fixes bug where k is nil, in case of lua load from folder as it's not declared explicitly by the user.
2024-02-14 16:54:15 +01:00
L3MON4D3
82108e7e31 Format with stylua 2024-01-08 10:01:27 +00:00
L3MON4D3
2ab3fdb96f lua/snipmate-loader: fix include/exclude (close #1106). 2024-01-08 11:00:22 +01:00
L3MON4D3
2f0db89fcb Format with stylua 2024-01-07 09:35:43 +00:00
L3MON4D3
31007a613c trigEngine: optionally restrict length of trigger (fix #1103). 2024-01-07 10:34:28 +01:00
L3MON4D3
68153ebb03 Format with stylua 2024-01-05 17:24:05 +00:00
L3MON4D3
a655485e57 correctly adjust extmarks of snippet in same insertNode (fix #1100) 2024-01-05 18:23:03 +01:00
masakichi
57c9f5c31b Format with stylua 2023-12-17 12:15:38 +01:00
Yuanji
f48ed75c05 feat(builtin): support vscode snippet variable CURRENT_TIMEZONE_OFFSET 2023-12-17 12:15:38 +01:00
L3MON4D3
43c89632f7 fix: recompute snippet-root-index if necessary. 2023-12-14 08:25:45 +01:00
L3MON4D3
954c81b539 Format with stylua 2023-12-05 16:35:23 +00:00
L3MON4D3
581c956a4a fix parsing of choices (close #1078). 2023-12-05 17:27:42 +01:00
L3MON4D3
fb0714da08 fix include and exclude (callers assumed swapped arguments) (close #1077)
Everywhere else the order is include, exclude, so accomodate here
instead of changing all callsites.
2023-12-05 11:22:42 +01:00
L3MON4D3
c5ce876359 feat(loaders): re-add reload_file (now as official API) (close #1074). 2023-12-03 00:16:01 +01:00
Hawtian Wang
07f217ff03
feat(snip_expand): make indenting snippets optional 2023-12-02 18:11:16 +01:00
L3MON4D3
2a75f4abd2 Format with stylua 2023-12-02 17:08:11 +00:00
L3MON4D3
c6e964b898 move config-defaults to prevent empty config and require-loop (close #1073) 2023-12-02 18:04:24 +01:00
L3MON4D3
1e57afa005 Format with stylua 2023-12-02 16:24:58 +01:00
L3MON4D3
ce400352e6 feat: major overhaul of loaders. Check DOC.md-changes for the gist.
Previously, we could not
* add files that were not present when `load/lazy_load` was called to
  the collection. This is pretty annoying if one wants to add
  project-local snippets, or snippets for a new filetype (ofc).
* load collections whose directory/package.json(c) did not exist when
  `load` was called.
  This is also an annoyance when creating project-local snippets, since
  a re-`load()` is required for the snippets to be picked up.
* pick up on changes to the snippet-files from another neovim-instance
  (due to reloading on BufWritePost)

This patch fixes all of these by modularizing the loaders a bit more,
into one component ("Collection") which takes care of all the logic of
loading different files, and another ("fswatchers") which notify the
collections when a file-change is detected. This allows, first of all, a
better design where the first concern can be nullified, and secondly, us
to use libuvs api for file-watching, to implement the last two (if a
potentially non-existing collection should be loaded, we can use libuv
to wait for the collection-root/manifest-file, and create the collection
once that exists).

Another cool addition is the loader-snippet-cache, which makes it so
that the snippet files (for vscode and snipmate) are only loaded once
for all filetypes, and not once for each filetype. That's probably not
noticeable though, except if a collection with many extends/languages
for one json-file is loaded :D
2023-12-02 16:24:58 +01:00
L3MON4D3
d0d6456fa8 fix: don't remove snippet-source set by loaders after first add.
If the same snippet-object is added to multiple filetypes, only the
first filetype receives the source-information.
This is actually done by the vscode-package-loader, so not a
theoretical concern, I guess jump-to-snippet is just not used enough for
this to get noticed.
2023-12-02 16:24:58 +01:00
L3MON4D3
7c2bc0b1e8 move lower-level methods out of main-module, add convenient wrappers.
Since these functions are called by eg. all the loaders, this removes
some potential for cyclic dependencies.
Also add enqueable-operations-wrapper around refresh_notify and
clean_invalidated, to prevent sending multiple updates for the same
filetype in the same "tick"(?), and to remove some overhead that would
result from calling clean_invalidated in quick succession (user doesn't
care if snippets are removed a few milliseconds later, ofc).
2023-12-02 16:24:58 +01:00
L3MON4D3
52918849e2 rename digraph-operations.
calling add_edge twice with the same vertices will not connect the
vertices twice.
2023-12-02 16:24:58 +01:00
L3MON4D3
ab5453886a extract autotables into their own module. 2023-12-02 16:24:58 +01:00
L3MON4D3
292454f9fd rename functions in util/table. 2023-12-02 16:24:58 +01:00