summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/ex_cmds
AgeCommit message (Collapse)AuthorFiles
2026-04-24fix(path): normalize path slashes on Windows #37729tao3
Problem: On Windows, path separators may become inconsistent for various reasons, which makes normalization quite painful. Solution: Normalize paths to `/` at the entry boundaries and always use it internally, converting back only in rare cases where `\` is really needed (e.g. cmd.exe/bat scripts?). This is the first commit in a series of incremental steps. Note: * some funcs won't respect shellslash. e.g. `expand/fnamemodify` * some funcs still respect shellslash, but will be updated in a follow PR. e.g. `ex_pwd/f_chdir/f_getcwd` * uv's built-in funcs always return `\`. e.g. `uv.cwd/uv.exepath` Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-04-24fix(trust): always use "/" slashes in filepaths #39355Justin M. Keyes1
Problem: We should not use "\" (backslashes) except where absolutely required. See references in https://github.com/neovim/neovim/pull/37729 Solution: There is no reason to use "\" slashes in the trust db, so don't.
2026-04-23feat(excmd): add :uptime command #39331Olivia Kinnear1
Problem Nvim marks its v:starttime, but there is no user-friendly way to get Nvim's uptime. Solution Add :uptime (based loosely on uptime(1)).
2026-04-23refactor(test): deduplicate trust tests #39354Justin M. Keyes1
2026-04-23fix(trust): hash unchanged empty buffers as empty files #39027Barrett Ruth1
Problem: `vim.secure.trust()` hashes an unchanged empty buffer as a newline, so trusting an empty file by buffer never works. Solution: Hash unchanged empty-buffers `''` so buffer-based trust matches the on-disk empty file.
2026-04-22ci: drop cirrus #39321Justin M. Keyes1
Problem: cirrus will shutdown soon, and we are running out of minutes anyway, which causes ci failures. Solution: Drop cirrus config.
2026-04-22fix(cmd): ++p, ++edit should match "word" boundary #39146glepnir1
Problem: `:write ++patate foo` doesn't error out, instead it turns on mkdir_p and uses "atate foo" as the filename. Same with ++edit. The parser just does strncmp without checking what comes after. Solution: require the next char after the option name to not be a letter
2026-04-21Merge pull request #39076 from bfredl/zig0.16bfredl1
IT IS HAPPENING: Zig 0.16
2026-04-21fix(substitute): don't crash with very large count (#39272)zeertzjq1
2026-04-21fix(build): more changes to make zig 0.16.0 workbfredl1
2026-04-20refactor(test): drop deprecated exc_exec #39242Justin M. Keyes14
2026-04-20fix(excmd): nlua_call_excmd require() failure is a "lua_error"Justin M. Keyes2
Although `nlua_call_excmd` is semantically for implementing Ex-commands, the `require()` should never fail, so that's a "Lua error". But if the call itself fails (the later `semsg` call), that's an "Ex cmd" error.
2026-04-18refactor(vimfn): full-Lua impl of vim.fn.environ()Justin M. Keyes1
2026-04-10feat(ex): add `:log` commandOlivia Kinnear1
2026-04-09fix(messages): truncate warning messages only in display (#38901)zeertzjq1
For now, add a private "_truncate" flag to nvim_echo, using a truncation method similar to showmode().
2026-04-07Merge pull request #38669 from SanzharKuandyk/fix-38667zeertzjq1
fix(channel): fix Windows console regressions from #37977
2026-04-06fix(channel): fix Ctrl-C handling regression in terminalSanzhar Kuandyk1
Problem: Normal Windows builtin-TUI startup spawns the embedded server as DETACHED_PROCESS, which breaks Ctrl-C delivery to :terminal jobs. Solution: Restores the default behavior once the embedded server has a console so terminal jobs inherit it.
2026-04-05fix(help): show error when using :help! with nothing at cursor #38775zeertzjq1
It's possible to still show the old Easter egg, but then the user won't know about the new feature, so showing E349 is better.
2026-03-31test(tui_spec): work around flaky test with ASAN (#38619)zeertzjq1
FAILED test/functional/terminal/tui_spec.lua @ 2641: TUI exits immediately when stdin is closed #35744 test/functional/terminal/tui_spec.lua:2648: Failed to match any screen lines. Expected (anywhere): "%[Process exited 1%]" Actual: |^ | |[Process exited 129]{100: }| |{100:~ }| |{100:~ }| |{3:[No Name] }| | | |{5:-- TERMINAL --} |
2026-03-29vim-patch:9.2.0253: various issues with wrong b_nwindows after closing buffersSean Dewar1
Problem: close_buffer() callers incorrectly handle b_nwindows, especially after nasty autocmds, allowing it to go out-of-sync. May lead to buffers that can't be unloaded, or buffers that are prematurely freed whilst displayed. Solution: Modify close_buffer() and review its callers; let them decrement b_nwindows if it didn't unload the buffer. Remove some now unneeded workarounds like 8.2.2354, 9.1.0143, 9.1.0764, which didn't always work (Sean Dewar) (endless yapping omitted) related: vim/vim#19728 https://github.com/vim/vim/commit/bf21df1c7bc772e3a29961c961d0821584d50ee0 b_nwindows = 0 change for free_all_mem() was already ported. Originally Nvim returned true when b_nwindows was decremented before the end was reached (to better indicate the decrement). That's not needed anymore, so just return true only at the end, like Vim. (retval isn't used anywhere now anyways) Set textlock for dict watchers at the end of close_buffer() to prevent them from switching windows, as that can leave a window with a NULL buffer. (possible before this PR, but the new assert catches it; added a test) Despite textlock, things still aren't ideal, as watchers may observe the buffer as unloaded and hidden (b_nwindows was decremented), yet still in a window... Likewise, for Nvim, wipe_qf_buffer()'s comment may not be entirely accurate; autocmds are blocked, but on_detach callbacks (textlocked) and dict watchers may still run. Might be problematic, but those aren't new issues. Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2026-03-25test: work around flaky swapfile test with ASAN (#38482)zeertzjq1
FAILED test/functional/ex_cmds/swapfile_preserve_recover_spec.lua @ 118: preserve and (R)ecover with custom 'directory' killing TUI process without :preserve #22096 test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:132: Failed to match any screen lines. Expected (anywhere): "%[Process exited 1%]" Actual: |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimDarkGrey2:^sometext }| |[Process exited 129]{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4: }| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4:~ }| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4:~ }| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4:~ }| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4:~ }| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4:~ }| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4:~ }| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4:~ }| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4:~ }| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimLightGrey4:~ }| |{UNEXPECTED background = Screen.colors.NvimLightGrey4, foreground = Screen.colors.NvimDarkGrey2:Xtest_recover_file1 [+] 1,8 All}| |{UNEXPECTED background = Screen.colors.NvimLightGrey2, foreground = Screen.colors.NvimDarkGrey2: }| | |
2026-03-20docs: miscJustin M. Keyes1
2026-03-19feat(defaults): map "grx" to vim.lsp.codelens.run() #37689Yi Ming1
Problem Unlike inlay hints, code lenses are closely related to running commands; a significant number of code lenses are used to execute a command (such as running tests). Therefore, it is necessary to provide a default mapping for them. Solution Add a new default mapping "grx" (mnemonic: "eXecute", like "gx").
2026-03-18fix(menu): right-click menu fails with E335 when using V after i_ctrl-o #37349glepnir1
Problem: Right-click menu fails with E335 when using V in Insert mode (after i_ctrl-o). The mode detection checks restart_edit before VIsual_active, incorrectly selecting Insert mode binding even when Visual mode is active. Solution: Check Visual mode before Insert mode, to match get_menu_mode() priority order.
2026-03-16fix(ux): drop "Sorry" from messages #38318Justin M. Keyes1
Problem: "Sorry" in a message (1) is noise, and (2) actually reduces the clarity of the message because the titlecasing of "Sorry" distracts from the actually important part of the message. Solution: Drop "Sorry" from messages.
2026-03-15feat(help): super K (":help!") guesses tag at cursor #36205Justin M. Keyes1
Problem: `K` in help files may fail in some noisy text. Example: (`fun(config: vim.lsp.ClientConfig): boolean`) ^cursor Solution: - `:help!` (bang, no args) activates DWIM behavior: tries `<cWORD>`, then trims punctuation until a valid tag is found. - Set `keywordprg=:help!` by default. - Does not affect `CTRL-]`, that is still fully "tags" based.
2026-03-11Merge #37830 docsJustin M. Keyes1
2026-03-11docs: deprecate hit-enterJustin M. Keyes1
2026-03-11test(ex_cmds/mksession_spec): fix possible error log (#38255)zeertzjq1
Problem: :terminal CWD restoration test may lead to an error log if after_each() runs before the PTY process calls chdir(). Solution: Wait for some time before wiping the buffer, which can also prevent SIGHUP being sent to the parent.
2026-03-10feat(terminal): surface exit code via virttext + nvim_get_chan_info #37987Ayaan1
Problem: When a terminal process exits, "[Process Exited]" text is added to the buffer contents. Solution: - Return `exitcode` field from `nvim_get_chan_info`. - Show it in the default 'statusline'. - Show exitcode as virtual text in the terminal buffer.
2026-02-19test(ex_cmds/write_spec): don't create files under test/ (#37963)zeertzjq1
2026-02-18test: support running functionaltests in parallel by directory (#37918)zeertzjq1
Define a CMake target for every subdirectory of test/functional that contains functional tests, and a functionaltest_parallel target that depends on all those targets, allowing multiple test runners to run in parallel. On CI, use at most 2 parallel test runners, as using more may increase system load and make tests unstable.
2026-02-12fix(bufwrite.c): handle invalid byte sequences #37363Kevin Goodsell1
Problem: bw_rest was used as an extra buffer to save incomplete byte sequences between calls to buf_write_bytes. Besides being unnecessarily complicated, this introduced a number of issues: 1) The bytes stored in bw_rest could still be there at the end of writing the file, never having been written, thus losing some of the file content on write. 2) bw_rest was not cleared out after the "checking_conversion" phase, leaving them to affect the written file content during the writing phase, corrupting the file. 3) bw_rest could contain extra bytes that need to be written to the output buffer during a buf_write_convert call, potentially before any bytes are consumed. But some conversions are in-place, without a separate output buffer. Writing bytes from bw_rest to the "output" buffer actually overwrote bytes from the input buffer before they were read, corrupting the data to be written. 4) The extra bytes in bw_rest that need to be written to the conversion output buffer were not originally accounted for in the size calculation for the output buffer, causing a buffer overflow (previously fixed in Vim patch 9.1.2028). Solution: Rather than maintaining a separate buffer, the unconverted bytes at the end of the buffer can just be shifted to the beginning of the buffer, and the buffer size updated. This requires a bit of refactoring, and buf_write_convert and buf_write_convert_with_iconv need to report the number of bytes they consumed so that buf_write_bytes can handle the remaining bytes. Following conversion, bw_buf can be checked for any remaining bytes. Leftover bytes in this case result in a conversion error, which is better than silently dropping them. A short section of dead code was removed from buf_write_convert, for converting a non-UTF-8 buffer to UTF-8. Neovim buffers are always UTF-8. A few additional tests for iconv conversions have been added. Vim's iconv tests are disabled in Neovim because they use unsupported values for 'encoding'.
2026-02-12test(testterm): remove useless TermCursor highlight definition (#37827)zeertzjq1
TermCursor already has cterm=reverse. Additionally, now that terminal buffers have a real cursor, the cterm=reverse in TermCursor no longer shows up in the screen state.
2026-02-10refactor(help): move escaping logic to Lua #37757Yochem van Rosmalen1
Problem: Escaping logic for {subject} in ex cmd `:help {subject}` is done in a messy 200+ lines C function which is hard to maintain and improve. Solution: Rewrite in Lua. Use `string.gsub()` instead of looping over characters to improve clarity and add many more tests to be able to confidently improve current code later on.
2026-02-08fix(messages): unwanted newlines with ext_messages #37733luukvbaal1
Problem: Newlines intended to write messages below the cmdline or to mark the start of a new message on message grid are emitted through ext_messages. This results in unnecessary newlines for a UI that has decoupled its message area from the cmdline. msg_col is set directly in some places which is not transmitted to msg_show events. Various missing message kind for list commands. Trailing newlines on various list commands. Solution: Only emit such newlines without ext_messages enabled. Use msg_advance() instead of setting msg_col directly. Assign them the "list_cmd" kind. Ensure no trailing newline is printed.
2026-02-03feat(defaults): exclude temp dirs from 'shada' oldfiles #37631Pavel Pisetski1
Problem: Temporary files from /tmp/ and /private/ paths clutter :oldfiles list. Additionally, the documented Windows default (rA:,rB:) was never applied due to a missing platform condition. Solution: Drop platform-specific shada differences and default to excluding /tmp/ and /private/ paths.
2026-02-03ci(test): bump Windows runners to windows-2025 and unskip tests (#37666)zeertzjq2
Bumping to windows-2025 seems to fix at least one case of spaces having wrong attributes in TUI tests, which allow unskipping dozens of tests.
2026-02-01test: wait for uv.pipe_connect() callback (#37640)zeertzjq1
Problem: On Windows, writing to a pipe doesn't work if the pipe isn't connected yet. This causes an RPC request to a session newly created by connect() to hang, as it's waiting for a response to a request that never reaches the server. Solution: Wait for uv.pipe_connect() callback to be called when using connect().
2026-01-31test: add reasons to some skipped tests (#37632)zeertzjq2
2026-01-28fix(tui): log chdir failure properly #37591zeertzjq1
2026-01-21fix(lua): correct line number reporting for options set in coroutines (#37463)Tommy Guo1
2026-01-10fix(session): window sizes not stored with float windows (#37344)zeertzjq1
2026-01-09fix(:ls): check for finished terminal properly (#37303)zeertzjq1
Use terminal_running() instead of channel_job_running().
2026-01-07feat(editor): :source can run Lua codeblock / ts injection #36799benarcher26911
Problem: Can't use `:source` to run a Lua codeblock (treesitter injection) in a help (vimdoc) file. Solution: Use treesitter to parse the range and treat it as Lua if detected as such.
2026-01-02fix(lsp): `:lsp restart` restarts on client exit #37125Olivia Kinnear1
Problem: `:lsp restart` detects when a client has exited by using the `LspDetach` autocommand. This works correctly in common cases, but breaks when restarting a client which is not attached to any buffer. It also breaks if a client is detached in between `:lsp restart` and the actual stopping of the client. Solution: Move restart logic into `vim/lsp/client.lua`, so it can hook in to `_on_exit()`. The public `on_exit` callback cannot be used for this, as `:lsp restart` needs to ensure the restart only happens once, even if the command is run multiple times on the same client.
2025-12-30build: ship "_core/*" as bytecode (built-into Nvim binary)Justin M. Keyes1
Problem: We want to encourage implementing core features in Lua instead of C, but it's clumsy because: - Core Lua code (built into `nvim` so it is available even if VIMRUNTIME is missing/invalid) requires manually updating CMakeLists.txt, or stuffing it into `_editor.lua`. - Core Lua modules are not organized similar to C modules, `_editor.lua` is getting too big. Solution: - Introduce `_core/` where core Lua code can live. All Lua modules added there will automatically be included as bytecode in the `nvim` binary. - Move these core modules into `_core/*`: ``` _defaults.lua _editor.lua _options.lua _system.lua shared.lua ``` TODO: - Move `_extui/ => _core/ui2/`
2025-12-20docs: misc, lspJustin M. Keyes1
2025-12-16fix(lsp): tests for :lsp, rename start/stopOlivia Kinnear1
- Rename :lsp start/stop to enable/disable - Move lua section of `:lsp` to `vim/_core` - Add tests
2025-11-30fix(buffer): defer w_buffer clearing to prevent dict watcher crash #36748CompileAndConquer1