Commit Graph

5513 Commits

Author SHA1 Message Date
Lewis Russell
1fe1bb084d refactor(options): deprecate nvim[_buf|_win]_[gs]et_option
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: famiu <famiuhaque@protonmail.com>
2023-05-21 15:14:01 +06:00
Christian Clason
e3e6fadfd8
feat(fs): expose join_paths as vim.fs.joinpath (#23685)
This is a small function but used a lot in some plugins.
2023-05-20 17:30:48 +02:00
Jon Huhn
073035a030
fix(lsp): don't register didChangeWatchedFiles when capability not set (#23689)
Some LSP servers (tailwindcss, rome) are known to request registration
for `workspace/didChangeWatchedFiles` even when the corresponding client
capability does not advertise support. This change adds an extra check
in the `client/registerCapability` handler not to start a watch unless
the client capability is set appropriately.
2023-05-20 07:45:39 +02:00
Christian Clason
201f366b37
vim-patch:9.0.1565: json lines files are not recognized (#23677)
Problem:    Json lines files are not recognized.
Solution:   Add a pattern to detect "jsonl" files. (issue vim/vim#7520)

6fadbc1e8c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-19 09:11:22 +02:00
Lewis Russell
ef64e225f6
fix(treesitter): allow foldexpr without highlights (#23672)
Ref nvim-treesitter/nvim-treesitter#4748
2023-05-18 10:52:01 +01:00
Lewis Russell
189fb62032
feat(treesitter): improved logging (#23638)
- Add bindings to Treesitter ts_parser_set_logger and ts_parser_logger
- Add logfile with path STDPATH('log')/treesitter.c
- Rework existing LanguageTree loggin to use logfile
- Begin implementing log levels for vim.g.__ts_debug
2023-05-17 11:42:18 +01:00
Lewis Russell
6b19170d44
fix(treesitter): correctly calculate bytes for text sources (#23655)
Fixes #20419
2023-05-16 16:41:47 +01:00
Christian Clason
9ff59517cb fix(treesitter): update c queries 2023-05-15 14:13:42 +02:00
Christian Clason
c97de026e3 fix(treesitter): update vimdoc and vimscript queries 2023-05-15 14:13:31 +02:00
Christian Clason
0dbed7132b build(deps): update lua parser and queries 2023-05-15 14:13:31 +02:00
Christian Clason
c11986ed1a
vim-patch:b7398fe41c9e (#23627)
Update runtime files

b7398fe41c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-15 09:38:32 +02:00
zeertzjq
0124b02490
docs(if_pyth): make it work with Python 3 instead of Python 2 (#23620) 2023-05-14 19:18:49 +08:00
dundargoc
08991b0782
docs: small fixes
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: HiPhish <hiphish@posteo.de>
Co-authored-by: Julio B <julio.bacel@gmail.com>
Co-authored-by: T727 <74924917+T-727@users.noreply.github.com>
Co-authored-by: camoz <camoz@users.noreply.github.com>
Co-authored-by: champignoom <66909116+champignoom@users.noreply.github.com>
2023-05-13 21:33:22 +02:00
Christian Clason
6f29c68928
vim-patch:9.0.1549: USD filetype is not recognized (#23608)
Problem:    USD filetype is not recognized.
Solution:   Add patterns for USD filetype. (Colin Kennedy, closes vim/vim#12370)

b848ce6b7e

Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
2023-05-13 15:00:08 +02:00
Christian Clason
32dc484ec9
fix(treesitter): support subfiletypes in get_lang (#23605) 2023-05-13 13:29:11 +02:00
Raphael
512a90520e
refactor(lsp): mark server_ready function as deprecated (#23520) 2023-05-13 11:27:05 +02:00
zeertzjq
f76e1ac92e
vim-patch:9.0.1546: some commands for opening a file don't use 'switchbuf' (#23600)
Problem:    Some commands for opening a file don't use 'switchbuf'.
Solution:   Use 'switchbuf' for more commands. (Yegappan Lakshmanan,
            closes vim/vim#12383, closes vim/vim#12381)

54be5fb382

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-05-13 08:40:06 +08:00
luukvbaal
5825d2f6ca
test(scroll_opt): fix typo in porting oldtest (#23593) 2023-05-12 08:17:38 +08:00
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)

4ce1bda869
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
zeertzjq
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.

806da5176e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-08 01:12:09 +08:00
zeertzjq
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)

957cf67d50

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
zeertzjq
3724e65c30 vim-patch:8.2.2607: strcharpart() cannot include composing characters
Problem:    strcharpart() cannot include composing characters.
Solution:   Add the {skipcc} argument.

02b4d9b18a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:49:56 +08:00
zeertzjq
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)

6601b62943

Cherry-pick a line in docs added later.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:40:29 +08:00
zeertzjq
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)

e3c37d8ebf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-04 17:16:23 +08:00
zeertzjq
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'.

bc49c5f48f

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 Baal
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.

870219c58c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-02 13:11:47 +02:00
Luuk van Baal
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.

f6196f4244

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.

bbbda8fd81

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 Clason
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)

2dcfe9ae1d

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