mirror of
https://github.com/neovim/neovim.git
synced 2026-08-02 13:49:19 +00:00
fix(ui2): clear empty cmdline after backspace #41043
Problem: Cmdline area shows stale ":" after backspacing out of the command line. Solution: Clear the command line for empty commands. Note that `:<CR>` will now clear the command line too.
This commit is contained in:
@@ -154,8 +154,8 @@ function M.cmdline_hide(level, abort)
|
||||
|
||||
fn.clearmatches(ui.wins.cmd) -- Clear matchparen highlights.
|
||||
api.nvim_win_set_cursor(ui.wins.cmd, { 1, 0 })
|
||||
if M.prompt or abort then
|
||||
-- Clear cmd buffer prompt or aborted command (non-abort is left visible).
|
||||
if M.prompt or abort or cmdbuff == '' then
|
||||
-- Clear cmd buffer prompt or aborted/empty command (non-abort is left visible).
|
||||
api.nvim_buf_set_lines(ui.bufs.cmd, 0, -1, false, {})
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user