diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-30 01:26:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-30 01:26:33 +0200 |
commit | 63526f2eeee774c657270a1ec0cbd788480f14b7 (patch) | |
tree | bacf8807780792b4a8dfaf0480f80e91cf4fe35e /src/nvim/eval.c | |
parent | a0d723db55cf2b81e3bd9271cda9b1b58a5c9f3c (diff) | |
parent | aac731c22b94117aea2257d4f19fd1f0930a2385 (diff) | |
download | rneovim-63526f2eeee774c657270a1ec0cbd788480f14b7.tar.gz rneovim-63526f2eeee774c657270a1ec0cbd788480f14b7.tar.bz2 rneovim-63526f2eeee774c657270a1ec0cbd788480f14b7.zip |
Merge #9956 from justinmk/vim-8.1.1231
vim-patch:8.1.1231, swap-related patches
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 19324acd5c..4d66e34a70 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -5221,7 +5221,7 @@ bool garbage_collect(bool testing) (void)garbage_collect(testing); } } else if (p_verbose > 0) { - verb_msg((char_u *)_( + verb_msg(_( "Not enough memory to set references, garbage collection aborted!")); } #undef ABORTING @@ -11474,25 +11474,21 @@ static void f_inputlist(typval_T *argvars, typval_T *rettv, FunPtr fptr) static garray_T ga_userinput = {0, 0, sizeof(tasave_T), 4, NULL}; -/* - * "inputrestore()" function - */ +/// "inputrestore()" function static void f_inputrestore(typval_T *argvars, typval_T *rettv, FunPtr fptr) { if (!GA_EMPTY(&ga_userinput)) { - --ga_userinput.ga_len; + ga_userinput.ga_len--; restore_typeahead((tasave_T *)(ga_userinput.ga_data) - + ga_userinput.ga_len); - /* default return is zero == OK */ + + ga_userinput.ga_len); + // default return is zero == OK } else if (p_verbose > 1) { - verb_msg((char_u *)_("called inputrestore() more often than inputsave()")); - rettv->vval.v_number = 1; /* Failed */ + verb_msg(_("called inputrestore() more often than inputsave()")); + rettv->vval.v_number = 1; // Failed } } -/* - * "inputsave()" function - */ +/// "inputsave()" function static void f_inputsave(typval_T *argvars, typval_T *rettv, FunPtr fptr) { // Add an entry to the stack of typeahead storage. @@ -11500,9 +11496,7 @@ static void f_inputsave(typval_T *argvars, typval_T *rettv, FunPtr fptr) save_typeahead(p); } -/* - * "inputsecret()" function - */ +/// "inputsecret()" function static void f_inputsecret(typval_T *argvars, typval_T *rettv, FunPtr fptr) { cmdline_star++; @@ -16423,6 +16417,27 @@ static void f_substitute(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } +/// "swapinfo(swap_filename)" function +static void f_swapinfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + tv_dict_alloc_ret(rettv); + get_b0_dict(tv_get_string(argvars), rettv->vval.v_dict); +} + +/// "swapname(expr)" function +static void f_swapname(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + rettv->v_type = VAR_STRING; + buf_T *buf = tv_get_buf(&argvars[0], false); + if (buf == NULL + || buf->b_ml.ml_mfp == NULL + || buf->b_ml.ml_mfp->mf_fname == NULL) { + rettv->vval.v_string = NULL; + } else { + rettv->vval.v_string = vim_strsave(buf->b_ml.ml_mfp->mf_fname); + } +} + /// "synID(lnum, col, trans)" function static void f_synID(typval_T *argvars, typval_T *rettv, FunPtr fptr) { |