diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval/typval.h | 2 | ||||
-rw-r--r-- | src/nvim/mark.c | 14 | ||||
-rw-r--r-- | src/nvim/spellfile.c | 7 | ||||
-rw-r--r-- | src/nvim/testdir/test_python2.vim | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_python3.vim | 15 | ||||
-rw-r--r-- | src/nvim/testdir/test_pyx2.vim | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_pyx3.vim | 8 | ||||
-rw-r--r-- | src/nvim/undo.c | 2 |
8 files changed, 52 insertions, 12 deletions
diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index 02d241f6f5..008453b87f 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -798,7 +798,7 @@ static inline bool tv_get_float_chk(const typval_T *const tv, *ret_f = (float_T)tv->vval.v_number; return true; } - emsgf(_("E808: Number or Float required")); + emsgf("%s", _("E808: Number or Float required")); return false; } diff --git a/src/nvim/mark.c b/src/nvim/mark.c index 93bc497cf0..8b2f342142 100644 --- a/src/nvim/mark.c +++ b/src/nvim/mark.c @@ -179,8 +179,8 @@ void setpcmark(void) } if (jop_flags & JOP_STACK) { - // If we're somewhere in the middle of the jumplist discard everything - // after the current index. + // jumpoptions=stack: if we're somewhere in the middle of the jumplist + // discard everything after the current index. if (curwin->w_jumplistidx < curwin->w_jumplistlen - 1) { // Discard the rest of the jumplist by cutting the length down to // contain nothing beyond the current index. @@ -1214,14 +1214,14 @@ void cleanup_jumplist(win_T *wp, bool checktail) break; } } + bool mustfree; - if (i >= wp->w_jumplistlen) { // not duplicate + if (i >= wp->w_jumplistlen) { // not duplicate mustfree = false; - } else if (i > from + 1) { // non-adjacent duplicate - // When the jump options include "stack", duplicates are only removed from - // the jumplist when they are adjacent. + } else if (i > from + 1) { // non-adjacent duplicate + // jumpoptions=stack: remove duplicates only when adjacent. mustfree = !(jop_flags & JOP_STACK); - } else { // adjacent duplicate + } else { // adjacent duplicate mustfree = true; } diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index 8e4f405d99..14abfda9ff 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -625,7 +625,7 @@ spell_load_file ( switch (scms_ret) { case SP_FORMERROR: case SP_TRUNCERROR: { - emsgf(_("E757: This does not look like a spell file")); + emsgf("%s", _("E757: This does not look like a spell file")); goto endFAIL; } case SP_OTHERERROR: { @@ -2654,8 +2654,9 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) } if (compsylmax != 0) { - if (syllable == NULL) - smsg(_("COMPOUNDSYLMAX used without SYLLABLE")); + if (syllable == NULL) { + smsg("%s", _("COMPOUNDSYLMAX used without SYLLABLE")); + } aff_check_number(spin->si_compsylmax, compsylmax, "COMPOUNDSYLMAX"); spin->si_compsylmax = compsylmax; } diff --git a/src/nvim/testdir/test_python2.vim b/src/nvim/testdir/test_python2.vim index 8d55b59c31..9628a298b9 100644 --- a/src/nvim/testdir/test_python2.vim +++ b/src/nvim/testdir/test_python2.vim @@ -164,3 +164,11 @@ func Test_Write_To_Current_Buffer_Fixes_Cursor_Str() bwipe! endfunction + +func Test_Catch_Exception_Message() + try + py raise RuntimeError( 'TEST' ) + catch /.*/ + call assert_match('^Vim(.*):.*RuntimeError: TEST$', v:exception ) + endtry +endfunc diff --git a/src/nvim/testdir/test_python3.vim b/src/nvim/testdir/test_python3.vim index cd07b0883f..5268dc9d1e 100644 --- a/src/nvim/testdir/test_python3.vim +++ b/src/nvim/testdir/test_python3.vim @@ -164,3 +164,18 @@ func Test_Write_To_Current_Buffer_Fixes_Cursor_Str() bwipe! endfunction + +func Test_Catch_Exception_Message() + try + py3 raise RuntimeError( 'TEST' ) + catch /.*/ + call assert_match('^Vim(.*):.*RuntimeError: TEST$', v:exception ) + endtry +endfunc + +func Test_unicode() + " this crashed Vim once + " set encoding=utf32 + py3 print('hello') + " set encoding=utf8 +endfunc diff --git a/src/nvim/testdir/test_pyx2.vim b/src/nvim/testdir/test_pyx2.vim index 50e57c3bfb..10ff3b6e58 100644 --- a/src/nvim/testdir/test_pyx2.vim +++ b/src/nvim/testdir/test_pyx2.vim @@ -72,3 +72,11 @@ func Test_pyxfile() call assert_match(s:py3pattern, split(var)[0]) endif endfunc + +func Test_Catch_Exception_Message() + try + pyx raise RuntimeError( 'TEST' ) + catch /.*/ + call assert_match('^Vim(.*):.*RuntimeError: TEST$', v:exception ) + endtry +endfunc diff --git a/src/nvim/testdir/test_pyx3.vim b/src/nvim/testdir/test_pyx3.vim index 64546b4688..2044af3abe 100644 --- a/src/nvim/testdir/test_pyx3.vim +++ b/src/nvim/testdir/test_pyx3.vim @@ -72,3 +72,11 @@ func Test_pyxfile() call assert_match(s:py2pattern, split(var)[0]) endif endfunc + +func Test_Catch_Exception_Message() + try + pyx raise RuntimeError( 'TEST' ) + catch /.*/ + call assert_match('^Vim(.*):.*RuntimeError: TEST$', v:exception ) + endtry +endfunc diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 539d42765d..980399a3ef 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -1057,7 +1057,7 @@ void u_write_undo(const char *const name, const bool forceit, buf_T *const buf, if (file_name == NULL) { if (p_verbose > 0) { verbose_enter(); - smsg(_("Cannot write undo file in any directory in 'undodir'")); + smsg("%s", _("Cannot write undo file in any directory in 'undodir'")); verbose_leave(); } return; |