diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi index b424392728..8bfe5e6c89 100644 --- a/nsis/gvim.nsi +++ b/nsis/gvim.nsi @@ -219,6 +219,14 @@ Section "Vim executables and runtime files" SetOutPath $0\macros File ${VIMRT}\macros\*.* + SetOutPath $0\macros\hanoi + File ${VIMRT}\macros\hanoi\*.* + SetOutPath $0\macros\life + File ${VIMRT}\macros\life\*.* + SetOutPath $0\macros\maze + File ${VIMRT}\macros\maze\*.* + SetOutPath $0\macros\urm + File ${VIMRT}\macros\urm\*.* SetOutPath $0\pack\dist\opt\dvorak\dvorak File ${VIMRT}\pack\dist\opt\dvorak\dvorak\*.* diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index f42f955f79..25f75d595e 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1219,30 +1219,40 @@ check_due_timer(void) { int save_timer_busy = timer_busy; int save_vgetc_busy = vgetc_busy; - int did_emsg_save = did_emsg; - int called_emsg_save = called_emsg; - int did_throw_save = did_throw; + int save_did_emsg = did_emsg; + int save_called_emsg = called_emsg; int save_must_redraw = must_redraw; + int save_trylevel = trylevel; + int save_did_throw = did_throw; + except_T *save_current_exception = current_exception; + /* Create a scope for running the timer callback, ignoring most of + * the current scope, such as being inside a try/catch. */ timer_busy = timer_busy > 0 || vgetc_busy > 0; vgetc_busy = 0; called_emsg = FALSE; + did_emsg = FALSE; + did_uncaught_emsg = FALSE; must_redraw = 0; + trylevel = 0; + did_throw = FALSE; + current_exception = NULL; + timer->tr_firing = TRUE; timer_callback(timer); timer->tr_firing = FALSE; + timer_next = timer->tr_next; did_one = TRUE; timer_busy = save_timer_busy; vgetc_busy = save_vgetc_busy; - if (called_emsg) - { + if (did_uncaught_emsg) ++timer->tr_emsg_count; - if (!did_throw_save && did_throw && current_exception != NULL) - discard_current_exception(); - } - did_emsg = did_emsg_save; - called_emsg = called_emsg_save; + did_emsg = save_did_emsg; + called_emsg = save_called_emsg; + trylevel = save_trylevel; + did_throw = save_did_throw; + current_exception = save_current_exception; if (must_redraw != 0) need_update_screen = TRUE; must_redraw = must_redraw > save_must_redraw diff --git a/src/globals.h b/src/globals.h index 44d7c5d184..2c83eb3a07 100644 --- a/src/globals.h +++ b/src/globals.h @@ -182,6 +182,10 @@ EXTERN dict_T globvardict; /* Dictionary with g: variables */ #endif EXTERN int did_emsg; /* set by emsg() when the message is displayed or thrown */ +#ifdef FEAT_EVAL +EXTERN int did_uncaught_emsg; /* emsg() was called and did not + cause an exception */ +#endif EXTERN int did_emsg_syntax; /* did_emsg set because of a syntax error */ EXTERN int called_emsg; /* always set by emsg() */ diff --git a/src/message.c b/src/message.c index b06029ef44..889f7a078d 100644 --- a/src/message.c +++ b/src/message.c @@ -609,11 +609,9 @@ emsg(char_u *s) called_emsg = TRUE; - /* - * If "emsg_severe" is TRUE: When an error exception is to be thrown, - * prefer this message over previous messages for the same command. - */ #ifdef FEAT_EVAL + /* If "emsg_severe" is TRUE: When an error exception is to be thrown, + * prefer this message over previous messages for the same command. */ severe = emsg_severe; emsg_severe = FALSE; #endif @@ -684,6 +682,9 @@ emsg(char_u *s) else flush_buffers(FALSE); /* flush internal buffers */ did_emsg = TRUE; /* flag for DoOneCmd() */ +#ifdef FEAT_EVAL + did_uncaught_emsg = TRUE; +#endif } emsg_on_display = TRUE; /* remember there is an error message */ diff --git a/src/term.c b/src/term.c index 3fc4775190..91f7efbadb 100644 --- a/src/term.c +++ b/src/term.c @@ -4586,9 +4586,10 @@ check_termcode( if (col >= 2500) is_not_xterm = TRUE; - /* PuTTY sends 0;136;0 */ + /* PuTTY sends 0;136;0 + * vandyke SecureCRT sends 1;136;0 */ if (version == 136 - && STRNCMP(tp + extra - 2, "0;136;0c", 8) == 0) + && STRNCMP(tp + extra - 3, ";136;0c", 8) == 0) is_not_xterm = TRUE; /* Konsole sends 0;115;0 */ diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim index 0c08a45abf..b0f543f73a 100644 --- a/src/testdir/test_timers.vim +++ b/src/testdir/test_timers.vim @@ -208,6 +208,24 @@ func Test_timer_errors() call assert_equal(3, g:call_count) endfunc +func FuncWithCaughtError(timer) + let g:call_count += 1 + try + doesnotexist + catch + " nop + endtry +endfunc + +func Test_timer_catch_error() + let g:call_count = 0 + let timer = timer_start(10, 'FuncWithCaughtError', {'repeat': 4}) + " Timer will not be stopped. + call WaitFor('g:call_count == 4') + sleep 50m + call assert_equal(4, g:call_count) +endfunc + func FeedAndPeek(timer) call test_feedinput('a') call getchar(1) diff --git a/src/version.c b/src/version.c index d2941f08ac..ba4b9f4e1d 100644 --- a/src/version.c +++ b/src/version.c @@ -784,6 +784,12 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1067, +/**/ + 1066, +/**/ + 1065, /**/ 1064, /**/