aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* vim-patch:9.1.0754: fixed order of items in insert-mode completion menu (#30619)glepnir2024-10-03
| | | | | | | | | | | | | Problem: fixed order of items in insert-mode completion menu Solution: Introduce the 'completeitemalign' option with default value "abbr,kind,menu" (glepnir). Adding an new option `completeitemalign` abbr is `cia` to custom the complete-item order in popupmenu. closes: vim/vim#14006 closes: vim/vim#15760 https://github.com/vim/vim/commit/6a89c94a9eeee53481ced1a1260a177bffde4c0f
* tests: skip watch.watchdirs test on macos 14 CIJustin M. Keyes2024-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Strange failure only in macos 14 CI FAILED test/functional/lua/watch_spec.lua @ 82: vim._watch watchdirs() detects file changes test/functional/lua/watch_spec.lua:149: Expected objects to be the same. Passed in: (table: 0x0116023758) { *[1] = { [change_type] = 3 *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/nvim_KFMvPbXk9a' } [2] = { [change_type] = 3 [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } } Expected: (table: 0x010d9d6548) { *[1] = { [change_type] = 1 *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } [2] = { [change_type] = 3 [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } } stack traceback: test/functional/lua/watch_spec.lua:149: in function <test/functional/lua/watch_spec.lua:82> Solution: Skip test for that exact version.
* fix(watch): ignore nonexistent paths (ENOENT)Justin M. Keyes2024-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The `_watch.watch()` strategy may fail if the given path does not exist: …/vim/_watch.lua:101: ENOENT: no such file or directory stack traceback: [C]: in function 'assert' …/vim/_watch.lua:101: in function <…/vim/_watch.lua:61> [string "<nvim>"]:5: in main chunk - `_watch.watch()` actively asserts any error returned by `handle:start()`. - whereas `_watch.watchdirs()` just ignores the result of `root_handle:start()`. Servers may send "client/registerCapability" with "workspace/didChangeWatchedFiles" item(s) (`baseUri`) which do not actually exist on the filesystem: https://github.com/neovim/neovim/issues/28058#issuecomment-2189929424 { method = "client/registerCapability", params = { registrations = { { method = "workspace/didChangeWatchedFiles", registerOptions = { watchers = { { globPattern = { baseUri = "file:///Users/does/not/exist", pattern = "**/*.{ts,js,mts,mjs,cjs,cts,json,svelte}" } }, ... } Solution: - Remove the assert in `_watch.watch()`. - Show a once-only message for both cases. - More detailed logging is blocked until we have `nvim_log` / `vim.log`. fix #28058
* vim-patch:9.1.0753: Wrong display when typing in diff mode with ↵zeertzjq2024-10-01
| | | | | | | | | | 'smoothscroll' (#30614) Problem: Wrong display when typing in diff mode with 'smoothscroll'. Solution: Use adjust_plines_for_skipcol() (zeertzjq). closes: vim/vim#15776 https://github.com/vim/vim/commit/47f8584a80006cd25e7dc6fa7fb1bfe2e768403c
* fix(tabline): restore behavior of click after last tabpage (#30602)zeertzjq2024-10-01
| | | Also correct the comments about tabpage labels in custom tabline.
* vim-patch:9.1.0749: filetype: http files not recognizedChristian Clason2024-10-01
| | | | | | | | | | | | | | | Problem: filetype: http files not recognized Solution: detect '*.http' as http filetype, include http filetype plugin (Riley Bruins) Based on the specification found [here](https://github.com/JetBrains/http-request-in-editor-spec/blob/master/spec.md) closes: vim/vim#15762 https://github.com/vim/vim/commit/de6c1d1182076b10212342fd2d441267fbe43a22 Co-authored-by: Riley Bruins <ribru17@hotmail.com>
* test: refactor exec_lua in xdiff_specLewis Russell2024-09-30
|
* fix(diff): use mmfile_t in linematchLewis Russell2024-09-30
| | | | | | | | | | | | | | | Problem: Linematch used to use strchr to navigate a string, however strchr does not supoprt embedded NULs. Solution: Use `mmfile_t` instead of `char *` in linematch and introduce `strnchr()`. Also remove heap allocations from `matching_char_iwhite()` Fixes: #30505
* feat(treesitter)!: use return values in `language.add()`Christian Clason2024-09-29
| | | | | | | | | Problem: No clear way to check whether parsers are available for a given language. Solution: Make `language.add()` return `true` if a parser was successfully added and `nil` otherwise. Use explicit `assert` instead of relying on thrown errors.
* fix(float): properly find last window of tabpage (#30571)zeertzjq2024-09-29
|
* docs: misc (#30177)dundargoc2024-09-29
| | | | | Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: Riley Bruins <ribru17@hotmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:9.1.0745: filetype: bun and deno history files not recognizedChristian Clason2024-09-29
| | | | | | | | | | | | Problem: filetype: bun and deno history files not recognized Solution: detect '.bun_repl_history' and 'deno_history.txt' as javascript filetype (Wu, Zhenyu) closes: vim/vim#15761 https://github.com/vim/vim/commit/8a2aea8a623ba183dc0703a47970463b105a9399 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0746: tests: Test_halfpage_longline() fails on large terminals ↵zeertzjq2024-09-29
| | | | | | | | | | | | (#30567) Problem: Test_halfpage_longline() fails on large terminals (lazypingu) Solution: Use a window with known width (zeertzjq). fixes: vim/vim#15755 closes: vim/vim#15756 https://github.com/vim/vim/commit/fa117387eea97306e4c59043b607ccb1533f64ea
* refactor(multibyte): neo-casefolding without allocationbfredl2024-09-29
| | | | fixes #30400
* fix(column): set signcolumn width after splitting window (#30556)zeertzjq2024-09-28
|
* fix(window): making float with title/footer non-float leaks memory (#30551)zeertzjq2024-09-28
|
* fix(treesitter): suppress get_parser warnings via opts.errorRiley Bruins2024-09-28
|
* fix(window): respect hide flag of float windows when switching (#30507)glepnir2024-09-28
|
* feat(defaults): pretty :help headings #30544Justin M. Keyes2024-09-27
| | | | | | | | | | | | | | Problem: Headings in :help do not stand out visually. Solution: Define a non-standard `@markup.heading.1.delimiter` group and special-case it in `highlight_group.c`. FUTURE: This is a cheap workaround until we have #25718 which will enable: - fully driven by `vimdoc/highlights.scm` instead of using highlight tricks (`guibg=bg guifg=bg guisp=fg`) - better support of "cterm" ('notermguicolors')
* fix(api): fix crash/leak with float title/footer on error (#30543)zeertzjq2024-09-27
|
* test(api/window_spec): remove duplicate test (#30538)zeertzjq2024-09-27
|
* vim-patch:9.1.0744: filetype: notmuch configs are not recognised (#30535)zeertzjq2024-09-27
| | | | | | | | | | | | | | Problem: filetype: notmuch configs are not recognised Solution: Detect more notmuch profile configuration files as dosini filetype (Julio B) Reference: https://notmuchmail.org/doc/latest/man1/notmuch-config.html#configuration closes: vim/vim#15744 https://github.com/vim/vim/commit/1a2870b57aa832500d59c17c8225a64c2b4aa619 Co-authored-by: Julio B <julio.bacel@gmail.com>
* vim-patch:9.1.0743: diff mode does not handle overlapping diffs correctly ↵zeertzjq2024-09-27
| | | | | | | | | | | | | | | | (#30532) Problem: diff mode does not handle overlapping diffs correctly Solution: correct the logic to handle overlapping blocks (Yukihiro Nakadaira) Vim merges overlapped diff blocks and it doesn't work expectedly in some situation. closes: vim/vim#15735 https://github.com/vim/vim/commit/06fe70c183a53ea97cd42ace490d4fb9fd14f042 Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
* fix(mbyte): check for utf8proc_map() failure (#30531)zeertzjq2024-09-26
|
* feat(health): highlight headings #30525Justin M. Keyes2024-09-26
| | | | | | | | | | Problem: checkhealth report sections are not visually separated. Solution: Highlight with "reverse". TODO: migrate checkhealth filetype to use treesitter. TODO: default :help should also highlight headings more boldy!
* vim-patch:9.1.0742: getcmdprompt() implementation can be improvedzeertzjq2024-09-26
| | | | | | | | | | | Problem: getcmdprompt() implementation can be improved Solution: Improve and simplify it (h-east) closes: vim/vim#15743 https://github.com/vim/vim/commit/25876a6cdd439054d0b3f920ccca0a435481de15 Co-authored-by: h-east <h.east.727@gmail.com>
* vim-patch:9.1.0741: No way to get prompt for input()/confirm()zeertzjq2024-09-26
| | | | | | | | | | | | Problem: No way to get prompt for input()/confirm() Solution: add getcmdprompt() function (Shougo Matsushita) (Shougo Matsushita) closes: vim/vim#15667 https://github.com/vim/vim/commit/6908428560a0d6ae27bf7af6fcb6dc362e31926c Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* test(api/buffer_updates_spec): prevent flakiness (#30521)zeertzjq2024-09-26
| | | Use poke_eventloop() to wait for Nvim to finish processing input.
* fix(channel): handle writing to file instead of pipe (#30519)zeertzjq2024-09-26
|
* perf(treesitter): use `child_containing_descendant()` in `is_ancestor()`Riley Bruins2024-09-25
| | | | | | | | **Problem:** `is_ancestor()` uses a slow, bottom-up parent lookup which has performance pitfalls detailed in #28512. **Solution:** Take `is_ancestor()` from $O(n^2)$ to $O(n)$ by incorporating the use of the `child_containing_descendant()` function
* refactor(lua): vim.keymap.set tests, docs #30511Justin M. Keyes2024-09-25
|
* fix(paste): only record a paste when it's from RPC (#30491)zeertzjq2024-09-24
| | | | | | | | | Problem: When using nvim_paste in a mapping during a macro recording, both the mapping and the paste are recorded, causing the paste to be performed twice when replaying the macro. Solution: Only record a paste when it is from RPC. Unfortunately this means there is no way for a script to make a recorded paste. A way to enable that can be discussed later if there is need.
* feat(paste): unify cancel and error behavior (#30476)zeertzjq2024-09-24
| | | | | | | | | | | | | | | | | | | | | | | | Before this PR, the behavior of nvim_paste is: - When vim.paste() returns false, return false to the client, but treat following chunks normally (i.e. rely on the client cancelling the paste as expected). - When vim.paste() throws an error, still return true to the client, but drain the following chunks in the stream without calling vim.paste(). There are two problems with such behavior: - When vim.paste() errors, the client is still supposed to send the remaining chunks of the stream, even though they do nothing. - Having different code paths for two uncommon but similar situations complicates maintenance. This PR makes both the cancel case and the error case return false to the client and drain the remaining chunks of the stream, which, apart from sharing the same code path, is beneficial whether the client checks the return value of nvim_paste or not: - If the client checks the return value, it can avoid sending the following chunks needlessly after an error. - If the client doesn't check the return value, chunks following a cancelled chunk won't be pasted on the server regardless, which leads to less confusing behavior.
* Merge #30435 refactor: rename "Dictionary" => "Dict"Justin M. Keyes2024-09-23
|\
| * refactor(api): rename Dictionary => DictJustin M. Keyes2024-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | In the api_info() output: :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val') ... {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1} The `ArrayOf(Integer, 2)` return type didn't break clients when we added it, which is evidence that clients don't use the `return_type` field, thus renaming Dictionary => Dict in api_info() is not a breaking change.
| * refactor(api)!: rename Dictionary => DictJustin M. Keyes2024-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the api_info() output: :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val') ... {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1} The `ArrayOf(Integer, 2)` return type didn't break clients when we added it, which is evidence that clients don't use the `return_type` field, thus renaming Dictionary => Dict in api_info() is not (in practice) a breaking change.
* | fix(vim.fs): dirname() returns "." on mingw/msys2 #30480Justin M. Keyes2024-09-23
|/ | | | | | | | | | Problem: `vim.fs.dirname([[C:\User\XXX\AppData\Local]])` returns "." on mingw/msys2. Solution: - Check for "mingw" when deciding `iswin`. - Use `has("win32")` where possible, it works in "fast" contexts since b02eeb6a7281df0561a021d7ae595c84be9a01be.
* test(tui_spec): prevent another case of race between paste and input (#30481)zeertzjq2024-09-23
| | | | | Problem: When input immediately follows end of bracketed paste, the nvim_input may be processed before the nvim_paste. Solution: Ensure some waiting after the end of a bracketed paste.
* vim-patch:9.1.0740: incorrect internal diff with empty file (#30471)zeertzjq2024-09-23
| | | | | | | | | | | | | | Problem: incorrect internal diff with an empty file Solution: Set pointer to NULL, instead of using an empty line file (Yukihiro Nakadaira) When using internal diff, empty file is read as one empty line file. So result differs from external diff. closes: vim/vim#15719 https://github.com/vim/vim/commit/f1694b439bb175d956b49da620f1253462ec507b Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
* feat(fs.lua): add vim.fs.rm()Lewis Russell2024-09-22
| | | | Analogous to the shell `rm` command.
* docs(api): nvim_get_runtime_file preserves 'runtimepath' order #30454Evgeni Chasnovski2024-09-22
|
* fix(paste): improve repeating of pasted text (#30438)zeertzjq2024-09-22
| | | | | | | - Fixes 'autoindent' being applied during redo. - Makes redoing a large paste significantly faster. - Stores pasted text in the register being recorded. Fix #28561
* test(terminal): unskip wrap tests on windowsChristian Clason2024-09-21
| | | | These should have been unskipped again when reflow was reenabled.
* test: support upvalues in exec_luaLewis Russell2024-09-21
|
* vim-patch:9.1.0738: filetype: rapid files are not recognizedzeertzjq2024-09-21
| | | | | | | | | | | | Problem: filetype: rapid files are not recognized Solution: detect '*.sysx' and '*.modx' as rapid filetype (KnoP-01) closes: vim/vim#15669 https://github.com/vim/vim/commit/fdcb08264d6e8525a07b29c14863adc6ead83913 Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
* vim-patch:35699f1: runtime(vim): Update base-syntax, improve folding ↵zeertzjq2024-09-20
| | | | | | | | | | | | | | | function matches (#30427) - Allow function command modifiers. - Match function bodies starting with empty lines. Command modifiers reported by @Konfekt. fixes vim/vim#15671 closes: vim/vim#15674 https://github.com/vim/vim/commit/35699f17497dcdcfdd747fedaef28f208ac6eb5f Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* refactor!: rename 'jumpoptions' flag "unload" to "clean" (#30418)zeertzjq2024-09-19
| | | Follow-up to #29347
* feat(tui): builtin UI (TUI) sets client info #30397Justin M. Keyes2024-09-18
| | | | | | | | | | | | Problem: The default builtin UI client does not declare its client info. This reduces discoverability and makes it difficult for plugins to identify the UI. Solution: - Call nvim_set_client_info after attaching, as recommended by `:help dev-ui`. - Also set the "pid" field. - Also change `ui_active()` to return a count. Not directly relevant to this commit, but will be useful later.
* vim-patch:9.1.0735: filetype: salt files are not recognizedGregory Anders2024-09-17
| | | | | | | | | | | | Problem: filetype: salt files are not recognized Solution: Detect '*.sls' files as filetype salt, include a syntax script (Gregory Anders) closes: vim/vim#15689 https://github.com/vim/vim/commit/89b9bb4ac8ceb701ebecb8c02aca3d047dff9991 Co-authored-by: Gregory Anders <greg@gpanders.com>
* vim-patch:9.1.0734: filetype: jinja files are not recognizedGregory Anders2024-09-17
| | | | | | | | | | | | Problem: filetype: jinja files are not recognized Solution: detect '*.jinja' files a jinja filetype, include jinja syntax script (Gregory Anders) related: vim/vim#15689 https://github.com/vim/vim/commit/202c467bb37b894ada6377d3f2621c103f324757 Co-authored-by: Gregory Anders <greg@gpanders.com>