aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* | fix(terminal): wrong row in TermRequest with full scrollback (#36298)zeertzjq2025-10-24
|/ | | | Problem: Wrong row in TermRequest with full scrollback. Solution: Subtract by the number of lines deleted from scrollback.
* fix(lsp): set 'linebreak' in floating windows (#36275)Fredrik Lanker2025-10-22
| | | | | Set linebreak to avoid splitting words. Fix #36268
* fix(ui2): start treesitter after deleting cmdline buffer (#36274)luukvbaal2025-10-22
| | | | Problem: Treesitter is not started in new cmdline buffer after deletion. Solution: Start treesitter when highlighter buffer no longer matches.
* docs(vimfn): getcwd() behavior #36222Robert2025-10-21
|
* fix(lsp): noisy log message when enabling server without config #36264Riley Bruins2025-10-21
| | | | | | | | | | This warning doesn't really make sense, since the `enable()` call is meant to be run before the `lsp.config` calls. It will be logged many times (once for each enabled LSP) at startup. This is especially annoying because calling `enable()` after configuration causes the first opened buffer not to have its filetype set in some situations. This is a separate bug which really needs to be fixed, and makes this superfluous logging more likely.
* fix(lsp): deduplicate completion items #36166Till Bungert2025-10-20
| | | | | | | The current implementation has a race condition where items are appended to the completion list twice when a second completion runs while the first is still going. This hotfix just deduplicates the entire list. Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
* docs(ui): 'pumborder' #36255Maria Solano2025-10-20
|
* fix(lsp): replace `string` types with LSP method alias type annotations ↵David2025-10-16
| | | | | where appropriate. (#36180) fix(lsp): replace `string` types with LSP method alias where appropriate
* fix(lsp): include missing LSP methods and update type annotationsDavidyz2025-10-16
|
* revert "fix(lsp): _get_workspace_folders does not handle root_dir() ↵Mathias Fußenegger2025-10-14
| | | | | | | function" #36183 This reverts commit 97ab24b9c7d9327740f0692f8076fed5737a52dc. See discussion in https://github.com/neovim/neovim/pull/36071
* fix(lsp): "attempt to index nil config" #36189Justin M. Keyes2025-10-15
| | | | | | | | | | | | | | | | | Problem: If a client doesn't have a config then an error may be thrown. Probably caused by: 2f78ff816b03661b5f74d0624e973eaca0d64ef1 Lua callback: …/lsp.lua:442: attempt to index local 'config' (a nil value) stack traceback: …/lsp.lua:442: in function 'can_start' …/lsp.lua:479: in function 'lsp_enable_callback' …/lsp.lua:566: in function <…/lsp.lua:565> Solution: Not all clients necessarily have configs. - Handle `config=nil` in `can_start`. - If user "enables" an invalid name that happens to match a *client* name, don't auto-detach the client.
* vim-patch:83eb1da: runtime(doc): Normalise formatting of builtin function ↵zeertzjq2025-10-14
| | | | | | | | | | | | | | descriptions (#36172) - Column align tags - Move tags to the same line as the function signature - Move descriptions to the line below the function signature - Add missing hyperlinks to builtins in the description text closes: vim/vim#18478 https://github.com/vim/vim/commit/83eb1da19eedbd56fe6100d7e9017b8ebca0a35b Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:partial:c58f91c: runtime(doc): Whitespace updates (#36160)zeertzjq2025-10-13
| | | | | | | | | | | | | | Use double sentence spacing and wrap lines at 'textwidth'. Code examples and tables were not wrapped unless this had already been done locally. closes: vim/vim#18453 https://github.com/vim/vim/commit/c58f91c035db09358c282f2a908e2aea4287785e Fix incorrect docs in :h ModeChanged. Cherry-pick :h bufnr() changes from patch 8.1.2080. Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* fix(difftool): fully resolve symlinks when comparing paths #36147Tomas Slusny2025-10-12
| | | | | | | | | | | | | | | | | | | Fixes issue on mac where it was constantly reloading buffers as paths were not being normalized and resolved correctly (in relation to buffer name). Quickfix entry: /var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue Buffer name: /private/var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue /var was synlinked to /private/var and this was not being properly handled. Also added lazy redraw to avoid too many redraws when this happens in future and added test for symlink handling. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
* docs: small fixes (#36146)zeertzjq2025-10-12
| | | | | | | | | Close #35989 Close #36031 Close #36107 Co-authored-by: Kieran Moy <kfatyuip@gmail.com> Co-authored-by: William Sprent <william@sprent.dk> Co-authored-by: David Briscoe <43559+idbrii@users.noreply.github.com>
* fix(ui): 'pumborder' parsing, shadow #36127glepnir2025-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 1. Setting `pumborder=+,+,+,+,+,+,+,+` failed to render the custom border characters correctly. The issue occurred in `parse_winborder()` where it incorrectly used `p_winborder` instead of the `border_opt` parameter when the option value didn't contain commas. 2. In `pum_redraw()`, calling `parse_border_style()` directly with the option string failed to parse comma-separated border characters. 3. Missing documentation for PmenuShadow and PmenuShadowThrough highlight groups used by the shadow border style. 4. Coverity reports CID 631420: passing WinConfig (480 bytes) by value in `grid_draw_border()`. 5. crash when using `shadow` value on pumborder. Solution: 1. Fix `parse_winborder()` to use `border_opt` parameter consistently, ensuring the correct option value is parsed regardless of which option (winborder/pumborder) is being set. 2. Update `pum_redraw()` to call `parse_winborder()` instead of `parse_border_style()`, properly handling both predefined styles and custom comma-separated border characters. 3. Add documentation for PmenuShadow (blended shadow areas) and PmenuShadowThrough (see-through corners) highlight groups. 4. Change `grid_draw_border()` to accept WinConfig by pointer. 5. When the "shadow" style is used, no additional row and column offset is applied, and the border width is reduced.
* feat(plugins): nvim.difftool can compare directories #35448Tomas Slusny2025-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Built-in diff mode (nvim -d) does not support directory diffing as required by git difftool -d. This makes it difficult to compare entire directories, detect renames, and navigate changes efficiently. Solution: Add a DiffTool plugin and command that enables side-by-side diffing of files and directories in Neovim. The plugin supports rename detection, highlights changes in the quickfix list, and provides a user command for easy invocation. This allows proper integration with git difftool -d for directory comparison. Example git config: ```ini [diff] tool = nvim_difftool [difftool "nvim_difftool"] cmd = nvim -c "packadd nvim.difftool" -c "DiffTool $LOCAL $REMOTE" ``` Signed-off-by: Tomas Slusny <slusnucky@gmail.com> Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* fix(lsp): _get_workspace_folders does not handle root_dir() function #36071atusy2025-10-11
| | | | | | | | | | | | | | | | * fix(lsp): type of root_dir should be annotated with string|fun|nil * feat(lsp): support root_dir as function in _get_workspace_folders * feat(lsp): let checkhealth support root_dir() function Examples: vim.lsp: Active Clients ~ - lua_ls (id: 1) - Version: <Unknown> - Root directories: ~/foo/bar ~/dev/neovim Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* fix: vim.lsp.omnifunc should not throw away other items #35346Till Bungert2025-10-11
|
* feat(ui): 'pumborder' (popup menu border) #25541glepnir2025-10-10
| | | | | | | | | Problem: Popup menu cannot have a border. Solution: Support 'pumborder' option. Generalize `win_redr_border` to `grid_redr_border`, which redraws border for window grid and pum grid.
* fix(ui2): don't scroll beyond eob in dialog window #36116luukvbaal2025-10-10
| | | | Problem: Forward page scrolling reveals eob lines in the dialog window. Solution: Check if the end of the buffer is visible before scrolling down.
* fix(vim.pack): skip checkout on bad `version` #36038Mickaël RAYBAUD-ROIG2025-10-09
| | | Refs: #36037
* fix(lsp): typos in method names #36077Igor Lacerda2025-10-07
|
* fix(pack): handle lockfile in case of install errors #36064Evgeni Chasnovski2025-10-07
| | | | | | | | | | | | | | Problem: If plugin was intended to install but there were errors (like if there is a typo in `src`), lockfile still includes its entry. This leads to all source of problems (like not correct `get()` output, not working `update()`, etc.). Solution: Explicitly account for plugins that were not installed. Alternative solution might be to write a safe `lock_set(plug, field, value)` wrapper (which sets field for a correct `plugins` entry in the lockfile Lua table) and use it after install to detect the change in `version`. However, this always requires an extra pass through plugins on every startup, which is suboptimal. Optimizing for the "happy path" should be a priority in `add()`.
* fix(lsp): use LSP method type in more places (#36069)Maria Solano2025-10-07
|
* vim-patch:9.1.1829: filetype: KerML and SysML files are not recognized (#36042)zeertzjq2025-10-06
| | | | | | | | | | | | Problem: filetype: KerML and SysML files are not recognized Solution: Detect *.kerml as kerml filetype, detect *.sysml as sysml filetype, include a kerml and sysml filetype plugin (Daumantas Kavolis) closes: vim/vim#18476 https://github.com/vim/vim/commit/b73ccf7ff0326ece9c942127c1965475ad71b78a Co-authored-by: Daumantas Kavolis <daumantas.kavolis@sensmetry.com>
* feat(lsp): pass client ID in code action filter (#36046)Maria Solano2025-10-05
|
* fix: remove quotes around `nil` deprecation alternatives (#36047)Maria Solano2025-10-05
|
* feat(pack): add code actions in confirmation bufferEvgeni Chasnovski2025-10-05
| | | | | | | | | | | | | Problem: No way to granularly operate on plugins when inside confirmation buffer. Solution: Implement code actions for in-process LSP that act on "plugin at cursor": - Update (if has updates). - Skip updating (if has updates). - Delete. Activate via default `gra` or `vim.lsp.buf.code_action()`.
* feat(pack): add `[[` and `]]` mappings in confirmation bufferEvgeni Chasnovski2025-10-05
| | | | | | Problem: No easy/robust way to jump between plugin sections. Solution: Add `[[` and `]]` mappings.
* fix(lsp): format_item should return string (#36025)phanium2025-10-05
| | | | Problem: format_item return two value Solution: `:h vim.ui.select()` say format_item should return string
* fix(lsp): deprecate `vim.lsp.protocol.Methods` (#35998)Maria Solano2025-10-04
|
* feat(pack): prefer using revision from lockfile during installEvgeni Chasnovski2025-10-04
| | | | | | | | | | Problem: Installing plugin always pulls latest `version` changes (usually from the default branch or "latest version tag"). It is more robust to prefer initial installation to use the latest recorded (i.e. "working") revision. Solution: Prefer using revision from the lockfile (if present) during install. The extra `update()` will pull the latest changes.
* feat(pack)!: make `update()` include not active plugins by defaultEvgeni Chasnovski2025-10-04
| | | | | | | | | | | Problem: Running `update()` by default doesn't include not active plugins, because there was no way to get relevant `version` to get updates from. This might be a problem in presence of lazy loaded plugins, i.e. ones that can be "not *yet* active" but still needed to be updated. Solution: Include not active plugins by default since their `version` is tracked via lockfile.
* feat(pack)!: update `get()` to return revision regardless of `opts.info`Evgeni Chasnovski2025-10-04
| | | | | | | Problem: The revision data is returned behind `opts.info` flag because it required extra Git calls. With lockfile it is not the case. Solution: Use lockfile to always set `rev` field in output of `get()`.
* fix(pack)!: use lockfile in `get()` for data about non-active pluginsEvgeni Chasnovski2025-10-04
| | | | | | | Problem: `get()` doesn't return `spec.version` about not-yet-active plugins (because there was no way to know that without `add()`). Solution: Use lockfile data to set `spec.version` of non-active plugins.
* feat(pack): add initial lockfile trackingEvgeni Chasnovski2025-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Some use cases require or benefit from persistent on disk storage of plugin data (a.k.a. "lockfile"): 1. Allow `update()` to act on not-yet-active plugins. Currently if `add()` is not yet called, then plugin's version is unknown and `update()` can't decide where to look for changes. 2. Efficiently know plugin's dependencies without having to read 'pkg.json' files on every load for every plugin. This is for the future, after there is `packspec` support (or other declaration of dependencies on plugin's side). 3. Allow initial install to check out the exact latest "working" state for a reproducible setup. Currently it pulls the latest available `version.` 4. Ensure that all declared plugins are installed, even if lazy loaded. So that later `add()` does not trigger auto-install (when there might be no Internet connection, for example) and there is no issues with knowing which plugins are used in the config (so even never loaded rare plugins are still installed and can be updated). 5. Allow `add()` to detect if plugin's spec has changed between Nvim sessions and act accordingly. I.e. either set new `src` as origin or enforce `version.` This is not critical and can be done during `update()`, but it might be nice to have. Solution: Add lockfile in JSON format that tracks (adds, updtes, removes) necessary data for described use cases. Here are the required data that enables each point: 1. `name` -> `version` map. 2. `name` -> `dependencies` map. 3. `name` -> `rev` map. Probably also requires `name` -> `src` map to ensure that commit comes from correct origin. 4. `name` -> `src` map. It would be good to also track the order, but that might be too many complications and redundant together with point 2. 5. Map from `name` to all relevant spec fields. I.e. `name` -> `src` and `name` -> `version` for now. Storing data might be too much, but can be discussed, of course. This commit only adds lockfile tracking without implementing actual use cases. It is stored in user's config directory and is suggested to be tracked via version control. Example of a lockfile: ```json { # Extra nesting to more future proof. "plugins": { "plug-a": { "ref": "abcdef1" "src": "https://github.com/user/plug-a", # No `version` means it was `nil` (infer default branch later) }, "plug-b": { "dependencies": ["plugin-a", "plug-c"], "src": "https://github.com/user/plug-b", "ref": "bcdefg2", # Enclose string `version` in quotes "version": "'dev'" }, "plug-c": { "src": "https://github.com/user/plug-c", "ref": "cdefgh3", # Store `vim.version.Range` via its `tostring()` output "version": ">=0.0.0", } } } ```
* vim-patch:9.1.1819: Cannot configure the inner foldlevel indicator (#36010)zeertzjq2025-10-03
| | | | | | | | | | | | Problem: Cannot configure the inner foldlevel indicator for the foldcolumn Solution: Add "foldinner" suboption value to the 'fillchar' option (Maria José Solano). closes: vim/vim#18365 https://github.com/vim/vim/commit/1a691afd2717732c6f42dfe3278a9540db0d8110 Co-authored-by: Maria José Solano <majosolano99@gmail.com>
* vim-patch:9.1.1821: filetype: Not all PKL files are recognized (#36008)zeertzjq2025-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: Not all PKL files are recognized Solution: Detect *.pcf as pkl filetype, detect using the pkl-lsp:// protocol as pkl filetype, include PKL syntax script (Jan Claußen) This adds basic syntax support for the new PKL language by Apple. What works: - Shebang support - Comment support - Integers (decimal, hex, octal and binary) support - Floating point support including exponentials - Basic datatype support - Unicode escape delimiters - Escape code support - String interpolation - Support up to five pounds for custom delimiters - Folding of multi-line comments and blocks What doesn't work: The language heavily uses parameterized type declarations, which can get very complex. It is very hard to highlight this properly. There is official Tree-sitter support for this. Since it is hard to pull this off in a vim syntax file, I opted for basic support of the data types. References: https://github.com/apple/pkl-pantry fixes: vim/vim#18271 closes: vim/vim#18274 https://github.com/vim/vim/commit/67a8f2945e54def2a9a94aad919e4f489595acb7 Co-authored-by: Jan Claußen <jan.claussen10@web.de>
* vim-patch:09b1ce0: runtime(doc): fix typo after commit cfcf1a57cbef (#36001)zeertzjq2025-10-03
| | | | | | | related: vim/vim#18452 https://github.com/vim/vim/commit/09b1ce08600bf2b423cb5b3a16952bf183bed1ff Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(lsp): inlineCompletion: ignore out-of-range items #35990Yi Ming2025-10-02
|
* refactor(treesitter): use scratch buffer for string parser #35988Riley Bruins2025-10-02
| | | | | | | | | | This commit changes `languagetree.lua` so that it creates a scratch buffer under the hood when dealing with string parsers. This will make it much easier to just use extmarks whenever we need to track injection trees in `languagetree.lua`. This also allows us to remove the `treesitter.c` code for parsing a string directly. Note that the string parser's scratch buffer has `set noeol nofixeol` so that the parsed source exactly matches the passed in string.
* feat(tui): native progress bars for Progress events #35973Gregory Anders2025-10-02
|
* vim-patch:cfcf1a5: runtime(doc): Clarify use of "noselect" in 'completeopt'zeertzjq2025-10-02
| | | | | | | | | closes: vim/vim#18452 https://github.com/vim/vim/commit/cfcf1a57cbef90831c26626aee6ba9491fb85cb3 Co-authored-by: Girish Palya <girishji@gmail.com> Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
* vim-patch:6e28211: runtime(doc): Tweak documentation stylezeertzjq2025-10-02
| | | | | | | | closes: vim/vim#18462 https://github.com/vim/vim/commit/6e282117c7409af15f33120e67a00c47eefbbba5 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* fix(diagnostics): showing stale diagnostics in handlers #35890Sergei Slipchenko2025-10-01
| | | | | | | | | | | | | | Fixes #35884 Problem: Since `once_buf_loaded` might call a callback passed to it at a later point (which is it's reason to exist) that callback might end up referring to stale diagnostics in a handler's `show` function. For example, if we first call `vim.diagnostic.set` for an unloaded buffer, then call `vim.diagnostic.reset` and only then load the buffer, we might still see diagnostics from `vim.diagnostic.set` call, which are stale at this point. Solution: only keep one autocommand from the most reset `show` call and delete it when `hide` is called.
* vim-patch:014c731: runtime(doc): make :h virtcol() more accurate (#35976)zeertzjq2025-10-01
| | | | | | | | | | | | | | The current description (especially the "unlimited width" part) is inaccurate in several ways: - The size of virtual text can depend on window width. In particular, the size of "above" virtual text can be equal to window width. - A double-width character that doesn't fit adds 1 to the virtual column of the following characters. - The size of 'showbreak' and 'breakindent' is counted. related: vim/vim#5713 closes: vim/vim#18447 https://github.com/vim/vim/commit/014c731fa50c28c94d56545938b6a05a86234c30
* fix(lsp): scope inline_completion autocmds to buffer (#35965)v1nh1shungry2025-10-01
| | | | | | | | | | | | | Problem: Autocmds in inline_completion Completor are not scoped to specific buffers. When multiple buffers have inline completion enabled, events (InsertEnter, CursorMovedI, TextChangedP, InsertLeave) in any buffer trigger callbacks for all Completor instances, causing incorrect behavior across buffers. Solution: Add `buffer = bufnr` parameter to nvim_create_autocmd() calls to make them buffer-local. Each Completor instance now only responds to events in its own buffer.
* vim-patch:4edaf89: runtime(doc): improve preinserted() doczeertzjq2025-09-30
| | | | | | | | | | Change the second "if" to "because", otherwise it may be misinterpreted that preinserted() can return non-zero just because these options are set. closes: vim/vim#18409 https://github.com/vim/vim/commit/4edaf8923335504c31810dc4c5213eaba84e7898
* vim-patch:9.1.1797: completion: autocompletion can be improvedzeertzjq2025-09-30
| | | | | | | | | | | | | | | | | | | | | Problem: completion: autocompletion can be improved Solution: Add support for "longest" and "preinsert" in 'autocomplete'; add preinserted() (Girish Palya) * Add support for "longest" in 'completeopt' when 'autocomplete' is enabled. (Note: the cursor position does not change automatically when 'autocomplete' is enabled.) * Add support for "preinsert" when 'autocomplete' is enabled. Ensure "preinsert" works the same with and without 'autocomplete' * introduce the preinserted() Vim script function, useful for defining custom key mappings. fixes: vim/vim#18314 closes: vim/vim#18387 https://github.com/vim/vim/commit/c05335082adb21d99d96374779856444a3a0688f Co-authored-by: Girish Palya <girishji@gmail.com>