aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* | fix(diff): filler lines for hunks bigger than linematch limit (#24676)Jaehwang Jung2023-08-12
| | | | | | | | | | | | Apply linematch filler computation only if the hunk is actually linematched. Fixes #24580
* | fix(events): avoid unnecessary CursorMoved (#24675)zeertzjq2023-08-12
| | | | | | | | | | | | Problem: Temporarily changing current window in a script causes CursorMoved to be triggerd. Solution: Don't trigger CursorMoved if neither curwin nor cursor changed between two checks.
* | vim-patch:9.0.1688: cannot store custom data in quickfix list (#24673)zeertzjq2023-08-12
| | | | | | | | | | | | | | | | | | | | Problem: cannot store custom data in quickfix list Solution: add `user_data` field for the quickfix list closes: vim/vim#11818 https://github.com/vim/vim/commit/ca6ac99077d2e6d020a34267aa5e0fbc4d23dc38 Co-authored-by: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
* | vim-patch:9.0.1694: wrong mapping applied when replaying a char search (#24670)zeertzjq2023-08-12
| | | | | | | | | | | | | | | | | | Problem: wrong mapping applied when replaying a char search Solution: Store a NOP after the ESC closes: vim/vim#12708 closes: vim/vim#6350 https://github.com/vim/vim/commit/bacc83009bc38c9ba0247aaa22b76d1993d57993
* | vim-patch:9.0.1693: Ctrl-Q not handled like Ctrl-V in replace mode (#24669)zeertzjq2023-08-12
| | | | | | | | | | | | | | | | | | | | | | Problem: Ctrl-Q not handled like Ctrl-V in replace mode Solution: Handle Ctrl-Q like Ctrl-V closes: vim/vim#12686 closes: vim/vim#12684 https://github.com/vim/vim/commit/2d63e4b3ccc0bb34db21a3c1d024cb114f8c4071 Co-authored-by: Christian Brabandt <cb@256bit.org>
* | vim-patch:9.0.1691: wrong viewport restored for incsearch and smoothscroll ↵zeertzjq2023-08-12
| | | | | | | | | | | | | | | | | | | | (#24667) Problem: wrong viewport restored for incsearch and smoothscroll Solution: Save and restore skipcol as well closes: vim/vim#12713 https://github.com/vim/vim/commit/7b7b4cb6f274e7bace127107b0d2752133c4020b
* | vim-patch:9.0.1687: mapset() not properly handling script ID (#24666)zeertzjq2023-08-12
| | | | | | | | | | | | | | | | | | Problem: mapset() not properly handling script ID Solution: replace_termcodes() may accept a script ID closes: vim/vim#12699 closes: vim/vim#12697 https://github.com/vim/vim/commit/7e0bae024d4c1673cff31763227ad52b936fa56f
* | vim-patch:9.0.1686: undotree() only works for the current buffer (#24665)zeertzjq2023-08-12
| | | | | | | | | | | | | | | | | | | | | | | | Problem: undotree() only works for the current buffer Solution: Add an optional "buffer number" parameter to undotree(). If omitted, use the current buffer for backwards compatibility. closes: vim/vim#4001 closes: vim/vim#12292 https://github.com/vim/vim/commit/5fee11114975b7405b7ccd3ee8758e54bf559760 Co-authored-by: Devin J. Pohly <djpohly@gmail.com>
* | feat(treesitter): add injection language fallback (#24659)Christian Clason2023-08-11
|/ | | | | | | | | | | | * feat(treesitter): add injection language fallback Problem: injection languages are often specified via aliases (e.g., filetype or in upper case), requiring custom directives. Solution: include lookup logic (try as parser name, then filetype, then lowercase) in LanguageTree itself and remove `#inject-language` directive. Co-authored-by: Lewis Russell <me@lewisr.dev>
* vim-patch:9.0.1683: Updated runtime files (#24638)zeertzjq2023-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a collection of various PRs from github that all require a minor patch number: 1) https://github.com/vim/vim/pull/12612 Do not conflate dictionary key with end of block 2) https://github.com/vim/vim/pull/12729: When saving and restoring 'undolevels', the constructs `&undolevels` and `:set undolevels` are problematic. The construct `&undolevels` reads an unpredictable value; it will be the local option value (if one has been set), or the global option value (otherwise), making it unsuitable for saving a value for later restoration. Similarly, if a local option value has been set for 'undolevels', temporarily modifying the option via `:set undolevels` changes the local value as well as the global value, requiring extra work to restore both values. Saving and restoring the option value in one step via the construct `:let &undolevels = &undolevels` appears to make no changes to the 'undolevels' option, but if a local option has been set to a different value than the global option, it has the unintended effect of changing the global 'undolevels' value to the local value. Update the documentation to explain these issues and recommend explicit use of global and local option values when saving and restoring. Update some unit tests to use `g:undolevels`. 3) https://github.com/vim/vim/pull/12702: Problem: Pip requirements files are not recognized. Solution: Add a pattern to match pip requirements files. 4) https://github.com/vim/vim/pull/12688: Add indent file and tests for ABB Rapid 5) https://github.com/vim/vim/pull/12668: Use Lua 5.1 numeric escapes in tests and add to CI Only Lua 5.2+ and LuaJIT understand hexadecimal escapes in strings. Lua 5.1 only supports decimal escapes: > A character in a string can also be specified by its numerical value > using the escape sequence \ddd, where ddd is a sequence of up to three > decimal digits. (Note that if a numerical escape is to be followed by a > digit, it must be expressed using exactly three digits.) Strings in Lua > can contain any 8-bit value, including embedded zeros, which can be > specified as '\0'. To make sure this works with Lua 5.4 and Lua 5.1 change the Vim CI to run with Lua 5.1 as well as Lua 5.4 6) https://github.com/vim/vim/pull/12631: Add hurl filetype detection 7) https://github.com/vim/vim/pull/12573: Problem: Files for haskell persistent library are not recognized Solution: Add pattern persistentmodels for haskell persistent library closes: vim/vim#12612 closes: vim/vim#12729 closes: vim/vim#12702 closes: vim/vim#12688 closes: vim/vim#12668 closes: vim/vim#12631 closes: vim/vim#12573 Already ported but wasn't marked: vim-patch:ad34abee2583 https://github.com/vim/vim/commit/6efb1980336ff324e9c57a4e282530b952fca816 Co-authored-by: Christian Brabandt <cb@256bit.org> Co-authored-by: lacygoill <lacygoill@lacygoill.me> Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com> Co-authored-by: ObserverOfTime <chronobserver@disroot.org> Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de> Co-authored-by: James McCoy <jamessan@jamessan.com> Co-authored-by: Jacob Pfeifer <jacob@pfeifer.dev> Co-authored-by: Borys Lykah <lykahb@fastmail.com>
* vim-patch:2eb413f89b97 (#24627)Christian Clason2023-08-09
| | | | | | | | | | | | * vim-patch:2eb413f89b97 detect filetype for `*.vsh` and `*.vv` files (vim/vim#12692) Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com> https://github.com/vim/vim/commit/2eb413f89b97a498679fbe68c7564b9e41c5af7f Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(iter): make pipeline termination conditions consistent (#24614)Gregory Anders2023-08-09
| | | | | | | | If an iterator pipeline stage returns nil as its first return value, the other return values are ignored and it is treated as if that stage returned only nil (the semantics of returning nil are different between different stages). This is consistent with how for loops work in Lua more generally, where the for loop breaks when the first return value from the function iterator is nil (see :h for-in for details).
* vim-patch:077ade4f6703 (#24629)Christian Clason2023-08-09
| | | | | | | feat: recognize geojson extension as json filetype (vim/vim#12636) https://github.com/vim/vim/commit/077ade4f67036e652b99f8f858c9ca1c1dd22245 Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
* vim-patch:b69b9d5e1753 (#24628)Christian Clason2023-08-09
| | | | | | | | | | | | | | Add filetype detection for eyaml files (vim/vim#12659) https://github.com/voxpupuli/hiera-eyaml/ uses and produces the eyaml format, which is simply yaml with some encrypted values. It's convenient to edit the file without decrypting when not touching encrypted values (or when you don't have access to the decryption key), which is why vim should treat those files as yaml files. https://github.com/vim/vim/commit/b69b9d5e175351c9a25507139954f6211f37fdd9 Co-authored-by: Max Gautier <mg@max.gautier.name>
* vim-patch:44ff25d5243b (#24625)Christian Clason2023-08-09
| | | | | | | | | | | | | * vim-patch:44ff25d5243b PyPA manifest files are not recognized (vim/vim#12707) Problem: PyPA manifest files are not recognized. Solution: Add a pattern to match PyPA manifest files. https://github.com/vim/vim/commit/44ff25d5243b6d4f7ee88b46d1254aec0b27f4eb Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
* vim-patch:7159ac7fec28 (#24624)Christian Clason2023-08-09
| | | | | | | Unison support (vim/vim#12715) https://github.com/vim/vim/commit/7159ac7fec282ad7427795b4bcd5b769268c083d Co-authored-by: Anton Parkhomenko <chuwy@users.noreply.github.com>
* vim-patch:a13eb2b14791 (#24622)Christian Clason2023-08-09
| | | | | | | | | | | | | | | | | | | | | | | | Add WebGPU Shading Language (WGSL) filetype (vim/vim#12723) The current W3C Working Draft for the WebGPU Shading Language (WGSL) specifies 'text/wgsl' media type for WGSL modules with the '.wgsl' file extension: https://www.w3.org/TR/WGSL/#text-wgsl-media-type It has also been registered at the Internet Assigned Numbers Authority (IANA): https://www.iana.org/assignments/media-types/text/wgsl Neovim's nvim-lspconfig already associates wgsl language servers with 'filetype wgsl': https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#wgsl_analyzer However currenly setting 'filetype wgsl' for *.wgsl files by defalut in Neovim is blocked by adding this filetype to the vim project first: https://github.com/neovim/neovim/pull/23331 This commit adds this missing wgsl filetype. https://github.com/vim/vim/commit/a13eb2b147915e7e92a6de6c19ce448c7def4057 Co-authored-by: Gergő Sályi <87373293+gergo-salyi@users.noreply.github.com>
* fix(api): revert unintended change of optional bool paramsbfredl2023-08-09
| | | | | | | | | | Currently (as of nvim 0.9), the behavior of boolean params in vim.api lua wrappers is inconsistent for optional parameters (part of an `opts` dict) compared to positional parameters. This was inadvertently changed in #24524 . While cleaning up this inconsistency is something we might want eventually, it needs to be discussed separately and the impact of existing code considered.
* fix(lua): improve annotations for stricter luals diagnostics (#24609)Christian Clason2023-08-09
| | | | | | | | | | | | | | | Problem: luals returns stricter diagnostics with bundled luarc.json Solution: Improve some function and type annotations: * use recognized uv.* types * disable diagnostic for global `vim` in shared.lua * docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type) * add type alias for lpeg pattern * fix return annotation for `vim.secure.trust` * rename local Range object in vim.version (shadows `Range` in vim.treesitter) * fix some "missing fields" warnings * add missing required fields for test functions in eval.lua * rename lsp meta files for consistency
* vim-patch:9.0.1679: Cleanup Tests from leftover files (#24617)zeertzjq2023-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Tests may leave leftover files around Solution: Clean up tests and remove files There were a few failures in 'linux (huge, gcc, testgui, true, true)' e.g. here: https://github.com/vim/vim/actions/runs/5497376153/jobs/10018060156 ,---- | Error detected while processing command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[585]..function RunTheTest[54]..Test_lvimgrep_crash[16]..TestTimeout[12]..VimLeavePre Autocommands for "*"..function EarlyExit[7]..FinishTesting: | line 70: | E445: Other window contains changes | E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt | E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt | E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txtmalloc(): unsorted double linked list corrupted `---- Which is puzzling, because the Xtest_stable_xxd file should have been long gone after test_crypt.vim is run (and definitely no longer be staying around in test_quickfix.vim). So try to clean up properly after a test script is run, just in case any X<file> is still around. During testing, a found a few leftover files, which I also fixed in the relevant test-file. Unfortunately, the test workflow 'linux (huge, gcc, testgui, true, true)' now seems to fail with 'E1230: Encryption: sodium_mlock()' in test_crypt.vim. Hopefully this is only temporary. https://github.com/vim/vim/commit/84bc00e9b52b1174888f2f696f8b628a83c49988 Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(treesitter): make sure injections don't return empty ranges (#24595)Lewis Russell2023-08-07
| | | | | | | | | | | | | | | | | | | | When an injection has not set include children, make sure not to add the injection if no ranges are determined. This could happen when there is an injection with a child that has the same range as itself. e.g. consider this Makefile snippet ```make foo: $(VAR) ``` Line 2 has an injection for bash and a make variable reference. If include-children isn't set (default), then there is no range on line 2 to inject since the variable reference needs to be excluded. This caused the language tree to return an empty range, which the parser now interprets to mean the full buffer. This caused makefiles to have completely broken highlighting.
* vim-patch:9.0.1678: blade files are not recognized (#24601)ObserverOfTime2023-08-07
| | | | | | | | Problem: Blade files are not recognized. Solution: Add a pattern for Blade files. (closes vim/vim#12650) https://github.com/vim/vim/commit/ad34abee258322826146d597ac5b5fd2111c2b79 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* Merge pull request #24524 from bfredl/typed_keysbfredl2023-08-07
|\ | | | | refactor(api): use typed keysets
| * test(api): update tests to new error messagesbfredl2023-08-07
| |
| * refactor(api): use typed keysetsbfredl2023-08-07
| | | | | | | | | | Initially this is just for geting rid of boilerplate, but eventually the types could get exposed as metadata
* | fix(inccommand): don't set an invalid 'undolevels' value (#24575)zeertzjq2023-08-05
|/ | | | | | | Problem: Cannot break undo by setting 'undolevels' to itself in 'inccommand' preview callback. Solution: Don't set an invalid 'undolevels' value. Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
* fix(lsp): do not assume client capability exists in watchfiles check (#24550)Sean Dewar2023-08-04
| | | | | | | | | | | | | | | | | | | | | PR #23689 assumes `client.config.capabilities.workspace.didChangeWatchedFiles` exists when checking `dynamicRegistration`, but thats's true only if it was passed to `vim.lsp.start{_client}`. This caused #23806 (still an issue in v0.9.1; needs manual backport), but #23681 fixed it by defaulting `config.capabilities` to `make_client_capabilities` if not passed to `vim.lsp.start{_client}`. However, the bug resurfaces on HEAD if you provide a non-nil `capabilities` to `vim.lsp.start{_client}` with missing fields (e.g: not made via `make_client_capabilities`). From what I see, the spec says such missing fields should be interpreted as an absence of the capability (including those indicated by missing sub-fields): https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities Also, suggest `vim.empty_dict()` for an empty dict in `:h vim.lsp.start_client()` (`{[vim.type_idx]=vim.types.dictionary}` no longer works anyway, probably since the cjson switch).
* test(options/defaults_spec): fix NVIM_APPNAME test flakiness (#24553)zeertzjq2023-08-04
| | | Also avoid leaving directories behind.
* fix(terminal): forward horizontal mouse scrolling (#24552)zeertzjq2023-08-04
|
* fix(terminal): include modifiers when forwarding mouse (#24549)zeertzjq2023-08-04
|
* fix(loader): cache path ambiguity #24491Tyler Miller2023-08-01
| | | | | | | | | | | Problem: cache paths are derived by replacing each reserved/filesystem- path-sensitive char with a `%` char in the original path. With this method, two different files at two different paths (each containing `%` chars) can erroneously resolve to the very same cache path in certain edge-cases. Solution: derive cache paths by url-encoding the original (path) instead using `vim.uri_encode()` with `"rfc2396"`. Increment `Loader.VERSION` to denote this change.
* 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
|