From d7060183b89742bdb89537beb06201faf05f2fef Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 3 Jul 2021 22:55:09 -0400 Subject: [PATCH 1/5] vim-patch:8.2.3085: JSONC files are not recognized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: JSONC files are not recognized. Solution: Recognize .jsonc files. (Izhak Jakov, closes vim/vim#8500) https://github.com/vim/vim/commit/acbb4b5720fc27b8b07357b763ed4e5a944ae1da N/A patches for version.c: vim-patch:8.2.3081: cannot catch errors in a channel command Problem: Cannot catch errors in a channel command. Solution: Instead of skipping the error make it silent. (closes vim/vim#8477) https://github.com/vim/vim/commit/11a632d60bde616feb298d180108819ebb1d04a0 vim-patch:8.2.3082: a channel command "echoerr" does not show anything Problem: A channel command "echoerr" does not show anything. Solution: Do not use silent errors when using an "echoerr" command. (closes vim/vim#8494) https://github.com/vim/vim/commit/b836f631dba2534efd314a8f77439cebc75acd4e vim-patch:8.2.3094: Test_popup_atcursor_pos() fails without the conceal feature Problem: Test_popup_atcursor_pos() fails without the conceal feature. Solution: Add a check for the conceal feature. (Dominique Pellé, closes vim/vim#8505) https://github.com/vim/vim/commit/c60e959cba03fae9cff9b2674fab646cc70819fc vim-patch:8.2.3098: popup window test is flaky on MS-Windows with GUI Problem: Popup window test is flaky on MS-Windows with GUI. Solution: Skip the check in this situation. https://github.com/vim/vim/commit/999db2346b61e6f6e6fde2d0b56f4646a46b727d --- runtime/filetype.vim | 3 +++ src/nvim/testdir/test_filetype.vim | 1 + 2 files changed, 4 insertions(+) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 2617d8ffc0..981515081e 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -864,6 +864,9 @@ au BufNewFile,BufRead *.json-patch setf json " Jupyter Notebook is also json au BufNewFile,BufRead *.ipynb setf json +" JSONC +au BufNewFile,BufRead *.jsonc setf jsonc + " Kixtart au BufNewFile,BufRead *.kix setf kix diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index eb6151fbe1..591dc251ed 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -260,6 +260,7 @@ let s:filename_checks = { \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'], \ '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'], + \ 'jsonc': ['file.jsonc'], \ 'jsp': ['file.jsp'], \ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'], \ 'kivy': ['file.kv'], From c2a7e445ce6652e986b2018c62cc1d54a9691b29 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 3 Jul 2021 22:59:35 -0400 Subject: [PATCH 2/5] vim-patch:8.2.3087: Gemtext files are not recognized Problem: Gemtext files are not recognized. Solution: Recognize .gmi and .gemini files. (closes vim/vim#8427) https://github.com/vim/vim/commit/fcde67c99fbb6d7294e01b9e87d8d2ae7af31255 --- runtime/filetype.vim | 3 +++ src/nvim/testdir/test_filetype.vim | 1 + 2 files changed, 4 insertions(+) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 981515081e..40d7e8be08 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -646,6 +646,9 @@ au BufNewFile,BufRead *.mo,*.gdmo setf gdmo " Gedcom au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom +" Gemtext +au BufNewFile,BufRead *.gmi,*.gemini setf gemtext + " Gift (Moodle) autocmd BufRead,BufNewFile *.gift setf gift diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 591dc251ed..18b810e63f 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -192,6 +192,7 @@ let s:filename_checks = { \ 'gdb': ['.gdbinit'], \ 'gdmo': ['file.mo', 'file.gdmo'], \ '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'], \ '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'], From 37959e88654c6b8e49de493231f6ff780adab67c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 3 Jul 2021 23:06:30 -0400 Subject: [PATCH 3/5] vim-patch:8.2.3088: with 'virtualedit' set to "block" Visual highlight is wrong Problem: With 'virtualedit' set to "block" Visual highlight is wrong after using "$". (Marco Trosi) Solution: Do not set w_old_cursor_lcol to MAXCOL. (closes vim/vim#8495) https://github.com/vim/vim/commit/9cee4a1c9c69542ccd73bcd2db05920150856361 --- src/nvim/screen.c | 7 +++++-- src/nvim/testdir/test_visual.vim | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 3446a944cd..cab41d1783 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1186,9 +1186,12 @@ static void win_update(win_T *wp, Providers *providers) getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc); ve_flags = save_ve_flags; - ++toc; - if (curwin->w_curswant == MAXCOL) + toc++; + // Highlight to the end of the line, unless 'virtualedit' has + // "block". + if (curwin->w_curswant == MAXCOL && !(ve_flags & VE_BLOCK)) { toc = MAXCOL; + } if (fromc != wp->w_old_cursor_fcol || toc != wp->w_old_cursor_lcol) { diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim index b7c5717bd2..9c62bdb16e 100644 --- a/src/nvim/testdir/test_visual.vim +++ b/src/nvim/testdir/test_visual.vim @@ -2,6 +2,7 @@ source shared.vim source check.vim +source screendump.vim func Test_block_shift_multibyte() " Uses double-wide character. @@ -1082,5 +1083,25 @@ func Test_visual_put_blockedit_zy_and_zp() bw! 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, "\gg$") + call VerifyScreenDump(buf, 'Test_visual_block_with_virtualedit', {}) + + " clean up + call term_sendkeys(buf, "\") + call StopVimInTerminal(buf) + call delete('XTest_beval') +endfunc + " vim: shiftwidth=2 sts=2 expandtab From ce4d424bfc92d7308d1edecd723d2f20cef6c2c0 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 3 Jul 2021 23:19:43 -0400 Subject: [PATCH 4/5] vim-patch:8.2.3093: tablabel_tooltip test fails with Athena MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: tablabel_tooltip test fails with Athena. (Dominique Pellé) Solution: Skip the test when using Athena. (closes vim/vim#8508) https://github.com/vim/vim/commit/fb773a3e0aa9466bb953c29bad0bf4ba34461a40 --- src/nvim/testdir/check.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/nvim/testdir/check.vim b/src/nvim/testdir/check.vim index 7b06e53dd5..14bab33a2f 100644 --- a/src/nvim/testdir/check.vim +++ b/src/nvim/testdir/check.vim @@ -9,6 +9,17 @@ func CheckFeature(name) endif endfunc +" Command to check for the absence of a feature. +command -nargs=1 CheckNotFeature call CheckNotFeature() +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 -nargs=1 CheckOption call CheckOption() func CheckOption(name) From 0d75b0d8d470fdf763743823feb6d9013eff069c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 4 Jul 2021 09:18:19 -0400 Subject: [PATCH 5/5] vim-patch:8.2.3097: crash when using "quit" at recovery prompt Problem: Crash when using "quit" at recovery prompt and autocommands are triggered. Solution: Block autocommands when creating an empty buffer to use as the current buffer. (closes vim/vim#8506) https://github.com/vim/vim/commit/1d97efce0ce31ddf0dd4c1ae2228ef4caee6880c --- src/nvim/buffer.c | 3 +++ src/nvim/testdir/test_swap.vim | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index f1f32076bf..8decd02b3a 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -901,7 +901,10 @@ void handle_swap_exists(bufref_T *old_curbuf) if (old_curbuf == NULL || !bufref_valid(old_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); + unblock_autocmds(); } else { buf = old_curbuf->br_buf; } diff --git a/src/nvim/testdir/test_swap.vim b/src/nvim/testdir/test_swap.vim index f27920d20f..3c191cd7c7 100644 --- a/src/nvim/testdir/test_swap.vim +++ b/src/nvim/testdir/test_swap.vim @@ -319,6 +319,7 @@ func Test_swap_prompt_splitwin() let buf = RunVimInTerminal('', {'rows': 20}) call term_sendkeys(buf, ":set nomore\n") call term_sendkeys(buf, ":set noruler\n") + call term_sendkeys(buf, ":split Xfile1\n") 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))}) @@ -330,8 +331,19 @@ func Test_swap_prompt_splitwin() call term_wait(buf) call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))}) 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! call delete('Xfile1') + call delete('Xvimrc') endfunc func Test_swap_symlink()