diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-12-23 07:16:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-23 07:16:21 +0100 |
commit | 2ef72437fc2e20ed7eee2520d818d3039b8e52bb (patch) | |
tree | 74ce9d579586d56f8a4fe538cae4f235595c840d /src/nvim/eval.c | |
parent | 2e280dac7df504b0681043647c8cc02abcbcc686 (diff) | |
parent | a16de288c3d3e033ab0cd60fec2a2d2042774685 (diff) | |
download | rneovim-2ef72437fc2e20ed7eee2520d818d3039b8e52bb.tar.gz rneovim-2ef72437fc2e20ed7eee2520d818d3039b8e52bb.tar.bz2 rneovim-2ef72437fc2e20ed7eee2520d818d3039b8e52bb.zip |
Merge #11594 from janlazo/vim-8.0.1767
vim-patch:8.0.1767,8.2.0030
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 04899f2c99..8749c7d8f0 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6626,8 +6626,6 @@ call_func( error = ERROR_NONE; executor_call_lua((const char *)funcname, len, argvars, argcount, rettv); - } else { - error = ERROR_UNKNOWN; } } else if (!builtin_function((const char *)rfname, -1)) { // User defined function. @@ -11797,7 +11795,6 @@ static void f_haslocaldir(typval_T *argvars, typval_T *rettv, FunPtr fptr) break; case kCdScopeGlobal: // The global scope never has a local directory - rettv->vval.v_number = 0; break; case kCdScopeInvalid: // We should never get here @@ -11909,16 +11906,12 @@ static void f_histget(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_histnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - int i; - const char *const history = tv_get_string_chk(&argvars[0]); - - i = history == NULL ? HIST_CMD - 1 : get_histtype(history, strlen(history), - false); + HistoryType i = history == NULL + ? HIST_INVALID + : get_histtype(history, strlen(history), false); if (i != HIST_INVALID) { i = get_history_idx(i); - } else { - i = -1; } rettv->vval.v_number = i; } @@ -17736,9 +17729,7 @@ static void f_strridx(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } - if (lastmatch == NULL) { - rettv->vval.v_number = -1; - } else { + if (lastmatch != NULL) { rettv->vval.v_number = (varnumber_T)(lastmatch - haystack); } } @@ -24076,7 +24067,7 @@ void option_last_set_msg(LastSet last_set) MSG_PUTS(_("\n\tLast set from ")); MSG_PUTS(p); if (last_set.script_ctx.sc_lnum > 0) { - MSG_PUTS(_(" line ")); + MSG_PUTS(_(line_msg)); msg_outnum((long)last_set.script_ctx.sc_lnum); } if (should_free) { |