Commit graph

2160 commits

Author SHA1 Message Date
Ote Leo
46d4b07308 Minor DOC.md modifications for panvimdoc lists
Pandoc fails to parse markdown lists unless they come after an empty line. Thus the panvimdoc generated lists are crammed in a single paragraph.
2023-12-26 16:48:13 +01:00
masakichi
57c9f5c31b Format with stylua 2023-12-17 12:15:38 +01:00
masakichi
0a2af16429 Auto generate docs 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
6a001360ce Format with stylua 2023-12-14 07:27:49 +00:00
L3MON4D3
c6f1644064 Auto generate docs 2023-12-14 07:27:45 +00: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
4b451141a4 Auto generate docs 2023-12-05 10:24:33 +00: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
f03089854a Format with stylua 2023-12-02 23:17:45 +00:00
L3MON4D3
5da6534daf Auto generate docs 2023-12-02 23:17:41 +00: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
507f60687d Auto generate docs 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
L3MON4D3
91ffd48d7a duplicate: always return the same table for retrieve_all.
This is necessary for the key-invalidation in add_snippets, which
expects that retrieve_all always returns the same objects.
2023-12-02 16:24:58 +01:00
L3MON4D3
1182638671 Format with stylua 2023-12-01 21:59:39 +01:00
L3MON4D3
23284ea6f7 Auto generate docs 2023-12-01 21:59:39 +01:00
L3MON4D3
e449e6e325 update jsregexp to 0.0.6.
Still continues to work with 0.0.5 too, but also support 0.0.6, which,
despite having the same API, is a bit harder to set up (see `util/jsregexp.lua`)
2023-12-01 21:59:39 +01:00
L3MON4D3
1def353778 Format with stylua 2023-11-28 13:07:43 +00:00
L3MON4D3
5e16fcf0a0 Auto generate docs 2023-11-28 13:07:39 +00:00
L3MON4D3
f0b315a84a fix(restoreNode): prevent error on double-exit. 2023-11-28 14:02:35 +01:00
L3MON4D3
425459f92f fix(refocus): handle edgecase (close #1039). 2023-11-28 14:02:30 +01:00
L3MON4D3
df58ee1664 Format with stylua 2023-11-24 22:08:37 +00:00
L3MON4D3
e4a750d4b2 Auto generate docs 2023-11-24 22:08:34 +00:00
L3MON4D3
acd514658a fix(parser): allow empty lsp-choice. 2023-11-24 23:07:00 +01:00
xu-cheng
cab667e267 Auto generate docs 2023-11-20 22:14:31 +01:00
Cheng XU
0ad5207a69 Use event.buf/event.file directly instead of vim.fn.expand
We don't need to use `vim.fn.expand(...)` to get the buffer or file for
the autocmd callbacks. Instead, use `event.buf` or `event.file` directly
from the callback function argument.

See also #1047.
2023-11-20 22:14:31 +01:00
L3MON4D3
1f4ad8bb72 Auto generate docs 2023-11-13 11:17:23 +00:00
mrcjkb
b8639fec38 Auto generate docs 2023-11-13 12:16:42 +01:00
Marc Jakobi
89997c7c58 feat: publich to luarocks 2023-11-13 12:16:42 +01:00
L3MON4D3
46c91e8147 Format with stylua 2023-11-10 22:44:34 +01:00
L3MON4D3
e67abd2227 Auto generate docs 2023-11-10 22:44:34 +01:00
L3MON4D3
c0f78cfa18 Don't get selection via buf_get_text, just cut and restore registers.
Easier than taking care of all the stupid edge-cases, like
multibyte-combined-characters or virtualedit.
2023-11-10 22:44:34 +01:00
Stevenjin8
a70a359eda Auto generate docs 2023-11-10 22:34:31 +01:00
Steven Jin Xuan
22cbc910c0 Consistent backtick use 2023-11-10 22:34:31 +01:00
xu-cheng
a4de64570b Auto generate docs 2023-11-04 09:17:26 +01:00
Cheng XU
c93c45731b Use event.buf directly to get bufnr
Due to the neovim's issue (https://github.com/neovim/neovim/issues/16416),
using `vim.fn.expand` sometimes throws Keyboard interrupt error when
pressing Ctrl-C (a common alternative to Esc).

This works around the above issue by simply getting the buffer number
from event argument.
2023-11-04 09:17:26 +01:00
L3MON4D3
80a8528f08 Auto generate docs 2023-10-18 06:08:50 +00:00
treequin
a9f692590e Auto generate docs 2023-10-18 08:07:27 +02:00