mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #19011 from zeertzjq/vim-8.2.5120
vim-patch:8.2.{5120.5121}
This commit is contained in:
commit
901fde60c6
@ -4057,6 +4057,11 @@ bool current_quote(oparg_T *oap, long count, bool include, int quotechar)
|
|||||||
|
|
||||||
// Find out if we have a quote in the selection.
|
// Find out if we have a quote in the selection.
|
||||||
while (i <= col_end) {
|
while (i <= col_end) {
|
||||||
|
// check for going over the end of the line, which can happen if
|
||||||
|
// the line was changed after the Visual area was selected.
|
||||||
|
if (line[i] == NUL) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (line[i++] == quotechar) {
|
if (line[i++] == quotechar) {
|
||||||
selected_quote = true;
|
selected_quote = true;
|
||||||
break;
|
break;
|
||||||
|
@ -13,15 +13,20 @@ func s:bufwritepost()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
func Test_interrupt()
|
func Test_interrupt()
|
||||||
new Xfile
|
new Xinterrupt
|
||||||
let n = 0
|
let n = 0
|
||||||
try
|
try
|
||||||
au BufWritePre Xfile call s:bufwritepre()
|
au BufWritePre Xinterrupt call s:bufwritepre()
|
||||||
au BufWritePost Xfile call s:bufwritepost()
|
au BufWritePost Xinterrupt call s:bufwritepost()
|
||||||
w!
|
w!
|
||||||
catch /^Vim:Interrupt$/
|
catch /^Vim:Interrupt$/
|
||||||
endtry
|
endtry
|
||||||
call assert_equal(1, s:bufwritepre_called)
|
call assert_equal(1, s:bufwritepre_called)
|
||||||
call assert_equal(0, s:bufwritepost_called)
|
call assert_equal(0, s:bufwritepost_called)
|
||||||
call assert_equal(0, filereadable('Xfile'))
|
call assert_equal(0, filereadable('Xinterrupt'))
|
||||||
|
|
||||||
|
au! BufWritePre
|
||||||
|
au! BufWritePost
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user