diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-11-22 03:08:29 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-11-22 03:08:29 +0100 |
commit | f951416a8396a54bbbe21de1a8b16716428549f2 (patch) | |
tree | 2903bb024e534d4a4c5004beef72f4dc38583b29 /runtime | |
parent | 2b84949ad8f247e5d142e2fb1371b3e37567977a (diff) | |
download | vim-git-f951416a8396a54bbbe21de1a8b16716428549f2.tar.gz |
patch 8.1.0542: shiftwidth() does not take 'vartabstop' into accountv8.1.0542
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)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/change.txt | 8 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 21 |
2 files changed, 17 insertions, 12 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index d6b0242d2..dc3a23c59 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -476,6 +476,10 @@ SHIFTING LINES LEFT OR RIGHT *shift-left-right* *<* <{motion} Shift {motion} lines one 'shiftwidth' leftwards. + If the 'vartabstop' feature is enabled, and the + 'shiftwidth' option is set to zero, the amount of + indent is calculated at the first non-blank character + in the line. *<<* << Shift [count] lines one 'shiftwidth' leftwards. @@ -487,6 +491,10 @@ SHIFTING LINES LEFT OR RIGHT *shift-left-right* *>* >{motion} Shift {motion} lines one 'shiftwidth' rightwards. + If the 'vartabstop' feature is enabled, and the + 'shiftwidth' option is set to zero, the amount of + indent is calculated at the first non-blank character + in the line. *>>* >> Shift [count] lines one 'shiftwidth' rightwards. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 07c88d114..5e6545cbd 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2308,7 +2308,6 @@ perleval({expr}) any evaluate |Perl| expression 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 @@ sha256({string}) String SHA256 checksum of {string} 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 @@ shellescape({string} [, {special}]) *shellescape()* < 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. - - 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. + 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 {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()* |