aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* fix(diagnostic): virtual lines should scroll horizontallyxzb2025-03-16
|
* docs(lsp): simplify example of enabling LSP foldingYi Ming2025-03-16
|
* fix(lsp): correctly check for "codeAction/resolve" supportTobias Schmitz2025-03-15
|
* docs: miscdundargoc2025-03-15
| | | | | | | | | | | | | Co-authored-by: Au. <acehinnnqru@gmail.com> Co-authored-by: Daniel Rainer <daniel.rainer@localhost> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: Luuk van Baal <luukvbaal@gmail.com> Co-authored-by: Pierre Barbin <pierre@heitzsystem.com> Co-authored-by: Riley Bruins <ribru17@hotmail.com> Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com> Co-authored-by: phanium <91544758+phanen@users.noreply.github.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(lsp): autocmds to close lsp preview windows not clearedbekaboo2025-03-15
| | | | | | | | Problem: Augroup to close lsp preview hover window is not cleared after the window is closed because of unmatched group name. Solution: Delete the augroup before closing the preview window with correct group name.
* feat(defaults): completeopt=popup #32909Justin M. Keyes2025-03-15
| | | | Assuming that completeopt=popup does what its documentation claims, it is more appropriate that completeopt=preview as a default.
* feat(snippet): set snippet keymaps permanent instead of dynamic (#31887)Mathias Fußenegger2025-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Given that `vim.snippet.expand()` sets temporary `<tab>`/`<s-tab>` keymaps there is no way to build "smart-tab" functionality where `<tab>` chooses the next completion candidate if the popup menu is visible. Solution: Set the keymap permanent in `_defaults`. The downside of this approach is that users of multiple snippet engine's need to adapt their keymaps to handle all their engines that are in use. For example: vim.keymap.set({ 'i', 's' }, "<Tab>", function() if foreign_snippet.active() then return "<Cmd>lua require('foreign_snippet').jump()<CR>" elseif vim.snippet.active({ direction = 1 }) then return "<Cmd>lua vim.snippet.jump(1)<CR>" else return key end end, { expr = true }) Upside is that using `vim.keymap.set` to override keymaps is a well established pattern and `vim.snippet.expand` calls made by nvim itself or plugins have working keymaps out of the box. Co-authored-by: Maria José Solano <majosolano99@gmail.com>
* fix(vim.fs): default to follow=false #32859Mike2025-03-14
| | | | | | | Problem: Following symlinks can have surprising behavior and slow performance. Solution: Do not set it by default.
* vim-patch:9.1.1196: filetype: config files for container tools are not ↵zeertzjq2025-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | recognized (#32873) Problem: filetype: config files for container tools are not recognized Solution: detect the ones that aren't detected yet as toml filetype (David Mandelberg) The .containerignore format doesn't look exactly the same as gitignore, but very close. And .dockerignore is already using gitignore. References: https://github.com/containers/common/blob/main/docs/containerignore.5.md https://github.com/containers/common/blob/main/docs/containers.conf.5.md https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md https://github.com/containers/image/blob/main/docs/containers-registries.conf.d.5.md I wasn't sure exactly how to interpret what containers.conf(5) was saying about modules, so I looked at https://github.com/containers/common/tree/main/pkg/config/testdata/modules to get examples, and based the detection off those. closes: vim/vim#16852 https://github.com/vim/vim/commit/7546afbf525861f586ea2deabf71e3a2940abd4d Co-authored-by: David Mandelberg <david@mandelberg.org>
* fix(lua): vim.hl.on_yank highlights wrong region with yi' (#32850)phanium2025-03-13
| | | | | | | Problem: yi' don't highlight last character since https://github.com/neovim/neovim/commit/8ce504820af04194a41acbe1f4c61cf12bd5feb5. Solution: Always use `opts.inclusive=true`, since calculation of `"]` (`b_op_end`) have taken `inclusive` into account.
* vim-patch:c1c3b5d: runtime(doc): remove unnecessary "an" (#32865)zeertzjq2025-03-13
| | | | | | | | | | | | "umask" is pronounce like "youmask", so having an "an" before it is a bit strange. In other places in the help, "umask" is not preceded by either "a" or "an", and sometimes preceded by "the". Also, "Note" is usually followed either by ":" or "that" in builtin.txt, so add a ":" after "Note". closes: 16860 https://github.com/vim/vim/commit/c1c3b5d6a0a3032057bf6de8672cc79100bb73c9
* fix(diagnostic): clear autocmd only for valid buf (#32861)Jaehwang Jung2025-03-12
|
* fix(lsp): handle non-existent configs in lsp.config/enableLewis Russell2025-03-12
|
* feat(treesitter): allow `iter_captures` to accept `opts`Riley Bruins2025-03-12
| | | | | | This matches the `iter_captures` functionality to the `iter_matches` functionality, allowing it to specify a match limit and start depth for the query iterator.
* feat(treesitter): allow passing lang to InspectTreeMaria José Solano2025-03-12
|
* vim-patch:0a336cc: runtime(doc): clarify that a umask is applied to mkdir() ↵zeertzjq2025-03-11
| | | | | | | | | (#32845) fixes: vim/vim#16849 https://github.com/vim/vim/commit/0a336ccb57003c44ba303ccc50cf50cb640c2309 Co-authored-by: Christian Brabandt <cb@256bit.org>
* refactor(lsp): rename `on_publish_diagnostics` parameter #32776Will Lillis2025-03-11
| | | | * fix(lsp): rename `on_publish_diagnostics` parameter: result->params * fix(colors): specify local var type to address lint failure
* feat(treesitter): allow disabling captures and patterns on TSQuery (#32790)Ian Chamberlain2025-03-11
| | | | | | | | | Problem: Cannot disable individual captures and patterns in treesitter queries. Solution: * Expose the corresponding tree-sitter API functions for `TSQuery` object. * Add documentation for `TSQuery`. * Return the pattern ID from `get_captures_at_pos()` (and hence `:Inspect!`).
* fix: warn when :InspectTree on buffer with no parser #32783phanium2025-03-11
| | | | | Problem: `InspectTree` error on buffer without ts parser attached. Solution: show a more correct warning.
* fix(lsp): improve LSP floating preview window cleanup #31353glepnir2025-03-11
| | | | | Problem: The current implementation creates a unique autocommand group for each floating preview window, which is inefficient and can lead to numerous autocommand groups. Solution: Use a single shared autocommand group with improved window validation to properly clean up LSP floating preview windows.
* fix(lsp): wrapped ctx in opts before passed to vim.lsp.completion.trigger #32837glepnir2025-03-11
| | | | | Problem: ctx is passed directly to M.trigger. In fact, it is a field of opts. Solution: wrapped in a table and passed to M.trigger.
* vim-patch:9.1.1194: filetype: false positive help filetype detectionzeertzjq2025-03-11
| | | | | | | | | | Problem: filetype: false positive help filetype detection Solution: Only detect a file as help if modeline appears either at start of line or is preceded by whitespace (zeertzjq). closes: vim/vim#16845 https://github.com/vim/vim/commit/6763b0ee95e7e66ab7992653fbba48691e803e70
* vim-patch:9.1.1186: filetype: help files in git repos are not detectedzeertzjq2025-03-11
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: help files in git repos are not detected Solution: detect */doc/*.txt files as help if they end with a help modeline, even if 'modeline' is off Here's how I checked that this would still detect vim's own help files correctly: $ find . -type f -path '*/doc/*.txt' \ > -exec awk '{ } ENDFILE { print FILENAME ":" $0; }' '{}' + | > grep -v 'vim:.*\<\(ft\|filetype\)=help\>' ./src/libvterm/doc/seqs.txt: 23 DECSM 42 = DECNRCM, national/multinational character closes: vim/vim#16817 https://github.com/vim/vim/commit/16d6fff98ed3a9dfd34a41696b005b0c4c7800f8 Split the pattern into a Lua pattern for the first part and a Vim regex pattern for the second part, so that if the first part doesn't match there is no need to use the Vim regex. Co-authored-by: David Mandelberg <david@mandelberg.org>
* feat(checkhealth): group parsers by name and path in outputEike2025-03-10
| | | | | | | | | Problem: :checkhealth vim.treesitter sorts parser entries solely by path, splitting duplicates and reducing clarity. Solution: Sort entries first by name, then by path, so that duplicates are grouped.
* fix(lsp)!: pass buffer number to root_dir functionLewis Russell2025-03-10
| | | | | | | | | | | | | | Problem: The root dir function is not passed any context and can only assume the current buffer is the one being attached. The main use case is for getting the path of the buffer using `nvim_buf_get_name`. Solution: Pass the buffer number as the first argument.
* feat(lsp): support completion context #32793Maria José Solano2025-03-10
| | | | | | | | | Problem: vim.lsp.completion with "autotrigger" enabled, does not send completion context, even though it has all the necessary info. Solution: Include the context for "autotrigger". trigger() also optionally accepts context when manually invoked.
* docs(vvars): vim.v.event.windows #32673Vlad2025-03-10
|
* 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'.