aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
| * 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>
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-11-25
|\|
| * 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
| * fix(api): only flush nvim__redraw when necessary #31250luukvbaal2024-11-18
| | | | | | | | | | | | | | | | Problem: Not possible to only set a "redraw later" type with nvim__redraw, which seems to be desired for the treesitter highlighter. Solution: Do not update the screen when "flush" is explicitly set to false and only redraw later types are present. In that case, do not call ui_flush() either.
| * feat(defaults): dot-repeat [<Space> #31186Peter Aronoff2024-11-17
| | | | | | | | | | | | Problem: `[<Space>` and `]<Space>` do not support repetition. Solution: use `operatorfunc` and `g@l` to make these mappings dot repeatable.
| * feat(lsp): highlight hover target/range #31110Riley Bruins2024-11-17
| | | | | | | | | | | | | | | | | | | | **Problem:** Despite the LSP providing the option for language servers to specify a range with a hover response (for highlighting), Neovim does not give the option to highlight this range. **Solution:** Add an option to `buf.hover()` which causes this range to be highlighted. Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
| * fix(api): update "range" windows in nvim__redraw #31042luukvbaal2024-11-17
| | | | | | | | | | | | | | Problem: nvim__redraw's "range" marks a buffer range for redraw, and subsequently flushes the UI without updating the windows containing that buffer. Solution: Implicitly update the screen, unless specified otherwise. Only update the screen with the last call of the treesitter on_changedtree() callback.
| * fix(messages): proper multiline Lua print() messages #31205luukvbaal2024-11-17
| | | | | | | | | | | | Problem: Separate message emitted for each newline present in Lua print() arguments. Solution: Make msg_multiline() handle NUL bytes. Refactor print() to use msg_multiline(). Refactor vim.print() to use print().
| * fix(lsp): type-errors, other nits in vim.lsp.log #31235Maria José Solano2024-11-16
| |
| * fix(treesitter): remove redundant on_bytes callback #31041luukvbaal2024-11-16
| | | | | | | | | | | | | | Problem: Treesitter highlighter implements an on_bytes callback that just re-marks a buffer range for redraw. The edit that prompted the callback will already have done that. Solution: Remove redundant on_bytes callback from the treesitter highlighter module.
| * fix(api): validation, documentation of hl_group #31195luukvbaal2024-11-16
| | | | | | | | | | | | | | | | Problem: Documentation for "hl_group" in nvim_buf_set_extmark() is unclear. "hl_group" in nvim_echo() does not accept highlight group id. Solution: Move documentation for highlight group name/id to first mention of hl_group. Update nvim_echo() to accept highlight group id.
| * feat(ui): don't show unfocusable windows in :tabs, 'tabline' #27984luukvbaal2024-11-16
| | | | | | | | | | | | | | Problem: Floating windows with focusable set to false can reasonably be expected to be UI elements but are listed in some outputs that should contain only regular windows. Solution: Hide unfocusable floating windows from the default tabline and :tabs.
| * docs: standardize doc for ChanInfo/ChanOpen autocmds/v:event (#31099)errael2024-11-16
| |
| * vim-patch:9.1.0866: filetype: LLVM IR files are not recognized (#31228)zeertzjq2024-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: LLVM IR files are not recognized Solution: detect '*.ll' files either as lifelines or llvm filetype (Wu, Zhenyu) closes: vim/vim#15824 https://github.com/vim/vim/commit/bc32bbddcfc2671158a4780838766ed2d1e14fa6 N/A patch: vim-patch:7e4b861: runtime(filetype): remove duplicated *.org file pattern Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
| * fix(ui): no fast context for prompt message kinds #31224luukvbaal2024-11-15
| | | | | | | | | | | | | | Problem: No longer able to show prompt messages with vim.ui_attach(). Solution: Do not execute callback in fast context for prompt message kinds. These events must be safe to show the incoming message so the event itself serves to indicate that the message should be shown immediately.
| * feat(default): bind `vim.lsp.buf.signature_help` in select mode (#31223)Yi Ming2024-11-15
| |
| * fix(treesitter): keep treeview open if source window is still open #31198Hyker2024-11-14
| | | | | | | | | | | | | | | | | | | | | | | | Problem: When there is a tree view opened by :InspectTree and the source buffer is open in multiple windows, closing one of the source windows will lead to the tree view being closed as well. Regression by #31181. Solution: Check how many source windows are open when trying to quit one. If there are more than one, keep the tree view(s) open. If the only source window is closed, also close the tree view(s). fix #31196
| * vim-patch:9.1.0864: message history is fixed to 200 (#31215)zeertzjq2024-11-15
| | | | | | | | | | | | | | | | | | | | | | | | Problem: message history is fixed to 200 Solution: Add the 'msghistory' option, increase the default value to 500 (Shougo Matsushita) closes: vim/vim#16048 https://github.com/vim/vim/commit/4bd9b2b2467e696061104a029000e9824c6c609e Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Co-authored-by: Milly <milly.ca@gmail.com>
| * Merge pull request #27874 from luukvbaal/funcerrbfredl2024-11-14
| |\ | | | | | | fix(messages)!: vim.ui_attach message callbacks are unsafe
| | * fix(messages)!: vim.ui_attach message callbacks are unsafeLuuk van Baal2024-11-14
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Lua callbacks for "msg_show" events with vim.ui_attach() are executed when it is not safe. Solution: Disallow non-fast API calls for "msg_show" event callbacks. Automatically detach callback after excessive errors. Make sure fast APIs do not modify Nvim state.
| * | feat(lsp): support utf-8 and utf-32 position encodingsLewis Russell2024-11-14
| |/ | | | | | | Resolves #30034
| * fix(lsp): filter completion candidates based on completeopt (#30945)Kristijan Husak2024-11-13
| |
| * fix(treesitter): add 'QuitPre' event to autocommands in inspect_treehykerr2024-11-12
| | | | | | | | | | | | | | | | | | Problem: Quitting source buffer for ```:InspectTree``` command raises ```E855``` when source buffer and tree views are the only open buffers. Solution: Add ```QuitPre``` event to autocmd handling closing/hiding the source buffer to close all open tree views. This allows nvim to quit when source and tree buffers are the only open windows.
| * refactor(lsp): avoid redundant function wrappingNicolas Hillegeer2024-11-12
| | | | | | | | Leftover from #21026.
| * vim-patch:9.1.0853: filetype: kubernetes config file not recognizedChristian Clason2024-11-12
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: kubernetes config file not recognized Solution: detect '/.kube/config' file as yaml filetype (Jonathan Lopez) closes: vim/vim#11076 https://github.com/vim/vim/commit/6fbf63de865001dedafc227465e651926cf6f6dc Co-authored-by: Jonathan Lopez <jonathanglopez@gmail.com>
| * perf(lsp): use faster version of str_byteindexLewis Russell2024-11-11
| |
| * perf(filetype): optimize internal data structuresLewis Russell2024-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the type for the sorted pattern table from `vim.filetype.mapping[]` to `vim.filetype.mapping.sorted[]` E.g. instead of: ```lua { { ['/debian/changelog$'] = {'debchangelog', { parent = '/debian/' } }, { ['%.git/'] = { detect.git , { parent = 'git/', priority = -1 } }, } ``` It is now: ```lua { { '/debian/, '/debian/changelog$', 'debchangelog' }, { 'git/' , '%.git/' , detect.git , -1 }, } ``` Overall this should roughly cut the amount of tables used by 3, and replaces lots of hash indexes with array indexes.
| * refactor(lsp): simplify reference range logicRiley Bruins2024-11-10
| |
| * fix(lsp): fix infinite loopLewis Russell2024-11-09
| | | | | | | | Fixes #31129
| * docs: misc (#30914)dundargoc2024-11-09
| | | | | | | | | | | | | | Co-authored-by: Ernie Rael <errael@raelity.com> Co-authored-by: Famiu Haque <famiuhaque@proton.me> Co-authored-by: Jade <spacey-sooty@proton.me> Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * fix(vim.system): resolve executable paths on windowsLewis Russell2024-11-08
| | | | | | | | Fixes #31107
| * perf(lsp): do not apply semantic tokens to folded linesLewis Russell2024-11-08
| | | | | | | | Fixes #31106