From 00ded43a5a85df57abb74f9e3a38a401f6fbd8fd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 3 Mar 2016 11:45:15 +0100 Subject: [PATCH 1/3] patch 7.4.1475 Problem: When using hangulinput with utf-8 a CSI character is misintepreted. Solution: Convert CSI to K_CSI. (SungHyun Nam) --- src/ui.c | 16 ++++++++++++---- src/version.c | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/ui.c b/src/ui.c index be5d8c50fb..3e88758510 100644 --- a/src/ui.c +++ b/src/ui.c @@ -1689,13 +1689,21 @@ push_raw_key(char_u *s, int len) tmpbuf = hangul_string_convert(s, &len); if (tmpbuf != NULL) + { s = tmpbuf; - while (len--) - inbuf[inbufcount++] = *s++; - - if (tmpbuf != NULL) + for (; len--; s++) + { + inbuf[inbufcount++] = *s; + if (*s == CSI) + { + /* Turn CSI into K_CSI. */ + inbuf[inbufcount++] = KS_EXTRA; + inbuf[inbufcount++] = (int)KE_CSI; + } + } vim_free(tmpbuf); + } } #endif diff --git a/src/version.c b/src/version.c index de168020ad..3491a4bad4 100644 --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1475, /**/ 1474, /**/ From f1d2501ebe33e148886c2914acd33140e20ee222 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 3 Mar 2016 12:22:53 +0100 Subject: [PATCH 2/3] patch 7.4.1476 Problem: Function arguments marked as unused while they are not. Solution: Remove UNUSED. (Yegappan Lakshmanan) --- src/diff.c | 2 +- src/eval.c | 8 ++++---- src/ex_cmds2.c | 2 +- src/ex_docmd.c | 4 ++-- src/version.c | 2 ++ src/window.c | 4 ++-- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/diff.c b/src/diff.c index be7e38ccbe..92e1a054e7 100644 --- a/src/diff.c +++ b/src/diff.c @@ -641,7 +641,7 @@ diff_write(buf_T *buf, char_u *fname) */ void ex_diffupdate( - exarg_T *eap UNUSED) /* can be NULL */ + exarg_T *eap) /* can be NULL */ { buf_T *buf; int idx_orig; diff --git a/src/eval.c b/src/eval.c index 794ff685bf..faed315e6b 100644 --- a/src/eval.c +++ b/src/eval.c @@ -9217,7 +9217,7 @@ f_argidx(typval_T *argvars UNUSED, typval_T *rettv) * "arglistid()" function */ static void -f_arglistid(typval_T *argvars UNUSED, typval_T *rettv) +f_arglistid(typval_T *argvars, typval_T *rettv) { win_T *wp; @@ -17782,7 +17782,7 @@ f_round(typval_T *argvars, typval_T *rettv) * "screenattr()" function */ static void -f_screenattr(typval_T *argvars UNUSED, typval_T *rettv) +f_screenattr(typval_T *argvars, typval_T *rettv) { int row; int col; @@ -17802,7 +17802,7 @@ f_screenattr(typval_T *argvars UNUSED, typval_T *rettv) * "screenchar()" function */ static void -f_screenchar(typval_T *argvars UNUSED, typval_T *rettv) +f_screenchar(typval_T *argvars, typval_T *rettv) { int row; int col; @@ -20969,7 +20969,7 @@ f_virtcol(typval_T *argvars, typval_T *rettv) * "visualmode()" function */ static void -f_visualmode(typval_T *argvars UNUSED, typval_T *rettv UNUSED) +f_visualmode(typval_T *argvars, typval_T *rettv) { char_u str[2]; diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 88257ccddd..e1a0dfd11e 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -2033,7 +2033,7 @@ set_arglist(char_u *str) static int do_arglist( char_u *str, - int what UNUSED, + int what, int after UNUSED) /* 0 means before first one */ { garray_T new_ga; diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 9900c1b6de..4aa7f5df73 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -9262,7 +9262,7 @@ ex_bang(exarg_T *eap) * ":undo". */ static void -ex_undo(exarg_T *eap UNUSED) +ex_undo(exarg_T *eap) { if (eap->addr_count == 1) /* :undo 123 */ undo_time(eap->line2, FALSE, FALSE, TRUE); @@ -9759,7 +9759,7 @@ theend: #if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \ || defined(PROTO) int -vim_mkdir_emsg(char_u *name, int prot UNUSED) +vim_mkdir_emsg(char_u *name, int prot) { if (vim_mkdir(name, prot) != 0) { diff --git a/src/version.c b/src/version.c index 3491a4bad4..c11af3f669 100644 --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1476, /**/ 1475, /**/ diff --git a/src/window.c b/src/window.c index ee69921ff9..7dfbe5a991 100644 --- a/src/window.c +++ b/src/window.c @@ -3896,8 +3896,8 @@ leave_tabpage( enter_tabpage( tabpage_T *tp, buf_T *old_curbuf UNUSED, - int trigger_enter_autocmds UNUSED, - int trigger_leave_autocmds UNUSED) + int trigger_enter_autocmds, + int trigger_leave_autocmds) { int old_off = tp->tp_firstwin->w_winrow; win_T *next_prevwin = tp->tp_prevwin; From b5760a1ce5b700fc32b8bd11948ee189a847c59e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 3 Mar 2016 13:10:44 +0100 Subject: [PATCH 3/3] patch 7.4.1477 Problem: Test_reltime is flaky, it depends on timing. Solution: When it fails run it a second time. --- src/testdir/runtest.vim | 41 +++++++++++++++++++++++++++-------------- src/version.c | 2 ++ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index 469a4d3855..0cf50006db 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -72,6 +72,24 @@ function GetAllocId(name) return lnum - top - 1 endfunc +function RunTheTest(test) + echo 'Executing ' . a:test + if exists("*SetUp") + call SetUp() + endif + + call add(s:messages, 'Executing ' . a:test) + let s:done += 1 + try + exe 'call ' . a:test + catch + call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) + endtry + + if exists("*TearDown") + call TearDown() + endif +endfunc " Source the test script. First grab the file name, in case the script " navigates away. g:testname can be used by the tests. @@ -92,6 +110,9 @@ else endtry endif +" Names of flaky tests. +let s:flaky = ['Test_reltime()'] + " Locate Test_ functions and execute them. set nomore redir @q @@ -106,18 +127,13 @@ endif " Execute the tests in alphabetical order. for s:test in sort(s:tests) - echo 'Executing ' . s:test - if exists("*SetUp") - call SetUp() - endif + call RunTheTest(s:test) - call add(s:messages, 'Executing ' . s:test) - let s:done += 1 - try - exe 'call ' . s:test - catch - call add(v:errors, 'Caught exception in ' . s:test . ': ' . v:exception . ' @ ' . v:throwpoint) - endtry + if len(v:errors) > 0 && index(s:flaky, s:test) >= 0 + call add(s:messages, 'Flaky test failed, running it again') + let v:errors = [] + call RunTheTest(s:test) + endif if len(v:errors) > 0 let s:fail += 1 @@ -126,9 +142,6 @@ for s:test in sort(s:tests) let v:errors = [] endif - if exists("*TearDown") - call TearDown() - endif endfor if s:fail == 0 diff --git a/src/version.c b/src/version.c index c11af3f669..a8e3f39cb2 100644 --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1477, /**/ 1476, /**/