summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim
AgeCommit message (Collapse)AuthorFiles
2024-06-15docs: misc (#29229)dundargoc4
Co-authored-by: Ilia Choly <ilia.choly@gmail.com> Co-authored-by: Jose Pedro Oliveira <jose.p.oliveira.oss@gmail.com> Co-authored-by: Maria José Solano <majosolano99@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-06-15vim-patch:c509c00: runtime(doc): fix wrong helptag for :deferzeertzjq1
https://github.com/vim/vim/commit/c509c009bbc07eff678a9239a5813398e180f019 Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-15vim-patch:d6d4e13: runtime(doc): rewrite mkdir() doc and simplify {flags} ↵zeertzjq1
meaning related: vim/vim#14991 https://github.com/vim/vim/commit/d6d4e1333659c0d2acee3133819498d014df47de Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-14fix(lsp): tune completion word extraction for decorated labels (#29331)Mathias Fußenegger1
Problem: For snippets lsp.completion prefers the label if it is shorter than the insertText or textEdit to support postfix completion cases but clangd adds decoration characters to labels. E.g.: `•INT16_C(c)` Solution: Use parse_snippet on insertText/textEdit before checking if it is shorter than the label. Fixes https://github.com/neovim/neovim/issues/29301
2024-06-14refactor(lsp): use metatable for buf_versions (#29304)Ilia Choly3
This reduces the number of nil checks around buf_versions usage Test changes were lifted from 5c33815 Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-06-14fix(lsp): check for nil response from server (#29196)Tama McGlinn1
this only changes the error message, so that it is clear that the error is with the LSP server, rather than being a crash inside nvim runtime scripts. We are already doing a lot of validation, it's just that nil was being overlooked here. This fixes issue #27395
2024-06-14fix(terminal): set local values of window options (#29326)zeertzjq1
2024-06-14vim-patch:d353d27: runtime(doc): restore description of "$" in col() and ↵zeertzjq1
virtcol() (vim/vim#14981) These are different from line() and getpos(). https://github.com/vim/vim/commit/d353d2782032b91498601afefee4256592f48074
2024-06-14vim-patch:02f3eba: runtime(doc): deduplicate getpos(), line(), col(), virtcol()zeertzjq1
Move the main description to getpos() and link to that from the other functions. closes: vim/vim#14970 https://github.com/vim/vim/commit/02f3ebacfbfa1f892347d7532278f24620e68300
2024-06-12Merge pull request #29103 from gpanders/test-no-tgcGregory Anders1
test: do not set termguicolors in test runner
2024-06-12Merge pull request #29303 from lewis6991/fix/wobufLewis Russell1
fix(vim.wo): never allow non-zero bufnr
2024-06-12refactor(terminal): move :terminal defaults to _defaults.luaGregory Anders1
2024-06-12fix(vim.wo): never allow non-zero bufnrLewis Russell1
2024-06-12vim-patch:210b39c: runtime(doc): clarify documentation for "v" position at ↵zeertzjq1
line() (#29296) Problem: the previous documentation falsely states that "v" always refers to the start of a visual area. In fact, the reference of "v" and "." complement each other. If the cursor is at the start of a (characterwise) visual area, then "v" refers to the end of the area. Solution: be more verbose and explicit about the connection between "." and "v" and also refer to |v_o| which many vim users will be familiar with for visual areas. https://github.com/vim/vim/commit/210b39c2d686d875e2464ca1f42131453dc6bd41 Co-authored-by: Peter Aronoff <peter@aronoff.org>
2024-06-11fix(types): add some vim.fn type annotationsnotomo1
Problem: Some vim.fn have no type annotations. Solution: Add type annotations.
2024-06-11fix(types): use vararg return type annotationWill Hopkins1
build(types): allow vararg returns in function types
2024-06-11refactor(lua): improve type annotationsLewis Russell15
2024-06-10fix(lsp): do not reset buf version when detaching client (#29242)Ilia Choly1
2024-06-10Merge #29238 from clason/feat/help-tocJustin M. Keyes1
2024-06-10fix(glob): handle overlapping `{}` condition elements #29236Jon Huhn1
This change fixes an issue where glob patterns like `{a,ab}` would not match `ab` because the first option `a` matches, then the end of the string is expected but `b` is found, and LPeg does not backtrack to try the next option `ab` which would match. The fix here is to also append the rest of the pattern to the generated LPeg pattern for each option. This changes a glob `{a,ab}` from being parsed as ("a" or "ab") "end of string" to ("a" "end of string" or "ab" "end of string") Here, matching against `ab` would try the first option, fail to match, then proceed to the next option, and match. The sacrifice this change makes is dropping support for nested `{}` conditions, which VSCode doesn't seem to support or test AFAICT. Fixes #28931 Co-authored-by: Sergey Slipchenko <faergeek@gmail.com>
2024-06-09feat(lsp): include end_col, end_lnum in vim.lsp.buf.locations_to_items #29164Tom Praschan1
2024-06-09feat(help): use treesitter for table of contentsChristian Clason1
Problem: Creating the table of contents for `gO` is complicated. Solution: Use treesitter instead.
2024-06-08feat(lua): add `vim._with`dundargoc2
It's a function to perform operations in their own sealed context, similar to pythons `with`. This helps ease operations where you need to perform an operation in a specific context, and then restore the context. Marked as private for now as it's not ready for public use. The current plan is to start using this internally so we can discover and fix any problems. Once this is ready to be exposed it will be renamed to `vim.with`. Usage: ```lua local ret = vim._with({context = val}, function() return "hello" end) ``` , where `context` is any combination of: - `buf` - `emsg_silent` - `hide` - `horizontal` - `keepalt` - `keepjumps` - `keepmarks` - `keeppatterns` - `lockmarks` - `noautocmd` - `options` - `sandbox` - `silent` - `unsilent` - `win` (except for `win` and `buf` which can't be used at the same time). This list will most likely be expanded in the future. Work on https://github.com/neovim/neovim/issues/19832. Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2024-06-07feat: get/set namespace properties #28728altermo3
ref https://github.com/neovim/neovim/pull/28432 ref https://github.com/neovim/neovim/issues/28469
2024-06-07fix(lsp): fix reverse sorting of same position text edits (#29212)Al Colmenar1
Problem: Text edits with the same position (both line and character) were being reverse sorted prior to being applied which differs from the lsp spec Solution: Change the sort order for just the same position edits
2024-06-07fix(lsp): revert buf_versions deprecation/replacement (#29217)Mathias Fußenegger6
* Revert "fix(lsp): account for changedtick version gap on modified reset (#29170)" This reverts commit 2e6d295f799c27372e5c0c44727fa613c81717fd. * Revert "refactor(lsp): replace util.buf_versions with changedtick (#28943)" This reverts commit 5c33815448e11b514678f39cecc74e68131d4628.
2024-06-07docs: misc (#28837)dundargoc5
Co-authored-by: Danymat <d.danymat@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Jakub Okoński <jakub@okonski.org> Co-authored-by: John L. Villalovos <john@sodarock.com> Co-authored-by: Maria José Solano <majosolano99@gmail.com> Co-authored-by: Michaili K <git@michaili.dev> Co-authored-by: TheLeoP <eugenio2305@hotmail.com> Co-authored-by: Tobias Schmitz <tobiasschmitz2001@gmail.com> Co-authored-by: W20MC <157727813+W20MC@users.noreply.github.com> Co-authored-by: Will Hopkins <willothyh@gmail.com> Co-authored-by: Yifan Hu <141280278+b0ae989c@users.noreply.github.com> Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: prljav <74116121+prljav@users.noreply.github.com>
2024-06-06vim-patch:9.1.0469: Cannot have buffer-local value for 'completeopt'zeertzjq1
Problem: Cannot have buffer-local value for 'completeopt' (Nick Jensen). Solution: Make 'completeopt' global-local (zeertzjq). Also for some reason test Test_ColonEight_MultiByte seems to be failing sporadically now. Let's mark it as flaky. fixes: vim/vim#5487 closes: vim/vim#14922 https://github.com/vim/vim/commit/529b9ad62a0e843ee56ef609aef7e51b7dc8a4c8
2024-06-05fix(tui): move $COLORTERM check to _defaults.lua (#29197)Gregory Anders1
We currently check $COLORTERM in the TUI process to determine if the terminal supports 24 bit color (truecolor). If $COLORTERM is "truecolor" or "24bit" then we automatically assume that the terminal supports truecolor, but if $COLORTERM is set to any other value we still query the terminal. The `rgb` flag of the UI struct is a boolean which only indicates whether the UI supports truecolor, but does not have a 3rd state that we can use to represent "we don't know if the UI supports truecolor". We currently use `rgb=false` to represent this "we don't know" state, and we use XTGETTCAP and DECRQSS queries to determine at runtime if the terminal supports truecolor. However, if $COLORTERM is set to a value besides "truecolor" or "24bit" (e.g. "256" or "16) that is a clear indication that the terminal _does not_ support truecolor, so it is incorrect to treat `rgb=false` as "we don't know" in that case. Instead, in the TUI process we only check for the terminfo capabilities. This must be done in the TUI process because we do not have access to this information in the core Neovim process when `_defaults.lua` runs. If the TUI cannot determine truecolor support from terminfo alone, we set `rgb=false` to indicate "we don't know if the terminal supports truecolor yet, keep checking". When we get to `_defaults.lua`, we can then check $COLORTERM and only query the terminal if it is unset. This means that users can explicitly opt out of truecolor determination by setting `COLORTERM=256` (or similar) in their environment.
2024-06-05fix(lua): don't clamp -1 or v:maxcol in vim.highlight.range() (#29203)zeertzjq1
2024-06-05vim-patch:2a2c4ff: runtime(doc): clarify how fuzzy 'completeopt' should workzeertzjq1
related: vim/vim#14912 https://github.com/vim/vim/commit/2a2c4fffd7e04f74b316209404767f128684a9e1 Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-05vim-patch:9.1.0463: no fuzzy-matching support for insert-completionzeertzjq1
Problem: no fuzzy-matching support for insert-completion Solution: enable insert-mode completion with fuzzy-matching using :set completopt+=fuzzy (glepnir). closes: vim/vim#14878 https://github.com/vim/vim/commit/a218cc6cdabae1113647b817c4eefc2b60a6902f Co-authored-by: glepnir <glephunter@gmail.com>
2024-06-04fix(diagnostic): fix float scope filtering (#29134)Andre Toerien1
2024-06-04fix(lsp): check if buffer is valid before LspDetach autocmd (#29162)Saltaformajo1
2024-06-04fix(lsp): remove superfluous on_detach callback from semantic tokens module ↵jdrouhard1
(#29174) LspDetach is now triggered by the main on_detach callback that is added when an LSP client is attached to a buffer. The semantic_tokens module already includes a LspDetach handler that does the right thing. When the LspDetach trigger was added to the main LSP on_detach, it created a race condition in semantic tokens when a buffer was deleted that would trigger both its own on_detach and the LspDetach handlers. If the former came last, an error was thrown trying to delete a non-existent augroup (destroy() was being called twice).
2024-06-04fix(lsp): account for changedtick version gap on modified reset (#29170)Mathias Fußenegger1
Follow up to https://github.com/neovim/neovim/pull/28943 Fixes https://github.com/neovim/neovim/issues/29163
2024-06-04refactor(lua): use tuple syntax everywhere #29111Ilia Choly13
2024-06-04fix(filetype): fix typos in filetype detectionEvgeni Chasnovski1
2024-06-04vim-patch:9.1.0464: no whitespace padding in commentstring option in ftpluginsChristian Clason1
Problem: no whitespace padding in commentstring option in ftplugins Solution: Change default to include whitespace padding, update existing filetype plugins with the new default value (Riley Bruins) closes: vim/vim#14843 https://github.com/vim/vim/commit/0a0830624a260660c7fa692ecb7e6e5de09114ba Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-06-03fix(lsp): use client.id instead of pairs index (#29143)ippachi1
Problem: Completion side effects not working randomly. Solution: When creating the table of LSP responses, the table index was used, but this is not the same as the actual client_id, so it was changed to use the client_id directly.
2024-06-03fix(gx): allow `@` in urldundargoc1
This will make `gx` work for links for the form https://hachyderm.io/@neovim.
2024-06-02vim-patch:9.1.0460: filetype: lintstagedrc files are not recognizedChristian Clason1
Problem: filetype: lintstagedrc files are not recognized Solution: recognize '.lintstagedrc' files as json filetype (İlyas Akın) see: https://github.com/lint-staged/lint-staged closes: vim/vim#14897 https://github.com/vim/vim/commit/7577afd5efd0f7ebf0dbbca09713185024263ed7 Co-authored-by: İlyas Akın <ilyas.akin@kuika.com>
2024-06-02fix(lsp): trim trailing whitespace from completion words (#29122)Mathias Fußenegger1
the `complete()` mechanism doesn't play nicely with trailing newlines or tabs. A newline causes it to insert a null character, showing up as `^@`.
2024-06-02vim-patch:e299591: runtime(doc): clarify 'shortmess' flag "S" (#29131)zeertzjq1
fixes: vim/vim#14893 https://github.com/vim/vim/commit/e299591498a20c5c587364e4df57f947dfc02897 Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-06-01perf(lsp): avoid repeated table lookup in completion.enableMathias Fussenegger1
2024-06-01refactor(lsp): share completion request logic between omnifunc & triggerMathias Fussenegger1
2024-06-01perf(lsp): don't copy completion items in filter passMathias Fussenegger1
2024-05-31refactor(lsp): use tuple syntax in generated protocol types (#29110)Ilia Choly1
2024-05-31fix(vim.text): remove assert from vim.text.hexdecodeGregory Anders1
Instead, return nil plus an error message if the input is invalid.
2024-05-31refactor(lsp): use predefined types in util function signatures (#29095)Ilia Choly1