mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
Merge pull request #14981 from janlazo/vim-8.2.3081
vim-patch:8.2.{3081,3082,3085,3087,3088,3093,3094,3097,3098}
This commit is contained in:
commit
18bfcfe77f
@ -646,6 +646,9 @@ au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
|
|||||||
" Gedcom
|
" Gedcom
|
||||||
au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
|
au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
|
||||||
|
|
||||||
|
" Gemtext
|
||||||
|
au BufNewFile,BufRead *.gmi,*.gemini setf gemtext
|
||||||
|
|
||||||
" Gift (Moodle)
|
" Gift (Moodle)
|
||||||
autocmd BufRead,BufNewFile *.gift setf gift
|
autocmd BufRead,BufNewFile *.gift setf gift
|
||||||
|
|
||||||
@ -864,6 +867,9 @@ au BufNewFile,BufRead *.json-patch setf json
|
|||||||
" Jupyter Notebook is also json
|
" Jupyter Notebook is also json
|
||||||
au BufNewFile,BufRead *.ipynb setf json
|
au BufNewFile,BufRead *.ipynb setf json
|
||||||
|
|
||||||
|
" JSONC
|
||||||
|
au BufNewFile,BufRead *.jsonc setf jsonc
|
||||||
|
|
||||||
" Kixtart
|
" Kixtart
|
||||||
au BufNewFile,BufRead *.kix setf kix
|
au BufNewFile,BufRead *.kix setf kix
|
||||||
|
|
||||||
|
@ -901,7 +901,10 @@ void handle_swap_exists(bufref_T *old_curbuf)
|
|||||||
if (old_curbuf == NULL
|
if (old_curbuf == NULL
|
||||||
|| !bufref_valid(old_curbuf)
|
|| !bufref_valid(old_curbuf)
|
||||||
|| old_curbuf->br_buf == curbuf) {
|
|| old_curbuf->br_buf == curbuf) {
|
||||||
|
// Block autocommands here because curwin->w_buffer is NULL.
|
||||||
|
block_autocmds();
|
||||||
buf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED);
|
buf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED);
|
||||||
|
unblock_autocmds();
|
||||||
} else {
|
} else {
|
||||||
buf = old_curbuf->br_buf;
|
buf = old_curbuf->br_buf;
|
||||||
}
|
}
|
||||||
|
@ -1186,9 +1186,12 @@ static void win_update(win_T *wp, Providers *providers)
|
|||||||
|
|
||||||
getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc);
|
getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc);
|
||||||
ve_flags = save_ve_flags;
|
ve_flags = save_ve_flags;
|
||||||
++toc;
|
toc++;
|
||||||
if (curwin->w_curswant == MAXCOL)
|
// Highlight to the end of the line, unless 'virtualedit' has
|
||||||
|
// "block".
|
||||||
|
if (curwin->w_curswant == MAXCOL && !(ve_flags & VE_BLOCK)) {
|
||||||
toc = MAXCOL;
|
toc = MAXCOL;
|
||||||
|
}
|
||||||
|
|
||||||
if (fromc != wp->w_old_cursor_fcol
|
if (fromc != wp->w_old_cursor_fcol
|
||||||
|| toc != wp->w_old_cursor_lcol) {
|
|| toc != wp->w_old_cursor_lcol) {
|
||||||
|
@ -9,6 +9,17 @@ func CheckFeature(name)
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Command to check for the absence of a feature.
|
||||||
|
command -nargs=1 CheckNotFeature call CheckNotFeature(<f-args>)
|
||||||
|
func CheckNotFeature(name)
|
||||||
|
if !has(a:name, 1)
|
||||||
|
throw 'Checking for non-existent feature ' .. a:name
|
||||||
|
endif
|
||||||
|
if has(a:name)
|
||||||
|
throw 'Skipped: ' .. a:name .. ' feature present'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Command to check for the presence of a working option.
|
" Command to check for the presence of a working option.
|
||||||
command -nargs=1 CheckOption call CheckOption(<f-args>)
|
command -nargs=1 CheckOption call CheckOption(<f-args>)
|
||||||
func CheckOption(name)
|
func CheckOption(name)
|
||||||
|
@ -192,6 +192,7 @@ let s:filename_checks = {
|
|||||||
\ 'gdb': ['.gdbinit'],
|
\ 'gdb': ['.gdbinit'],
|
||||||
\ 'gdmo': ['file.mo', 'file.gdmo'],
|
\ 'gdmo': ['file.mo', 'file.gdmo'],
|
||||||
\ 'gedcom': ['file.ged', 'lltxxxxx.txt', '/tmp/lltmp', '/tmp/lltmp-file', 'any/tmp/lltmp', 'any/tmp/lltmp-file'],
|
\ 'gedcom': ['file.ged', 'lltxxxxx.txt', '/tmp/lltmp', '/tmp/lltmp-file', 'any/tmp/lltmp', 'any/tmp/lltmp-file'],
|
||||||
|
\ 'gemtext': ['file.gmi', 'file.gemini'],
|
||||||
\ 'gift': ['file.gift'],
|
\ 'gift': ['file.gift'],
|
||||||
\ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG'],
|
\ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG'],
|
||||||
\ 'gitconfig': ['file.git/config', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config', '/etc/gitconfig', '/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config', 'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'],
|
\ 'gitconfig': ['file.git/config', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config', '/etc/gitconfig', '/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config', 'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'],
|
||||||
@ -260,6 +261,7 @@ let s:filename_checks = {
|
|||||||
\ 'jovial': ['file.jov', 'file.j73', 'file.jovial'],
|
\ 'jovial': ['file.jov', 'file.j73', 'file.jovial'],
|
||||||
\ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file'],
|
\ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file'],
|
||||||
\ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb'],
|
\ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb'],
|
||||||
|
\ 'jsonc': ['file.jsonc'],
|
||||||
\ 'jsp': ['file.jsp'],
|
\ 'jsp': ['file.jsp'],
|
||||||
\ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'],
|
\ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'],
|
||||||
\ 'kivy': ['file.kv'],
|
\ 'kivy': ['file.kv'],
|
||||||
|
@ -319,6 +319,7 @@ func Test_swap_prompt_splitwin()
|
|||||||
let buf = RunVimInTerminal('', {'rows': 20})
|
let buf = RunVimInTerminal('', {'rows': 20})
|
||||||
call term_sendkeys(buf, ":set nomore\n")
|
call term_sendkeys(buf, ":set nomore\n")
|
||||||
call term_sendkeys(buf, ":set noruler\n")
|
call term_sendkeys(buf, ":set noruler\n")
|
||||||
|
|
||||||
call term_sendkeys(buf, ":split Xfile1\n")
|
call term_sendkeys(buf, ":split Xfile1\n")
|
||||||
call term_wait(buf)
|
call term_wait(buf)
|
||||||
call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))})
|
call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))})
|
||||||
@ -330,8 +331,19 @@ func Test_swap_prompt_splitwin()
|
|||||||
call term_wait(buf)
|
call term_wait(buf)
|
||||||
call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))})
|
call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))})
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
|
|
||||||
|
" This caused Vim to crash when typing "q".
|
||||||
|
" TODO: it does not actually reproduce the crash.
|
||||||
|
call writefile(['au BufAdd * set virtualedit=all'], 'Xvimrc')
|
||||||
|
|
||||||
|
let buf = RunVimInTerminal('-u Xvimrc Xfile1', {'rows': 20, 'wait_for_ruler': 0})
|
||||||
|
call TermWait(buf)
|
||||||
|
call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:', term_getline(buf, 20))})
|
||||||
|
call term_sendkeys(buf, "q")
|
||||||
|
|
||||||
%bwipe!
|
%bwipe!
|
||||||
call delete('Xfile1')
|
call delete('Xfile1')
|
||||||
|
call delete('Xvimrc')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_swap_symlink()
|
func Test_swap_symlink()
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
source check.vim
|
source check.vim
|
||||||
|
source screendump.vim
|
||||||
|
|
||||||
func Test_block_shift_multibyte()
|
func Test_block_shift_multibyte()
|
||||||
" Uses double-wide character.
|
" Uses double-wide character.
|
||||||
@ -1082,5 +1083,25 @@ func Test_visual_put_blockedit_zy_and_zp()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_visual_block_with_virtualedit()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
call setline(1, ['aaaaaa', 'bbbb', 'cc'])
|
||||||
|
set virtualedit=block
|
||||||
|
normal G
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XTest_block')
|
||||||
|
|
||||||
|
let buf = RunVimInTerminal('-S XTest_block', {'rows': 8, 'cols': 50})
|
||||||
|
call term_sendkeys(buf, "\<C-V>gg$")
|
||||||
|
call VerifyScreenDump(buf, 'Test_visual_block_with_virtualedit', {})
|
||||||
|
|
||||||
|
" clean up
|
||||||
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('XTest_beval')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user