Mercurial > vim
diff src/eval.c @ 3875:8235ccf121bb v7.3.694
updated for version 7.3.694
Problem: Now that 'shiftwidth' may use the value of 'tabstop' it is not so
easy to use in indent files.
Solution: Add the shiftwidth() function. (so8res)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 21 Oct 2012 00:45:18 +0200 |
parents | 06749e351b1c |
children | c656847932d3 |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -687,6 +687,7 @@ static void f_settabvar __ARGS((typval_T static void f_settabwinvar __ARGS((typval_T *argvars, typval_T *rettv)); static void f_setwinvar __ARGS((typval_T *argvars, typval_T *rettv)); static void f_shellescape __ARGS((typval_T *argvars, typval_T *rettv)); +static void f_shiftwidth __ARGS((typval_T *argvars, typval_T *rettv)); static void f_simplify __ARGS((typval_T *argvars, typval_T *rettv)); #ifdef FEAT_FLOAT static void f_sin __ARGS((typval_T *argvars, typval_T *rettv)); @@ -8051,6 +8052,7 @@ static struct fst {"settabwinvar", 4, 4, f_settabwinvar}, {"setwinvar", 3, 3, f_setwinvar}, {"shellescape", 1, 2, f_shellescape}, + {"shiftwidth", 0, 0, f_shiftwidth}, {"simplify", 1, 1, f_simplify}, #ifdef FEAT_FLOAT {"sin", 1, 1, f_sin}, @@ -16652,6 +16654,17 @@ f_shellescape(argvars, rettv) } /* + * shiftwidth() function + */ + static void +f_shiftwidth(argvars, rettv) + typval_T *argvars; + typval_T *rettv; +{ + rettv->vval.v_number = get_sw_value(); +} + +/* * "simplify()" function */ static void