aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
| * | | | | Merge #24504 feat(lsp): protocol.MethodsJustin M. Keyes2023-08-01
| |\ \ \ \ \
| | * | | | | feat(gen_lsp.lua): sort by name, handle failure #24504Justin M. Keyes2023-08-01
| | | | | | |
| | * | | | | feat(gen_lsp.lua): protocol.Methods #24504mathew2023-08-01
| | | | | | |
| * | | | | | feat(lua-types): types for vim.api.* (#24523)Lewis Russell2023-08-01
| |/ / / / /
| * | | | | fix(lsp): inlay hints: "Failed to delete autocmd" when closing buffer #24469Chris AtLee2023-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: "Failed to delete autocmd" error when deleting LspNotify autocmd. #24456 Solution: Change a few things in the inlay_hint and diagnostic LSP code: 1. Re-introduce the `enabled` flag for the buffer state tables. Previously I was relying on the presence of an autocmd id in the state table to track whether inlay_hint / diagnostic was enabled for a buffer. There are two reasons why this doesn't work well: - Each time inlay_hint / diagnostic is enabled, we call `nvim_buf_attach` on the buffer, resulting in multiple `on_reload` or `on_detach` callbacks being registered. - Commands like `bwipeout` delete buffer local autocmds, sometimes before our `on_detach` callbacks have a chance to delete them first. This causes the - Use module local enabled state for diagnostic as well. bwipeout can race with on_detach callbacks for deleting autocmds. Error referenced in #24456. 2. Change the `LspDetach` autocmd to run each time (i.e., remove the `once` flag). Since we're only registering autocmds once per buffer now, we need to make sure that we set the enabled flag properly each time the LSP client detaches from the buffer. - Remove `once` from the LspDetach autocmds for inlay_hint and diagnostic. We only set up the autocmd once now. Gets removed when buffer is deleted. 3. Have the `LspNotify` handler also refresh the inlay_hint / diagnostics when receiving the `textDocument/didOpen` event. Before this point, the LSP backend doesn't have the contents of the buffer, so can't provide inlay hints or diagnostics. Downsides of this approach: * When inlay_hint / diagnostics are disabled on a buffer, it will continue to receive `LspNotify` events for that buffer. The callback exits early since the `enabled` flag is false. Alternatives: * Can we wrap the call to `nvim_del_autocmd` in `pcall` to swallow any errors resulting from trying to delete the autocmd? Fixes #24456 Helped-by: Maria José Solano <majosolano99@gmail.com>
| * | | | | docs(builtin): right align tags (#24522)Lewis Russell2023-08-01
| | | | | |
| * | | | | fix(defaults): don't use nvim_feedkeys in default mappings (#24520)zeertzjq2023-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Using nvim_feedkeys in default mappings makes it hard to use them as a part of another mapping. Solution: Use an expression mapping and stop Visual mode later. Fix #24518.
| * | | | | 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
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |