mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
vim-patch:8.1.0542: shiftwidth() does not take 'vartabstop' into account
Problem: shiftwidth() does not take 'vartabstop' into account.
Solution: Use the cursor position or a position explicitly passed.
Also make >> and << work better with 'vartabstop'. (Christian
Brabandt)
f951416a83
This commit is contained in:
@@ -8849,6 +8849,18 @@ static void f_shellescape(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
*/
|
||||
static void f_shiftwidth(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
rettv->vval.v_number = 0;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN) {
|
||||
long col;
|
||||
|
||||
col = (long)tv_get_number_chk(argvars, NULL);
|
||||
if (col < 0) {
|
||||
return; // type error; errmsg already given
|
||||
}
|
||||
rettv->vval.v_number = get_sw_value_col(curbuf, col);
|
||||
return;
|
||||
}
|
||||
rettv->vval.v_number = get_sw_value(curbuf);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user