summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-23 22:11:59 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-23 22:11:59 +0200
commit1c6fd1e100fd0457375642ec50d483bcc0f61bb2 (patch)
tree88d15359a046a461250ab7301d0f5216b1616837 /runtime
parent99499b1c05f85f83876b828eea3f6e14f0f407b4 (diff)
patch 8.1.1372: when evaluating 'statusline' the current window is unknownv8.1.1372
Problem: When evaluating 'statusline' the current window is unknown. (Daniel Hahler) Solution: Set "g:actual_curwin" for %{} items. Set "g:statusline_winid" when evaluationg %!. (closes #4406, closes #3299)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/options.txt22
1 files changed, 14 insertions, 8 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 53d72b38c1..2c2afa17c2 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5082,6 +5082,8 @@ A jump table for the options with a short description can be found at |Q_op|.
When on allow some options that are an expression to be set in the
modeline. Check the option for whether it is affected by
'modelineexpr'. Also see |modeline|.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
*'modelines'* *'mls'*
'modelines' 'mls' number (default 5)
@@ -7089,7 +7091,9 @@ A jump table for the options with a short description can be found at |Q_op|.
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()
-< The result can contain %{} items that will be evaluated too.
+< The *g:statusline_winid* variable will be set to the |window-ID| of the
+ window that the status line belongs to.
+ The result can contain %{} items that will be evaluated too.
Note that the "%!" expression is evaluated in the context of the
current window and buffer, while %{} items are evaluated in the
context of the window that the statusline belongs to.
@@ -7192,13 +7196,15 @@ A jump table for the options with a short description can be found at |Q_op|.
become empty. This will make a group like the following disappear
completely from the statusline when none of the flags are set. >
:set statusline=...%(\ [%M%R%H]%)...
-< *g:actual_curbuf*
- Beware that an expression is evaluated each and every time the status
- line is displayed. The current buffer and current window will be set
- temporarily to that of the window (and buffer) whose statusline is
- currently being drawn. The expression will evaluate in this context.
- The variable "g:actual_curbuf" is set to the `bufnr()` number of the
- real current buffer.
+< Beware that an expression is evaluated each and every time the status
+ line is displayed.
+ *g:actual_curbuf* *g:actual_curwin*
+ The current buffer and current window will be set temporarily to that
+ of the window (and buffer) whose statusline is currently being drawn.
+ The expression will evaluate in this context. The variable
+ "g:actual_curbuf" is set to the `bufnr()` number of the real current
+ buffer and "g:actual_curwin" to the |window-ID| of the real current
+ window. These values are strings.
The 'statusline' option will be evaluated in the |sandbox| if set from
a modeline, see |sandbox-option|.