diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-26 16:33:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-26 16:33:10 +0200 |
commit | 2b4c0181ba5a064b13f4e96e364124245e6f494c (patch) | |
tree | 5235096650cc259e01ecc1c5af2c88eaafacc0a6 /src/nvim/eval.c | |
parent | 52215f57526f27c7752685ae280865ae71105969 (diff) | |
parent | 58d6e2d3cc4c39f7a2c78a3060758bee31f831e4 (diff) | |
download | rneovim-2b4c0181ba5a064b13f4e96e364124245e6f494c.tar.gz rneovim-2b4c0181ba5a064b13f4e96e364124245e6f494c.tar.bz2 rneovim-2b4c0181ba5a064b13f4e96e364124245e6f494c.zip |
Merge #10064 from janlazo/vim-8.1.0211
vim-patch:8.1.{211,307}
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 12e309bfdc..868305c88d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8868,8 +8868,8 @@ static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr) } else { len = strlen(fname); size_t usedlen = 0; - (void)modify_fname((char_u *)mods, &usedlen, (char_u **)&fname, &fbuf, - &len); + (void)modify_fname((char_u *)mods, false, &usedlen, + (char_u **)&fname, &fbuf, &len); } rettv->v_type = VAR_STRING; @@ -17872,6 +17872,25 @@ static void f_winheight(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } +// "winlayout()" function +static void f_winlayout(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + tabpage_T *tp; + + tv_list_alloc_ret(rettv, 2); + + if (argvars[0].v_type == VAR_UNKNOWN) { + tp = curtab; + } else { + tp = find_tabpage((int)tv_get_number(&argvars[0])); + if (tp == NULL) { + return; + } + } + + get_framelayout(tp->tp_topframe, rettv->vval.v_list, true); +} + /* * "winline()" function */ @@ -22623,6 +22642,7 @@ void reset_v_option_vars(void) int modify_fname( char_u *src, // string with modifiers + bool tilde_file, // "~" is a file name, not $HOME size_t *usedlen, // characters after src that are used char_u **fnamep, // file name so far char_u **bufp, // buffer for allocated file name or NULL @@ -22652,8 +22672,8 @@ repeat: || (*fnamep)[1] == '\\' # endif || (*fnamep)[1] == NUL) - #endif + && !(tilde_file && (*fnamep)[1] == NUL) ) { *fnamep = expand_env_save(*fnamep); xfree(*bufp); /* free any allocated file name */ |