diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 1f666118c1..9bc5bfa46a 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1174,8 +1174,8 @@ omnifunc({findstart}, {base}) *vim.lsp.omnifunc()* Return: ~ (`integer|table`) Decided by {findstart}: - • findstart=0: column where the completion starts, or -2 or -3 - • findstart=1: list of matches (actually just calls |complete()|) + • findstart=1: column where the completion starts, or -2 or -3 + • findstart=0: list of matches (actually just calls |complete()|) See also: ~ • |complete-functions| diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 49d513288b..3631d6199c 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -425,6 +425,7 @@ TERMINAL bottom-left of the buffer and can be resumed by pressing a key. • On terminal exit, "[Process exited]" is shown as virtual text (instead of modifying buffer contents), and exit code is shown in statusline. + • You can disable "[Process exited]" entirely, see |terminal-config|. TREESITTER @@ -494,7 +495,7 @@ These existing features changed their behavior. absolute paths (to the current drive) and no longer relative. • When 'shelltemp' is off, shell commands now use `pipe()` and not `socketpair()` for input and output. This matters mostly for Linux where some command lines - using "/dev/stdin" and similiar would break as these special files can be + using "/dev/stdin" and similar would break as these special files can be reopened when backed by pipes but not when backed by socket pairs. ============================================================================== diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index a44a73f53a..2bcb62571b 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -54,10 +54,10 @@ mode. *t_CTRL-\_CTRL-O* Terminal-mode forces these local options: - 'cursorlineopt' = number - 'nocursorcolumn' - 'scrolloff' = 0 - 'sidescrolloff' = 0 +- 'cursorlineopt' = number +- 'nocursorcolumn' +- 'scrolloff' = 0 +- 'sidescrolloff' = 0 Terminal-mode has its own |:tnoremap| namespace for mappings, this can be used to automate any terminal interaction. @@ -101,6 +101,7 @@ Configuration *terminal-config* - Options: 'modified', 'scrollback' - Events: |TermOpen|, |TermEnter|, |TermLeave|, |TermClose| +- Event groups: "nvim.terminal" |default-autocmds| - Highlight groups: |hl-TermCursor| Terminal sets local defaults for some options, which may differ from your @@ -114,7 +115,13 @@ global configuration. - 'foldcolumn' is set to "0" You can change the defaults with a TermOpen autocommand: >vim - au TermOpen * setlocal list + :autocmd TermOpen * setlocal list + +By default, "[Process exited]" is displayed when the terminal process ends. To +disable that, you can delete the "nvim.terminal" TermClose handler (this also +deletes other |default-autocmds| TermClose functionality): >vim + :autocmd! nvim.terminal TermClose +< TERMINAL COLORS ~ diff --git a/runtime/lua/vim/_core/defaults.lua b/runtime/lua/vim/_core/defaults.lua index 51f26d845b..b8c5daf09b 100644 --- a/runtime/lua/vim/_core/defaults.lua +++ b/runtime/lua/vim/_core/defaults.lua @@ -605,14 +605,13 @@ do vim.api.nvim_buf_get_extmarks(ev.buf, nvim_terminal_exitmsg_ns, 0, -1, {}) ) > 0 - -- `nvim_open_term` buffers do not have any attached chan + -- `nvim_open_term` buffers do not have an attached 'channel'. local msg = buf.channel == 0 and '[Terminal closed]' or ('[Process exited %d]'):format(vim.v.event.status) - -- TermClose may be queued before TermOpen if the process - -- exits before `terminal_open` is called. Don't display - -- the msg now, let TermOpen display it. if buf.buftype ~= 'terminal' or buf_has_exitmsg then + -- TermClose may be queued before TermOpen if process exits before `terminal_open` is called. + -- Don't display the msg now, let TermOpen display it. vim.api.nvim_create_autocmd('TermOpen', { buffer = ev.buf, once = true, diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index aad7958aeb..07af250ef8 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -1332,8 +1332,8 @@ end ---@param base integer findstart=0, text to match against --- ---@return integer|table Decided by {findstart}: ---- - findstart=0: column where the completion starts, or -2 or -3 ---- - findstart=1: list of matches (actually just calls |complete()|) +--- - findstart=1: column where the completion starts, or -2 or -3 +--- - findstart=0: list of matches (actually just calls |complete()|) function lsp.omnifunc(findstart, base) return vim.lsp.completion._omnifunc(findstart, base) end diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua index 0257494832..4734ab935e 100644 --- a/runtime/lua/vim/lsp/completion.lua +++ b/runtime/lua/vim/lsp/completion.lua @@ -1262,8 +1262,8 @@ end --- @param base integer findstart=0, text to match against --- --- @return integer|table Decided by {findstart}: ---- - findstart=0: column where the completion starts, or -2 or -3 ---- - findstart=1: list of matches (actually just calls |complete()|) +--- - findstart=1: column where the completion starts, or -2 or -3 +--- - findstart=0: list of matches (actually just calls |complete()|) function M._omnifunc(findstart, base) lsp.log.debug('omnifunc.findstart', { findstart = findstart, base = base }) local bufnr = api.nvim_get_current_buf() diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 3f7de39caf..52db651ea8 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -1556,7 +1556,7 @@ static void deferred_event(void **argv) /// @param event event that occurred /// @param fname filename, NULL or empty means use actual file name /// @param fname_io filename to use for on cmdline -/// @param force When true, ignore autocmd_busy +/// @param force Ignore autocmd_busy (force "++nested" behavior) /// @param buf Buffer for /// /// @return true if some commands were executed. @@ -1571,7 +1571,7 @@ bool apply_autocmds(event_T event, char *fname, char *fname_io, bool force, buf_ /// @param event event that occurred /// @param fname NULL or empty means use actual file name /// @param fname_io fname to use for on cmdline -/// @param force When true, ignore autocmd_busy +/// @param force Ignore autocmd_busy (force "++nested" behavior) /// @param buf Buffer for /// @param exarg Ex command arguments /// @@ -1590,7 +1590,7 @@ bool apply_autocmds_exarg(event_T event, char *fname, char *fname_io, bool force /// @param event event that occurred /// @param fname NULL or empty means use actual file name /// @param fname_io fname to use for on cmdline -/// @param force When true, ignore autocmd_busy +/// @param force Ignore autocmd_busy (force "++nested" behavior) /// @param buf Buffer for /// @param[in,out] retval caller's retval /// @@ -1643,7 +1643,7 @@ bool trigger_cursorhold(void) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT /// @param fname filename, NULL or empty means use actual file name /// @param fname_io filename to use for on cmdline, /// NULL means use `fname`. -/// @param force When true, ignore autocmd_busy +/// @param force Ignore autocmd_busy (force "++nested" behavior) /// @param group autocmd group ID or AUGROUP_ALL /// @param buf Buffer for /// @param eap Ex command arguments