From a9a25fda42abdec267e89bf607f35e60806ec092 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 30 Jan 2016 17:42:22 +0100 Subject: vim-patch:7.4.755 Problem: It is not easy to count the number of characters. Solution: Add the skipcc argument to strchars(). (Hirohito Higashi, Ken Takata) https://github.com/vim/vim/commit/641e48c2248ccb3c25a5cdaa3709f16152d8c77d --- src/nvim/eval.c | 29 ++++++++++++++++++++--------- src/nvim/version.c | 2 +- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index a9af7d94c1..969a03fce3 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -3045,12 +3045,13 @@ static int do_lock_var(lval_T *lp, char_u *name_end, int deep, int lock) li = li->li_next; ++lp->ll_n1; } - } else if (lp->ll_list != NULL) - /* (un)lock a List item. */ + } else if (lp->ll_list != NULL) { + // (un)lock a List item. item_lock(&lp->ll_li->li_tv, deep, lock); - else - /* un(lock) a Dictionary item. */ + } else { + // (un)lock a Dictionary item. item_lock(&lp->ll_di->di_tv, deep, lock); + } return ret; } @@ -7337,7 +7338,7 @@ static struct fst { { "sqrt", 1, 1, f_sqrt }, { "str2float", 1, 1, f_str2float }, { "str2nr", 1, 2, f_str2nr }, - { "strchars", 1, 1, f_strchars }, + { "strchars", 1, 2, f_strchars }, { "strdisplaywidth", 1, 2, f_strdisplaywidth }, { "strftime", 1, 2, f_strftime }, { "stridx", 2, 3, f_stridx }, @@ -16213,13 +16214,23 @@ static void f_strlen(typval_T *argvars, typval_T *rettv) static void f_strchars(typval_T *argvars, typval_T *rettv) { char_u *s = get_tv_string(&argvars[0]); + int skipcc = 0; varnumber_T len = 0; + int (*func_mb_ptr2char_adv)(char_u **pp); - while (*s != NUL) { - mb_cptr2char_adv(&s); - ++len; + if (argvars[1].v_type != VAR_UNKNOWN) { + skipcc = get_tv_number_chk(&argvars[1], NULL); + } + if (skipcc < 0 || skipcc > 1) { + EMSG(_(e_invarg)); + } else { + func_mb_ptr2char_adv = skipcc ? mb_ptr2char_adv : mb_cptr2char_adv; + while (*s != NUL) { + func_mb_ptr2char_adv(&s); + ++len; + } + rettv->vval.v_number = len; } - rettv->vval.v_number = len; } /* diff --git a/src/nvim/version.c b/src/nvim/version.c index 425c71d0b3..42b3802ca7 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -533,7 +533,7 @@ static int included_patches[] = { // 758, // 757 NA // 756 NA - // 755, + 755, 754, 753, // 752, -- cgit From b0cfb6905a14b5701ae83149a17bf9408bd33ae4 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 30 Jan 2016 18:40:30 +0100 Subject: vim-patch:7.4.758 Problem: When 'conceallevel' is 1 and quitting the command-line window with CTRL-C the first character ':' is erased. Solution: Reset 'conceallevel' in the command-line window. (Hirohito Higashi) https://github.com/vim/vim/commit/fa67fbe6b84133207271e4ff582c3d589172efd9 --- src/nvim/ex_getln.c | 2 ++ src/nvim/version.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 96bf2c78d2..d015f6b4a0 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -5136,6 +5136,8 @@ static int ex_window(void) /* Don't execute autocommands while deleting the window. */ block_autocmds(); + // Avoid command-line window first character being concealed + curwin->w_p_cole = 0; wp = curwin; bp = curbuf; win_goto(old_curwin); diff --git a/src/nvim/version.c b/src/nvim/version.c index 42b3802ca7..b596345f46 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -530,7 +530,7 @@ static int included_patches[] = { // 761 NA // 760, // 759 NA - // 758, + 758, // 757 NA // 756 NA 755, -- cgit From 0429b7714f2f7c35f81d80c42f7ee7a71f2d0adc Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 30 Jan 2016 18:55:04 +0100 Subject: vim-patch:7.4.760 Problem: Spelling mistakes are not displayed after ":syn spell". Solution: Force a redraw after ":syn spell" command. (Christian Brabandt) https://github.com/vim/vim/commit/5081d202475328a920c0bdcab990e8da84128c13 --- src/nvim/syntax.c | 13 +++++++++---- src/nvim/version.c | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 24422c71fb..b46131b972 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -3004,14 +3004,19 @@ static void syn_cmd_spell(exarg_T *eap, int syncing) return; next = skiptowhite(arg); - if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8) + if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8) { curwin->w_s->b_syn_spell = SYNSPL_TOP; - else if (STRNICMP(arg, "notoplevel", 10) == 0 && next - arg == 10) + } else if (STRNICMP(arg, "notoplevel", 10) == 0 && next - arg == 10) { curwin->w_s->b_syn_spell = SYNSPL_NOTOP; - else if (STRNICMP(arg, "default", 7) == 0 && next - arg == 7) + } else if (STRNICMP(arg, "default", 7) == 0 && next - arg == 7) { curwin->w_s->b_syn_spell = SYNSPL_DEFAULT; - else + } else { EMSG2(_("E390: Illegal argument: %s"), arg); + return; + } + + // assume spell checking changed, force a redraw + redraw_win_later(curwin, NOT_VALID); } /* diff --git a/src/nvim/version.c b/src/nvim/version.c index b596345f46..90ae2e6ce7 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -528,7 +528,7 @@ static int included_patches[] = { // 763 NA // 762 NA // 761 NA - // 760, + 760, // 759 NA 758, // 757 NA -- cgit