feat: improve wrapped-line editing and completion cancellation

Use word-boundary wrapping and count-aware displayed-line movement in ordinary buffers. Escape cancels Blink completion before falling back. Preserve the existing ergonomics check; it was not rerun during Git cleanup.
This commit is contained in:
kiri committed 2026-09-09 17:31:25 +02:00
1 parent 35ce6be8f9
commit 8f5d690d75
4 files changed
+26

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
-- Configured startup: nvim --headless -i NONE '+lua local ok,e=pcall(dofile,"tests/neovim-ergonomics.lua"); if not ok then print(e); vim.cmd.cquit() end' '+qa!'
assert(vim.o.linebreak)
vim.api.nvim_buf_set_lines(0, 0, -1, false, { string.rep("word ", 80), "two", "three", "four" })
vim.cmd("normal gg0j")
assert(vim.fn.line(".") == 1 and vim.fn.col(".") > 1)
vim.cmd("normal k")
assert(vim.fn.line(".") == 1 and vim.fn.col(".") == 1)
vim.cmd("normal 3j")
assert(vim.fn.line(".") == 4)
vim.cmd("normal 3k")
assert(vim.fn.line(".") == 1)
assert(vim.fn.maparg("j", "o") == "")
vim.bo.buftype = "nofile"
vim.cmd("normal j")
assert(vim.fn.line(".") == 2)
vim.cmd("doautocmd InsertEnter")
assert(vim.deep_equal(require("blink.cmp.config").keymap["<Esc>"], { "cancel", "fallback" }))
print("Neovim motion and completion configuration smoke check passed")