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)
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 07c88d1..5e6545c 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2308,7 +2308,6 @@
pow({x}, {y}) Float {x} to the power of {y}
prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
printf({fmt}, {expr1}...) String format text
-prompt_addtext({buf}, {expr}) none add text to a prompt buffer
prompt_setcallback({buf}, {expr}) none set prompt callback function
prompt_setinterrupt({buf}, {text}) none set prompt interrupt function
prompt_setprompt({buf}, {text}) none set prompt text
@@ -2386,7 +2385,7 @@
shellescape({string} [, {special}])
String escape {string} for use as shell
command argument
-shiftwidth([{list}]) Number effective value of 'shiftwidth'
+shiftwidth([{col}]) Number effective value of 'shiftwidth'
simplify({filename}) String simplify filename as much as possible
sin({expr}) Float sine of {expr}
sinh({expr}) Float hyperbolic sine of {expr}
@@ -7639,19 +7638,17 @@
< See also |::S|.
-shiftwidth([{list}]) *shiftwidth()*
+shiftwidth([{col}]) *shiftwidth()*
Returns the effective value of 'shiftwidth'. This is the
'shiftwidth' value unless it is zero, in which case it is the
'tabstop' value. This function was introduced with patch
- 7.3.694 in 2012, everybody should have it by now.
+ 7.3.694 in 2012, everybody should have it by now (however it
+ did not allow for the optional {col} argument until 8.1.542).
- When there is one argument {list} this is used as position
- |List| for which to return the 'shiftwidth' value (actually
- only the column number is relevant). This matters for the
- 'vartabstop' feature. For the {list} arguments see |cursor()|
- function. If the 'vartabstop' setting is enabled and no
- {list} argument is given, the current cursor position is
- taken into account.
+ When there is one argument {col} this is used as column number
+ for which to return the 'shiftwidth' value. This matters for the
+ 'vartabstop' feature. If the 'vartabstop' setting is enabled and
+ no {col} argument is given, column 1 will be assumed.
simplify({filename}) *simplify()*