mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
vim-patch:8.2.1000: get error when leaving Ex mode with :visual
Problem: Get error when leaving Ex mode with :visual and a CmdLineEnter
autocommand was used.
Solution: Reset ex_pressedreturn. (closes vim/vim#6293)
158ea175a9
This commit is contained in:
parent
d5b9a7d6e8
commit
7339290900
@ -7305,6 +7305,7 @@ do_exedit(
|
|||||||
if (exmode_active && (eap->cmdidx == CMD_visual
|
if (exmode_active && (eap->cmdidx == CMD_visual
|
||||||
|| eap->cmdidx == CMD_view)) {
|
|| eap->cmdidx == CMD_view)) {
|
||||||
exmode_active = FALSE;
|
exmode_active = FALSE;
|
||||||
|
ex_pressedreturn = false;
|
||||||
if (*eap->arg == NUL) {
|
if (*eap->arg == NUL) {
|
||||||
/* Special case: ":global/pat/visual\NLvi-commands" */
|
/* Special case: ":global/pat/visual\NLvi-commands" */
|
||||||
if (global_busy) {
|
if (global_busy) {
|
||||||
|
@ -54,3 +54,29 @@ func Test_ex_mode()
|
|||||||
set sw&
|
set sw&
|
||||||
let &encoding = encoding_save
|
let &encoding = encoding_save
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_ex_mode_errors()
|
||||||
|
" Not allowed to enter ex mode when text is locked
|
||||||
|
au InsertCharPre <buffer> normal! gQ<CR>
|
||||||
|
let caught_e523 = 0
|
||||||
|
try
|
||||||
|
call feedkeys("ix\<esc>", 'xt')
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E523/ " catch E523
|
||||||
|
let caught_e523 = 1
|
||||||
|
endtry
|
||||||
|
call assert_equal(1, caught_e523)
|
||||||
|
au! InsertCharPre
|
||||||
|
|
||||||
|
new
|
||||||
|
au CmdLineEnter * call ExEnterFunc()
|
||||||
|
func ExEnterFunc()
|
||||||
|
|
||||||
|
endfunc
|
||||||
|
call feedkeys("gQvi\r", 'xt')
|
||||||
|
|
||||||
|
au! CmdLineEnter
|
||||||
|
delfunc ExEnterFunc
|
||||||
|
quit
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user