diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-21 20:28:54 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-21 20:28:54 +0200 |
commit | 00f123a56585363cd13f062fd3bb123efcfaa664 (patch) | |
tree | 7c8fb2556c2b395cb4d6035a1b0299f05073e409 /src/evalfunc.c | |
parent | 8e82c057ffb86cec3210ad8a22ad3f21d52e0953 (diff) |
patch 8.1.0313: information about a swap file is unavailablev8.1.0313
Problem: Information about a swap file is unavailable.
Solution: Add swapinfo(). (Enzo Ferber)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 5e7c013979..3c64212061 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -398,6 +398,7 @@ static void f_strdisplaywidth(typval_T *argvars, typval_T *rettv); static void f_strwidth(typval_T *argvars, typval_T *rettv); static void f_submatch(typval_T *argvars, typval_T *rettv); static void f_substitute(typval_T *argvars, typval_T *rettv); +static void f_swapinfo(typval_T *argvars, typval_T *rettv); static void f_synID(typval_T *argvars, typval_T *rettv); static void f_synIDattr(typval_T *argvars, typval_T *rettv); static void f_synIDtrans(typval_T *argvars, typval_T *rettv); @@ -859,6 +860,7 @@ static struct fst {"strwidth", 1, 1, f_strwidth}, {"submatch", 1, 2, f_submatch}, {"substitute", 4, 4, f_substitute}, + {"swapinfo", 1, 1, f_swapinfo}, {"synID", 3, 3, f_synID}, {"synIDattr", 2, 3, f_synIDattr}, {"synIDtrans", 1, 1, f_synIDtrans}, @@ -12314,6 +12316,16 @@ f_substitute(typval_T *argvars, typval_T *rettv) } /* + * "swapinfo(swap_filename)" function + */ + static void +f_swapinfo(typval_T *argvars, typval_T *rettv) +{ + if (rettv_dict_alloc(rettv) == OK) + get_b0_dict(get_tv_string(argvars), rettv->vval.v_dict); +} + +/* * "synID(lnum, col, trans)" function */ static void |