mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
Merge pull request #25249 from neovim/backport-25248-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1915: r_CTRL-C works differently in visual mode
This commit is contained in:
commit
3f796c5410
@ -196,6 +196,7 @@ gR Enter Virtual Replace mode: Each character you type
|
|||||||
|
|
||||||
*v_r*
|
*v_r*
|
||||||
{Visual}r{char} Replace all selected characters by {char}.
|
{Visual}r{char} Replace all selected characters by {char}.
|
||||||
|
CTRL-C will be inserted literally.
|
||||||
|
|
||||||
*v_C*
|
*v_C*
|
||||||
{Visual}["x]C Delete the highlighted lines [into register x] and
|
{Visual}["x]C Delete the highlighted lines [into register x] and
|
||||||
|
@ -169,6 +169,7 @@ If you want to highlight exactly the same area as the last time, you can use
|
|||||||
CTRL-C In Visual mode: Stop Visual mode. When insert mode is
|
CTRL-C In Visual mode: Stop Visual mode. When insert mode is
|
||||||
pending (the mode message shows
|
pending (the mode message shows
|
||||||
"-- (insert) VISUAL --"), it is also stopped.
|
"-- (insert) VISUAL --"), it is also stopped.
|
||||||
|
On MS-Windows, you may need to press CTRL-Break.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
3. Changing the Visual area *visual-change*
|
3. Changing the Visual area *visual-change*
|
||||||
|
@ -4529,7 +4529,7 @@ static void nv_replace(cmdarg_T *cap)
|
|||||||
// Visual mode "r"
|
// Visual mode "r"
|
||||||
if (VIsual_active) {
|
if (VIsual_active) {
|
||||||
if (got_int) {
|
if (got_int) {
|
||||||
reset_VIsual();
|
got_int = false;
|
||||||
}
|
}
|
||||||
if (had_ctrl_v) {
|
if (had_ctrl_v) {
|
||||||
// Use a special (negative) number to make a difference between a
|
// Use a special (negative) number to make a difference between a
|
||||||
|
@ -1575,4 +1575,18 @@ func Test_visual_hl_with_showbreak()
|
|||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_Visual_r_CTRL_C()
|
||||||
|
new
|
||||||
|
" visual r_cmd
|
||||||
|
call setline(1, [' '])
|
||||||
|
call feedkeys("\<c-v>$r\<c-c>", 'tx')
|
||||||
|
call assert_equal([''], getline(1, 1))
|
||||||
|
|
||||||
|
" visual gr_cmd
|
||||||
|
call setline(1, [' '])
|
||||||
|
call feedkeys("\<c-v>$gr\<c-c>", 'tx')
|
||||||
|
call assert_equal([''], getline(1, 1))
|
||||||
|
bw!
|
||||||
|
endfu
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user