aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
* docs(diagnostics): allow list of strings for vim.diagnostic.Opts.border (#35863)Karl Yngve Lervåg2025-09-22
| | | Type checkers complain if we pass a list of strings, but this should be allowed.
* fix(health): errors in :checkhealth with pyenv-virtualenv #35865SkrrtBacharach2025-09-21
| | | | | | | | | | | Problem: pyenv-virtualenv sets a different path for VIRTUAL_ENV than the path to the python binary it provides, but these paths both symlink to the same file, so there should be no disparity. The python health-check reports an error, since it only checks if these paths are equal, not where they point to (resolve to). Solution: - Resolve the python symlinks before checking if they are equal. - Deduplicate some code.
* vim-patch:9.1.1779: completion: 'autocomplete' cannot be enabled per buffer ↵zeertzjq2025-09-21
| | | | | | | | | | | | | | (#35853) Problem: completion: 'autocomplete' cannot be enabled per buffer (Tomasz N) Solution: Make 'autocomplete' global or local to buffer (Girish Palya) fixes: vim/vim#18320 closes: vim/vim#18333 https://github.com/vim/vim/commit/0208b3e80a080740ff77a5661d0f65090e317d90 Co-authored-by: Girish Palya <girishji@gmail.com>
* vim-patch:9.1.1774: cannot calculate sha256 of a Blobzeertzjq2025-09-21
| | | | | | | | | | | | Problem: cannot calculate sha256() of a Blob Solution: Change sha256() to accept a Blob or String argument (thinca). closes: vim/vim#18336 https://github.com/vim/vim/commit/4150283b837975152d36f87a2bb975e894bc965c Co-authored-by: thinca <thinca@gmail.com>
* fix(health): hard fail on invalid "python-*" bin #35382Judit Novak2025-09-18
| | | | | | | | | | | | | | | Problem: Scripts named with 'python-…' prefix may not be valid python bins. If such a script is found in a venv, the Python healthcheck fails hard. .venv/python-argcomplete-check-easy-install-script .venv/bin/python3.13 .venv/bin/python Solution: - Discard known false-positives such as `python-argcomplete*`. - Call `health.warn()` instead of `assert()` in `python_exepath()`. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* vim-patch:9.1.1775: filetype: Mamba configuration files are not recognized ↵Samuel Huang2025-09-18
| | | | | | | | | | | | | #35829 Problem: filetype: Mamba configuration files are not recognized Solution: Detect .mambarc and mambarc as yaml filetype (Samuel Huang). References: - https://mamba.readthedocs.io/en/latest/user_guide/configuration.html closes: vim/vim#18338 https://github.com/vim/vim/commit/21a21eafeccb7f40a7af80a8ff600b513e70d188
* vim-patch:6701480: runtime(filetype): Use s:StarSetf for all patterns ending ↵zeertzjq2025-09-19
| | | | | | | | | | | | | | | | | in * (#35825) Problem: Some filetype autocmds with patterns ending in * do not skip filenames matching g:ignored_patterns. Solution: Move these autocmds to the appropriate section and call s:StarSetf() to set the filetype. - Affected filetypes: dosini, execline, foam, messages, nginx, tmux. - Convert foam filetype patterns to use wildcard matching. closes: vim/vim#17422 https://github.com/vim/vim/commit/6701480c43ce3addff01447b9590260a4fe227f7 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* fix(lsp): treat 2-triggers-at-once as "last char wins" #35435Tomasz N2025-09-17
| | | | | | | | | | | | | | Problem: If there are 2 language servers with different trigger chars (`-` and `>`), and a keymap inputs both simultaneously (`->`), then `>` doesn't trigger. We get completion items from server1 only. This happens because the `completion_timer` for the `-` trigger is still pending. Solution: If the next character arrived enough quickly (< 25 ms), replace the existing deferred autotrigger with a new one that matches this later character.
* vim-patch:9.1.1763: filetype: kitty config files are not recognizedzeertzjq2025-09-17
| | | | | | | | | | | | Problem: filetype: kitty config files are not recognized Solution: Detect */kitty/*.conf as kitty filetype, include a syntax script (Shawon). closes: vim/vim#18280 https://github.com/vim/vim/commit/a946ccf5ffdb7bbc2631c5cbebde18b75a5e284b Co-authored-by: Shawon <mdmoinulhossainshawon@gmail.com>
* fix(lsp): restore Client:stop() force-stopping behavior (#35800)zeertzjq2025-09-16
| | | | | | | | | | | | | This fixes a regression from #33796. I tried for several hours and cannot write a working test for this, but this does fix the following warning in tests run with ASAN or TSAN: -------- Running tests from test/functional/plugin/lsp_spec.lua RUN T4667 LSP server_name specified start_client(), stop_client(): 114.00 ms OK RUN T4668 LSP server_name specified stop_client() also works on client objects: 97.00 ms OK RUN T4669 LSP server_name specified does not reuse an already-stopping client #33616: 31.00 ms OK nvim took 2022 milliseconds to exit after last test This indicates a likely problem with the test even if it passed!
* docs: small fixes (#35791)zeertzjq2025-09-16
| | | | | | | | | | | | | | | | | | | | | Close #34938 Close #35030 Close #35233 Close #35259 Close #35290 Close #35433 Close #35541 Close #35766 Close #35792 Co-authored-by: huylg <45591413+huylg@users.noreply.github.com> Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com> Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com> Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com> Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com> Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com> Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com> Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
* vim-patch:9.1.1764: filetype: CODEOWNERS file not recognized (#35789)zeertzjq2025-09-16
| | | | | | | | | | | | | | | | | | Problem: filetype: CODEOWNERS file not recognized Solution: Detect CODEOWNERS file as codeowners filetype, include a syntax and filetype plugin (Jon Parise). CODEOWNERS files define code ownership rules for GitHub-hosted (and other) repositories. The syntax is similar to 'gitignore' files but differs in enough ways to warrant its own filetype. References: - https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners closes: vim/vim#18299 https://github.com/vim/vim/commit/817e4d3ee6b051477596ba1d86a2631d9fabc95b Co-authored-by: Jon Parise <jon@indelible.org>
* fix(lsp): avoid re-enabling `document_color` on `registerCapability` (#35774)skewb1k2025-09-15
| | | | | | | Problem: The registerCapability handler re-enables document_color, making it impossible to disable it in LspAttach. Solution: Enable it once on initialization and avoid re-enabling on registerCapability.
* fix(paste): don't use :echo immediately before :redraw (#35773)zeertzjq2025-09-16
| | | | | | | - If tick == 0 at the last chunk, the first :echo will print an empty string, which isn't really helpful, and may cause :redraw to move cursor to the message area for 'showmode'. - If tick > 0 at the last chunk, there'll be another :echo that prints an empty string immediately after the :redraw.
* docs: optionlinks don't need the bars #35777Yochem van Rosmalen2025-09-15
| | | | | | | | Problem: Options links work even without vertical bars around them due to their single quotes: the bars are unnecessary. Solution: Remove them.
* fix(lsp): avoid automatic request after leaving insert mode (#35767)zeertzjq2025-09-15
| | | | | | | | | | | | | | | | | This also fixes the following warning in tests with ASAN or TSAN: -------- Running tests from test/functional/plugin/lsp/inline_completion_spec.lua RUN T4604 vim.lsp.inline_completion enable() requests or abort when entered/left insert mode: 225.00 ms OK RUN T4605 vim.lsp.inline_completion get() applies the current candidate: 212.00 ms OK nvim took 2013 milliseconds to exit after last test This indicates a likely problem with the test even if it passed! RUN T4606 vim.lsp.inline_completion get() accepts on_accept callback: 212.00 ms OK RUN T4607 vim.lsp.inline_completion select() selects the next candidate: 220.00 ms OK -------- 4 tests from test/functional/plugin/lsp/inline_completion_spec.lua (3437.00 ms total) -------- Running tests from test/functional/plugin/lsp/linked_editing_range_spec.lua nvim took 2011 milliseconds to exit after last test This indicates a likely problem with the test even if it passed!
* fix(lua): don't leak timer when vim._watch.watch() fails (#35768)zeertzjq2025-09-15
| | | | | | | | This fixes the following warning in tests with ASAN or TSAN: -------- Running tests from test/functional/lua/watch_spec.lua RUN T4253 vim._watch watch() ignores nonexistent paths: 29.00 ms OK nvim took 2006 milliseconds to exit after last test This indicates a likely problem with the test even if it passed!
* vim-patch:partial:235e77a: runtime(doc): Tweak documentation style more in ↵zeertzjq2025-09-15
| | | | | | | | | | | options and ft_hare (#35761) closes: 18289 https://github.com/vim/vim/commit/235e77a3a35525671d6a5e60c180c0dcc0351ea1 Skip ft_hare.txt. Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* vim-patch:97e0f95: runtime(doc): tweak documentation style a bit more in ↵zeertzjq2025-09-14
| | | | | | | options.txt (#35755) related: vim/vim#18284 https://github.com/vim/vim/commit/97e0f955dadc58e878d9933ca6a5d97374573199
* feat(json): vim.json.encode() sort_keys #35574skewb1k2025-09-13
| | | | | | | | Problem: There is no way to ensure a stable key order when encoding a JSON string, which can be useful for comparisons and producing cleaner diffs. Solution: Introduce a `sort_keys` option for `vim.json.encode()`,which is disabled by default. When enabled, object keys are sorted in alphabetical order.
* docs: manpage, keycodes, jsonJustin M. Keyes2025-09-13
|
* fix(lsp): misleading logs in non-applicable filetypes #35749Justin M. Keyes2025-09-13
| | | | | | | | | | | | | | Problem: LSP logs show misleading "cannot start" messages when editing a filetype NOT listed in the `config.filetypes` field. [ERROR][2025-09-13 18:55:56] …/runtime//lua/vim/lsp/log.lua:151 "cannot start cssls due to config error: …/runtime//lua/vim/lsp.lua:423: cmd: expected expected function or table with executable command, got table: 0x0104701b18. Info: vscode-css-language-server is not executable" Solution: - `can_start`: check `config.filetypes` before checking the rest of the config.
* vim-patch:partial:450d591: runtime(doc): tweak documentation style (#35748)zeertzjq2025-09-13
| | | | | | | | | closes: vim/vim#18284 https://github.com/vim/vim/commit/450d59145e8675e608611a37db5f722ae31e041d Skip ft_hare.txt. Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* feat(ui): support grid=0 in nvim_input_mouse #32535fredizzimo2025-09-13
| | | | | | | | | | | | | | | | | Problem: Multigrid UIs have to find out which window to send the input by using the Nvim focus rules, which are not fully documented. Furthermore,`getmousepos()` has several problems when multigrid is enabled, with the main one being that screenrow and screencol are window relative instead of screen relative, due to the fact that the UI don't send any absolute coordinates. Solution: Allow passing 0 as grid to `nvim_input_mouse`, with absolute coordinates, which lets nvim determine the actual window to send the mouse input to. This works as long as nvim is in charge of the window positioning. If the UI repositions or resizes the windows, it can still pass the grid it determines like before.
* feat(pack): confirm "Always" to install all plugins #35733Evgeni Chasnovski2025-09-13
| | | | | | | | | Problem: First clean start with config containing multiple `vim.pack.add()` calls requires to explicitly confirm each one. Although usually a rare occurrence, it still might be tedious. Solution: Add a third choice during installation confirmation that approves current and all next installs within current session. It is reset after session restart.
* vim-patch:9.1.1753: defaults: 'diffopt' option value can be improved (#35727)zeertzjq2025-09-12
| | | | | | | | | | | | | | | | | | | | | | | Problem: defaults: 'diffopt' option value can be improved Solution: Update diffopt defaults to include "indent-heuristic" and "inline:char" (Yee Cheng Chin) The default diff options have not been updated much despite new functionality having been added to Vim. - indent-heurstic: This has been enabled by default in Git since 33de716387 in 2017. Given that Vim uses xdiff from Git, it makes sense to track the default configuration from Git. - inline:char: This turns on character-wise inline highlighting which is generally much better than the default inline:simple. It has been implemented since vim/vim#16881 and we have not seen reports of any issues with it, and it has received good feedbacks. closes: vim/vim#18255 https://github.com/vim/vim/commit/976b365305c2e9025813ff3c7fe52f8d927fafc3 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:a0f37db: runtime(doc): use a single pattern in :h 'incsearch' ↵zeertzjq2025-09-11
| | | | | | | | example (#35721) related: https://github.com/vim/vim/pull/18262#issuecomment-3277008408 closes: vim/vim#18270 https://github.com/vim/vim/commit/a0f37dbbf413537815656fb0752a8eb926acb05c
* vim-patch:b2c8848: runtime(doc): improve docs related to 'autocomplete'zeertzjq2025-09-11
| | | | | | | | | Manual completion can still be used when 'autocomplete' is set, so saying "active" is better than "enabled". closes: vim/vim#18261 https://github.com/vim/vim/commit/b2c88480553de7a7dc247fe8e361c8365eb4edec
* vim-patch:9.1.1750: completion: preinserted text highlighed using ComplMatchInszeertzjq2025-09-11
| | | | | | | | | | | | | | | | | | Problem: completion: preinserted text highlighed using ComplMatchIns Solution: Use highlighting group PreInsert and update the documentation (Girish Palya). When "preinsert" is included in 'completeopt', only the PreInsert highlight group should be applied, whether autocompletion is active or not. Previously, ComplMatchIns was used when autocompletion was not enabled. Related to https://github.com/vim/vim/pull/18213. closes: vim/vim#18254 https://github.com/vim/vim/commit/2525c56e423b3ddce8de925f582b9c4d00079675 Co-authored-by: Girish Palya <girishji@gmail.com>
* Merge pull request #35536 from bfredl/skipaheadbfredl2025-09-09
|\ | | | | | | | | perf(highlight): allow decoration providers to skip ranges without data fixes #35644
| * fix(treesitter): use subpriorities for tree orderingbfredl2025-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts 0b8a72b73934d33a05e20c255298e88cd921df32, that is unreverts 15e77a56b711102fdc123e15b3f37d49bc0b1df1 "priority" is an internal neovim concept which does not occur in shared queries. Ideally a single priority space should eventually be enough for our needs. But as we don't want to poke at the usages of priorities right now in the wider ecosystem, introduce the "subpriorities" so that treesitter code can distinguish highlights of the same priorities with different tree nesting depth. This mainly affects `injection.combined` as parent-tree nodes might appear in the middle of child-tree nodes which otherwise is not possible.
| * perf(highlight): allow decoration providers to skip ranges without databfredl2025-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the work of #31400 That PR allowed the provider to be invoked multiple times per line. We want only to do that when there actually is more data later on the line. Additionally, we want to skip over lines which contain no new highlight items. The TS query cursor already tells us what the next position with more data is, so there is no need to reinvoke the range callback before that. NB: this removes the double buffering introduced in #32619 which is funtamentally incompatible with this (nvim core is supposed to keep track of long ranges by itself, without requiring a callback reinvoke blitz). Need to adjust the priorities some other way to fix the same issue.
* | vim-patch:9.1.1742: complete: preinsert does not work well with ↵zeertzjq2025-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'autocomplete' (#35692) Problem: complete: preinsert does not work well with preinsert Solution: Make "preinsert" completeopt value work with autocompletion (Girish Palya) This change extends Insert mode autocompletion so that 'preinsert' also works when 'autocomplete' is enabled. Try: `:set ac cot=preinsert` See `:help 'cot'` for more details. closes: vim/vim#18213 https://github.com/vim/vim/commit/fa6fd41a943e6442c1a2ce6b0a237298b00ecca0 Co-authored-by: Girish Palya <girishji@gmail.com>
* | Merge pull request #35690 from zeertzjq/vim-9.1.1738zeertzjq2025-09-09
|\ \ | | | | | | vim-patch:9.1.{1738,1744},d7d6a6f
| * | vim-patch:d7d6a6f: runtime(doc): Improve doc for cmdline-autocompletionzeertzjq2025-09-09
| |/ | | | | | | | | | | | | | | | | | | | | - Address https://github.com/vim/vim/pull/18219#issuecomment-3264634710 - Make the cmdline-autocompletion help more user friendly closes: vim/vim#18245 https://github.com/vim/vim/commit/d7d6a6f05a536b443188ff95a45bbd46485f11fb Co-authored-by: Girish Palya <girishji@gmail.com>
* / fix(lsp): check if buffer is valid in scheduled client:on_attach() #35672notomo2025-09-08
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: lsp._capability.is_enabled() can raise error if buffer is invalid in client:on_attach(). - error ``` ./build/bin/nvim --clean --headless +"source ./minimal.lua" vim.schedule callback: ...omo/workspace/neovim/runtime/lua/vim/lsp/_capability.lua:209: scoped variable: Invalid buffer id: 2 stack traceback: [C]: in function '__index' ...omo/workspace/neovim/runtime/lua/vim/lsp/_capability.lua:209: in function 'is_enabled' ...e/notomo/workspace/neovim/runtime/lua/vim/lsp/client.lua:1108: in function <...e/notomo/workspace/neovim/runtime/lua/vim/lsp/client.lua:1101> ``` - reproduction minimal.lua ```lua vim.opt.runtimepath:append("/path/to/nvim-lspconfig/") vim.lsp.enable("lua_ls") vim.cmd.tabedit("runtime/lua/vim/_defaults.lua") vim.api.nvim_create_autocmd({ "LspAttach" }, { group = vim.api.nvim_create_augroup("test", {}), callback = function() vim.cmd.tabedit("runtime/lua/vim/_defaults.lua") local bufnr = vim.api.nvim_get_current_buf() vim.api.nvim_buf_delete(bufnr, { force = true }) end, }) ``` Solution: Check whether buffer is valid.
* vim-patch:9.1.1679: unclear what key causes CmdlineLeave autocommand (#35677)zeertzjq2025-09-08
| | | | | | | | | | | Problem: unclear what key causes CmdlineLeave autocommand Solution: Set |v:char| to the key (Girish Palya). related: vim/vim#17806 closes: vim/vim#18063 https://github.com/vim/vim/commit/ba9551d131d608b71155bacc0c4a65264f1f5f7c Co-authored-by: Girish Palya <girishji@gmail.com>
* fix(pack): handle Git environment variables #35626Evgeni Chasnovski2025-09-07
| | | | | | Problem: Some environment variables which are useful when working inside a bare repository can affect any Git operation. Solution: Explicitly unset problematic environment variables.
* feat(json): pretty-format (indent) with vim.json.encode() #35424skewb1k2025-09-07
| | | | | | | | | | | Problem: There is no straightforward way to pretty-print objects as JSON. The existing `vim.inspect` outputs LON. Solution: Introduce an `indent` option for `vim.json.encode()` which enables human-readable output with configurable indentation. Adapts PR to upstream: openresty/lua-cjson#114
* feat(pack): vim.pack.get() gets VCS info #35631Evgeni Chasnovski2025-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Force resolve `spec.version` overrides the information about whether a user supplied `version` or not. Knowing it might be useful in some use cases (like comparing to previously set `spec` to detect if it has changed). Solution: Do not resolve `spec.version`. This also improves speed when triggering events and calling `get()`. - Place default branch first when listing all branches. - Use correct terminology in `get_hash` helper. - Do not return `{ '' }` if there are no tags. Problem: There is no way to get more information about installed plugins, like current revision or default branch (necessary if resolving default `spec.version` manually). As computing Git data migth take some time, also allow `get()` to limit output to only necessary set of plugins. Solution: - introduce arguments to `get(names, opts)`, which follows other `vim.pack` functions. Plugin extra info is returned by default and should be opt-out via `opts.info = false`. - Examples: - Get current revision: `get({ 'plug-name' })[1].rev` - Get default branch: `get({ 'plug_name' })[1].branches[1]` - `update()` and `del()` act on plugins in the same order their names are supplied. This is less surprising. - default `opts.info` to `true` since this simplifies logic for the common user, while still leaving the door open for a faster `get()` if needed.
* docs(lsp): tweak `inline_completion.get` code snippet #35657Maria José Solano2025-09-06
| | | | `replace_keycodes` is true if `expr` is set, and "Accept" is a better term to describe the keymap.
* fix(types): nvim_get_win_config return type #35639Lewis Russell2025-09-06
|
* docs: `details` dict in nvim_buf_get_extmark() #35289Phạm Bình An2025-09-06
| | | | | | | | | Problem: The document of nvim_buf_get_extmark currently lacks the following: - "details" directory: nvim_buf_get_extmarks() allows an option details to get a "details" directory in result, but it doesn't mention where that "details" directory is, what fields does it have. Solution: Add docs for "details" directory in nvim_buf_get_extmarks()
* feat(pack): use `nvim_echo{kind=progress}` to report progress #35625Evgeni Chasnovski2025-09-05
| | | | | | | | | Problem: Progress reports use plain `nvim_echo()` with manually constructed messages and populate history on every call. Solution: Use `nvim_echo()` with newly added `kind=progress` which (at least for now) is meant to be a unified interface for showing progress report. Also save in history only first and last progress report messages.
* vim-patch:9.1.1732: filetype: .inc file detection can be improved (#35635)zeertzjq2025-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: .inc file detection can be improved Solution: Update filetype detection for Pascal and BitBake code (Martin Schwan). Fix the detection of .inc files containing Pascal and BitBake code: - the concatenated string, merged from three lines, only contains one beginning and the pattern "^" would not match as expected. Use a range() loop to iterate each line string individually. This way, the pattern "^" works for beginning of lines. - improve BitBake include file detection by also matching forward-slashes "/" in variable names and assignment operators with a dot ".=" and "=.". Valid examples, which should match, are: PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" MACHINEOVERRIDES =. "qemuall:" BBPATH .= ":${LAYERDIR}" - parse twenty instead of just three lines, to accommodate for potential comments at the beginning of files closes: vim/vim#18202 https://github.com/vim/vim/commit/9fd1a657d2efae5cff278eb5acaa380623a50cf6 Co-authored-by: Martin Schwan <m.schwan@phytec.de>
* docs: lsp, miscJustin M. Keyes2025-09-03
| | | | | | | | | - Problem: It's not clear for new plugin developers that `:help` uses a help-tags file for searching the docs, generated by `:helptags`. - Solution: Hint to the |:helptags| docs for regenerating the tags file for their freshly written documentation. Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
* vim-patch:9.1.1730: filetype: vivado journal/log files are not recognized ↵zeertzjq2025-09-04
| | | | | | | | | | | | | | (#35613) Problem: filetype: vivado journal/log files are not recognized Solution: Detect vivado*.{jou,log} as tcl filetype (Wu Zhenyu). closes: vim/vim#18191 https://githu