comparison src/testdir/test_visual.vim @ 33299:4c975fa0a442 v9.0.1915

patch 9.0.1915: r_CTRL-C works differently in visual mode Commit: https://github.com/vim/vim/commit/476733f3d06876c7ac105e064108c973a57984d3 Author: Christian Brabandt <cb@256bit.org> Date: Tue Sep 19 20:41:51 2023 +0200 patch 9.0.1915: r_CTRL-C works differently in visual mode Problem: r_CTRL-C works differently in visual mode Solution: Make r_CTRL-C behave consistent in visual mode in terminal and Windows GUI in visual mode, r CTRL-C behaves strange in Unix like environments. It seems to end visual mode, but still is waiting for few more chars, however it never seems to replace it by any characters and eventually just returns back into normal mode. In contrast in Windows GUI mode, r_CTRL-C replaces in the selected area all characters by a literal CTRL-C. Not sure why it behaves like this. It seems in the Windows GUI, got_int is not set and therefore behaves as if any other normal character has been pressed. So remove the special casing of what happens when got_int is set and make it always behave like in Windows GUI mode. Add a test to verify it always behaves like replacing in the selected area each selected character by a literal CTRL-C. closes: #13091 closes: #13112 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Sep 2023 21:00:03 +0200
parents 8325b9a4c732
children 63341afcd329
comparison
equal deleted inserted replaced
33298:b5879bdef29e 33299:4c975fa0a442
1571 " clean up 1571 " clean up
1572 call term_sendkeys(buf, "\<Esc>") 1572 call term_sendkeys(buf, "\<Esc>")
1573 call StopVimInTerminal(buf) 1573 call StopVimInTerminal(buf)
1574 endfunc 1574 endfunc
1575 1575
1576 func Test_Visual_r_CTRL_C()
1577 new
1578 " visual r_cmd
1579 call setline(1, [' '])
1580 call feedkeys("\<c-v>$r\<c-c>", 'tx')
1581 call assert_equal([''], getline(1, 1))
1582
1583 " visual gr_cmd
1584 call setline(1, [' '])
1585 call feedkeys("\<c-v>$gr\<c-c>", 'tx')
1586 call assert_equal([''], getline(1, 1))
1587 bw!
1588 endfu
1589
1576 " vim: shiftwidth=2 sts=2 expandtab 1590 " vim: shiftwidth=2 sts=2 expandtab