Merge pull request #15234 from janlazo/vim-8.2.3164
vim-patch:8.2.{3164,3167,3192,3208,3213,3214,3225,3231,3243,3246,3247,3250,3253,3256,3260}
This commit is contained in:
commit
337b1b31ac
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1006,6 +1006,9 @@ func Test_Executable()
|
|||
if catcmd =~ '\<sbin\>' && result =~ '\<bin\>'
|
||||
call assert_equal('/' .. substitute(catcmd, '\<sbin\>', '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
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue