aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* 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.
* build(deps): bump tree-sitter-c to v0.20.4 (#24495)Christian Clason2023-07-27
|
* 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).
* 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
* 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.
* fix(startup): make recovery mode work without --headless (#24477)zeertzjq2023-07-25
|
* 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(highlight): make CurSearch work properly with 'winhl' (#24448)zeertzjq2023-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(api/options): validate buf and winLewis Russell2023-07-22
| | | Fixes #24398
* fix(terminal): send Shift-Home Shift-End Ctrl-Home Ctrl-End (#24418)zeertzjq2023-07-22
|
* test(vim.ui.open): mock failure on WindowsJustin M. Keyes2023-07-21
| | | | | | | | | Problem: On Windows, `rundll32` exits zero (success) even when given a non-existent file. Solution: Mock vim.system() on Windows to force a "failure" case.
* docs: also change "vimL" and "viml" to "Vimscript" (#24414)zeertzjq2023-07-21
|
* fix(folds): update folds in Insert mode with fdm=indent (#24402)Brandon Simmons2023-07-21
| | | | | | | | | | | Previously, when using foldmethod=indent, inserting an unindented line would inadvertently open closed folds below it. As a performance improvement, folds were only updated once, across all lines, after Insert mode was exited. Now, the performance improvement is no longer being used when foldmethod=indent, so folds are updated multiple times during Insert mode, but only across the lines that are changing, which preserves the folds (and their open/close states) instead of recreating them.
* feat(lsp): implement textDocument/diagnostic (#24128)Chris AtLee2023-07-20
|
* feat(decoration_provider): log errors as error messagesThomas Vigouroux2023-07-19
|
* test(startup_spec): add a test for #18315 (#24391)zeertzjq2023-07-19
|
* fix(fs.lua): normalize slash truncation (#23753)Mike2023-07-18
| | | Preserve last slash in windows' root drive directories
* feat(lsp)!: rename vim.lsp.get_active_clients to get_clients (#24113)Mathias Fußenegger2023-07-17
|
* fix(terminal): don't send unknown special keys to terminal (#24378)zeertzjq2023-07-17
| | | | Special keys are negative integers, so sending them to terminal leads to strange behavior.
* feat(options)!: remove compatible behaviours for vim 5.0 and earlierLewis Russell2023-07-17
|
* test(fs): vim.loop was renamed to vim.uv (#24376)kylo2522023-07-17
| | | test(fs): vim.loop has been replaced with vim.uv
* fix(inccommand): block errors when parsing command line again (#24374)zeertzjq2023-07-17
| | | Revert the change to ex_getln.c from a741c7fd0465c949a0016fcbee5f4526b65f8c02
* test(fs): get tmpdir robustly #23021kylo2522023-07-16
| | | | | | | | Problem: helpers.tmpname() may create a local file, depending on circumstances. Solution: Only use helpers.tmpname() for its parent directory (the "temp root"). Use fs_mkdtemp() to actually get a unique name.
* fix(lsp): markdown code fence should allow space before info string #24364Mike2023-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Bash language server returns "hover" markdown content that starts with a code fence and info string of `man` preceded by whitespace, which Nvim does not render properly. See https://github.com/bash-lsp/bash-language-server/blob/0ee73c53cebdc18311d4a4ad9367185ea4d98a03/server/src/server.ts#L821C15-L821C15 ```typescript function getMarkdownContent(documentation: string, language?: string): LSP.MarkupContent { return { value: language ? // eslint-disable-next-line prefer-template ['``` ' + language, documentation, '```'].join('\n') : documentation, kind: LSP.MarkupKind.Markdown, } } ``` For example, ``` ``` man NAME git - the stupid content tracker ``` ``` If I remove the white space, then it is properly formatted. ``` ```man instead of ``` man ``` Per CommonMark Spec https://spec.commonmark.org/0.30/#info-string whitespace is allowed before and after the `info string` which identifies the language in a codeblock. > The line with the opening code fence may optionally contain some text > following the code fence; this is trimmed of leading and trailing > spaces or tabs and called the [info > string](https://spec.commonmark.org/0.30/#info-string). If the [info > string](https://spec.commonmark.org/0.30/#info-string) comes after > a backtick fence, it may not contain any backtick characters. (The > reason for this restriction is that otherwise some inline code would > be incorrectly interpreted as the beginning of a fenced code block.) Solution: Adjust stylize_markdown() to allow whitespace before codeblock info.
* feat(api)!: change return type of nvim_win_text_height to Dict (#24365)zeertzjq2023-07-16
|
* feat(tui): support Super and Meta modifiers (#24357)zeertzjq2023-07-15
|
* feat(lsp): map K to hover by default #24331Mathias Fußenegger2023-07-14
| | | Related: https://github.com/neovim/neovim/issues/24252
* fix(runtime): respect 'fileignorecase' when sourcing (#24344)zeertzjq2023-07-14
|
* fix(runtime): respect 'rtp' order for all runtime files (#24335)zeertzjq2023-07-14
|
* perf(rtp): reduce rtp scans (#24191)Lewis Russell2023-07-13
| | | | | | | | | | | * perf(rtp): reduce rtp scans Problem: Scanning the filesystem is expensive and particularly affects startuptime. Solution: Reduce the amount of redundant directory scans by relying less on glob patterns and handle vim and lua sourcing lower down.
* fix(ui): cursor pos with left gravity inline virt_text at eol (#24329)zeertzjq2023-07-13
| | | | | | Problem: Cursor is not after inline virtual text with left gravity when inserting after the end of the line. Solution: Add width of inline virtual text with left gravity to cursor virtcol in Insert mode even if on a NUL.
* test(extmarks): add test for virt_text_win_col with cpo+=n (#24328)zeertzjq2023-07-13
|
* fix(mouse): copy the line before syntax matching (#24320)zeertzjq2023-07-12
|
* fix(drawline): fix missing Visual hl on double-width fold char (#24308)zeertzjq2023-07-11
|
* feat(api): add nvim_win_text_height (#24236)zeertzjq2023-07-11
| | | | It uses the same code as "scroll_delta" of "win_viewport" UI event to calculate text height, but is more flexible.
* vim-patch:9.0.1673: cannot produce a status 418 or 503 message (#24287)Gregory Anders2023-07-10
| | | | | | | | Problem: Cannot produce a status 418 or 503 message. Solution: Add err_teapot(). https://github.com/vim/vim/commit/80adaa8ae8398403ca4e9797219ea9a501fc76a5 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(completion): don't add backslashes to runtime pattern (#24296)zeertzjq2023-07-08
| | | | | Problem: Bashslashes added as regexp in runtime completion may be treated as path separator with some 'isfname' value. Solution: Make curly braces work for runtime completion and use it.
* test(tui): add test for overriding argv[0] (#24293)zeertzjq2023-07-08
|