From 4eef5ac453866dae7c03f5432fc8c4dfcda19f54 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 26 Mar 2023 09:24:04 +0800 Subject: vim-patch:9.0.1428: cursor in wrong position when leaving insert mode (#22786) Problem: Cursor in wrong position when leaving insert mode. Solution: Update the w_valid flags. Position the cursor also when not redrawing. (closes vim/vim#12137) https://github.com/vim/vim/commit/c174c2e58c9e24a75b189e01143e6d057b84e96e Co-authored-by: Bram Moolenaar --- test/functional/legacy/edit_spec.lua | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'test/functional/legacy/edit_spec.lua') diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua index 362d33a0fd..a0d8ca63a2 100644 --- a/test/functional/legacy/edit_spec.lua +++ b/test/functional/legacy/edit_spec.lua @@ -55,4 +55,68 @@ describe('edit', function() =^ | ]]) end) + + -- oldtest: Test_edit_ctrl_r_failed() + it('positioning cursor after CTRL-R expression failed', function() + local screen = Screen.new(60, 6) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {foreground = Screen.colors.Blue}, -- SpecialKey + [2] = {foreground = Screen.colors.SlateBlue}, + [3] = {bold = true}, -- ModeMsg + [4] = {reverse = true, bold = true}, -- MsgSeparator + [5] = {background = Screen.colors.Red, foreground = Screen.colors.White}, -- ErrorMsg + [6] = {foreground = Screen.colors.SeaGreen, bold = true}, -- MoreMsg + }) + screen:attach() + + feed('i') + screen:expect([[ + {1:^"} | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {3:-- INSERT --} | + ]]) + feed('={}') + screen:expect([[ + {1:"} | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + ={2:{}}^ | + ]]) + -- trying to insert a dictionary produces an error + feed('') + screen:expect([[ + {1:"} | + {0:~ }| + {4: }| + ={2:{}} | + {5:E731: using Dictionary as a String} | + {6:Press ENTER or type command to continue}^ | + ]]) + + feed(':') + screen:expect([[ + :^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {3:-- INSERT --} | + ]]) + -- ending Insert mode should put the cursor back on the ':' + feed('') + screen:expect([[ + ^: | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]) + end) end) -- cgit From 75119fcc86e055895af824f7fdbba2f42c1cbbe8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 May 2023 07:02:43 +0800 Subject: vim-patch:8.2.3135: Vim9: builtin function arguments not checked at compile time Problem: Vim9: builtin function arguments not checked at compile time. Solution: Add more type checks. (Yegappan Lakshmanan, closes vim/vim#8539) https://github.com/vim/vim/commit/5b73992d8f82be7ac4b6f46c17f53ffb9640e5fa Co-authored-by: Yegappan Lakshmanan --- test/functional/legacy/edit_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/legacy/edit_spec.lua') diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua index a0d8ca63a2..186bf395cc 100644 --- a/test/functional/legacy/edit_spec.lua +++ b/test/functional/legacy/edit_spec.lua @@ -95,7 +95,7 @@ describe('edit', function() {0:~ }| {4: }| ={2:{}} | - {5:E731: using Dictionary as a String} | + {5:E731: Using a Dictionary as a String} | {6:Press ENTER or type command to continue}^ | ]]) -- cgit From a9a48d6b5f00241e16e7131c997f0117bc5e9047 Mon Sep 17 00:00:00 2001 From: bfredl Date: Sat, 30 Sep 2023 10:31:55 +0200 Subject: refactor(message): simplify msg_puts_display and use batched grid updates msg_puts_display was more complex than necessary in nvim, as in nvim, it no longer talks directly with a terminal. In particular we don't need to scroll the grid before emiting the last char. The TUI already takes care of things like that, for terminals where it matters. --- test/functional/legacy/edit_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/legacy/edit_spec.lua') diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua index 186bf395cc..939999e21b 100644 --- a/test/functional/legacy/edit_spec.lua +++ b/test/functional/legacy/edit_spec.lua @@ -43,7 +43,7 @@ describe('edit', function() {0:~ }| {0:~ }| {0:~ }| - {2:-- INSERT -} | + {2:-- INSERT --}| ]]) feed('=') screen:expect([[ -- cgit