From 34f3c5cc9604e6ef241bd690b94e2f2593d03b55 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 1 Aug 2021 01:53:52 -0400 Subject: [PATCH 1/6] vim-patch:8.2.3167: get E12 in a job callback when searching for tags Problem: Get E12 in a job callback when searching for tags. (Andy Stewart) Solution: Use the sandbox only for executing a command, not for searching. (closes vim/vim#8511) https://github.com/vim/vim/commit/547f94f33098b060da9d62c29d9fcbe9bf1e2b11 N/A patches for version.c: vim-patch:8.2.3164: MS-Windows: reported version lacks patchlevel Problem: MS-Windows: reported version lacks patchlevel, causing some update tools to update too often. (Klaus Frank) Solution: Add the patchlevel to the version. (Christian Brabandt) https://github.com/vim/vim/commit/0894e0d8087aad4d467fd7b3d87b1930fe661916 vim-patch:8.2.3192: build failure with small version Problem: Build failure with small version (Tony Mechelynck). Solution: Remove stray #ifdef. https://github.com/vim/vim/commit/11d7e62f1d29fdd7a88b86131b7bbb853f29fe8b vim-patch:8.2.3208: dynamic library load error does not mention why it failed Problem: Dynamic library load error does not mention why it failed. Solution: Add the error message. (Martin Tournoij, closes vim/vim#8621) https://github.com/vim/vim/commit/1a3e5747b7df7ddda312bbfd18e04fc2122001fb vim-patch:8.2.3214: MS-Windows: passing /D does not set the install location Problem: MS-Windows: passing /D does not set the install location. Solution: Adjust how the installer uses $VIM. Update the documentation. (Christian Brabandt, closes vim/vim#8605) https://github.com/vim/vim/commit/7d60384a00755e5c0112cebeb5e232fc133c9eca vim-patch:8.2.3231: build failure with small features Problem: Build failure with small features. Solution: Adjust #ifdef. https://github.com/vim/vim/commit/9088784972c0ed72997de8752964d6b587218778 vim-patch:8.2.3243: MS-Windows: "edit with multiple Vim" choice is less useful Problem: MS-Windows: the "edit with multiple Vim" choice is not that useful. Solution: Change it to "Edit with multiple tabs". (Michael Soyka, closes vim/vim#8645) https://github.com/vim/vim/commit/83cd0156e01b5befadf12ee66bc26436ee8d023f vim-patch:8.2.3247: using uninitialized memory when checking for crypt method Problem: Using uninitialized memory when checking for crypt method. Solution: Check the header length before using the salt and seed. https://github.com/vim/vim/commit/77ab4e28a26a92628bc85cd580c1bfa2b6230be6 vim-patch:8.2.3250: MS-Windows: cannot build with libsodium Problem: MS-Windows: cannot build with libsodium. Solution: Change FEAT_SODIUM into HAVE_SODIUM. (Christian Brabandt, closes vim/vim#8668, closes vim/vim#8663) https://github.com/vim/vim/commit/1790be6cb6f2edfd8a833dd848b8df02cef599cf vim-patch:8.2.3253: channel test fails randomly Problem: Channel test fails randomly. Solution: Add a sleep after sending the "echoerr" command. (Michael Soyka) https://github.com/vim/vim/commit/890ee4e2be1dca0c07a91f836e26baead952ae7c vim-patch:8.2.3260: build failure with small features Problem: Build failure with small features. Solution: Add #ifdef. https://github.com/vim/vim/commit/335c8c7b206df776b59fb63a1c7f91c8b1425398 --- src/nvim/globals.h | 2 +- src/nvim/tag.c | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 4012cc5897..96acca4ac7 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -501,7 +501,7 @@ EXTERN volatile int full_screen INIT(= false); /// Non-zero when only "safe" commands are allowed, e.g. when sourcing .exrc or /// .vimrc in current directory. -EXTERN int secure INIT(= false); +EXTERN int secure INIT(= 0); /// Non-zero when changing text and jumping to another window/buffer is not /// allowed. diff --git a/src/nvim/tag.c b/src/nvim/tag.c index a236adee06..d6c6b064b2 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -2611,7 +2611,6 @@ static int jumpto_tag( int keep_help // keep help flag (FALSE for cscope) ) { - int save_secure; int save_magic; bool save_p_ws; int save_p_scs, save_p_ic; @@ -2766,9 +2765,6 @@ static int jumpto_tag( curwin->w_set_curswant = true; postponed_split = 0; - save_secure = secure; - secure = 1; - ++sandbox; save_magic = p_magic; p_magic = false; // always execute with 'nomagic' // Save value of no_hlsearch, jumping to a tag is not a real search @@ -2866,21 +2862,26 @@ static int jumpto_tag( * of the line. May need to correct that here. */ check_cursor(); } else { - curwin->w_cursor.lnum = 1; /* start command in line 1 */ + const int save_secure = secure; + + // Setup the sandbox for executing the command from the tags file. + secure = 1; + sandbox++; + curwin->w_cursor.lnum = 1; // start command in line 1 do_cmdline_cmd((char *)pbuf); retval = OK; + + // When the command has done something that is not allowed make sure + // the error message can be seen. + if (secure == 2) { + wait_return(true); + } + secure = save_secure; + sandbox--; } - /* - * When the command has done something that is not allowed make sure - * the error message can be seen. - */ - if (secure == 2) - wait_return(TRUE); - secure = save_secure; p_magic = save_magic; - --sandbox; - /* restore no_hlsearch when keeping the old search pattern */ + // restore no_hlsearch when keeping the old search pattern if (search_options) { set_no_hlsearch(save_no_hlsearch); } From d95e28f5ce9c8a156423bf29900f159ce313de35 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 1 Aug 2021 09:39:05 -0400 Subject: [PATCH 2/6] vim-patch:8.2.3213: NOCOMPOUNDSUGS entry in spell file not tested MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: NOCOMPOUNDSUGS entry in spell file not tested. Solution: Add a test. (Dominique Pellé, closes vim/vim#8624) https://github.com/vim/vim/commit/9c9472ff49b09c3d8f747b330eeb1cdb92bab449 --- src/nvim/testdir/test_spellfile.vim | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/nvim/testdir/test_spellfile.vim b/src/nvim/testdir/test_spellfile.vim index 729467b556..0f48ab8f6f 100644 --- a/src/nvim/testdir/test_spellfile.vim +++ b/src/nvim/testdir/test_spellfile.vim @@ -210,6 +210,52 @@ func Test_spellfile_CHECKCOMPOUNDPATTERN() call delete('XtestCHECKCOMPOUNDPATTERN-utf8.spl') endfunc +" Test NOCOMPOUNDSUGS (see :help spell-NOCOMPOUNDSUGS) +func Test_spellfile_NOCOMPOUNDSUGS() + call writefile(['3', + \ 'one/c', + \ 'two/c', + \ 'three/c'], 'XtestNOCOMPOUNDSUGS.dic') + + " pass 0 tests without NOCOMPOUNDSUGS, pass 1 tests with NOCOMPOUNDSUGS + for pass in [0, 1] + if pass == 0 + call writefile(['COMPOUNDFLAG c'], 'XtestNOCOMPOUNDSUGS.aff') + else + call writefile(['NOCOMPOUNDSUGS', + \ 'COMPOUNDFLAG c'], 'XtestNOCOMPOUNDSUGS.aff') + endif + + mkspell! XtestNOCOMPOUNDSUGS-utf8.spl XtestNOCOMPOUNDSUGS + set spell spelllang=XtestNOCOMPOUNDSUGS-utf8.spl + + for goodword in ['one', 'two', 'three', + \ 'oneone', 'onetwo', 'onethree', + \ 'twoone', 'twotwo', 'twothree', + \ 'threeone', 'threetwo', 'threethree', + \ 'onetwothree', 'onethreetwo', 'twothreeone', 'oneoneone'] + call assert_equal(['', ''], spellbadword(goodword), goodword) + endfor + + for badword in ['four', 'onetwox', 'onexone'] + call assert_equal([badword, 'bad'], spellbadword(badword)) + endfor + + if pass == 0 + call assert_equal(['one', 'oneone'], spellsuggest('onne', 2)) + call assert_equal(['onethree', 'one three'], spellsuggest('onethre', 2)) + else + call assert_equal(['one', 'one one'], spellsuggest('onne', 2)) + call assert_equal(['one three'], spellsuggest('onethre', 2)) + endif + endfor + + set spell& spelllang& + call delete('XtestNOCOMPOUNDSUGS.dic') + call delete('XtestNOCOMPOUNDSUGS.aff') + call delete('XtestNOCOMPOUNDSUGS-utf8.spl') +endfunc + " Test COMMON (better suggestions with common words, see :help spell-COMMON) func Test_spellfile_COMMON() call writefile(['7', From 5e4fcc8b36cc9a618f5476b939830e0c397e1066 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 1 Aug 2021 10:38:51 -0400 Subject: [PATCH 3/6] vim-patch:8.2.3225: incsearch highlighting is attempted halfway a mapping Problem: Incsearch highlighting is attempted halfway a mapping. Solution: Only do incsearch highlighting if keys were typed or there is no more typeahead. https://github.com/vim/vim/commit/ccb148ac63941feba879ea4678aa4713d81494f2 --- src/nvim/ex_getln.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index d3a5c383e5..2b3d773ca4 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2267,7 +2267,7 @@ static int command_line_changed(CommandLineState *s) close_preview_windows(); update_screen(SOME_VALID); // Clear 'inccommand' preview. } else { - if (s->xpc.xp_context == EXPAND_NOTHING) { + if (s->xpc.xp_context == EXPAND_NOTHING && (KeyTyped || vpeekc() == NUL)) { may_do_incsearch_highlighting(s->firstc, s->count, &s->is_state); } } From 20fc0519af073374506b7a2cf4c452c1a9d62146 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 1 Aug 2021 10:45:01 -0400 Subject: [PATCH 4/6] vim-patch:8.2.3246: memory use after free Problem: Memory use after free. Solution: When clearing a string option set the pointer to "empty_option". https://github.com/vim/vim/commit/77111e2bfc7316eb6b1e653386cef6441af806f8 --- src/nvim/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/option.c b/src/nvim/option.c index 95970a77f8..b40ecd22c8 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -770,7 +770,7 @@ void free_all_options(void) } } else if (options[i].var != VAR_WIN && (options[i].flags & P_STRING)) { // buffer-local option: free global value - free_string_option(*(char_u **)options[i].var); + clear_string_option((char_u **)options[i].var); } } } From e98eba9086e703f5e010201ba05a73bcb713f751 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 1 Aug 2021 11:15:21 -0400 Subject: [PATCH 5/6] vim-patch:8.2.3256: executable test may fail on new Ubuntu system Problem: Executable test may fail on new Ubuntu system. Solution: Consider /usr/bin/cat and /bin/cat the same. https://github.com/vim/vim/commit/bf634a0a8b64fda2e53d3e2254fe0ffdc3d67196 --- src/nvim/testdir/test_functions.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index bcf2edcc93..48f97be96b 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1006,6 +1006,9 @@ func Test_Executable() if catcmd =~ '\' && result =~ '\' call assert_equal('/' .. substitute(catcmd, '\', 'bin', ''), result) else + " /bin/cat and /usr/bin/cat may be hard linked, we could get either + let result = substitute(result, '/usr/bin/cat', '/bin/cat', '') + let catcmd = substitute(catcmd, 'usr/bin/cat', 'bin/cat', '') call assert_equal('/' .. catcmd, result) endif bwipe From de74fcc74cee4e4b35335bff6cecea46f36a78f6 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 1 Aug 2021 09:32:10 -0400 Subject: [PATCH 6/6] fixup! remove DYNAMIC_ICONV Code for "DYNAMIC_ICONV" macro was dead since v0.3.0. https://github.com/neovim/neovim/commit/d87e5d70163addaa4ab140425c8bf875ea3b747f --- src/nvim/mbyte.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 9cd57affb9..cba372b9d3 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -73,9 +73,6 @@ struct interval { # include "unicode_tables.generated.h" #endif -char_u e_loadlib[] = "E370: Could not load library %s"; -char_u e_loadfunc[] = "E448: Could not load library function %s"; - // To speed up BYTELEN(); keep a lookup table to quickly get the length in // bytes of a UTF-8 character from the first byte of a UTF-8 string. Bytes // which are illegal when used as the first byte have a 1. The NUL byte has