aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* vim-patch:992e307: runtime(doc): update list of modifiers at :h expand() ↵zeertzjq2025-09-30
| | | | | | | | | (#35957) fixes: vim/vim#18435 https://github.com/vim/vim/commit/992e30774f5ec81f53d5554c42137d3c85999081 Co-authored-by: Christian Brabandt <cb@256bit.org>
* docs: json, tests, lsp #35754Justin M. Keyes2025-09-28
| | | | | | | Close #35926 Close #35818 Co-authored-by: skewb1k <skewb1kunix@gmail.com> Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.1802: 'nowrap' in a modeline may hide malicious code (#35946)zeertzjq2025-09-29
| | | | | | | | | | | | | | | | Problem: 'nowrap' in a modeline may hide malicious code. Solution: Forcibly use '>' as 'listchars' "extends" if 'nowrap' was set from a modeline (zeertzjq). Manual `:setlocal nowrap` disables this behavior. There is a separate problem with `:set nowrap` that also applies to some other options. related: vim/vim#18214 related: vim/vim#18399 closes: vim/vim#18425 https://github.com/vim/vim/commit/9d5208a9313dd8b0d62c97af5485f1715af98a1c Cherry-pick some test_modeline.vim changes from patches 9.0.{0363,0626}.
* fix(lsp): remove `vim.lsp.diagnostic.reset()` (#35938)Maria Solano2025-09-27
|
* feat(lsp): document method types (#35934)Maria Solano2025-09-27
|
* fix(lsp): use correct `workspace.diagnostics` capability key (#35937)Maria Solano2025-09-27
|
* fix(highlight): ensure extmark range is within buffer bounds #35928skewb1k2025-09-26
| | | | | | Adds an additional check for the case when end_col = 0, addressing https://github.com/neovim/neovim/issues/35814#issuecomment-3340709532. Validation is now localized to the highlighter without affecting the C API.
* fix(extui): setup buffers after activating `eventignorewin` (#35915)Tomasz N2025-09-26
| | | | | | fix(extui): set options and buffer name after 'eventignorewin' Problem: Setting up extui buffers emits OptionSet and BufFilePost events. Solution: Set options and buffer name after 'eventignorewin'.
* vim-patch:9.1.1787: filetype: not all Sway config files are recognizedzeertzjq2025-09-24
| | | | | | | | | | | | | | | | Problem: filetype: not all Sway config files are recognized Solution: Detect files within */sway/config.d/* as swayconfig filetype (Felix Pehla). Sways default config automatically includes files placed in @sysconfdir@/sway/config.d/* (see config.in), so it makes sense to use the sway syntax for those. related: vim/vim#18293 https://github.com/vim/vim/commit/24f0dbba8c19be6969f392f891067ded4233bde7 Co-authored-by: Felix Pehla <29adc1fd92@gmail.com>
* vim-patch:224f8ca: runtime(doc): clarify 'fileignorecase' option setting ↵zeertzjq2025-09-23
| | | | | | | | | (#35879) fixes: vim/vim#18360 https://github.com/vim/vim/commit/224f8ca769f2f5c8c4f3293e2adf7672418ba2fe Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(diagnostic): show diagnostics on buffer load #35866Yochem van Rosmalen2025-09-22
| | | | | | | | Problem: Diagnostics set on unloaded buffers are not shown when the buffer loads. Solution: Use `once_buf_loaded()` to show the diagnostics on BufRead is the buffer is not yet loaded.
* 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