aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* test(vim.ui.open): opt.cmdJustin M. Keyes2024-09-16
|
* vim-patch:9.1.0731: inconsistent case sensitive extension matchingChristian Clason2024-09-16
| | | | | | | | | | | | | | | | | | | | | Problem: inconsistent case sensitive extension matching Solution: unify case sensitive extension matching (Evgeni Chasnovski). There are different approaches of how extensions are matched with respect to case sensitivity. In particular, '\c' flag is used in pattern whereas in most places case sensitive matching is guarded behind `has("fname_case")` condition. Replace all instances of '\c' with an explicit case sensitive pattern variants guarded by `has("fname_case")`. Strictly speaking, this is a breaking change because only two (most common and prevailingly tested) variants are now matched: upper first letter and upper all letters. closes: vim/vim#15672 https://github.com/vim/vim/commit/59b089c9df238ce940b3c593295bc511e201399a Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
* refactor: rename "process" => "proc" #30387Justin M. Keyes2024-09-15
| | | | | | | | | | | | Problem: - "process" is often used as a verb (`multiqueue_process_events`), which is ambiguous for cases where it's used as a topic. - The documented naming convention for processes is "proc". - `:help dev-name-common` - Shorter is better, when it doesn't harm readability or discoverability. Solution: Rename "process" => "proc" in all C symbols and module names.
* refactor(tests): rename terminal/testutil.lua => testterm.lua #30372Justin M. Keyes2024-09-15
| | | | | This module is generally used by any tests that need the full Nvim TUI instead of `screen.lua`. Thus it should live in `functional/` instead of in `functional/terminal/`.
* Merge pull request #30378 from zeertzjq/vim-9.1.0729zeertzjq2024-09-14
|\ | | | | vim-patch:9.1.{0729,0730}
| * vim-patch:9.1.0730: Crash with cursor-screenline and narrow windowzeertzjq2024-09-14
| | | | | | | | | | | | | | | | | | | | | | Problem: Crash with cursor-screenline and narrow window (elig0n) Solution: Don't set right_col when width2 is 0 (zeertzjq). fixes: vim/vim#15677 closes: vim/vim#15678 https://github.com/vim/vim/commit/59149f02692804267e7cc0665d0334f6ff4675be
| * vim-patch:9.1.0729: Wrong cursor-screenline when resizing windowzeertzjq2024-09-14
| | | | | | | | | | | | | | | | | | | | Problem: Wrong cursor-screenline when resizing window Solution: Invalidate saved left_col and right_col when width1 or width2 change. closes: vim/vim#15679 https://github.com/vim/vim/commit/86dc4f8b432233a01d022c3e71df53db58229713
* | vim-patch:9.1.0728: [security]: heap-use-after-free in garbage collection ↵zeertzjq2024-09-14
|/ | | | | | | | | | | | | with location list user data (#30377) Problem: heap-use-after-free in garbage collection with location list user data. Solution: Mark user data as in use when no other window is referencing the location list (zeertzjq) fixes: neovim/neovim#30371 closes: vim/vim#15683 https://github.com/vim/vim/commit/be4bd189d23854ddf1d85ad291d8f7ad3f22b7a0
* feat(treesitter): start moving get_parser to return nil #30313Riley Bruins2024-09-13
| | | | | | | | | | | | | | | | | | | **Problem:** `vim.treesitter.get_parser` will throw an error if no parser can be found. - This means the caller is responsible for wrapping it in a `pcall`, which is easy to forget - It also makes it slightly harder to potentially memoize `get_parser` in the future - It's a bit unintuitive since many other `get_*` style functions conventionally return `nil` if no object is found (e.g. `get_node`, `get_lang`, `query.get`, etc.) **Solution:** Return `nil` if no parser can be found or created - This requires a function signature change, and some new assertions in places where the parser will always (or should always) be found. - This commit starts by making this change internally, since it is breaking. Eventually it will be rolled out to the public API.
* vim-patch:9.1.0725: filetype: swiftinterface files are not recognized (#30350)zeertzjq2024-09-12
| | | | | | | | | | | Problem: filetype: swiftinterface files are not recognized Solution: Detect '*.swiftinterface' files as swift filetype (LosFarmosCTL) closes: vim/vim#15658 https://github.com/vim/vim/commit/03cac4b70d819148f4b4404701b8f331a3af0fb6 Co-authored-by: LosFarmosCTL <80157503+LosFarmosCTL@users.noreply.github.com>
* feat(log): use "ui" as default name for TUI client #30345Justin M. Keyes2024-09-11
| | | | | | | | | | | | | The default "session name" for the builtin TUI is "ui". before: INF 2024-09-10T14:57:35.385 hello.sock os_exit:692: Nvim exit: 1 INF 2024-09-10T14:57:35.388 ?.4543 os_exit:692: Nvim exit: 1 after: INF 2024-09-10T14:59:19.919 hello.sock os_exit:692: Nvim exit: 1 INF 2024-09-10T14:59:19.922 ui.5684 os_exit:692: Nvim exit: 1
* fix: replace NVIM with Nvim in default titlestring (#30348)Gregory Anders2024-09-11
|
* test(health): "test_plug/health/init.lua" completes as "test_plug"Justin M. Keyes2024-09-11
|
* test: add termkey unit testsdundargoc2024-09-11
| | | | | | | | | | | Skipped importing the following unit tests from libtermkey as they'd require introducing a lot of unused code or require more effort to port than is probably worth: - 05read - 12strpkey - 20canon - 40ti-override
* Merge pull request #30295 from glepnir/nfloatbfredl2024-09-10
|\ | | | | fix(highlight): floating windows inherit NormalFloat from global-ns
| * fix(highlight): floating windows inherit NormalFloat from global-nsglepnir2024-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: floating windows did not correctly inherit the NormalFloat highlight group from the global namespace when it was not defined in the window-specific namespace. This led to floating windows losing their background highlight when switching between namespaces. Solution: Updated the window highlight logic in update_window_hl() to handle the fallback. This fix resolves issues with floating window backgrounds not displaying as expected in certain namespace configurations.
* | fix(test): "tempdir not a directory" in CI logsJustin M. Keyes2024-09-09
| | | | | | | | | | | | $NVIM_LOG_FILE: /Users/runner/work/neovim/neovim/build/.nvimlog WRN 2024-09-08T21:48:13.279 ?.21134 vim_mktempdir:3281: $TMPDIR tempdir not a directory (or does not exist): TMPDIR-should-be-ignored WRN 2024-09-08T21:48:13.312 ?.21137 vim_mktempdir:3281: $TMPDIR tempdir not a directory (or does not exist): TMPDIR-should-be-ignored
* | refactor(test): rename alter_slashes, invert its behaviorJustin M. Keyes2024-09-09
| | | | | | | | | | | | | | - `alter_slashes` belongs in `testutil.lua`, not `testnvim.lua`. - `alter_slashes` is an unusual name. Rename it to `fix_slashes`. - invert its behavior, to emphasize that `/` slashes are the preferred, pervasive convention, not `\` slashes.
* | fix(startup): server fails if $NVIM_APPNAME is relative dir #30310Justin M. Keyes2024-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: If $NVIM_APPNAME is a relative dir path, Nvim fails to start its primary/default server, and `v:servername` is empty. Root cause is d34c64e342dfba9248d1055e702d02620a1b31a8, but this wasn't noticed until 96128a5076b7 started reporting the error more loudly. Solution: - `server_address_new`: replace slashes "/" in the appname before using it as a servername. - `vim_mktempdir`: always prefer the system-wide top-level "nvim.user/" directory. That isn't intended to be specific to NVIM_APPNAME; rather, each *subdirectory* ("nvim.user/xxx") is owned by each Nvim instance. Nvim "apps" can be identified by the server socket(s) stored in those per-Nvim subdirs. fix #30256
* | fix(lua): revert vim.tbl_extend behavior change and document itChristian Clason2024-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: vim.tbl_deep_extend had an undocumented feature where arrays (integer-indexed tables) were not merged but compared literally (used for merging default and user config, where one list should overwrite the other completely). Turns out this behavior was relied on in quite a number of plugins (even though it wasn't a robust solution even for that use case, since lists of tables (e.g., plugin specs) can be array-like as well). Solution: Revert the removal of this special feature. Check for list-like (contiguous integer indices) instead, as this is closer to the intent. Document this behavior.
* | fix(startup): ignore broken $XDG_RUNTIME_DIR #30285Justin M. Keyes2024-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: $XDG_RUNTIME_DIR may be broken on WSL, which prevents starting (and even building) Nvim. #30282 Solution: - When startup fails, mention the servername in the error message. - If an autogenerated server address fails, log an error and continue with an empty `v:servername`. It's only fatal if a user provides a bad `--listen` or `$NVIM_LISTEN_ADDRESS` address. Before: $ nvim --headless --listen ./hello.sock nvim: Failed to --listen: "address already in use" $ NVIM_LISTEN_ADDRESS='./hello.sock' ./build/bin/nvim --headless nvim: Failed to --listen: "address already in use" After: $ nvim --headless --listen ./hello.sock nvim: Failed to --listen: address already in use: "./hello.sock" $ NVIM_LISTEN_ADDRESS='./hello.sock' ./build/bin/nvim --headless nvim: Failed $NVIM_LISTEN_ADDRESS: address already in use: "./hello.sock"
* | fix(lsp): handle out-of-bounds character positions #30288Tristan Knight2024-09-08
| | | | | | | | | | | | | | | | | | | | | | Problem: str_byteindex_enc could return an error if the index was longer than the lline length. This was handled in each of the calls to it individually Solution: * Fix the call at the source level so that if the index is higher than the line length, line length is returned as per LSP specification * Remove pcalls on str_byteindex_enc calls. No longer needed now that str_byteindex_enc has a bounds check.
* | test(tohtml): simplify font testJustin M. Keyes2024-09-08
| |
* | fix(tohtml): enclose font-family names in quotation marksyayoyuyu2024-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | Font-family names must be enclosed in quotation marks to ensure that fonts are applied correctly when there are spaces in the name. Fix an issue where multiple fonts specified in `vim.o.guifont` are inserted as a single element, treating them as a single font. Support for escaping commas with backslash and ignoring spaces after a comma. ref `:help 'guifont'`
* | test(lua): tbl_deep_extend "after second argument" #30297Justin M. Keyes2024-09-07
| |
* | vim-patch:9.1.0720: Wrong breakindentopt=list:-1 with multibyte or TABs (#30293)zeertzjq2024-09-07
| | | | | | | | | | | | | | | | | | | | Problem: Wrong breakindentopt=list:-1 with multibyte chars or TABs in text matched by 'formatlistpat' (John M Devin) Solution: Use the width of the match text (zeertzjq) fixes: vim/vim#15634 closes: vim/vim#15635 https://github.com/vim/vim/commit/61a6ac4d0066317131528f1b3ecc3b3a2599a75c
* | vim-patch:9.1.0719: Resetting cell widths can make 'listchars' or ↵zeertzjq2024-09-06
| | | | | | | | | | | | | | | | | | | | | | 'fillchars' invalid (#30289) Problem: Resetting cell widths can make 'listchars' or 'fillchars' invalid. Solution: Check for conflicts when resetting cell widths (zeertzjq). closes: vim/vim#15629 https://github.com/vim/vim/commit/66f65a46c5d169f20f780721d4f74d4729855b96
* | Merge pull request #30236 from luukvbaal/invalidbfredl2024-09-06
|\ \ | | | | | | fix(decor): revise marktree metadata for invalid marks
| * | fix(decor): exclude invalid marks from meta totalLuuk van Baal2024-09-04
| |/ | | | | | | | | | | Problem: Marktree meta count still includes invalidated marks, making guards that check the meta total ineffective. Solution: Revise marktree metadata when in/revalidating a mark.
* | Merge pull request #30272 from bfredl/replace_emojibfredl2024-09-06
|\ \ | | | | | | fix(multibyte): handle backspace of wide clusters in replace mode
| * | fix(multibyte): handle backspace of wide clusters in replace modebfredl2024-09-06
| | | | | | | | | | | | | | | Make utf_head_off more robust against invalid sequences and embedded NUL chars
* | | vim-patch:9.1.0716: resetting setcellwidth() doesn't update the screen (#30274)zeertzjq2024-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: resetting setcellwidth() doesn't update the screen Solution: Redraw after clearing the cellwidth table (Ken Takata) closes: vim/vim#15628 https://github.com/vim/vim/commit/539e9b571ae2a80dfa8a42eb132ad9f65f0bbcbc Co-authored-by: Ken Takata <kentkt@csc.jp>
* | | feat(defaults): popupmenu "Open in browser", "Go to definition" #30261Justin M. Keyes2024-09-05
| | | | | | | | | | | | - Use the popup to expose more features such as LSP and gx. - Move the copy/paste items lower in the menu, they are lower priority.
* | | test: avoid noise in CI logs #30264Justin M. Keyes2024-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Since 96128a5076b7 the test logs have noise from tests that *expect* failures: $NVIM_LOG_FILE: /tmp/cirrus-ci-build/build/.nvimlog (last 100 lines) ERR 2024-09-04T13:38:45.181 T949.28335.0/c terminfo_start:486: uv_pipe_open failed: no such device or address ERR 2024-09-04T13:38:45.181 T949.28335.0/c flush_buf:2527: uv_write failed: bad file descriptor ERR 2024-09-04T13:38:45.181 T949.28335.0/c flush_buf:2527: uv_write failed: bad file descriptor WRN 2024-09-04T13:43:43.294 ?.35904 server_start:173: Failed to start server: address already in use: /…/Xtest_tmpdir/…/T7159.35895.0 WRN 2024-09-04T13:43:43.314 ?.35907 server_start:173: Failed to start server: illegal operation on a directory: / ERR 2024-09-04T13:43:43.332 ?.35909 socket_watcher_init:60: Host lookup failed: https://example.com Solution: Rewrite the test to use `vim.system()`. Set NVIM_LOG_FILE in the child process to a "throwaway" logfile.
* | | fix(lsp): handle locations exceeding line length #30253Tristan Knight2024-09-05
| |/ |/| | | | | | | | | | | | | | | | | | | Problem: LSP spec [states](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position) that "if the character value is greater than the line length it defaults back to the line length", but `locations_to_items` fails in that case. Solution: Adjust locations_to_items to follow the spec. closes #28281
* | fix(lua): allows tables with integer keys to be merged in tbl_deep_extendLewis Russell2024-09-04
|/ | | | | | | | | - The exclusion of lists was never justified in the commit history and is the wrong thing to do for a function that deals with tables. - Move the error checks out of the recursive path. Fixes #23654
* vim-patch:9.1.0713: Newline causes E749 in Ex mode (#30254)zeertzjq2024-09-04
| | | | | | | | | | Problem: Newline causes E749 in Ex mode (after 9.1.0573). Solution: Don't execute empty command followed by a newline. closes: vim/vim#15614 https://github.com/vim/vim/commit/2432b4a75321a1a9ac0f9b326c7e46d38bdb71bb Cherry-pick code change from patch 8.2.3405.
* feat(lsp): support hostname in rpc.connect #30238Tristan Knight2024-09-03
| | | | | | | | | | | | | | | Updated the `rpc.connect` function to support connecting to LSP servers using hostnames, not just IP addresses. This change includes updates to the documentation and additional test cases to verify the new functionality. - Modified `connect` function to resolve hostnames. - Updated documentation to reflect the change. - Added test case for connecting using hostname. Added a TCP echo server utility function to the LSP test suite. This server echoes the first message it receives and is used in tests to verify LSP server connections via both IP address and hostname. Refactored existing tests to use the new utility function.
* fix(api): nvim_buf_get_text() crashes with large negative column #28740vanaigr2024-09-03
| | | | | | | | | | Problem: crash when calling nvim_buf_get_text() with a large negative start_col: call nvim_buf_get_text(0, 0, -123456789, 0, 0, {}) Solution: clamp start_col after subtracting it from the line length.
* test: tmpname(create:boolean) #30242Justin M. Keyes2024-09-03
| | | | | | | | | Problem: 137f98cf6428 added the `create` parameter to `tmpname()` but didn't fully implement it. Solution: - Update impl for the `os.tmpname()` codepath. - Inspect all usages of `tmpname()`, update various tests.
* feat(startup): validate --listen addressJustin M. Keyes2024-09-02
| | | | | | | | | | | | | Problem: `nvim --listen` does not error on EADDRINUSE. #30123 Solution: Now that `$NVIM_LISTEN_ADDRESS` is deprecated and input *only* (instead of the old, ambiguous situation where it was both an input *and* an output), we can be fail fast instead of trying to "recover". This reverts the "recovery" behavior of 704ba4151e7f67999510ee0ac19fdabb595d530c, but that was basically a workaround for the fragility of `$NVIM_LISTEN_ADDRESS`.
* test: tmpname() can skip file creationJustin M. Keyes2024-09-02
|
* docs: misc #28970Justin M. Keyes2024-09-01
|
* feat(treesitter)!: default to correct behavior for quantified captures (#30193)Gregory Anders2024-09-01
| | | | | | | | | | | | For context, see https://github.com/neovim/neovim/pull/24738. Before that PR, Nvim did not correctly handle captures with quantifiers. That PR made the correct behavior opt-in to minimize breaking changes, with the intention that the correct behavior would eventually become the default. Users can still opt-in to the old (incorrect) behavior for now, but this option will eventually be removed completely. BREAKING CHANGE: Any plugin which uses `Query:iter_matches()` must update their call sites to expect an array of nodes in the `match` table, rather than a single node.
* vim-patch:9.1.0708: Recursive window update does not account for reset ↵luukvbaal2024-09-01
| | | | | | | | | | skipcol (#30217) Problem: Window is updated with potentially invalid skipcol in recursive window update path. I.e. cursor outside of visible range in large line that does not fit. Solution: Make sure it is valid (Luuk van Baal). https://github.com/vim/vim/commit/3d5065fc7553c8de3d0555c3085165bdd724663b
* fix(completion): don't include <Lua function> in -complete= (#30209)zeertzjq2024-09-01
|
* vim-patch:9.1.0704: inserting with a count is inefficient (#30206)zeertzjq2024-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: inserting with a count is inefficient Solution: Disable calculation of the cursor position and topline, if a count has been used (Ken Takata) Optimize insertion when using :normal 10000ix. This patch optimizes the insertion with a large count (e.g. `:normal 10000ix`). It seems that calculation of the cursor position for a long line is slow and it takes O(n^2). Disable the calculation if not needed. Before: ``` $ time ./vim --clean -c 'normal 10000ix' -cq! real 0m1.879s user 0m1.328s sys 0m0.139s $ time ./vim --clean -c 'normal 20000ix' -cq! real 0m5.574s user 0m5.421s sys 0m0.093s $ time ./vim --clean -c 'normal 40000ix' -cq! real 0m23.588s user 0m23.187s sys 0m0.140s ``` After: ``` $ time ./vim --clean -c 'normal 10000ix' -cq! real 0m0.187s user 0m0.046s sys 0m0.093s $ time ./vim --clean -c 'normal 20000ix' -cq! real 0m0.217s user 0m0.046s sys 0m0.108s $ time ./vim --clean -c 'normal 40000ix' -cq! real 0m0.278s user 0m0.093s sys 0m0.140s $ time ./vim --clean -c 'normal 80000ix' -cq! real 0m0.494s user 0m0.311s sys 0m0.140s $ time ./vim --clean -c 'normal 160000ix' -cq! real 0m1.302s user 0m1.140s sys 0m0.094s ``` closes: vim/vim#15588 https://github.com/vim/vim/commit/09b80d23cfae24fa13ef4f52b0ec90625839a6ab Co-authored-by: Ken Takata <kentkt@csc.jp>
* vim-patch:9.1.0684: completion is inserted on Enter with "noselect" (#30111)glepnir2024-08-31
| | | | | | | | | | | Problem: completion is inserted on Enter with "noselect" (Carman Fu) Solution: check noselect before update compl_shown_match (glepnir) fixes: vim/vim#15526 closes: vim/vim#15530 https://github.com/vim/vim/commit/753794bae8a9401903b82e5c5d1f35a106aa912a
* fix(completion): fix inconsistent Enter behavior (#30196)zeertzjq2024-08-31
| | | | | | Problem: Behavior of Enter in completion depends on typing speed. Solution: Don't make whether Enter selects original text depend on whether completion has been interrupted, which can happen interactively with a slow completion function.
* fix(lsp): when prefix is non word add all result into matches (#30044)glepnir2024-08-30
| | | | | | | Problem: prefix can be a symbol like period, the fuzzy matching can't handle it correctly. Solution: when prefix is empty or a symbol add all lsp completion result into matches.