summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorshadmansaleh <shadmansaleh3@gmail.com>2021-05-15 17:23:28 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-15 17:23:28 +0200
commit30e3de21fc36153c5f7c9cf9db90bcc60dd67fb9 (patch)
tree009edc4fee70a74a78f74d680a58e0dd1b9ca5b3 /runtime
parentd832c3c56ec7043322ad3e99897e312700fa1d3e (diff)
patch 8.2.2854: custom statusline cannot contain % itemsv8.2.2854
Problem: Custom statusline cannot contain % items. Solution: Add "%{% expr %}". (closes #8190)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/options.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index efab64802e..9cff98da74 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -7339,6 +7339,18 @@ A jump table for the options with a short description can be found at |Q_op|.
Note that there is no '%' before the closing '}'. The
expression cannot contain a '}' character, call a function to
work around that. See |stl-%{| below.
+ {% - This is almost same as { except the result of the expression is
+ re-evaluated as a statusline format string. Thus if the
+ return value of expr contains % items they will get expanded.
+ The expression can contain the } character, the end of
+ expression is denoted by %}.
+ The For example: >
+ func! Stl_filename() abort
+ return "%t"
+ endfunc
+< `stl=%{Stl_filename()}` results in `"%t"`
+ `stl=%{%Stl_filename()%}` results in `"Name of current file"`
+ } - End of `{%` expression
( - Start of item group. Can be used for setting the width and
alignment of a section. Must be followed by %) somewhere.
) - End of item group. No width fields allowed.