aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* fix(lsp): add foldingrange method support check #31463Tristan Knight2024-12-06
| | | | | | Problem: The folding_range request method assumes that the client supports the method Solution: Add a capability guard to the call
* Merge #30085 #trim! all whitespaceJustin M. Keyes2024-12-06
|\
| * feat(treesitter): #trim! can trim all whitespaceRiley Bruins2024-12-06
| | | | | | | | | | | | | | | | | | | | This commit also implements more generic trimming, acting on all whitespace (charwise) rather than just empty lines. It will unblock https://github.com/nvim-treesitter/nvim-treesitter/pull/3442 and allow for properly concealing markdown bullet markers regardless of indent width, e.g.
* | feat(defaults): disable 'foldcolumn' in terminal buffers (#31480)Micah Halter2024-12-06
|/
* fix(events): don't expand `args.file` for Lua callback (#31473)zeertzjq2024-12-06
| | | | | | | | Problem: In an autocommand Lua callback whether `args.file` is expanded depends on whether `expand('<afile>')` has been called. Solution: Always use the unexpanded file name for `args.file`. Related to #31306 and vim/vim#16106. This doesn't provide `sfname`, but at least makes `args.file` have a consistent value.
* vim-patch:9.1.0906: filetype: Nvidia PTX files are not recognizedChristian Clason2024-12-06
| | | | | | | | | | | | | Problem: filetype: Nvidia PTX files are not recognized Solution: detect '*.ptx' files as ptx filetype (Yinzuo Jiang) Reference: https://docs.nvidia.com/cuda/parallel-thread-execution/ closes: vim/vim#16171 https://github.com/vim/vim/commit/bdb5f85a5189534653f36e92b1bc780ca8d25218 Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
* fix(diagnostic): only store quickfix id when creating a new one #31466Jeremy Fleischman2024-12-05
| | | | | | The old code would always update `_qf_id` with the current quickfix, even if you're currently looking at a completely different, non-diagnostics quickfix list. This completely defeats the intent of <https://github.com/neovim/neovim/pull/30868>, whoops!
* fix(defaults): don't replace keycodes in Visual search mappings (#31460)zeertzjq2024-12-05
| | | Also remove "silent" to be more consistent with Normal mode search.
* vim-patch:9.1.0905: Missing information in CompleteDone event (#31455)glepnir2024-12-05
| | | | | | | | | Problem: Missing information in CompleteDone event Solution: add complete_word and complete_type to v:event dict (glepnir) closes: vim/vim#16153 https://github.com/vim/vim/commit/1c5a120a701fcf558617c4e70b5a447778f0e51d
* misc: keep deprecated vim.loader.disable stub (#31450)Gregory Anders2024-12-04
| | | | Transitional stub to minimize breaking change pain, to be removed after 0.11 release.
* feat(diagnostic): vim.diagnostic.setqflist improvements #30868Jeremy Fleischman2024-12-04
| | | | | | 1. Use the new "u" action to update the quickfix list so we don't lose our position in the quickfix list when updating it. 2. Rather than creating a new quickfix list each time, update the exiting one if we've already created one.
* fix(vim.system): close pipe handles after process handleLewis Russell2024-12-04
| | | | Fixes #30846
* defaults: disable 'number', 'relativenumber', and 'signcolumn' in terminal ↵Gregory Anders2024-12-04
| | | | buffers (#31443)
* feat(lsp): deprecate vim.lsp.start_client #31341Maria José Solano2024-12-04
| | | | | | | | Problem: LSP module has multiple "start" interfaces. Solution: - Enhance vim.lsp.start - Deprecate vim.lsp.start_client
* vim-patch:9.1.0902: filetype: Conda configuration files are not recognized ↵zeertzjq2024-12-04
| | | | | | | | | | | (#31445) Problem: filetype: Conda configuration files are not recognized Solution: detect '.condarc' and 'condarc' files as yaml filetype. (zeertzjq) closes: vim/vim#16162 https://github.com/vim/vim/commit/876de275cb3affa5910664cc52a5177c214313e8
* docs: misc, help tags for neovim.io searches #31428Justin M. Keyes2024-12-03
| | | | | | | | | | Problem: Various keywords are commonly searched-for on https://neovim.io, but don't have help tags. Solution: Add help tags. fix #31327
* docs: provide example for configuring LSP foldexpr (#31411)Gregory Anders2024-12-02
| | | | | Using the "supports_method" function with a client capability inside of an LspAttach autocommand is the preferred method to do this, so we should be showing users how to do it.
* vim-patch:768728b: runtime(doc): Update documentation for "noselect" in ↵dundargoc2024-12-02
| | | | | | | | | | | | | 'completeopt' In particular, make the distinction and interaction between "noinsert" and "noselect" clearer as it was very confusing before. closes: vim/vim#16148 https://github.com/vim/vim/commit/768728b48751c5e937409d12d98bfa1fb4c37266 Co-authored-by: dundargoc <gocdundar@gmail.com>
* docs: example keybind for :Inspect #31391C.D. MacEachern2024-12-01
|
* vim-patch:9.1.0897: filetype: pyrex files are not detectedChristian Clason2024-11-30
| | | | | | | | | | | | | | | | Problem: filetype: pyrex files are not detected Solution: detect '*.pxi' and '*.pyx+' as pyrex filetype (user202729) References: https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#cython-file-types https://www.csse.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/using_with_c++.html closes: vim/vim#16136 https://github.com/vim/vim/commit/aa16b30552f0c6a00dcc761e3954cd5266bf106a Co-authored-by: user202729 <25191436+user202729@users.noreply.github.com>
* feat(lsp): support `textDocument/foldingRange` (#31311)Yi Ming2024-11-29
| | | | | | | | | | | | | | | | | | | * refactor(shared): extract `vim._list_insert` and `vim._list_remove` * feat(lsp): add `vim.lsp.foldexpr()` * docs(lsp): add a todo for state management * feat(lsp): add `vim.lsp.folding_range.foldclose()` * feat(lsp): schedule `foldclose()` if the buffer is not up-to-date * feat(lsp): add `vim.lsp.foldtext()` * feat(lsp): support multiple folding range providers * refactor(lsp): expose all folding related functions under `vim.lsp.*` * perf(lsp): add `lsp.MultiHandler` for do `foldupdate()` only once
* docs(lsp): update example, optional parameters #31299Yi Ming2024-11-28
|
* docs: more accurate typing for LSP references contextRiley Bruins2024-11-28
| | | | | | | **Problem:** The `context` parameter for `references()` is just typed as a table, which is unhelpful. **Solution:** Properly type it as an `lsp.ReferenceContext`!
* vim-patch:9.1.0890: %! item not allowed for 'rulerformat' (#31369)zeertzjq2024-11-28
| | | | | | | | | | | | | Problem: %! item not allowed for 'rulerformat' (yatinlala) Solution: also allow to use %! for rulerformat option (Yegappan Lakshmanan) fixes: vim/vim#16091 closes: vim/vim#16118 https://github.com/vim/vim/commit/ac023e8baae65584537aa3c11494dad6f71770af Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* docs: add tag `vim.fs.exists()` and document suggested replacementdundargoc2024-11-27
|
* fix(lsp): mention function name in warning #31301glepnir2024-11-27
| | | | | | Problem: The warning message is the same in different functions. It is not convenient to locate the specific function name Solution: add function name in warning message
* feat(tui): update 'background' on theme change events (#31350)Gregory Anders2024-11-26
| | | | | | | | | | | | | Enabling private DEC mode 2031 tells the terminal to notify Nvim whenever the OS theme changes (i.e. light mode to dark mode or vice versa) or the terminal emulator's palette changes. When we receive one of these notifications we query the terminal color's background color again to see if it has changed and update the value of 'background' if it has. We only do this though if the user has not explicitly set the value of 'bg' themselves. The help text is updated slightly to hint to users that they probably shouldn't set this value: on modern terminal emulators Nvim is able to completely determine this automatically.
* perf(vim.text): use lookup table implementation for hex encoding (#30080)Gregory Anders2024-11-26
| | | Co-authored-by: glepnir <glephunter@gmail.com>
* fix(lua): remove vim.loader.disable() #31344Justin M. Keyes2024-11-26
| | | | | | | | | | | | | | Problem: `vim.loader.disable` does not conform to `:help dev-name-common` and `:help dev-patterns`. Solution: - Add `enable` parameter to `vim.loader.enable` - Remove `vim.loader.disable` - Note the change in `:help news-breaking-dev` (HEAD changes). - This is not a breaking change (except to "HEAD") because `vim.loader` is marked "experimental". previous: 26765e8461c1ba1e9a351632212cf89900221781
* vim-patch:9.1.0888: leftcol property not available in getwininfo() (#31349)zeertzjq2024-11-26
| | | | | | | | | | Problem: leftcol property not available in getwininfo() Solution: add leftcol property property (glepnir) closes: vim/vim#16119 https://github.com/vim/vim/commit/0a850673e3d4193d55f47bcbbc0b0da5f155307d Co-authored-by: glepnir <glephunter@gmail.com>
* fix(defaults): omit empty line from unimpaired mapping messages (#31347)Marcus Caisey2024-11-25
| | | | | | | | | | | | | | | | | | | | | Problem: The default unimpaired mappings display an empty line after the command's output. This results (with default configuration) in the `Press ENTER or type command to continue` prompt to be displayed, like so: ``` (2 of 16): item2 Press ENTER or type command to continue ``` Solution: The cause is that we're checking the second return value from `pcall(vim.api.nvim_cmd, opts, {})` to determine whether the call was successful. `nvim_cmd` returns an empty string on success, so this value is an empty string in the successful path which we then display. The fix is simple: check the first return value instead which is the "status code" of the call.
* fix(lsp): retrigger diagnostics request on server cancellation (#31345)Gregory Anders2024-11-25
| | | Co-authored-by: Jesse <github@jessebakker.com>
* feat(keysets): teach Union and LuaRefOfLewis Russell2024-11-25
|
* feat(diagnostic): inherit parent 'path' option in open_float (#31273)Mathias Fußenegger2024-11-25
| | | | | Diagnostics sometimes contain stack traces, it's useful being able to use `CTRL-W F` on them to open related files from within the diagnostic window.
* refactor(lsp): rename `offset_encoding` to `position_encoding` #31286Yi Ming2024-11-25
| | | | | | | | Problem: LSP spec uses the term "position encoding" where we say "offset encoding". Solution: - Rename it everywhere except `vim.lsp.Client.offset_encoding` (which would be breaking). - Mention "position encoding" in the documentation for `vim.lsp.Client.offset_encoding`.
* vim-patch:9.1.0886: filetype: debian control file not detectedChristian Clason2024-11-25
| | | | | | | | | | | | Problem: filetype: debian control file not detected Solution: detect 'debian/control' files as debcontrol filetype (author) closes: vim/vim#16067 https://github.com/vim/vim/commit/57b947e3c3b8d52b914158979263855d785445d5 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0883: message history cleanup is missing some tests (#31331)zeertzjq2024-11-24
| | | | | | | | | | | | Problem: message history cleanup is missing some tests Solution: Add tests, refactor common code into did_set_msghistory() (Shougo Matsushita) closes: vim/vim#16078 https://github.com/vim/vim/commit/9f860a14c308f7a9a27a6850d36790615717a710 Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Co-authored-by: Milly <milly.ca@gmail.com>
* fix(lsp): delete bufvar inside WinClosed eventglepnir2024-11-24
| | | | | | | | Problem: floaing preview window can be closed by some ex commands like `only` `fclose` which will not clean the bufvar Solution: use WinClosed event with floating_winnr for clean bufnr, and add test cases for vim.lsp.util.open_floating_preview
* fix(lsp): hover keymap (#31208)andrew snelling2024-11-22
| | | | | * fix: use function call in keymap * fix: test
* fix(lsp): delete b:lsp_floating_preview buf var after win closeglepnir2024-11-22
| | | | | | Problem: After floating preview window closed the buf var still exist Solution: delete after floating window closed.
* refactor(options): impl default 'titlestring' by format flags #30843zshuzh2024-11-20
| | | | | | | Problem: Unnecessary C impl of default 'titlestring'. Solutin: Define it using format flags.
* feat(lsp): require `offset_encoding` param #31249Yi Ming2024-11-20
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Since [version 3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocuments), LSP supports specifying the position encoding (aka offset encoding) supported by the client through `positionEncoding`. Since #31209, Nvim fully supports `utf-8`, `utf-16`, and `utf-32` encodings. Previously, nvim assumed all clients for a buffer had the same `offset_encoding`, so: * Nvim provides `vim.lsp._get_offset_encoding()` to get `offset_encoding`, but this function is incorrect because `offset_encoding` is per-client, not per-buffer. * Based on the strategy of `vim.lsp._get_offset_encoding()`, `vim.lsp.util.make_position_params()`, `vim.lsp.util.make_range_params()`, and `vim.lsp.util.make_given_range_params()` do not require the caller to pass `offset_encoding`, which is invalid. * https://github.com/neovim/neovim/issues/25272 Solution: * Mark `vim.lsp._get_offset_encoding()` as `@deprecated`. * Change the type annotations of `vim.lsp.util.make_position_params()`, `vim.lsp.util.make_range_params()`, `vim.lsp.util.make_given_range_params()` to require the `offset_encoding` param.
* feat(lsp): deprecate non-method client functionsLewis Russell2024-11-20
| | | | | | | | | | | | | | Deprecated: - `client.request()` -> `client:request()` - `client.request_sync()` -> `client:request_sync()` - `client.notify()` -> `client:notify()` - `client.cancel_request()` -> `client:cancel_request()` - `client.stop()` -> `client:stop()` - `client.is_stopped()` `client:is_stopped()` - `client.supports_method()` -> `client:supports_method()` - `client.on_attach()` -> `client:on_attach()` Fixed docgen to link class fields to the full function doc.
* vim-patch:9.1.0880: filetype: C3 files are not recognizedChristian Clason2024-11-20
| | | | | | | | | | | Problem: filetype: C3 files are not recognized Solution: detect '*.c3*' files as c3 filetype (Turiiya) closes: vim/vim#16087 https://github.com/vim/vim/commit/c8dfcfc53ba5ed69b5d4e534fd7e8694de014e6a Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com>
* vim-patch:9.1.0876: filetype: openCL files are not recognizedChristian Clason2024-11-20
| | | | | | | | | | | | Problem: filetype: openCL files are not recognized Solution: detect '*.cl' files as opencl or lisp filetype, include a opencl syntax and filetype plugin (Wu, Zhenyu) closes: vim/vim#15825 https://github.com/vim/vim/commit/e2c27ca8eff7cc8ec852b531d5a7f328a343a761 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0875: filetype: hyprlang detection can be improvedChristian Clason2024-11-20
| | | | | | | | | | | | | Problem: filetype: hyprlang detection can be improved Solution: detect '/hypr/*.conf' files as hyprlang filetype, include basic syntax highlighting (Luca Saccarola) fixes: vim/vim#15875 closes: vim/vim#16064 https://github.com/vim/vim/commit/a13bd294ab2d9ab38634c9ec51fa76205af6eb62 Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
* vim-patch:9.1.0874: filetype: karel files are not detectedChristian Clason2024-11-20
| | | | | | | | | | | | | | Problem: filetype: karel files are not detected Solution: detect '*.kl' files as karel filetype, include syntax and filetype plugin (Kirill Morozov) closes: vim/vim#16075 https://github.com/vim/vim/commit/fdac54d7bbf6d68a8bf741e734b86d0f1998ac86 Co-authored-by: Kirill Morozov <kirill@robotix.pro> Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
* fix(lsp): restore get_language_id behaviourLewis Russell2024-11-19
| | | | | | Ensure filetype is always passed. Fixes #31262
* vim-patch:9.1.0873: filetype: Vivado files are not recognizedChristian Clason2024-11-19
| | | | | | | | | | | | | | | Problem: filetype: Vivado files are not recognized Solution: detect '*.mss' files as 'mss' filetype (Wu, Zhenyu) references: https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS closes: vim/vim#15907 https://github.com/vim/vim/commit/a87462a498a883e12ad7699b26bd28f4600b68c6 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* refactor(lsp): fold in dynamic_registration code into the clientLewis Russell2024-11-18
| | | | | | | | | | | Problem: Capability register logic is spread across 3 files. Solution: - Consolidate (and simplify) logic into the client. - Teach client.supports_method about resolve methods