| Commit message (Collapse) | Author | Age |
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Now `:InspectTree` will show missing nodes as e.g. `(MISSING identifier)`
or `(MISSING ";")` rather than just `(identifier)` or `";"`. This is
doable because the `MISSING` keyword is now valid query syntax.
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: diff feature can be improved
Solution: include the linematch diff alignment algorithm
(Jonathon)
closes: vim/vim#9661
https://github.com/vim/vim/commit/7c7a4e6d1ad50d5b25b42aa2d5a33a8d04a4cc8a
Co-authored-by: Jonathon <jonathonwhite@protonmail.com>
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
When given, only that range will be checked for validity rather than the
entire tree. This is used in the highlighter to save CPU cycles since we
only need to parse a certain region at a time anyway.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This means that all work previously done by a `_parse()` iteration will
be kept in future iterations. This prevents it from running indefinitely
in some cases where the file is very large and there are 2+ injections.
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Cannot control cursor positioning of getchar().
Solution: Add "cursor" flag to {opts}, with possible values "hide",
"keep" and "msg".
related: vim/vim#10603
closes: vim/vim#16569
https://github.com/vim/vim/commit/edf0f7db28f87611368e158210e58ed30f673098
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
When running an initial parse, parse() returns an empty table rather
than an actual range. In `languagetree.lua`, we manually check if
a parse was incremental to determine the changed parse region.
Solution:
- Always return a range (in the C side) from parse().
- Simplify the language tree code a bit.
- Logger no longer shows empty ranges on the initial parse.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This simplifies some logic in `languagetree.lua`, removing the need for
`_has_regions`, and removing side effects in `:included_regions()`.
Before:
- Edit is made which sets `_regions = nil`
- Upon the next call to `included_regions()` (usually right after we
marked `_regions` as `nil` due to an `_iter_regions()` call), if
`_regions` is nil, we repopulate the table (as long as the tree
actually has regions)
After:
- Edit is made which resets `_regions` if it exists
- `included_regions()` no longer needs to perform this logic itself, and
also no longer needs to read a `_has_regions` variable
|
| |
| |
| |
| |
| | |
Compute the diagnostics per line when `show` is called, allowing for
O(1) access for the diagnostics to display when the cursor line or the
list of diagnostics haven't changed.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before the 7121983c45d92349a6532f32dcde9f425e30781e refactoring this
loop added highlights from a `buf_hls` list that had filtered out
elements with `Attrs.None`. After the refactoring this added highlights
from `hls` directly, and those elements would fail with e.g.:
$ nvim 'man://math.h(0)'
Error detected while processing command line:
Error executing Lua callback: /usr/share/nvim/runtime/lua/man.lua:205: Invalid 'hl_group': Expected Lua string
stack traceback:
[C]: in function 'nvim_buf_add_highlight'
/usr/share/nvim/runtime/lua/man.lua:205: in function 'highlight_man_page'
/usr/share/nvim/runtime/lua/man.lua:632: in function 'init_pager'
/usr/share/nvim/runtime/plugin/man.lua:9: in function </usr/share/nvim/runtime/plugin/man.lua:6>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
The current implementation uses a global augroup for virtual lines in
diagnostics, which can lead to conflicts and unintended behavior when
multiple namespaces/buffers are involved.
Solution:
Refactor the code to use a namespace-specific augroup for virtual lines.
This ensures that each namespace has its own augroup.
Scope the clear commands to only the relevant buffer.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: getchar() can't distinguish between C-I and Tab.
Solution: Add {opts} to pass extra flags to getchar() and getcharstr(),
with "number" and "simplify" keys.
related: vim/vim#10603
closes: vim/vim#16554
https://github.com/vim/vim/commit/e0a2ab397fd13a71efec85b017d5d4d62baf7f63
Cherry-pick tv_dict_has_key() from patch 8.2.4683.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Co-authored-by: Dustin S. <dstackmasta27@gmail.com>
Co-authored-by: Ferenc Fejes <fejes@inf.elte.hu>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: brianhuster <phambinhanctb2004@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
completing (#32251)
Problem: Vim doesn't highlight to be inserted text when completing
Solution: Add support for the "preinsert" 'completeopt' value
(glepnir)
Support automatically inserting the currently selected candidate word
that does not belong to the latter part of the leader.
fixes: vim/vim#3433
closes: vim/vim#16403
https://github.com/vim/vim/commit/edd4ac3e895ce16034c7e098f1d68e0155d97886
Co-authored-by: glepnir <glephunter@gmail.com>
|
| |
| |
| |
| |
| | |
Problem: Error occurs if delete buffer in the middle of parsing.
Solution: Check if buffer is valid in parsing.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: `TSHighlighter:destroy()` causes double-processing of the modeline
and failure of `b:undo_ftplugin`.
Solution: Disable modeline in `TSHighlighter:destroy()` by setting `modeline=false`
if executing `syntaxset` autocommands for the `FileType` event.
Co-authored-by: Daniel Petrovic <daniel.petrovic@ebcont.com>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
**Problem:** In the case where the user sets the treesitter foldexpr upon startup in
their `init.lua`, the fold info will be calculated before the parser has
been loaded in, meaning folds will be properly calculated until edits or
`:e`.
**Solution:** Refresh fold information upon `VimEnter` as a sanity check
to ensure that a parser really doesn't exist before always returning
`'0'` in the foldexpr.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
**Problem:** Currently, if users want to efficiently disable injections,
they have to delete the injection query files at their runtime path.
This is because we only check for existence of the files before running
the query over the entire buffer.
**Solution:** Check for existence of query files, *and* that those files
actually have captures. This will allow users to just comment out
existing queries (or better yet, just add their own injection query to
`~/.config/nvim` which contains only comments) to disable running the
query over the entire buffer (a potentially slow operation)
|
| | |
|
| |
| |
| |
| | |
Uses an overload to properly show the different return type based on the
input parameter.
|
| | |
|
| |
| |
| |
| |
| | |
Breaking change: `ts_node_child_containing_descendant()` was removed
Breaking change: tree-sitter 0.25 (HEAD) required
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Problem:
nvim_get_autocmds cannot filter by id.
Solution:
Support it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
detection
so make the regex more strict and have it check for a parenthesis.
See:
https://github.com/vlang/v/blob/master/examples/submodule/mymodules/submodule/sub_functions.v
related: vim/vim#16513
https://github.com/vim/vim/commit/fb49e3cde79de4ce558c86d21a56eb9d60aeabd5
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
for modules definition
While at it, also increase the maximum number of lines to check to 500.
fixes: vim/vim#16513
https://github.com/vim/vim/commit/99181205c5f8284a30f839107a12932924168f17
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: insert-completed items are always sorted, although the LSP
spec[1] standard defines sortText in the returned
completionitem list. This means that the server has sorted the
results. When fuzzy is enabled, this will break the server's
sorting results.
Solution: disable sorting of candidates when "nosort" is set in
'completeopt'
[1]
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem
closes: vim/vim#16501
https://github.com/vim/vim/commit/f400a0cc41113eb75516bdd7f38aeaa15208ba2c
Co-authored-by: glepnir <glephunter@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Right aligned virtual text can cover up buffer text if virtual
text is too long
Solution: An additional option for `virt_text_pos` called
`eol_right_align` has been added to truncate virtual text if it would
have otherwise covered up buffer text. This ensures the virtual text
extends no further left than EOL.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: setting `loclist = true` makes `on_list` being ignored. This
was not a problem before, but with `vim.lsp.buf.document_symbol` using
`loclist = true` as default it is needed to explicitly pass `loclist =
false` in order to use custom `on_list`.
Solution: prefer `on_list` over `loclist` and document the latter as
taking effect only in the default handler.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Combined highlighting was not applied to nvim_eval_statusline(),
and 'statuscolumn' sign segment/numhl highlights.
Solution: Add an additional `groups` element to the return value of
`nvim_eval_statusline()->highlights`. This is an array of stacked
highlight groups (highest priority last). Also resolve combined
highlights for the 'statuscolumn' sign segment/numhl highlights.
Expose/synchronize some drawline.c logic that is now mimicked in
three different places.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: filetype: just files are not recognized
Solution: adjust filetype detection pattern, detect just shebang line,
include just ftplugin, indent and syntax plugin
(Peter Benjamin)
closes: vim/vim#16466
https://github.com/vim/vim/commit/72755b3c8e91ec90447969b736f080e0de36003d
Co-authored-by: Peter Benjamin <petermbenjamin@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(#32170)
Problem: filetype: N-Tripels and TriG files are not recognized
Solution: detect '*.nt' files as ntriples filetype and '*.trig' files
as trig filetype (Gordian Dziwis)
closes: vim/vim#16493
https://github.com/vim/vim/commit/c04334c33f543a6b84a4442cf235d84f5eaef6bb
Co-authored-by: Gordian Dziwis <gordian@dziw.is>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
`vim.hl.on_yank()` has a "timeout" behavior but this is not available for
`vim.hl.range()`.
Solution:
Add `timeout` arg to `vim.hl.range()`.
|
| |
| |
| |
| | |
This updates the extmark namespace to search for when filtering out
semantic tokens to match the new namespace style recently introduced.
|
| |\
| | |
| | | |
feat(extmark): stack multiple highlight groups in `hl_group`
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This has been possible in the "backend" for a while but
API was missing.
Followup: we will need a `details2=true` mode for `nvim_get_hl_id_by_name`
to return information in a way forward compatible with even further
enhancements.
|
| | | |
|
| |\ \
| | | |
| | | | |
feat(api): deprecate nvim_buf_add_highlight()
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This was kept for a while as it was a useful short hand and initially
matched what highlights what actually properly implemented. But now
|vim.hl.range()| is a better high-level shorthand with full support for
native multi-line ranges.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Problem:
vim.lsp.completion.enable(true, client.id, bufnr)
vim.lsp.completion.enable(false, client.id, bufnr)
Error detected while processing LspDetach Autocommands for "*":
Error executing lua callback: …/lsp/completion.lua:701: Vim:E367: No such group: "vim/lsp/completion-22"
stack traceback:
[C]: in function 'nvim_del_augroup_by_name'
…/lsp/completion.lua:701: in function 'disable_completions'
…/lsp/completion.lua:724: in function 'enable'
Solution:
Delete the correct augroup.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Problem:
The filetype for the floating window buffer is being set before its context is fully initialized.
This results in `FileType` events not receiving the correct context.
Solution:
Set the filetype after the floating preview window and its buffer variables are
fully configured to ensure proper context is provided.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Plugins may want to climb up the LanguageTree.
Also add missing type annotations for other methods.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Problem: filetype: setting bash filetype is backwards incompatible
Solution: revert patch v9.1.0965, detect bash scripts again as sh
filetype
This reverts commit b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721.
related: vim/vim#16309
https://github.com/vim/vim/commit/727c567a0934643e2d6e1dd92d4e636b17d9067f
Co-authored-by: Christian Brabandt <cb@256bit.org>
vim-patch:9.1.1033: tests: shaderslang was removed from test_filetype erroneously
Problem: tests: shaderslang was removed from test_filetype erroneously
(Christian Clason, after v9.1.1030)
Solution: restore the test
https://github.com/vim/vim/commit/1d2867df0c5dfa3d2444229f9e4b23d6ff935956
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Follow up to https://github.com/neovim/neovim/pull/32072
If there is no prefix (e.g. at the start of word boundary or a line), it
always used the `filterText` because the `match` function always
returned false.
|