diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-02-09 01:41:04 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-02-09 01:41:04 -0500 |
commit | 17ae27190d4589b2a35f44bc6c8b552f4bf06d4e (patch) | |
tree | 63744d41c9c2e3b0fe0eafd55e96d26896bbba82 /src | |
parent | 31aa060bca0084d19eac382408727c5f3b190af3 (diff) | |
parent | 18be6e0b30e64b45d3bcec944ac19a32410da0ee (diff) | |
download | rneovim-17ae27190d4589b2a35f44bc6c8b552f4bf06d4e.tar.gz rneovim-17ae27190d4589b2a35f44bc6c8b552f4bf06d4e.tar.bz2 rneovim-17ae27190d4589b2a35f44bc6c8b552f4bf06d4e.zip |
Merge #4136 vim-patch:7.4.{755,758,760}
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 29 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 2 | ||||
-rw-r--r-- | src/nvim/syntax.c | 13 | ||||
-rw-r--r-- | src/nvim/version.c | 6 |
4 files changed, 34 insertions, 16 deletions
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/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/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 425c71d0b3..90ae2e6ce7 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -528,12 +528,12 @@ static int included_patches[] = { // 763 NA // 762 NA // 761 NA - // 760, + 760, // 759 NA - // 758, + 758, // 757 NA // 756 NA - // 755, + 755, 754, 753, // 752, |