@@ -1932,6 +1932,7 @@ setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
19321932shellescape( {string} [, {special} ])
19331933 String escape {string} for use as shell
19341934 command argument
1935+ shiftwidth() Number effective value of 'shiftwidth'
19351936simplify( {filename} ) String simplify filename as much as possible
19361937sin( {expr} ) Float sine of {expr}
19371938sinh( {expr} ) Float hyperbolic sine of {expr}
@@ -3754,10 +3755,10 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()*
37543755 Like | input() | , but when the GUI is running and text dialogs
37553756 are supported, a dialog window pops up to input the text.
37563757 Example: >
3757- :let n = inputdialog("value for shiftwidth", &sw )
3758- :if n != ""
3759- : let &sw = n
3760- :endif
3758+ :let n = inputdialog("value for shiftwidth", shiftwidth() )
3759+ :if n != ""
3760+ : let &sw = n
3761+ :endif
37613762< When the dialog is cancelled {cancelreturn} is returned. When
37623763 omitted an empty string is returned.
37633764 Hitting <Enter> works like pressing the OK button. Hitting
@@ -5331,6 +5332,23 @@ shellescape({string} [, {special}]) *shellescape()*
53315332 :call system("chmod +w -- " . shellescape(expand("%")))
53325333
53335334
5335+ shiftwidth() *shiftwidth()*
5336+ Returns the effective value of 'shiftwidth' . This is the
5337+ 'shiftwidth' value unless it is zero, in which case it is the
5338+ 'tabstop' value. To be backwards compatible in indent
5339+ plugins, use this: >
5340+ if exists('*shiftwidth')
5341+ func s:sw()
5342+ return shiftwidth()
5343+ endfunc
5344+ else
5345+ func s:sw()
5346+ return &sw
5347+ endfunc
5348+ endif
5349+ < And then use s:sw() instead of &sw.
5350+
5351+
53345352simplify({filename} ) *simplify()*
53355353 Simplify the file name as much as possible without changing
53365354 the meaning. Shortcuts (on MS-Windows) or symbolic links (on
0 commit comments