aboutsummaryrefslogtreecommitdiff
path: root/src/gen/gen_vimdoc.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2026-06-19 12:56:38 +0200
committerJustin M. Keyes <justinkz@gmail.com>2026-06-25 18:36:24 +0200
commitb2bf7bcfb15125fe65f3e503af00174f31eb92d8 (patch)
tree54f8c380bd2a63d64bd232906495e44df619dd44 /src/gen/gen_vimdoc.lua
parent122be61ed24cce4be721557421a05f1a35e0dcb5 (diff)
downloadrneovim-b2bf7bcfb15125fe65f3e503af00174f31eb92d8.tar.gz
rneovim-b2bf7bcfb15125fe65f3e503af00174f31eb92d8.tar.bz2
rneovim-b2bf7bcfb15125fe65f3e503af00174f31eb92d8.zip
feat(cmdwin): implement cmdwin as a normal buf+win
Problem: cmdwin (the `:q` cmdline buffer) has various limitations which require special-casing all over the codebase. Besides complicating the code, it also breaks async plugins if they try to create buffers/windows after some work is done, if the user happens to open cmdwin at the wrong the moment: Lua callback: …/guh.nvim/lua/guh/util.lua:531: E11: Invalid in command-line window; <CR> executes, CTRL-C quits stack traceback: [C]: in function 'nvim_buf_delete' …/guh.nvim/lua/guh/util.lua:531: in function <…/guh.nvim/lua/guh/util.lua:526> Solution: Just say no to "inception". Reimplement cmdwin as a normal buffer+window. All of the cmdwin contortions (in both core, and innocent plugins) exist literally only to support "inception": recursive cmdwin-in-cmdline-things, like `<c-r>=`, `/`, search-during-substitute, `:input()`, etc. So we just won't support that (though I have a potential plan for that later, which I call "modal parking lot"). The benefit is that plugins, and core, no longer have to care about cmdwin. BONUS: - mouse-drag on vertical separators works (it only worked for horizontal/statusline before) - inccommand-in-cmdwin now works correctly, for free (thus don't need #40077). POTENTIAL FOLLOWUPS - Drop `CHECK_CMDWIN` ("E11: Invalid in command-line window"), allow chaos. - Unify `BUFLOCK_OK` / `LOCK_OK` ? DESIGN: - Eliminate lots of C globals, `EX_CMDWIN`, etc. - `text_locked()` no longer reports true for cmdwin. - cmdwin = a normal window with 'winfixbuf', 'bufhidden=wipe', 'buftype=nofile'. Invariants come from those options rather than special cases throughout the codebase. - `nv_record` for q:/q//q? calls Lua `nlua_call_vimfn("vim._core.cmdwin", …)`. No `K_CMDWIN` / cmdline-reader detour. - `cedit_key` (`c_CTRL-F`) schedules a deferred event that calls `vim._core.cmdwin.open(type, content, pos)` and returns `Ctrl_C` so the in-flight cmdline cancels. Reader state is not serialized; instead the captured `(type, line, col)` is replayed via `nvim_feedkeys(type..line.."<CR>", "nt", …)` after user confirms. - On confirm/cancel: `<CR>` / `<C-C>` calls into Lua which closes the window and re-feeds the cmdline. BREAKING CHANGES: - Expression-register cmdline (`<C-R>=` from insert-mode) no longer supports cmdwin. Same applies to `input()` / `inputlist()` (already covered by `text_locked`). - Usage of cmdwin in macros/mappings will probably break (assuming they ever worked).
Diffstat (limited to 'src/gen/gen_vimdoc.lua')
-rwxr-xr-xsrc/gen/gen_vimdoc.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gen/gen_vimdoc.lua b/src/gen/gen_vimdoc.lua
index 22a94b049b..4d92c94be8 100755
--- a/src/gen/gen_vimdoc.lua
+++ b/src/gen/gen_vimdoc.lua
@@ -981,8 +981,7 @@ local function render_fun(fun, classes, cfg)
table.insert(ret, '\n Attributes: ~\n')
for _, attr in ipairs(fun.attrs) do
local attr_str = ({
- textlock = 'not allowed when |textlock| is active or in the |cmdwin|',
- textlock_allow_cmdwin = 'not allowed when |textlock| is active',
+ textlock = 'not allowed when |textlock| is active',
fast = '|api-fast|',
remote_only = '|RPC| only',
lua_only = 'Lua |vim.api| only',