aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* docs(builtin): fix and annotate language blocks (#24506)Lewis Russell2023-08-01
|
* build: fix --luamod-dev not working properly (#24519)zeertzjq2023-08-01
| | | Fixes a regression from #23112.
* feat(lsp): add actionable advice to lsp client quit error msg (#24510)Mathias Fußenegger2023-07-29
| | | Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* docs(lua): vim.str_utf_{start,end,pos} #24424altermo2023-07-29
| | | Closes #24422
* feat(docs): generate builtin.txt (#24493)Lewis Russell2023-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - eval.lua is now the source of truth. - Formatting is much more consistent. - Fixed Lua type generation for polymorphic functions (get(), etc). - Removed "Overview" section from builtin.txt - Can generate this if we really want it. - Moved functions from sign.txt and testing.txt into builtin.txt. - Removed the *timer* *timers* tags since libuv timers via vim.uv should be preferred. - Removed the temp-file-name tag from tempname() - Moved lueval() from lua.txt to builtin.txt. * Fix indent * fixup! * fixup! fixup! * fixup! better tag formatting * fixup: revert changes no longer needed * fixup! CI --------- Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(inccommand): don't save information of a buffer twice (#24501)zeertzjq2023-07-28
| | | | | Problem: 'inccommand' doesn't restore 'undolevels' properly for a buffer shown in multiple windows. Solution: Don't save information of a buffer twice.
* fix(editorconfig): highlight properties with dashes (#24407)ObserverOfTime2023-07-27
| | | also add metadata comment and update Lua code in syntax file
* build(deps): bump tree-sitter-c to v0.20.4 (#24495)Christian Clason2023-07-27
|
* Merge pull request #24457 from seandewar/relax-cmdwinSean Dewar2023-07-26
|\ | | | | feat(api): relax cmdwin restrictions for a few functions
| * fix(window): prevent win_size_restore from changing cmdheightSean Dewar2023-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it only skips if `Rows` changed, but it's possible for the height of the usable area for windows to change (e.g: via `&ch`, `&stal` or `&ls`), which can cause the value of `&cmdheight` to change when the sizes are restored. This is a Vim bug, so I've submitted a PR there too. No telling when it'll be merged though, given the current lack of activity there. `ROWS_AVAIL` is convenient here, but also subtracts the `global_stl_height()`. Not ideal, as we also care about the height of the last statusline for other values of `&ls`. Meh. Introduce `last_stl_height` for getting the height of the last statusline and use it in `win_size_save/restore` and `last_status` (means `last_status_rec`'s `statusline` argument will now be true if `&ls` is 3, but that does not change the behaviour). Also corrects the logic in `comp_col` to not assume there's a last statusline if `&ls` is 1 and the last window is floating.
| * feat(api): allow win_hide to close cmdwin or non-previous windowsSean Dewar2023-07-26
| | | | | | | | | | | | | | This aligns its behaviour better with `nvim_win_close`. Note that `:hide` is actually incapable of closing the cmdwin, unlike `:close` and `:quit`, so this is a bit of a difference in behaviour.
| * feat(api): allow win_close in cmdwin to close wins except previousSean Dewar2023-07-26
| | | | | | | | | | | | | | | | | | | | | | Disallow closing the previous window from `nvim_win_close`, as this will cause issues. Again, no telling how safe this is. It also requires exposing old_curwin. :/ Also note that it's possible for the `&cmdheight` to change if, for example, there are 2 tabpages and `nvim_win_close` is used to close the last window in the other tabpage while `&stal` is 1. This is addressed in a later commit.
| * feat(api): allow open_win/win_set_buf in the cmdwin in some casesSean Dewar2023-07-26
|/ | | | | | | | | | | | | | | | | | | | | | Problem: As discussed on Matrix, there was some interest in having `nvim_open_win` again be able to open floats in the cmdwin (e.g: displaying a hover doc related to what's in the cmdwin). After #23228, this was disallowed. Solution: Allow `nvim_open_win` in the cmdwin as long as `!enter` and `buffer != curbuf` (the former can cause all sorts of issues, and the latter can crash Nvim after closing cmdwin). Also allow `nvim_win_set_buf` in a similar fashion. Note that we're not *entirely* sure if this is 100% safe (cmdwin is a global-state-using-main-loop-calling beast), but this seems to work OK..? Also: - Check the buffer argument of `nvim_open_win` earlier, and abort if it's invalid (it used to still open a window in this case). - Untranslate `e_cmdwin` errors in the API (other errors in the API are not translated: although not detailed in the API contract yet, errors are supposed to be stable).
* fix(gen_vimfn_types): don't include tag before signature's line (#24492)zeertzjq2023-07-26
| | | | | | | When signature is a bit long or there are too many tags, the tags appear before the signature's line. Don't include the line with tags in the previous function' docs. Also fix lint warnings.
* feat(lua): typing for vim.fn.* (#24473)Lewis Russell2023-07-26
| | | | | | | Problem: No LSP information for `vim.fn.*` Solution: Add meta file for `vim.fn.*`.
* vim-patch:partial:8.1.1981: the evalfunc.c file is too big (#24490)zeertzjq2023-07-26
| | | | | | | | | | | | | Problem: The evalfunc.c file is too big. Solution: Move undo functions to undo.c. Move cmdline functions to ex_getln.c. Move some container functions to list.c. https://github.com/vim/vim/commit/08c308aeb5e7dfa18fa61f261b0bff79517a4883 Undo functions only. Cmdline functions have already been moved. A lot of container functions have been added to eval/funcs.c instead of list.c in previously ported Vim 8.2.x patches, so deal with that later. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* test(inccommand): add a test for #20248 (#24489)zeertzjq2023-07-26
|
* fix(inccommand): restrict cmdpreview undo calls (#24289)Alexandre Teoi2023-07-26
| | | | | | | | | | | | | | | Problem: The cmdpreview saved undo nodes on cmdpreview_prepare() from ex_getln.c may become invalid (free) if the preview function makes undo operations, causing heap-use-after-free errors. Solution: Save the buffer undo list on cmdpreview_prepare)_ and start a new empty one. On cmdpreview_restore_state(), undo all the entries in the new undo list and restore the original one. With this approach, the preview function will be allowed to undo only its own changes. Fix #20036 Fix #20248
* fix(lsp): fix multi client handling workspace_folder methods (#18839)Mathias Fußenegger2023-07-25
| | | | `buf_notify` sends the notification to all clients of a buffer, calling that inside a loop over clients multiplies the amount of notifications.
* vim-patch:9.0.1335: no test for bad use of spaces in help files (#24483)zeertzjq2023-07-25
| | | | | | | | | | | | Problem: No test for bad use of spaces in help files. Solution: Add checks for use of spaces in help files. Ignore intentional spaces. (Hirohito Higashi, closes vim/vim#11952) https://github.com/vim/vim/commit/d950984489e50b12d87c85f0cce1d672c880aa23 Cherry-pick changes from patch 9.0.1604. Co-authored-by: h-east <h.east.727@gmail.com> Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(lsp): SignatureHelp docstring is not escaped #16702Christoph Hasse2023-07-25
| | | | | | | | | | | | | Problem: Nvim LSP client always treats signature.documentation as markdown, even if the server returns a plain string. Per https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation in a SignatureInformation response, the documentation field can be either "string" or "MarkupContent". Solution: If signature.documentation is a string, treat it as "plaintext". Closes #16563
* test(core/startup_spec): use retry() instead of jobwait() (#24481)zeertzjq2023-07-25
| | | This should work on Windows.
* docs: remove trailing spaces #24455ii142023-07-25
|
* fix(lsp): E403 if doc contains multiple codeblocks #24458Raphael2023-07-25
| | | | | | | | | | | | | | | | | Problem: Content that has codeblocks with different languages, results in multiple calls to: syntax include vim syntax/vim.vim which raises error: E403: syntax sync: line continuations pattern specified twice Before ba8f19ebb67ca27d746f4b1cd902ab3d807eace3, this was avoided by using pcall() to ignore the error. Solution: Restore the use of pcall() to ignore the error. We plan to replace this logic with a treesitter approach, so this is good enough for now. Fix #24431
* fix(startup): make recovery mode work without --headless (#24477)zeertzjq2023-07-25
|
* fix(lsp): replace @private with @nodoc for public client functions (#24415)Mathias Fußenegger2023-07-24
| | | | | | | | | * fix(lsp): replace @private with @nodoc for public client functions To prevent lua-ls warnings in plugins which use the functions. * fix(lsp): remove duplicate type annotations/class definitions These annotations became duplicate with https://github.com/neovim/neovim/pull/23750
* fix(lsp): announce publishDiagnostics.dataSupport (#24442)Bruce Weirdan2023-07-24
| | | | | | | | | | | Neovim already passed `data` element from published diagnostic to code action, but failed to announce it in client capabilities. Here is the test that shows that `data` element is returned by `vim.lsp.diagnostic.get_line_diagnostics()`: https://github.com/neovim/neovim/blob/f56c1848091bb64c63b5bc25ec74bcbd2f52bdde/test/functional/plugin/lsp/diagnostic_spec.lua#L103-L115 and then `get_line_diagnostics()` is used to construct the context for code action request: https://github.com/neovim/neovim/blob/f56c1848091bb64c63b5bc25ec74bcbd2f52bdde/runtime/lua/vim/lsp/buf.lua#L742
* fix(lsp): send empty "added" list when removing workspace folder #24440Mitchell Hanberg2023-07-24
| | | | | | | | | | | | | | | | | | When adding `workspace/didChangeWorkspaceFolders` support to my [language server](https://github.com/elixir-tools/next-ls), I noticed that when neovim removes a workspace, it sends an empty table (which is serialized to an empty JSON array) for the value in the `added` field. This does not follow the spec; the `added` table should just be empty. The following error led me to this discovery. Note the payload includes `"added" => [[]]`: ``` 22:46:48.476 [error] LSP Exited. Last message received: handle_notification %{"jsonrpc" => "2.0", "method" => "workspace/didChangeWorkspaceFolders", "params" => %{"event" => %{"added" => [[]], "removed" => [%{"name" => "/Users/mitchell/src/gen_lsp", "uri" => "file:///Users/mitchell/src/gen_lsp"}]}}} ** (MatchError) no match of right hand side value: {:error, %{"params" => %{"event" => %{"added" => [error: "expected a map"]}}}} (gen_lsp 0.4.0) lib/gen_lsp.ex:265: anonymous fn/4 in GenLSP.loop/3 (gen_lsp 0.4.0) lib/gen_lsp.ex:292: GenLSP.attempt/3 (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3 ```
* fix(lsp): noisy warning about offset_encodings #24441Keith Smiley2023-07-24
| | | | | In the case you hit this warning in a buffer (like with C++ and clangd), this message potentially fires over and over again making it difficult to use the editor at all.
* fix(gx): move to to _init_default_mappings #24420marshmallow2023-07-24
| | | | | | | | Problem: netrw may conflict with the Nvim default "gx" mapping. Solution: Initialize keymapping earlier by moving it to vim._init_default_mappings(). That also avoids needing to check maparg().
* fix(treesitter): stop() should treat 0 as current buffer #24450Micah Halter2023-07-24
|
* docs(vim_diff): fixed inconsistent autocmds behavior #24453ii142023-07-24
|
* fix(mouse): drag vsep of window with 'statuscolumn' (#24462)zeertzjq2023-07-24
| | | | | | Problem: Cannot drag a vertical separator to the right of a window whose 'statuscolumn' is wider than itself. Solution: Never treat a click on a vertical separator as a click on 'statuscolumn'.
* fix(statuscolumn): don't update clicks if current width is 0 (#24459)zeertzjq2023-07-24
|
* fix(terminal): call validate_cursor() before screen update (#24425)fredizzimo2023-07-23
| | | | | | | | | | | | | Problem: When the CurSearch highlight group is set, and a search is active and you are listening to the remote UI "win_viewport" events, then typing is very unresponsive, because "win_viewport" is not sent as soon as the character is typed. On the other hand if you refresh the screen on "flush", the screen will scroll with a delay since "win_viewport" comes too late. I estimate this delay be up to one second, but it varies. Solution: Call validate_cursor() before drawing the screen, just like other modes. No tests have been added because only the intermediate state is wrong.
* fix(highlight): make CurSearch work properly with 'winhl' (#24448)zeertzjq2023-07-23
|
* build(deps): bump tree-sitter to HEAD - 3f44b8968 (#24447)Christian Clason2023-07-23
|
* build(deps): bump tree-sitter-python to v0.20.3 (#24446)Christian Clason2023-07-23
|
* test: reduce flakiness (#24443)zeertzjq2023-07-23
| | | | | | | Avoid consecutive RPC requests involving :startinsert or :stopinsert, because consecutive RPC requests may be processed together, before the :startinsert or :stopinsert takes effect. Also change some feed_command() to command() to make tests faster.
* test: fix VimResume test flakiness (#24438)zeertzjq2023-07-23
|
* test: check that TextChangedT cannot delete terminal buffer (#24437)zeertzjq2023-07-23
|
* test: check real cursor position in Terminal mode (#24436)zeertzjq2023-07-23
|
* fix(events): trigger VimResume on next UI request (#24426)zeertzjq2023-07-23
|
* fix(treesitter): update markdown parser and queries (#24429)Christian Clason2023-07-22
|
* refactor: remove some (const char **) casts (#24423)zeertzjq2023-07-22
|
* refactor(lsp): use LspNotify for inlay_hint (#24411)Chris AtLee2023-07-22
|
* fix(api/options): validate buf and winLewis Russell2023-07-22
| | | Fixes #24398
* docs(lua): add missing word in docs for vim.empty_dict (#24401)Gnik2023-07-22
|
* fix(terminal): send Shift-Home Shift-End Ctrl-Home Ctrl-End (#24418)zeertzjq2023-07-22
|
* Merge #24392 from mrshmllow/gx_winJustin M. Keyes2023-07-21
|\ | | | | fix(ui.open): some URLs fail on Windows