Commit Graph
5495 Commits
Author SHA1 Message Date
Lewis Russell af040c3a07 feat(treesitter): add support for setting query depths 2023-05-11 11:13:32 +01:00
Gaétan Lepage e90b506903 vim-patch:9.0.1539: typst filetype is not recognized (#23578)
Problem:    Typst filetype is not recognized.
Solution:   Distinguish between sql and typst. (Gaetan Lepage, closes vim/vim#12363)

https://github.com/vim/vim/commit/4ce1bda869e4ec0152d7dcbe1e491ceac5341d5e
2023-05-11 15:43:02 +08:00
hituzi no sippo 4e5061dba7 docs(lsp): fix config.cmd argument for vim.lsp.start_client (#23560) 2023-05-09 21:00:29 +02:00
Jon Huhn 075a72d5ff fix(lsp): fix relative patterns for workspace/didChangeWatchedFiles (#23548) 2023-05-09 18:12:54 +02:00
hituzi no sippo 02f92978fe docs(lsp): fix type of config.cmd argument for vim.lsp.start_client (#23550) 2023-05-09 17:24:49 +02:00
Christian Clason 9753cda591 fix(syntax): use correct diagnostic group for checkhealth (#23538) 2023-05-08 17:02:53 +02:00
zeertzjq a961bb7101 Merge pull request #23486 from msva/patch-1
fix(man.lua): return support of all sections
2023-05-08 16:09:33 +08:00
zeertzjq 057a5bc78d docs: add some missing changes from Vim runtime updates (#23533) 2023-05-08 13:57:24 +08:00
zeertzjqandBram Moolenaar 29c228dc10 vim-patch:8.2.3887: E1135 is used for two different errors
Problem:    E1135 is used for two different errors.
Solution:   Renumber one error.

https://github.com/vim/vim/commit/806da5176e9e9ab011d927c4ca33a8dde1769539

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 01:12:09 +08:00
zeertzjqandBram Moolenaar a2b9117ca8 vim-patch:8.2.1978: making a mapping work in all modes is complicated
Problem:    Making a mapping work in all modes is complicated.
Solution:   Add the <Cmd> special key. (Yegappan Lakshmanan, closes vim/vim#7282,
            closes 4784, based on patch by Bjorn Linse)

https://github.com/vim/vim/commit/957cf67d50516ba98716f59c9e1cb6412ec1535d

Change docs to match Vim if it's wording is better.
Change error numbers to match Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 01:12:08 +08:00
Vadim A. Misbakh-Soloviov 209ed16f57 fix(man.lua): return support of all sections
Current behaviour of `:Man` is to only work with "number" sections.
This is caused by wrong assumptions about man sections naming.

Also, there was similar assumption about length of section dirs
in `paths` variable.

fixes #23485

Signed-off-by: Vadim Misbakh-Soloviov <git@mva.name>
2023-05-07 17:31:33 +07:00
marcoSven 9248dd77ac feat(lua): add hl priority opts on yank (#23509)
feat(lua): add hl priority opts on_yank

Signed-off-by: marcoSven <me@marcosven.com>
2023-05-06 21:53:36 +02:00
Christian Clason c8ebb04e92 fix(health): replace healthFoo with DiagnosticFoo (#23475)
This replaces the custom `health{Error,Warning,Success}` highlight
groups with `Diagnostic{Error,Warning,Ok}`, which are defined by
default. Removes the link for `healthHelp`, which was no longer
actually used after #20879.
2023-05-05 18:15:44 +02:00
jdrouhard 648f777931 perf(lsp): load buffer contents once when processing semantic tokens responses (#23484)
perf(lsp): load buffer contents once when processing semantic token responses

Using _get_line_byte_from_position() for each token's boundaries was a
pretty huge bottleneck, since that function would load individual buffer
lines via nvim_buf_get_lines() (plus a lot of extra overhead). So each
token caused two calls to nvim_buf_get_lines() (once for the start
position, and once for the end position).

For semantic tokens, we only attach to buffers that have already been
loaded, so we can safely just get all the lines for the entire buffer at
once, and lift the rest of the _get_line_byte_from_position()
implementation directly while bypassing the part that loads the buffer
line.

While I was looking at get_lines (used by _get_line_byte_from_position),
I noticed that we were checking for non-file URIs before we even looked
to see if we already had the buffer loaded. Moving the buffer-loaded
check to be the first thing done in get_lines() more than halved the
average time spent transforming the token list into highlight ranges vs
when it was still using _get_line_byte_from_position. I ended up
improving that loop more by not using get_lines, but figured the
performance improvement it provided was worth leaving in.
2023-05-05 07:41:36 +02:00
zeertzjq b8d5586d5b refactor: using a different error number for 'mousescroll'
Because E548 is linked to 'guicursor' in help.
2023-05-05 09:19:06 +08:00
zeertzjqandBram Moolenaar 3724e65c30 vim-patch:8.2.2607: strcharpart() cannot include composing characters
Problem:    strcharpart() cannot include composing characters.
Solution:   Add the {skipcc} argument.

https://github.com/vim/vim/commit/02b4d9b18a03549b68e364e428392b7a62766c74

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:49:56 +08:00
zeertzjqandBram Moolenaar b441dafdf5 vim-patch:8.2.2344: using inclusive index for slice is not always desired
Problem:    Using inclusive index for slice is not always desired.
Solution:   Add the slice() method, which has an exclusive index. (closes
            vim/vim#7408)

https://github.com/vim/vim/commit/6601b62943a19d4f8818c3638440663d67a17b6a

Cherry-pick a line in docs added later.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:40:29 +08:00
zeertzjqandBram Moolenaar dd3d857c39 vim-patch:8.2.1461: Vim9: string indexes are counted in bytes
Problem:    Vim9: string indexes are counted in bytes.
Solution:   Use character indexes. (closes vim/vim#6574)

https://github.com/vim/vim/commit/e3c37d8ebf9dbbf210fde4a5fb28eb1f2a492a34

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:16:23 +08:00
zeertzjqandBram Moolenaar 7e70a1e44b vim-patch:9.0.0138: not enough characters accepted for 'spellfile'
Problem:    Not enough characters accepted for 'spellfile'.
Solution:   Add vim_is_fname_char() and use it for 'spellfile'.

https://github.com/vim/vim/commit/bc49c5f48f89c2d6f4d88ee77f44a11d68293be3

Cherry-pick related doc update from Vim runtime.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 13:48:52 +08:00
Bogdan Grigoruță 143a178332 fix(editorconfig): add missing root validation (#23462) 2023-05-03 12:26:40 -06:00
Lewis Russell 3ba930844c perf(treesitter): insert/remove items efficiently (#23443) 2023-05-02 22:27:14 +01:00
Luuk van Baal f78130b2d8 test: 'smoothscroll' works with virt_lines above and below 2023-05-02 13:11:47 +02:00
Luuk van BaalandBram Moolenaar 4e4383ffa2 vim-patch:9.0.1247: divide by zero with 'smoothscroll' set and a narrow window
Problem:    Divide by zero with 'smoothscroll' set and a narrow window.
Solution:   Bail out when the window is too narrow.

https://github.com/vim/vim/commit/870219c58c0804bdc55419b2e455c06ac715a835

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
Luuk van BaalandBram Moolenaar be11f80d01 vim-patch:9.0.0640: cannot scroll by screen line if a line wraps
Problem:    Cannot scroll by screen line if a line wraps.
Solution:   Add the 'smoothscroll' option.  Only works for CTRL-E and CTRL-Y
            so far.

https://github.com/vim/vim/commit/f6196f424474e2a9c160f2a995fc2691f82b58f9

vim-patch:9.0.0641: missing part of the new option code

Problem:    Missing part of the new option code.
Solution:   Add missing WV_SMS.

https://github.com/vim/vim/commit/bbbda8fd81f6d720962b67ae885825bad9be4456

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:26 +02:00
Lewis Russell fba18a3b62 fix(treesitter): do not calc folds on unloaded buffers
Fixes #23423
2023-05-02 10:07:18 +01:00
Lewis Russell 26cc946226 fix(treesitter): foldexpr tweaks
Some small general fixes found working on developing async parsing.
2023-05-01 10:32:29 +01:00
Christian ClasonandAmaan Qureshi 37dd818722 vim-patch:9.0.1503: Luau files are not recognized (#23412)
Problem:    Luau files are not recognized.
Solution:   Add a patter for Luau files. (Amaan Qureshi, closes vim/vim#12317)

https://github.com/vim/vim/commit/2dcfe9ae1df61e1249520ed435dd8cf60e157103

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-05-01 10:55:51 +02:00
Mathias Fußenegger 5e31f53457 docs(lsp): remove vim.lsp.sync (#23416)
The module is used internally and not intended to be used by plugins or
users.
2023-05-01 10:54:37 +02:00
jdrouhard edf05b005f perf(lsp): process semantic tokens response in a coroutine that yields every 5ms (#23375) 2023-05-01 07:15:32 +02:00
Lewis Russell 19a793545f fix(treesitter): redraw added/removed injections properly (#23287)
When injections are added or removed make sure to:
- invoke 'changedtree' callbacks for when new trees are added.
- invoke 'changedtree' callbacks for when trees are invalidated
- redraw regions when languagetree children are removed
2023-04-30 17:11:38 +02:00
luukvbaal 064bf39c46 docs: fix erroneous nvim_buf_set_extmark example (#23404) 2023-04-30 14:36:54 +02:00
JP 4f3f81ed86 docs(api): document nvim_buf_add_highlight vs nvim_buf_set_extmark (#23310) 2023-04-30 11:02:38 +02:00
Christian Clason 668f16bac7 feat(treesitter): upstream query omnifunc from playground (#23394)
and set by default in `ftplugin/query.lua`
2023-04-30 11:01:54 +02:00
Gregory Anders 2d54f5e903 Merge pull request #23382 from gpanders/iter-benchmark
Add vim.iter benchmark to benchmark test suite
2023-04-29 20:33:27 -06:00
c194acbfc4 feat(treesitter): add query_linter from nvim-treesitter/playground (#22784)
Co-authored-by: clason <clason@users.noreply.github.com>
Co-authored-by: lewis6991 <lewis6991@users.noreply.github.com>
2023-04-29 18:22:26 +02:00
zeertzjq 4bcf8c15b3 vim-patch:8.2.0578: heredoc for interfaces does not support "trim"
Problem:    Heredoc for interfaces does not support "trim".
Solution:   Update the script heredoc support to be same as the :let command.
            (Yegappan Lakshmanan, closes vim/vim#5916)

https://github.com/vim/vim/commit/6c2b7b8055b96463f78abb70f58c4c6d6d4b9d55
2023-04-29 09:20:52 +08:00
Gregory Anders ef1801cc7c perf(iter): reduce number of table allocations
Packing and unpacking return values impairs performance considerably.
In an attempt to avoid creating tables as much as possible we can
instead pass return values between functions (which does not require
knowing the number of values a function might return). This makes the
code more complex, but improves benchmark numbers non-trivially.
2023-04-28 15:38:50 -06:00
zeertzjqandBram Moolenaar 715587f8e4 vim-patch:8.2.3509: undo file is not synced (#23371)
Problem:    Undo file is not synced. (Sami Farin)
Solution:   Sync the undo file if 'fsync' is set. (Christian Brabandt,
            closes vim/vim#8879, closes vim/vim#8920)

https://github.com/vim/vim/commit/340dd0fbe462a15a9678cfba02085b4adcc45f02

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-28 21:07:00 +08:00
Lewis Russell eb4676c67f fix: disallow removing extmarks in on_lines callbacks (#23219)
fix(extmarks): disallow removing extmarks in on_lines callbacks

decor_redraw_start (which runs before decor_providers_invoke_lines) gets
references for the extmarks on a specific line. If these extmarks are
deleted in on_lines callbacks then this results in a heap-use-after-free
error.

Fixes #22801
2023-04-27 17:30:22 +01:00
Christian Clason 4b3fdf321c docs(lsp): remove obsolete lsp-extension example (#23346)
This example is made obsolete by the addition of `vim.lsp.start()` and
`vim.fs` (whose use is already documented in `:h lsp-quickstart`).
2023-04-27 13:05:26 +02:00
bfredl 45bcf83869 refactor(build): include lpeg as a library 2023-04-27 11:40:00 +02:00
zeertzjqandYegappan Lakshmanan 191e8b4062 vim-patch:9.0.1485: no functions for converting from/to UTF-16 index (#23318)
Problem:    no functions for converting from/to UTF-16 index.
Solution:   Add UTF-16 flag to existing funtions and add strutf16len() and
            utf16idx(). (Yegappan Lakshmanan, closes vim/vim#12216)

https://github.com/vim/vim/commit/67672ef097dd708244ff042a8364994da2b91e75

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-26 09:50:37 +08:00
zeertzjqandBram Moolenaar 8af97ecefa vim-patch:8.2.3314: behavior of exists() in a :def function is unpredictable (#23317)
Problem:    Behavior of exists() in a :def function is unpredictable.
Solution:   Add exists_compiled().

https://github.com/vim/vim/commit/267359902c8792fed13543ddeb56c6df0ae74957

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-26 08:37:22 +08:00
Gregory Anders cacc2dc419 Merge pull request #23303 from gpanders/more-vim-iter
Create iter_spec and vim.iter module
2023-04-25 09:17:46 -06:00
ii14andii14 7e70ca0b48 feat(lua): vim.keycode (#22960)
Using nvim_replace_termcodes is too verbose, add vim.keycode for
translating keycodes.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-04-25 16:52:44 +02:00
Gregory Anders 1e73891d69 refactor(iter): move helper functions under vim.iter
vim.iter is now both a function and a module (similar to vim.version).
2023-04-25 08:23:16 -06:00
zeertzjqandLemonBoy bfa92d3861 vim-patch:8.2.5019: cannot get the first screen column of a character (#23312)
Problem:    Cannot get the first screen column of a character.
Solution:   Let virtcol() optionally return a list. (closes vim/vim#10482,
            closes vim/vim#7964)

https://github.com/vim/vim/commit/0f7a3e1de6f71e8e1423fe594890d6aa7f94e132

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-04-25 22:22:26 +08:00
zeertzjqandYegappan Lakshmanan 43c49746d9 vim-patch:9.0.0335: checks for Dictionary argument often give a vague error (#23309)
Problem:    Checks for Dictionary argument often give a vague error message.
Solution:   Give a useful error message. (Yegappan Lakshmanan, closes vim/vim#11009)

https://github.com/vim/vim/commit/04c4c5746e15884768d2cb41370c3276a196cd4c

Cherry-pick removal of E922 from docs from patch 9.0.1403.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-25 21:32:12 +08:00
Christian ClasonandBram Moolenaar e3f36377c1 vim-patch:71badf9547e8 (#23285)
Update runtime files

https://github.com/vim/vim/commit/71badf9547e8f89571b9a095183671cbb333d528

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 15:22:55 +02:00
f17bb4f411 vim-patch:9.0.1478: filetypes for *.v files not detected properly (#23282)
* vim-patch:9.0.1478: filetypes for *.v files not detected properly

Problem:    Filetypes for *.v files not detected properly.
Solution:   Use the file contents to detect the filetype. (Turiiya,
            closes vim/vim#12281)

https://github.com/vim/vim/commit/80406c26188219f3773b2e9c49160caeeb386ee2

Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com>
Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>
2023-04-23 14:15:52 +02:00