-*options.txt* For Vim version 9.1. Last change: 2024 Nov 24
+*options.txt* For Vim version 9.1. Last change: 2024 Nov 27
VIM REFERENCE MANUAL by Bram Moolenaar
All fields except the {item} are optional. A single percent sign can
be given as "%%".
+ *stl-%!*
When the option starts with "%!" then it is used as an expression,
evaluated and the result is used as the option value. Example: >
:set statusline=%!MyStatusLine()
static-tag tagsrch.txt /*static-tag*
status-line windows.txt /*status-line*
statusmsg-variable eval.txt /*statusmsg-variable*
+stl-%! options.txt /*stl-%!*
stl-%{ options.txt /*stl-%{*
str2float() builtin.txt /*str2float()*
str2list() builtin.txt /*str2list()*
-*version9.txt* For Vim version 9.1. Last change: 2024 Nov 14
+*version9.txt* For Vim version 9.1. Last change: 2024 Nov 27
VIM REFERENCE MANUAL by Bram Moolenaar
started via |:Tutor|
- improve the |vimtutor| and add a second chapter for more advanced tips
- allow to pass local Vim script variables to python interpreter |py3eval()|
+- |getwininfo()| now also returns the "leftcol" property for a window
+- 'rulerformat' now supports the |stl-%!| item
*added-9.2*
Added ~
if (wid && *s == '(' && (errmsg = check_stl_option(p_ruf)) == NULL)
ru_wid = wid;
else
- errmsg = check_stl_option(p_ruf);
+ {
+ // Validate the flags in 'rulerformat' only if it doesn't point to
+ // a custom function ("%!" flag).
+ if ((*varp)[1] != '!')
+ errmsg = check_stl_option(p_ruf);
+ }
}
// check 'statusline' or 'tabline' only if it doesn't start with "%!"
else if (rulerformat || s[0] != '%' || s[1] != '!')
--- /dev/null
+> +0&#ffffff0@39
+@22|1|0|,|2|0| @8|3|0|%|
call StopVimInTerminal(buf)
endfunc
+" Test for using "%!" in 'rulerformat' to use a function
+func Test_rulerformat_function()
+ CheckScreendump
+
+ let lines =<< trim END
+ func TestRulerFn()
+ return '10,20%=30%%'
+ endfunc
+ END
+ call writefile(lines, 'Xrulerformat_function', 'D')
+
+ let buf = RunVimInTerminal('-S Xrulerformat_function', #{rows: 2, cols: 40})
+ call term_sendkeys(buf, ":set ruler rulerformat=%!TestRulerFn()\<CR>")
+ call term_sendkeys(buf, ":redraw!\<CR>")
+ call term_wait(buf)
+ call VerifyScreenDump(buf, 'Test_rulerformat_function', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_getcompletion_usercmd()
command! -nargs=* -complete=command TestCompletion echo <q-args>
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 890,
/**/
889,
/**/