aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* fix(checkhealth): check outdated pynvim version properly #33175zeertzjq2025-03-30
| | | Fixes #33174, a regression from #22962.
* feat(checkhealth): emoji for OK/WARN/ERROR #33172Justin M. Keyes2025-03-30
| | | | | | | Problem: Health status can be much more visually distinct. Solution: Use emoji next to each status.
* fix(checkhealth): check g:loaded_xx_provider for all providers #33168Justin M. Keyes2025-03-29
|
* fix(provider): misleading :checkhealth if user sets ↵Sathya Pramodh2025-03-29
| | | | | | | | | | | | g:loaded_python3_provider=1 #32696 Problem: :checkhealth shows a confusing message if user sets g:loaded_python3_provider=1. Solution: - Show a warning if that var is set to 1. - Update provider modules to default to 0. Any user code that is checking for 1, is like already broken because these may be set to 2.
* refactor(treesitter): migrate to ts parser callback API #33141Riley Bruins2025-03-29
| | | | | Remove the `set_timeout` functions for `TSParser` and instead add a timeout parameter to the regular parse function. Remove these deprecated tree-sitter API functions and replace them with the preferred `TSParseOptions` style.
* vim-patch:9.1.1250: cannot set the maximum popup menu widthzeertzjq2025-03-29
| | | | | | | | | | | | | | Problem: cannot set the maximum popup menu width (Lucas Mior) Solution: add the new global option value 'pummaxwidth' (glepnir) fixes: vim/vim#10901 closes: vim/vim#16943 https://github.com/vim/vim/commit/88d75934c3d5bc4c406343f106e1a61638abd3a7 Co-authored-by: glepnir <glephunter@gmail.com>
* fix(checkhealth): don't override user "q" keymap #33132phanium2025-03-29
|
* vim-patch:9.1.1252: typos in code and docs related to 'diffopt' "inline:" ↵zeertzjq2025-03-29
| | | | | | | | | | | | (#33143) Problem: Typos in code and docs related to 'diffopt' "inline:". (after v9.1.1243) Solution: Fix typos and slightly improve the docs. (zeertzjq) closes: vim/vim#16997 https://github.com/vim/vim/commit/5a307c361cbe9f7ac438a917b905378d87f8f2de
* fix(lsp): warn on missing config in :checkhealth #33087Micah Halter2025-03-28
| | | | | | | | | | | Problem When calling `:checkhealth vim.lsp` after the user has enabled a language server with `vim.lsp.enable` that has no configuration a runtime error is hit because the code expects for a configuration to exist. Solution: Check if a configuration was returned before parsing it, if it isn't returned then warn the user that the server has been enabled but a configuration was not found.
* fix(provider)!: drop Python 3.7, 3.8 support #33088v1nh1shungry2025-03-28
| | | | | | Problem: #33022 didn't update `min_version` to 3.9, therefore Python 3.7 and 3.8 are still available. Solution: Update `min_version` to 3.9.
* refactor(treesitter): simplify injection retrieval #33104Riley Bruins2025-03-28
| | | | | | | Simplify the logic for retrieving the injection ranges for the language tree. The trees are now also sorted by starting position, regardless of whether they are part of a combined injection or not. This would be helpful if ranges are ever to be stored in an interval tree or other kind of sorted tree structure.
* vim-patch:9.1.1243: diff mode is lacking for changes within lineszeertzjq2025-03-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Diff mode's inline highlighting is lackluster. It only performs a line-by-line comparison, and calculates a single shortest range within a line that could encompass all the changes. In lines with multiple changes, or those that span multiple lines, this approach tends to end up highlighting much more than necessary. Solution: Implement new inline highlighting modes by doing per-character or per-word diff within the diff block, and highlight only the relevant parts, add "inline:simple" to the defaults (which is the old behaviour) This change introduces a new diffopt option "inline:<type>". Setting to "none" will disable all inline highlighting, "simple" (the default) will use the old behavior, "char" / "word" will perform a character/word-wise diff of the texts within each diff block and only highlight the differences. The new char/word inline diff only use the internal xdiff, and will respect diff options such as algorithm choice, icase, and misc iwhite options. indent-heuristics is always on to perform better sliding. For character highlight, a post-process of the diff results is first applied before we show the highlight. This is because a naive diff will create a result with a lot of small diff chunks and gaps, due to the repetitive nature of individual characters. The post-process is a heuristic-based refinement that attempts to merge adjacent diff blocks if they are separated by a short gap (1-3 characters), and can be further tuned in the future for better results. This process results in more characters than necessary being highlighted but overall less visual noise. For word highlight, always use first buffer's iskeyword definition. Otherwise if each buffer has different iskeyword settings we would not be able to group words properly. The char/word diffing is always per-diff block, not per line, meaning that changes that span multiple lines will show up correctly. Added/removed newlines are not shown by default, but if the user has 'list' set (with "eol" listchar defined), the eol character will be be highlighted correctly for the specific newline characters. Also, add a new "DiffTextAdd" highlight group linked to "DiffText" by default. It allows color schemes to use different colors for texts that have been added within a line versus modified. This doesn't interact with linematch perfectly currently. The linematch feature splits up diff blocks into multiple smaller blocks for better visual matching, which makes inline highlight less useful especially for multi-line change (e.g. a line is broken into two lines). This could be addressed in the future. As a side change, this also removes the bounds checking introduced to diff_read() as they were added to mask existing logic bugs that were properly fixed in vim/vim#16768. closes: vim/vim#16881 https://github.com/vim/vim/commit/9943d4790e42721a6777da9e12637aa595ba4965 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:9.1.1219: Strange error with wrong type for matchfuzzy() "camelcase"zeertzjq2025-03-27
| | | | | | | | | | | | | | | Problem: Strange error with type for matchfuzzy() "camelcase". Solution: Show the error "Invalid value for argument camelcase" instead of "Invalid argument: camelcase" (zeertzjq). Note that using tv_get_string() will lead to confusion, as when the value cannot be converted to a string tv_get_string() will also give an error about that, but "camelcase" takes a boolean, not a string. Also don't use tv_get_string() for the "limit" argument above. closes: vim/vim#16926 https://github.com/vim/vim/commit/c4815c157b27923001e44bfd241fb540bf1fb518
* vim-patch:9.1.1214: matchfuzzy() can be improved for camel case matchesglepnir2025-03-27
| | | | | | | | | | | | | | | | Problem: When searching for "Cur", CamelCase matches like "lCursor" score higher than exact prefix matches like Cursor, which is counter-intuitive (Maxim Kim). Solution: Add a 'camelcase' option to matchfuzzy() that lets users disable CamelCase bonuses when needed, making prefix matches rank higher. (glepnir) fixes: vim/vim#16504 closes: vim/vim#16797 https://github.com/vim/vim/commit/28e40a7b55ce471656cccc2260c11a29d5da447e Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.1201: 'completefuzzycollect' does not handle dictionary correctlyzeertzjq2025-03-27
| | | | | | | | | | | | | Problem: 'completefuzzycollect' does not handle dictionary correctly Solution: check for ctrl_x_mode_dictionary (glepnir) closes: vim/vim#16867 https://github.com/vim/vim/commit/587601671cd06ddc4d78f907d98578cdab96003f Cherry-pick a documentation fix from later. Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:1dc731a: runtime(doc): make :h 'completefuzzycollect' a bit clearerzeertzjq2025-03-27
| | | | | | | | | | | - Fix grammar - Use "matches" instead of "items" ("completion candidates" is used in some other places, but it's a bit verbose) - "When set" is a bit vague, instead use "For specified modes" closes: vim/vim#16871 https://github.com/vim/vim/commit/1dc731a49ff5d06ead4b506afa04288a5baafc1a
* vim-patch:9.1.1197: process_next_cpt_value() uses wrong conditionzeertzjq2025-03-27
| | | | | | | | | | | | Problem: process_next_cpt_value() uses wrong condition Solution: use cfc_has_mode() instead and remove redundant else if branch (glepnir) closes: vim/vim#16833 https://github.com/vim/vim/commit/53b14578e03f93a53fd6eb21c00caf96484742ed Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.1182: No cmdline completion for 'completefuzzycollect'zeertzjq2025-03-27
| | | | | | | | | | | | | | Problem: No cmdline completion for the 'completefuzzycollect' option (after v9.1.1178) Solution: Add cmdline completion for the 'completefuzzycollect' option, improve its description in optwin.vim (zeertzjq). closes: vim/vim#16813 https://github.com/vim/vim/commit/53d59ecc1d93ce3a3f6d0182479d825852018ceb No code change is needed in Nvim as Nvim uses expand_set_str_generic() by default.
* vim-patch:9.1.1178: not possible to generate completion candidates using ↵zeertzjq2025-03-27
| | | | | | | | | | | | | | | | | | fuzzy matching Problem: not possible to generate completion candidates using fuzzy matching Solution: add the 'completefuzzycollect' option for (some) ins-completion modes (glepnir) fixes vim/vim#15296 fixes vim/vim#15295 fixes vim/vim#15294 closes: vim/vim#16032 https://github.com/vim/vim/commit/f31cfa29bf72b0cdf6fa1b60346ea4e187bcafd1 Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:26e4b00: runtime(doc): Revert outdated comment in completeopt's ↵zeertzjq2025-03-27
| | | | | | | | | | | | | | | | fuzzy documentation Originally, `:set completeopt+=fuzzy` did not affect how the candidate list is collected in default keyword completion. A comment was added to documentation as part of vim/vim#14912 to clarify it. vim/vim#15193 later changed the fuzzy behavior to now change the candidate collection behavior as well so the clarification in docs is now wrong. Remove them here. closes: vim/vim#15656 https://github.com/vim/vim/commit/26e4b000025ea0e25ea7877314d9095737431bae Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* refactor(diagnostic)!: remove deprecated diagnostic APIs (#33072)Gregory Anders2025-03-26
|
* docs(lsp): completion.enable #33063Mathias Fußenegger2025-03-26
|
* docs: news, lsp autocomplete #33047Justin M. Keyes2025-03-26
|
* fix(lua): no omni/cmdline completion for vim.env (#33044)Phạm Bình An2025-03-26
| | | | | | | | Problem: - `:lua vim.env.<Tab>` does not show completion of environment variables - Meanwhile, `:let $<Tab>` does show completion of environment variables Solution: - Fix it
* fix(cmdline): cmdline completion of _defer_require() modules #33007phanium2025-03-24
| | | | | | | | | | | Problem: `:lua vim.lsp.c<tab>` does not list vim.lsp.completion in the completion list after 24cea4c7f7417c7fe99a98a0487f51dd68c4f409. Solution: - Always include `vim.lsp._submodule` keys in candidates. - Fixes `vim.lsp.c<tab>` -> `vim.lsp.completion`. - Eager-load `vim.lsp.completion` to get its completion. - Fixes `vim.lsp.completion.g<tab>` -> `vim.lsp.completion.get`.
* fix(paste): wrong '[ mark after pasting a big string (streamed chunks) #33025Au.2025-03-23
| | | | | | | | | | | | | Problem Pasting a big string ("streamed paste" with multiple chunks) sets the '[ mark to the edit from the last chunk, instead of the start of the paste. Solution: Set the '[ mark where the paste started, not where the last chunk was inserted. Note: `startpos == nil` is not equal to `phase == 1` because there may be some empty chunks pasted which won't arrive here (returned at code before).
* vim-patch:9.1.1231: filetype: SPA JSON files are not recognizedChristian Clason2025-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: SPA (single page application) JSON files are not recognized (used by pipewire and wireplumber) Solution: detect pipewire and wireplumber configuration files as spajson filetype, include filetype, indent and syntax scripts for this new filetype (David Mandelberg). I looked at all the files found by this command to see if the syntax highlighting looked reasonable: ``` find {~/.config,/etc,/usr/share}/{pipewire,wireplumber} -type f -name \*.conf ``` References: * pipewire config files: https://docs.pipewire.org/page_config.html * wireplumber config files: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/conf_file.html and * https://pipewire.pages.freedesktop.org/wireplumber/daemon/locations.html closes: vim/vim#16950 https://github.com/vim/vim/commit/4e7b4308fb92628434bd7e07ab92910c33051431 Co-authored-by: David Mandelberg <david@mandelberg.org>
* feat(provider/python)!: add python 3.13, drop 3.7 and 3.8 (EOL) #33022Eisuke Kawashima2025-03-22
| | | | | https://devguide.python.org/versions/ Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
* fix(lsp): handle using array as open_floating_preview title (#33016)Au.2025-03-22
|
* docs: misc (#32928)dundargoc2025-03-21
| | | | Co-authored-by: James Trew <j.trew10@gmail.com> Co-authored-by: przepompownia <przepompownia@users.noreply.github.com>
* docs: LSP completion #33006Justin M. Keyes2025-03-21
|
* docs(treesitter): document TSNode:named_children()Riley Bruins2025-03-21
| | | | | This commit also gives an internal documentation description for `TSNode:__has_ancestor()`.
* fix(checkhealth): module not found when `&rtp` has nested paths #32988phanium2025-03-19
| | | | | | | | | | | Problem: `:checkhealth` fail to find the module when `&rtp` have nested paths. Solution: find in order all existed `&rtp/lua` path rather than `&rtp` to ensure prefix exist before trim `&rtp`. In this case one module can be searched out from two different `&rtp/lua`, we use the first `&rtp/lua` contain the module (like how require() works).
* fix(snippet): wrong indentation when snippet contains "^" #32970Avinash Thakur2025-03-19
| | | | | | | | | | | | | | | | | | | | | | | ## Problem The pattern used to match indentation is wrong as can be seen in ```lua -- current pattern doesn't match starting space print(vim.inspect((" xyz"):match("(^%s+)%S"))) -- nil -- instead, it matches characters `^ ` in text print(vim.inspect(("x^ yz"):match("(^%s+)%S"))) -- "^ " -- indentation could've been matched by, however not required print(vim.inspect((" xyz"):match("^(%s+)%S"))) -- " " ``` ## Solution We don't even need to modify `base_indent` at every line. If every line's indentation is calculated by the previous line's indentation (which already has starting indentation) added to the starting indentation, we see that indentation is multiplied on every line. Hence, we only add the starting line indentation to every line.
* fix(filetype): normalize full path before matching #32227markstegeman2025-03-19
| | | | | | | | | | | | | Problem: On Windows, treesitter query files are not recognized as such when opened from inside their directory, because the full path returned from fnamemodify(_, ':p') contains backslashes, while the filetype patterns expect forward slashes. Solution: Normalize the result of fnamemodify(_, ':p') before trying to match it to filetype patterns. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* fix(diagnostic): clear virtual_lines autocmd only for valid buf #32979Mars Peng2025-03-19
|
* fix(runtime): gO always says "Help TOC" #32971Justin M. Keyes2025-03-19
| | | | | | | Problem: gO always says "Help TOC". Solution: Use a generic title instead.
* vim-patch:9.1.1220: filetype: uv.lock file not recognized (#32955)Acaibrid2025-03-18
| | | | | | | | | Problem: filetype: uv.lock file not recognized Solution: detect uv.lock file as toml filetype (Acaibird) closes: vim/vim#16924 https://github.com/vim/vim/commit/18a6853a7627de231f0128237665112a0c8aaaf0
* feat(float): add winborder option (#31074)glepnir2025-03-18
| | | | | | | | | Problem: There is currently no global option to define the default border style for floating windows. This leads to repetitive code when developers need consistent styling across multiple floating windows. Solution: Introduce a global option winborder to specify the default border style for floating windows. When a floating window is created without explicitly specifying a border style, the value of the winborder option will be used. This simplifies configuration and ensures consistency in floating window appearance. Co-authored-by: Gregory Anders <greg@gpanders.com>
* docs: misc #32959Justin M. Keyes2025-03-18
|
* fix(lua): ensure inspect_pos() only shows visible highlight extmarksLuuk van Baal2025-03-18
| | | | | | | | | | | | | | | Problem: Unpaired marks are shown with `filter.extmarks == true`, which should only return visible highlights. Misleading `end_col` included in `inspect_pos()` for unpaired mark; it is set to `start_col + 1` which would be a visible highlight, which it is not. Custom "is_here" filter used to get extmarks overlapping a position. Solution: Exclude unpaired highlight extmarks with `filter.extmarks == true`. Set `end_col` to `start_col` for an unpaired mark. Supply appropriate arguments to nvim_buf_get_extmarks() to return overlapping extmarks; exclude marks whose end is at `{row, col}` with `filter.extmarks == true`.
* test: cleanup ftplugin_spec.lua #32948Justin M. Keyes2025-03-17
| | | | | | | | Problem: - cannot run ftplugin_spec.lua by itself - test leaves foo/ dir Solution: - fix setup and teardown
* fix(diagnostic): remove deprecated `severity_limit` optionChristian Clason2025-03-17
| | | | Deprecated to be removed in 0.11
* feat(runtime): Lua ftplugin 'includeexpr' #32719Phạm Bình An2025-03-17
| | | | | | | | | Problem: Current `'includeexpr'` in runtime/ftplugin/lua.vim doesn't work with Nvim Lua. Solution: Provide an improved 'includeexpr' for Lua in "ftplugin/lua.lua". Closes: https://github.com/neovim/neovim/issues/32490
* docs: miscJustin M. Keyes2025-03-17
|
* docs(api): rename "handle" => "id"Justin M. Keyes2025-03-17
|
* perf(lsp): don't construct potentially expensive stringsRiley Bruins2025-03-16
|
* refactor(lsp)!: rename lsp.completion.trigger() to get() (#32911)Mathias Fußenegger2025-03-16
| | | | | | | | | | | | Problem: `trigger` is a custom word not yet used in APIs. Solution: Use `get` instead because the main effect is that the completion candidates will be collected (and shown by default, but follow-up commits are planned to add an `on_result` callback that allows more general handling). --------- Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* fix(checkhealth): handle nested lua/ directory #32918phanium2025-03-16
| | | | | | Problem: :checkhealth fails if plugin has nested "lua/" directory Solution: trim `{runtimepath}/lua` from fullpath to get subpath (`./**/{health, health/init.lua}`)
* fix(diagnostic): virtual lines should scroll horizontallyxzb2025-03-16
|