aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
| * fix(treesitter): ensure syntaxset augroup exists (#29542)zeertzjq2024-07-03
| | | | | | | | | | | | | | | | Problem: Error when calling vim.treesitter.start() and vim.treesitter.stop() in init.lua. Solution: Ensure syntaxset augroup exists after loading synload.vim.
| * fix(lsp): fallback to `label` for completion items if all others are missing ↵Sebastian Lyng Johansen2024-07-02
| | | | | | | | (#29522)
| * feat(jumplist): allow opting out of removing unloaded buffers (#29347)zeertzjq2024-06-30
| | | | | | | | Problem: Cannot opt out of removing unloaded buffers from the jumplist. Solution: Only enable that with "unload" flag in 'jumpoptions'.
| * refactor: use `vim._with` where possibledundargoc2024-06-28
| | | | | | | | | | This mostly means replacing `nvim_buf_call` and `nvim_win_call` with `vim._with`.
| * Merge pull request #29483 from bfredl/nonbinarybfredl2024-06-27
| |\ | | | | | | refactor(typval)!: remove binary distinction of binary and nonbinary strings
| | * refactor(typval)!: remove distinction of binary and nonbinary stringsbfredl2024-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a breaking change which will make refactor of typval and shada code a lot easier. In particular, code that would use or check for v:msgpack_types.binary in the wild would be broken. This appears to be rarely used in existing plugins. Also some cases where v:msgpack_type.string would be used to represent a binary string of "string" type, we use a BLOB instead, which is vimscripts native type for binary blobs, and already was used for BIN formats when necessary. msgpackdump(msgpackparse(data)) no longer preserves the distinction of BIN and STR strings. This is very common behavior for language-specific msgpack bindings. Nvim uses msgpack as a tool to serialize its data. Nvim is not a tool to bit-perfectly manipulate arbitrary msgpack data out in the wild. The changed tests should indicate how behavior changes in various edge cases.
| * | fix(lsp): pre-filter matches on label if filterText is missing (#29491)Mathias Fußenegger2024-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the built-in pum completion mechanism will filter anyway on the next input it is odd if the initial popup shows entries which don't match the current prefix. Using fuzzy match on the label/prefix is compatible with `completeopt+=fuzzy` and also doesn't seem to break postfix snippet cases Closes https://github.com/neovim/neovim/issues/29287
| * | fix(lsp): avoid vim.keymap.del error when stopping a client (#29478)Matt Fellenz2024-06-26
| | |
| * | feat(lua): add `context.env` (environment variables) to `vim._with()`Evgeni Chasnovski2024-06-24
| | |
| * | feat(lua): update `vim._with` to allow more granular option contextsEvgeni Chasnovski2024-06-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: with a single `context.options` there is no way for user to force which scope (local, global, both) is being temporarily set and later restored. Solution: replace single `options` context with `bo`, `go`, `wo`, and `o`. Naming and implementation follows how options can be set directly with `vim.*` (like `vim.bo`, etc.). Options are set for possible target `win` or `buf` context.
| * | test(lua): cover `vim._with()` with testsEvgeni Chasnovski2024-06-24
| |/ | | | | | | | | | | | | | | | | | | | | | | Problem: `vim._with()` has many different use cases which are not covered with tests. Solution: cover with tests. Some (many) test cases are intentionally marked as "pending" because they cover cases which don't work as expected at the moment (and fixing them requires specific knowledge of C codebase). Use them as a reference for future fixes. Also some of "can be nested" tests currently might pass only because the tested context doesn't work.
| * feat(lsp): vim.lsp.buf.format() supports textDocument/rangesFormatting #27323Tom Praschan2024-06-24
| | | | | | | | | | | | | | | | | | | | While this relies on a proposed LSP 3.18 feature, it's fully backwards compatible, so IMO there's no harm in adding this already. Looks like some servers already support for this e.g. - gopls: https://go-review.googlesource.com/c/tools/+/510235 - clangd: https://github.com/llvm/llvm-project/pull/80180 Fixes #27293
| * refactor(filetype): change some patterns to extensions (#29472)zeertzjq2024-06-24
| | | | | | Ref #29468
| * perf(treesitter): remove unnecessary foldexpr loopRiley Bruins2024-06-24
| | | | | | | | | | | | Instead of looping over all captured nodes, just take the end range from the last node in the list. This uses the fact that nodes returned by iter_matches are ordered by their range (earlier to later).
| * fix(treesitter): do not modify highlight state for _on_spell_navLuuk van Baal2024-06-24
| | | | | | | | | | | | | | | | Problem: Treesitter highlighter clears the already populated highlight state when performing spell checking while drawing a smoothscrolled topline. Solution: Save and restore the highlight state in the highlighter's _on_spell_nav callback.
| * vim-patch:9.1.0506: filetype: .envrc & .prettierignore not recognizedChristian Clason2024-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: .envrc & .prettierignore not recognized Solution: Detect '.envrc' as shell and '.prettierignore' as gitignore filetype (Tyler Miller) Support ft detection for `.envrc` files used by direnv, and `.prettierignore` files used by prettier. closes: vim/vim#15053 resolves: neovim/neovim#29405 https://github.com/vim/vim/commit/49012cd8c2fb0452847e5d213b07aa8a978f4762 Co-authored-by: Tyler Miller <tmillr@proton.me>
| * fix(treesitter): don't open fold when o/O adds a line below #28709Jaehwang Jung2024-06-20
| | | | | | | | | | | | | | | | | | | | | | Problem: `o`-ing on a folded line opens the fold, because the new line gets the fold level from the above line (level '='), which extends the fold to the new line. `O` has a similar problem when run on the line below a fold. Solution: Use -1 for the added line to get the lower level from the above/below line.
| * vim-patch:9.1.0505: filetype: Faust files are not recognized (#29426)zeertzjq2024-06-20
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: Faust files are not recognized Solution: Detect '*.lib' files as Faust filetype, add detection for '*.dsp' files (Faust or Make), remove '*.lib' from Cobol filetype (PowerUser64) closes: vim/vim#14894 https://github.com/vim/vim/commit/aa61b8a9087e9cd999ef07e0d87b60f43d68f2c6 Co-authored-by: PowerUser64 <blake@blakenorth.net>
| * fix(diagnostics): don't apply extmarks to invalid lines #29321Riley Bruins2024-06-19
| | | | | | | | | | | | | | | | | | | | | | Problem: If there are errors in the last line of a buffer, something like `Gdk` or `G2k3J` will produce an error (at least with `lua_ls`): Error executing vim.schedule lua callback: .../neovim/share/nvim/runtime/lua/vim/diagnostic.lua:1446: Invalid 'line': out of range Solution: Only set extmarks if the target buffer line still exists
| * vim-patch:9718ed7: runtime(filetype): update htmldjango detectionChristian Clason2024-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - update tags to detect djangohtml based on https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#built-in-tag-reference - increase the lines to inspect to 40 lines 10 lines is too few and might result in high false negative. Increasing it to 40 lines should reduce the false negative. closes: vim/vim#15037 https://github.com/vim/vim/commit/9718ed7ab989c0a0be88a0d749f24321eb0e6af1 Co-authored-by: Afiq Nazrie <afnazrie@gmail.com>
| * docs(news): fix inconsistencies (#29381)zeertzjq2024-06-18
| |
| * Merge pull request #29357 from luukvbaal/statuscolzeertzjq2024-06-17
| |\ | | | | | | feat(column)!: rework 'statuscolumn' %r/l items
| | * feat(column)!: rework 'statuscolumn' %r/l itemsLuuk van Baal2024-06-16
| | | | | | | | | | | | | | | | | | | | | Problem: A custom 'statuscolumn' needs to check a bunch of options and placed signs to replicate the default number column. Solution: Rework %l item to include the necessary logic to mimic the default number column. Remove now redundant %r item.
| * | vim-patch:9.1.0492: filetype: Vim-script files not detected by shebang lineChristian Clason2024-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim-script files may not be recognised Solution: Add shebang line detection (Doug Kearns) closes: vim/vim#15012 https://github.com/vim/vim/commit/0d4d23dac0a5a77ccb0ebf1dcf646afe0c6886bf Co-authored-by: Doug Kearns <dougkearns@gmail.com>
| * | docs: document 'list' behavior when 'listchars' excludes "tab" (#29360)zeertzjq2024-06-16
| |/
| * vim-patch:9.1.0486: filetype: Snakemake files are not recognizedChristian Clason2024-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: Snakemake files are not recognized Solution: Detect '*.smk' and Snakefile files as snakemake filetype (Riley Bruins) See: https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#distribution-and-reproducibility closes: vim/vim#14992 https://github.com/vim/vim/commit/82a579e15ad78f4b99d2957300da3076ccc7d378 Co-authored-by: Riley Bruins <ribru17@hotmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * fix(defaults): default @/Q broken when 'ignorecase' is set (#29343)Jerry2024-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When 'ignorecase' is set, the default keymap Q and Q would exit visual mode. This issue was raised in #28287 and a fix was applied in #28289. However, `==` operator is subject to user `ignorecase` setting. Solution: Switching to `==#` operator would guarantee case sensitive comparison between visual mode and linewise visual mode. Co-authored-by: Kuanju Chen <kuanju.chen@mksinst.com>
| * docs: misc (#29229)dundargoc2024-06-15
| | | | | | | | | | | | 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>
| * vim-patch:c509c00: runtime(doc): fix wrong helptag for :deferzeertzjq2024-06-15
| | | | | | | | | | | | https://github.com/vim/vim/commit/c509c009bbc07eff678a9239a5813398e180f019 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * vim-patch:d6d4e13: runtime(doc): rewrite mkdir() doc and simplify {flags} ↵zeertzjq2024-06-15
| | | | | | | | | | | | | | | | | | | | meaning related: vim/vim#14991 https://github.com/vim/vim/commit/d6d4e1333659c0d2acee3133819498d014df47de Co-authored-by: Christian Brabandt <cb@256bit.org>
| * fix(lsp): tune completion word extraction for decorated labels (#29331)Mathias Fußenegger2024-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * refactor(lsp): use metatable for buf_versions (#29304)Ilia Choly2024-06-14
| | | | | | | | | | | | 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>
| * fix(lsp): check for nil response from server (#29196)Tama McGlinn2024-06-14
| | | | | | | | | | | | | | | | 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
| * fix(terminal): set local values of window options (#29326)zeertzjq2024-06-14
| |
| * vim-patch:d353d27: runtime(doc): restore description of "$" in col() and ↵zeertzjq2024-06-14
| | | | | | | | | | | | | | | | virtcol() (vim/vim#14981) These are different from line() and getpos(). https://github.com/vim/vim/commit/d353d2782032b91498601afefee4256592f48074
| * vim-patch:02f3eba: runtime(doc): deduplicate getpos(), line(), col(), virtcol()zeertzjq2024-06-14
| | | | | | | | | | | | | | | | | | 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
| * Merge pull request #29103 from gpanders/test-no-tgcGregory Anders2024-06-12
| |\ | | | | | | test: do not set termguicolors in test runner
| | * fix(vim.text): remove assert from vim.text.hexdecodeGregory Anders2024-05-31
| | | | | | | | | | | | Instead, return nil plus an error message if the input is invalid.
| * | Merge pull request #29303 from lewis6991/fix/wobufLewis Russell2024-06-12
| |\ \ | | | | | | | | fix(vim.wo): never allow non-zero bufnr
| | * | fix(vim.wo): never allow non-zero bufnrLewis Russell2024-06-12
| | | |
| * | | refactor(terminal): move :terminal defaults to _defaults.luaGregory Anders2024-06-12
| |/ /
| * | vim-patch:210b39c: runtime(doc): clarify documentation for "v" position at ↵zeertzjq2024-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | fix(types): add some vim.fn type annotationsnotomo2024-06-11
| | | | | | | | | | | | | | | | | | Problem: Some vim.fn have no type annotations. Solution: Add type annotations.
| * | fix(types): use vararg return type annotationWill Hopkins2024-06-11
| | | | | | | | | | | | build(types): allow vararg returns in function types
| * | refactor(lua): improve type annotationsLewis Russell2024-06-11
| | |
| * | fix(lsp): do not reset buf version when detaching client (#29242)Ilia Choly2024-06-10
| | |
| * | Merge #29238 from clason/feat/help-tocJustin M. Keyes2024-06-10
| |\ \
| | * | feat(help): use treesitter for table of contentsChristian Clason2024-06-09
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Creating the table of contents for `gO` is complicated. Solution: Use treesitter instead.
| * | | fix(glob): handle overlapping `{}` condition elements #29236Jon Huhn2024-06-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | feat(lsp): include end_col, end_lnum in vim.lsp.buf.locations_to_items #29164Tom Praschan2024-06-09
| | | |