aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* fix(lua): types for vim.api.keyset.win_config #32700Tomasz N2025-03-10
|
* fix(build): vimdoc tags are not validated #32801Justin M. Keyes2025-03-09
| | | | | | | | | Problem: "make lintdoc" is not validating vimdoc (:help) tags. Solution: - Call `lang_tree:parse()` to init the parser. - Load netrw 🤢 explicitly, since it was moved to `pack/dist/opt/`. - Fix invalid help tags.
* fix(types): do not mark unstable API as privateLewis Russell2025-03-08
| | | | | These functions are allowed to be used downstream, they are just not API stable.
* feat(defaults): jump between :terminal shell prompts with ]]/[[ #32736Gregory Anders2025-03-07
|
* fix(lua): always use vim.inspect() for :lua= (#32715)zeertzjq2025-03-07
|
* fix(lsp): use unresolved code action when `codeAction/resolve` failsMaria José Solano2025-03-07
|
* vim-patch:9.1.1177: filetype: tera files not detectedChristian Clason2025-03-07
| | | | | | | | | | | | | Problem: filetype: tera files not detected Solution: detect '*.tera' files as tera filetype, include a simple filetype plugin (MuntasirSZN) closes: vim/vim#16806 https://github.com/vim/vim/commit/5daaf2326800ff0683a5be9a7f475667a4fc09db Co-authored-by: MuntasirSZN <muntasir.joypurhat@gmail.com>
* vim-patch:9.1.1173: filetype: ABNF files are not detected (#32751)zeertzjq2025-03-06
| | | | | | | | | | | | | | | Problem: filetype: ABNF files are not detected Solution: detect '.abnf' file as abnf filetype and include an abnf syntax plugin (A4-Tacks). References: - RFC5234 - RFC7405 closes: vim/vim#16802 https://github.com/vim/vim/commit/9f827ec58728c4ea55a8d71d40a283ca2ce5b058 Co-authored-by: A4-Tacks <wdsjxhno1001@163.com>
* feat(lsp): support for resolving code action command (#32704)Maria José Solano2025-03-06
| | | | | * fix(lsp): don't call codeAction_resolve with commands * feat(lsp): support for resolving code action command
* fix(tui): remove DCS escaping in tmux (#32723)Gregory Anders2025-03-05
| | | | Per https://github.com/tmux/tmux/issues/4386, tmux does not support DCS responses, even if the initial request was escaped.
* feat(terminal)!: include cursor position in TermRequest event data (#31609)Gregory Anders2025-03-05
| | | | | | | | | | | | | | | | | | When a plugin registers a TermRequest handler there is currently no way for the handler to know where the terminal's cursor position was when the sequence was received. This is often useful information, e.g. for OSC 133 sequences which are used to annotate shell prompts. Modify the event data for the TermRequest autocommand to be a table instead of just a string. The "sequence" field of the table contains the sequence string and the "cursor" field contains the cursor position when the sequence was received. To maintain consistency between TermRequest and TermResponse (and to future proof the latter), TermResponse's event data is also updated to be a table with a "sequence" field. BREAKING CHANGE: event data for TermRequest and TermResponse is now a table
* fix(lsp): open_floating_preview() ignores max_height (#32716)Robert Muir2025-03-04
| | | | | | | Problem: After 47aaddfa the max_height option is no longer respected. Hover documentation and Signature help windows take up the entire text height. Solution: Compare to window's current height and only modify the height if it would reduce the height, not enlarge it.
* fix(diagnostic): virtual_lines diagnostic columns (#32703)James Trew2025-03-04
| | | | | When multiple diagnostics appear on a single line, the virtual lines for all diagnostics except the first were rendered with progressively fewer columns.
* vim-patch:659cb28: runtime(doc): fix typo "bet" in :h 'completeopt' (#32711)zeertzjq2025-03-04
| | | | | closes: vim/vim#16773 https://github.com/vim/vim/commit/659cb28c25b756e59c712c337f8b4650e85f8bcd
* vim-patch:9.1.1166: command-line auto-completion hard with wildmenuTomas Slusny2025-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: command-line auto-completion hard with wildmenu Solution: implement "noselect" wildoption value (Girish Palya) When `noselect` is present in `wildmode` and 'wildmenu' is enabled, the completion menu appears without pre-selecting the first item. This change makes it easier to implement command-line auto-completion, where the menu dynamically appears as characters are typed, and `<Tab>` can be used to manually select an item. This can be achieved by leveraging the `CmdlineChanged` event to insert `wildchar(m)`, triggering completion menu. Without this change, auto-completion using the 'wildmenu' mechanism is not feasible, as it automatically inserts the first match, preventing dynamic selection. The following Vimscript snippet demonstrates how to configure auto-completion using `noselect`: ```vim vim9script set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu autocmd CmdlineChanged : timer_start(0, function(CmdComplete, [getcmdline()])) def CmdComplete(cur_cmdline: string, timer: number) var [cmdline, curpos] = [getcmdline(), getcmdpos()] if cur_cmdline ==# cmdline # Avoid completing each character in keymaps and pasted text && !pumvisible() && curpos == cmdline->len() + 1 if cmdline[curpos - 2] =~ '[\w*/:]' # Reduce noise by completing only selected characters feedkeys("\<C-@>", "ti") set eventignore+=CmdlineChanged # Suppress redundant completion attempts timer_start(0, (_) => { getcmdline()->substitute('\%x00$', '', '')->setcmdline() # Remove <C-@> if no completion items exist set eventignore-=CmdlineChanged }) endif endif enddef ``` fixes: vim/vim#16551 closes: vim/vim#16759 https://github.com/vim/vim/commit/2bacc3e5fb3569e0fd98e129cb1e422ca18b80a6 Cherry-pick Wildmode_Tests() change from patch 9.0.0418. Co-authored-by: Girish Palya <girishji@gmail.com> Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
* docs: misc #31996Justin M. Keyes2025-03-02
|
* feat(lua): don't complete private (_) fields after dot (.) #32690Maria José Solano2025-03-02
|
* feat(comment): allow commentstring to be determined from node metadataRiley Bruins2025-03-02
| | | | | | | | | | | **Problem:** Some weird languages have different comment syntax depending on the location in the code, and we do not have a way to determine the correct `commentstring` for these special cases. **Solution:** Allow queries to specify `commentstring` values in metadata, allowing users/`nvim-treesitter` to provide a better commenting experience without hugely increasing the scope of the code in core.
* vim-patch:9.1.1161: preinsert requires bot "menu" and "menuone" to be setzeertzjq2025-03-02
| | | | | | | | | | | | Problem: preinsert requires bot "menu" and "menuone" to be set, but "menu" is redundant (after v9.1.1160) Solution: preinsert only requires menuone (glepnir) closes: vim/vim#16763 https://github.com/vim/vim/commit/94a045ed56d7616c0cd0080d3f308d6cf9fbe64c Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.1160: Ctrl-Y does not work well with "preinsert" when ↵zeertzjq2025-03-02
| | | | | | | | | | | | | | | | | | | | | completing items Problem: The 'preinsert' feature requires Ctrl-Y to confirm insertion, but Ctrl-Y only works when the popup menu (pum) is displayed. Without enforcing this dependency, it could lead to confusing behavior or non-functional features. Solution: Modify ins_compl_has_preinsert() to check for both 'menu' and 'menuone' flags when 'preinsert' is set. Update documentation to clarify this requirement. This avoids adding complex conditional behaviors. (glepnir) fixes: vim/vim#16728 closes: vim/vim#16753 https://github.com/vim/vim/commit/a2c5559f297a18dc1ce3c4f1f9fd6204aed321c9 Co-authored-by: glepnir <glephunter@gmail.com>
* feat(treesitter): add more metadata to `language.inspect()` (#32657)Lewis Russell2025-03-01
| | | | | | | | | Problem: No way to check the version of a treesitter parser. Solution: Add version metadata (ABI 15 parsers only) as well as parser state count and supertype information (ABI 15) in `vim.treesitter.language.inspect()`. Also graduate the `abi_version` field, as this is now the official upstream name. --------- Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* docs(Open): add reference in documentation (#32678)Luca Saccarola2025-02-28
|
* fix(marks): ineffective conceal_line callback optimization (#32662)luukvbaal2025-02-28
| | | | | | | Problem: _on_conceal_line callbacks are not invoked if callback has not let Nvim know it wants to receive them. But this may change on factors other than what is currently checked (changed buffer). Solution: Forego this optimization, callback is still guarded behind 'conceallevel'.
* fix(treesitter): correctly parse queries with combined injectionsRiley Bruins2025-02-28
|
* vim-patch:85a50fe: runtime(doc): fix confusing docs for 'completeitemalign' ↵zeertzjq2025-02-28
| | | | | | | (#32671) closes: vim/vim#16743 https://github.com/vim/vim/commit/85a50fe825ba11a35ce654f7313b4350e3ba4b52
* doc: clarify window-id, tab-id, nvim_set_current_x #32528David Briscoe2025-02-27
| | | | | | | | | | | | | | Problem: Descriptions are somewhat vague. nvim_set_current_line modifies contents but nvim_set_current_buf does not, etc. Solution: - Make it clear that these functions accept or return a winid/tabid by linking to that concept in help. - Only these few files use the term "handles", so replace them with the more conventional terminology. - Add a new help section for tab-ID. This concept is unique to neovim because vim exposes tabnr, but not tab handles. This section is modelled after `:h winid`.
* feat(lua): vim.text.indent()Justin M. Keyes2025-02-26
| | | | | | | | | | | | | Problem: Indenting text is a common task in plugins/scripts for presentation/formatting, yet vim has no way of doing it (especially "dedent", and especially non-buffer text). Solution: Introduce `vim.text.indent()`. It sets the *exact* indentation because that's a more difficult (and thus more useful) task than merely "increasing the current indent" (which is somewhat easy with a `gsub()` one-liner).
* fix(treesitter): nil check query for has_conceal_lineLuuk van Baal2025-02-25
|
* fix(lsp): resize hover window for concealed linesLuuk van Baal2025-02-25
| | | | | | | | Problem: Height of a (markdown) `vim.lsp.util.open_floating_preview()` window can be reduced to account for concealed lines (after #31324). Solution: Set the window height to the text height of the preview window. Set 'concealcursor' to avoid unconcealing the cursorline when entering the hover window.
* feat(treesitter): vertical conceal support for highlighterLuuk van Baal2025-02-25
| | | | | | | | TSHighlighter now places marks for conceal_lines metadata. A new internal decor provider callback _on_conceal_line was added that instructs the highlighter to place conceal_lines marks whenever the editor needs to know whether a line is concealed. The bundled markdown queries use conceal_lines metadata to conceal code block fence lines.
* feat(marks): add conceal_lines to nvim_buf_set_extmark()Luuk van Baal2025-02-25
| | | | Implement an extmark property that conceals lines vertically.
* vim-patch:9.1.1140: filetype: m17ndb files are not detected (#32618)zeertzjq2025-02-25
| | | | | | | | | | | | | | | | | | | | Problem: filetype: m17ndb files are not detected Solution: detect m17ndb files as m17ndb filetype, include filetype, syntax and indent files for the new filetype (David Mandelberg). References: https://www.nongnu.org/m17n/manual-en/m17nDBFormat.html describes the format. https://git.savannah.nongnu.org/cgit/m17n/m17n-db.git/tree/ has examples of the files. closes: vim/vim#16696 https://github.com/vim/vim/commit/ed7d8e55ac232758fc14fd132994b4a09b19350b Also adjust the xkb parent pattern according to dev_vimpatch.txt. Co-authored-by: David Mandelberg <david@mandelberg.org>
* fix(lsp): reset the applied hints on `refresh` request #32446Yi Ming2025-02-23
|
* Merge #32503 feat(lsp): use the meta model to generate server capability mapJustin M. Keyes2025-02-23
|\
| * feat(lsp): use the meta model to generate server capability mapMaria José Solano2025-02-21
| |
| * feat(lsp): update LSP typesMaria José Solano2025-02-17
| |
* | refactor(treesitter): simplify parsing coroutine logicRiley Bruins2025-02-23
| | | | | | | | | | | | | | | | | | Lua coroutines can yield across non-coroutine function boundaries, meaning that we don't need to wrap each helper function in a coroutine and resume it within `_parse()`. If we just have them yield when appropriate, this will be caught by the top level `_parse()` coroutine, and resuming the `_parse()` will resume from the position in the helper function where we yielded last.
* | fix(lua): `@private` => `@nodoc` #32587Dan Sully2025-02-23
| | | | | | | | | | | | | | Problem: vim.log.levels.* and vim.opt_local are marked `@private` but they should be `@nodoc`. Solution: Fix the annotation.
* | fix(float): ensure floating window width can fit titleMaria José Solano2025-02-23
| |
* | vim-patch:9.1.1134: filetype: Guile init file not recognizedChristian Clason2025-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: Guile init file not recognized Solution: detect '.guile' file as scheme filetype (David Mandelberg) References: https://www.gnu.org/software/guile/manual/html_node/Init-File.html > When run interactively, Guile will load a local initialization file > from ~/.guile. This file should contain Scheme expressions for > evaluation. closes: vim/vim#16683 https://github.com/vim/vim/commit/41a6026f007facb1ada3ff2a63a054913432860c Co-authored-by: David Mandelberg <david@mandelberg.org>
* | vim-patch:9.1.1133: filetype: xkb files not recognized everywhereChristian Clason2025-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: xkb files not recognized everywhere Solution: detect xkb files in more places (David Mandelberg) References: https://xkbcommon.org/doc/current/user-configuration.html#user-config-locations closes: vim/vim#16684 https://github.com/vim/vim/commit/b62bf814886185cb8607ce15051aa7017b8c88ba Co-authored-by: David Mandelberg <david@mandelberg.org>
* | feat(treesitter): table of contents for checkhealth, markdown (#32282)Christian Clason2025-02-22
| | | | | | | | | | | | | | | | | | | | | | Problem: It's difficult to navigate large structured text files (vim help, checkhealth, Markdown). Solution: Support `gO` for table of contents and `]]`/`[[` for moving between headings for all these filetypes using treesitter queries. Refactor: colorization of highlight groups is moved to the `help` ftplugin while headings-related functionality is implemented in a private `vim.treesitter` module for possible future use for other filetypes.
* | fix(lsp): unify get_completion_word for textEdits/insertTextMathias Fussenegger2025-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: After https://github.com/neovim/neovim/pull/32377 selecting snippets provided by luals inserted the multi-line text before accepting the candidates. That's inconsistent with servers who provide `textEdit` instead of `insertText` and having lines shift up/down while cycling through the completion candidates is a bit irritating. Solution: Use the logic used for `textEdit` snippets also for `insertText`
* | perf(treesitter): don't block when finding injection rangesRiley Bruins2025-02-21
| | | | | | | | | | | | | | | | | | | | | | **Problem:** Currently, parsing is asynchronous, but it involves a (sometimes lengthy) step which finds all injection ranges for a tree by iterating over that language's injection queries. This causes edits in large files to be extremely slow, and also causes a long stutter during the initial parse of a large file. **Solution:** Break up the injection query iteration over multiple event loop iterations.
* | fix(treesitter): `TSNode:field()` returns all children with the given fieldRiley Bruins2025-02-21
| |
* | perf(treesitter): only search for injections within the parse rangeRiley Bruins2025-02-21
| | | | | | | | Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
* | feat(marks): virtual lines support horizontal scrolling (#32497)zeertzjq2025-02-20
| | | | | | | | Add a new field `virt_lines_overflow` that enables horizontal scrolling for virtual lines when set to "scroll".
* | vim-patch:c729d6d: runtime: decouple Open and Launch commands and gx mapping ↵Luca Saccarola2025-02-20
| | | | | | | | | | | | | | | | from netrw (#32506) closes: vim/vim#16494 fixes: #vim/vim#16486 https://github.com/vim/vim/commit/c729d6d154e097b439ff264b9736604824f4a5f4
* | fix(treesitter): don't spam query errors in the highlighterRiley Bruins2025-02-19
| | | | | | | | | | | | | | | | **Problem:** An erroneous query in the treesitter highlighter gives a deluge of errors that makes the editor almost unusable. **Solution:** Detach the highlighter after an error is detected, so that it only gets displayed once (per highlighter instance).
* | fix(treesitter): avoid computing fold levels for empty bufferLuuk van Baal2025-02-19
| | | | | | | | | | | | | | | | Problem: Computing fold levels for an empty buffer (somehow) breaks the parser state, resulting in a broken highlighter and foldexpr. Cached foldexpr parser is invalid after filetype has changed. Solution: Avoid computing fold levels for empty buffer. Clear cached foldinfos upon `FileType`.