mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
vim-patch:9.1.1464: gv does not work in operator-pending mode (#34534)
Problem: gv does not work in operator-pending mode
(liushapku)
Solution: remove the check for checkclearop in nv_gv_cmd()
(phanium)
fixes: vim/vim#3666
closes: vim/vim#17551
cb27992cda
Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
This commit is contained in:
@ -251,6 +251,7 @@ CHANGED FEATURES *news-changed*
|
|||||||
|
|
||||||
These existing features changed their behavior.
|
These existing features changed their behavior.
|
||||||
|
|
||||||
|
• |gv| works in operator pending mode and does not abort.
|
||||||
• 'smartcase' applies to completion filtering.
|
• 'smartcase' applies to completion filtering.
|
||||||
• 'spellfile' location defaults to `stdpath("data").."/site/spell/"` instead of
|
• 'spellfile' location defaults to `stdpath("data").."/site/spell/"` instead of
|
||||||
the first writable directory in 'runtimepath'.
|
the first writable directory in 'runtimepath'.
|
||||||
|
@ -5157,10 +5157,6 @@ static void nv_suspend(cmdarg_T *cap)
|
|||||||
/// exchange previous and current Visual area.
|
/// exchange previous and current Visual area.
|
||||||
static void nv_gv_cmd(cmdarg_T *cap)
|
static void nv_gv_cmd(cmdarg_T *cap)
|
||||||
{
|
{
|
||||||
if (checkclearop(cap->oap)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (curbuf->b_visual.vi_start.lnum == 0
|
if (curbuf->b_visual.vi_start.lnum == 0
|
||||||
|| curbuf->b_visual.vi_start.lnum > curbuf->b_ml.ml_line_count
|
|| curbuf->b_visual.vi_start.lnum > curbuf->b_ml.ml_line_count
|
||||||
|| curbuf->b_visual.vi_end.lnum == 0) {
|
|| curbuf->b_visual.vi_end.lnum == 0) {
|
||||||
|
@ -2611,8 +2611,14 @@ func Test_normal33_g_cmd2()
|
|||||||
exe "norm! G0\<c-v>4k4ly"
|
exe "norm! G0\<c-v>4k4ly"
|
||||||
exe "norm! gvood"
|
exe "norm! gvood"
|
||||||
call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'fgh', 'fgh', 'fgh', 'fgh', 'fgh'], getline(1,'$'))
|
call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'fgh', 'fgh', 'fgh', 'fgh', 'fgh'], getline(1,'$'))
|
||||||
" gv cannot be used in operator pending mode
|
" gv works in operator pending mode
|
||||||
call assert_beeps('normal! cgv')
|
call assert_nobeep('normal! cgvxyza')
|
||||||
|
call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'xyza', 'xyza', 'xyza', 'xyza', 'xyza'], getline(1,'$'))
|
||||||
|
exe "norm! ^\<c-v>Gydgv..cgvbc"
|
||||||
|
call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'bc', 'bc', 'bc', 'bc', 'bc'], getline(1,'$'))
|
||||||
|
exe "norm! v^GragggUgv"
|
||||||
|
call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'bA', 'AA', 'AA', 'AA', 'Ac'], getline(1,'$'))
|
||||||
|
|
||||||
" gv should beep without a previously selected visual area
|
" gv should beep without a previously selected visual area
|
||||||
new
|
new
|
||||||
call assert_beeps('normal! gv')
|
call assert_beeps('normal! gv')
|
||||||
|
Reference in New Issue
Block a user