Merge pull request #14355 from janlazo/vim-8.1.2313

vim-patch:8.1.2313,8.2.{2046,2769}
This commit is contained in:
Jan Edmund Lazo 2021-04-15 21:55:56 -04:00 committed by GitHub
commit fe808f02f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 39 additions and 41 deletions

View File

@ -413,6 +413,10 @@ endif
" Lynx config files " Lynx config files
au BufNewFile,BufRead lynx.cfg setf lynx au BufNewFile,BufRead lynx.cfg setf lynx
" Modula-3 configuration language (must be before *.cfg and *makefile)
au BufNewFile,BufRead *.quake,cm3.cfg setf m3quake
au BufNewFile,BufRead m3makefile,m3overrides setf m3build
" Quake " Quake
au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake
au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake
@ -1041,10 +1045,10 @@ au BufNewFile,BufRead *.mod
\ setf modsim3 | \ setf modsim3 |
\ endif \ endif
" Modula 2 (.md removed in favor of Markdown) " Modula-2 (.md removed in favor of Markdown)
au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.mi setf modula2 au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.mi setf modula2
" Modula 3 (.m3, .i3, .mg, .ig) " Modula-3 (.m3, .i3, .mg, .ig)
au BufNewFile,BufRead *.[mi][3g] setf modula3 au BufNewFile,BufRead *.[mi][3g] setf modula3
" Monk " Monk

View File

@ -1844,7 +1844,7 @@ buf_T *buflist_new(char_u *ffname_arg, char_u *sfname_arg, linenr_T lnum,
EMSG(_("W14: Warning: List of file names overflow")); EMSG(_("W14: Warning: List of file names overflow"));
if (emsg_silent == 0) { if (emsg_silent == 0) {
ui_flush(); ui_flush();
os_delay(3000L, true); // make sure it is noticed os_delay(3001L, true); // make sure it is noticed
} }
top_file_num = 1; top_file_num = 1;
} }

View File

@ -68,7 +68,7 @@ void change_warning(int col)
(void)msg_end(); (void)msg_end();
if (msg_silent == 0 && !silent_mode && ui_active()) { if (msg_silent == 0 && !silent_mode && ui_active()) {
ui_flush(); ui_flush();
os_delay(1000L, true); // give the user time to think about it os_delay(1002L, true); // give the user time to think about it
} }
curbuf->b_did_warn = true; curbuf->b_did_warn = true;
redraw_cmdline = false; // don't redraw and erase the message redraw_cmdline = false; // don't redraw and erase the message
@ -109,7 +109,7 @@ void changed(void)
// and don't let the emsg() set msg_scroll. // and don't let the emsg() set msg_scroll.
if (need_wait_return && emsg_silent == 0) { if (need_wait_return && emsg_silent == 0) {
ui_flush(); ui_flush();
os_delay(2000L, true); os_delay(2002L, true);
wait_return(true); wait_return(true);
msg_scroll = save_msg_scroll; msg_scroll = save_msg_scroll;
} else { } else {

View File

@ -2058,7 +2058,7 @@ static bool check_compl_option(bool dict_opt)
vim_beep(BO_COMPL); vim_beep(BO_COMPL);
setcursor(); setcursor();
ui_flush(); ui_flush();
os_delay(2000L, false); os_delay(2004L, false);
} }
return false; return false;
} }

View File

@ -4947,11 +4947,11 @@ int buf_check_timestamp(buf_T *buf)
(void)msg_end(); (void)msg_end();
if (emsg_silent == 0) { if (emsg_silent == 0) {
ui_flush(); ui_flush();
/* give the user some time to think about it */ // give the user some time to think about it
os_delay(1000L, true); os_delay(1004L, true);
/* don't redraw and erase the message */ // don't redraw and erase the message
redraw_cmdline = FALSE; redraw_cmdline = false;
} }
} }
already_warned = TRUE; already_warned = TRUE;

View File

@ -630,9 +630,9 @@ static void normal_redraw_mode_message(NormalState *s)
ui_cursor_shape(); // show different cursor shape ui_cursor_shape(); // show different cursor shape
ui_flush(); ui_flush();
if (msg_scroll || emsg_on_display) { if (msg_scroll || emsg_on_display) {
os_delay(1000L, true); // wait at least one second os_delay(1003L, true); // wait at least one second
} }
os_delay(3000L, false); // wait up to three seconds os_delay(3003L, false); // wait up to three seconds
State = save_State; State = save_State;
msg_scroll = false; msg_scroll = false;

View File

@ -62,6 +62,7 @@ uint64_t os_now(void)
/// @param ignoreinput If true, only SIGINT (CTRL-C) can interrupt. /// @param ignoreinput If true, only SIGINT (CTRL-C) can interrupt.
void os_delay(uint64_t ms, bool ignoreinput) void os_delay(uint64_t ms, bool ignoreinput)
{ {
DLOG("%" PRIu64 " ms", ms);
if (ignoreinput) { if (ignoreinput) {
if (ms > INT_MAX) { if (ms > INT_MAX) {
ms = INT_MAX; ms = INT_MAX;

View File

@ -6227,7 +6227,7 @@ void check_for_delay(int check_msg_scroll)
&& !did_wait_return && !did_wait_return
&& emsg_silent == 0) { && emsg_silent == 0) {
ui_flush(); ui_flush();
os_delay(1000L, true); os_delay(1006L, true);
emsg_on_display = false; emsg_on_display = false;
if (check_msg_scroll) { if (check_msg_scroll) {
msg_scroll = false; msg_scroll = false;

View File

@ -2373,10 +2373,11 @@ showmatch(
* brief pause, unless 'm' is present in 'cpo' and a character is * brief pause, unless 'm' is present in 'cpo' and a character is
* available. * available.
*/ */
if (vim_strchr(p_cpo, CPO_SHOWMATCH) != NULL) if (vim_strchr(p_cpo, CPO_SHOWMATCH) != NULL) {
os_delay(p_mat * 100L, true); os_delay(p_mat * 100L + 8, true);
else if (!char_avail()) } else if (!char_avail()) {
os_delay(p_mat * 100L, false); os_delay(p_mat * 100L + 9, false);
}
curwin->w_cursor = save_cursor; // restore cursor position curwin->w_cursor = save_cursor; // restore cursor position
*so = save_so; *so = save_so;
*siso = save_siso; *siso = save_siso;

View File

@ -625,7 +625,7 @@ do_tag(
} }
if (ic && !msg_scrolled && msg_silent == 0) { if (ic && !msg_scrolled && msg_silent == 0) {
ui_flush(); ui_flush();
os_delay(1000L, true); os_delay(1007L, true);
} }
} }
@ -2853,7 +2853,7 @@ static int jumpto_tag(
MSG(_("E435: Couldn't find tag, just guessing!")); MSG(_("E435: Couldn't find tag, just guessing!"));
if (!msg_scrolled && msg_silent == 0) { if (!msg_scrolled && msg_silent == 0) {
ui_flush(); ui_flush();
os_delay(1000L, true); os_delay(1010L, true);
} }
} }
retval = OK; retval = OK;

View File

@ -276,28 +276,28 @@ func Test_augroup_warning()
augroup TheWarning augroup TheWarning
au VimEnter * echo 'entering' au VimEnter * echo 'entering'
augroup END augroup END
call assert_true(match(execute('au VimEnter'), "TheWarning.*VimEnter") >= 0) call assert_match("TheWarning.*VimEnter", execute('au VimEnter'))
redir => res redir => res
augroup! TheWarning augroup! TheWarning
redir END redir END
call assert_true(match(res, "W19:") >= 0) call assert_match("W19:", res)
call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0) call assert_match("-Deleted-.*VimEnter", execute('au VimEnter'))
" check "Another" does not take the pace of the deleted entry " check "Another" does not take the pace of the deleted entry
augroup Another augroup Another
augroup END augroup END
call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0) call assert_match("-Deleted-.*VimEnter", execute('au VimEnter'))
augroup! Another augroup! Another
" no warning for postpone aucmd delete " no warning for postpone aucmd delete
augroup StartOK augroup StartOK
au VimEnter * call RemoveGroup() au VimEnter * call RemoveGroup()
augroup END augroup END
call assert_true(match(execute('au VimEnter'), "StartOK.*VimEnter") >= 0) call assert_match("StartOK.*VimEnter", execute('au VimEnter'))
redir => res redir => res
doautocmd VimEnter doautocmd VimEnter
redir END redir END
call assert_true(match(res, "W19:") < 0) call assert_notmatch("W19:", res)
au! VimEnter au! VimEnter
endfunc endfunc
@ -325,7 +325,7 @@ func Test_augroup_deleted()
au VimEnter * echo au VimEnter * echo
augroup end augroup end
augroup! x augroup! x
call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0) call assert_match("-Deleted-.*VimEnter", execute('au VimEnter'))
au! VimEnter au! VimEnter
endfunc endfunc

View File

@ -1,15 +1,5 @@
" Tests for 'backspace' settings " Tests for 'backspace' settings
func Exec(expr)
let str=''
try
exec a:expr
catch /.*/
let str=v:exception
endtry
return str
endfunc
func Test_backspace_option() func Test_backspace_option()
set backspace= set backspace=
call assert_equal('', &backspace) call assert_equal('', &backspace)
@ -41,10 +31,10 @@ func Test_backspace_option()
set backspace-=eol set backspace-=eol
call assert_equal('', &backspace) call assert_equal('', &backspace)
" Check the error " Check the error
call assert_equal(0, match(Exec('set backspace=ABC'), '.*E474')) call assert_fails('set backspace=ABC', 'E474:')
call assert_equal(0, match(Exec('set backspace+=def'), '.*E474')) call assert_fails('set backspace+=def', 'E474:')
" NOTE: Vim doesn't check following error... " NOTE: Vim doesn't check following error...
"call assert_equal(0, match(Exec('set backspace-=ghi'), '.*E474')) "call assert_fails('set backspace-=ghi', 'E474:')
" Check backwards compatibility with version 5.4 and earlier " Check backwards compatibility with version 5.4 and earlier
set backspace=0 set backspace=0
@ -55,8 +45,8 @@ func Test_backspace_option()
call assert_equal('2', &backspace) call assert_equal('2', &backspace)
set backspace=3 set backspace=3
call assert_equal('3', &backspace) call assert_equal('3', &backspace)
call assert_false(match(Exec('set backspace=4'), '.*E474')) call assert_fails('set backspace=4', 'E474:')
call assert_false(match(Exec('set backspace=10'), '.*E474')) call assert_fails('set backspace=10', 'E474:')
" Cleared when 'compatible' is set " Cleared when 'compatible' is set
" set compatible " set compatible

View File

@ -275,6 +275,8 @@ let s:filename_checks = {
\ 'lss': ['file.lss'], \ 'lss': ['file.lss'],
\ 'lua': ['file.lua', 'file.rockspec', 'file.nse'], \ 'lua': ['file.lua', 'file.rockspec', 'file.nse'],
\ 'lynx': ['lynx.cfg'], \ 'lynx': ['lynx.cfg'],
\ 'm3build': ['m3makefile', 'm3overrides'],
\ 'm3quake': ['file.quake', 'cm3.cfg'],
\ 'm4': ['file.at'], \ 'm4': ['file.at'],
\ 'mail': ['snd.123', '.letter', '.letter.123', '.followup', '.article', '.article.123', 'pico.123', 'mutt-xx-xxx', 'muttng-xx-xxx', 'ae123.txt', 'file.eml'], \ 'mail': ['snd.123', '.letter', '.letter.123', '.followup', '.article', '.article.123', 'pico.123', 'mutt-xx-xxx', 'muttng-xx-xxx', 'ae123.txt', 'file.eml'],
\ 'mailaliases': ['/etc/mail/aliases', '/etc/aliases'], \ 'mailaliases': ['/etc/mail/aliases', '/etc/aliases'],