Mercurial > vim
comparison runtime/doc/options.txt @ 16740:dc85d49349f7 v8.1.1372
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
commit https://github.com/vim/vim/commit/1c6fd1e100fd0457375642ec50d483bcc0f61bb2
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 23 22:11:59 2019 +0200
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 May 2019 22:15:04 +0200 |
parents | e55c26aaf484 |
children | eda4d65f232c |
comparison
equal
deleted
inserted
replaced
16739:bf8c594e9fde | 16740:dc85d49349f7 |
---|---|
5080 'modelineexpr' 'mle' boolean (default: off) | 5080 'modelineexpr' 'mle' boolean (default: off) |
5081 global | 5081 global |
5082 When on allow some options that are an expression to be set in the | 5082 When on allow some options that are an expression to be set in the |
5083 modeline. Check the option for whether it is affected by | 5083 modeline. Check the option for whether it is affected by |
5084 'modelineexpr'. Also see |modeline|. | 5084 'modelineexpr'. Also see |modeline|. |
5085 This option cannot be set from a |modeline| or in the |sandbox|, for | |
5086 security reasons. | |
5085 | 5087 |
5086 *'modelines'* *'mls'* | 5088 *'modelines'* *'mls'* |
5087 'modelines' 'mls' number (default 5) | 5089 'modelines' 'mls' number (default 5) |
5088 global | 5090 global |
5089 If 'modeline' is on 'modelines' gives the number of lines that is | 5091 If 'modeline' is on 'modelines' gives the number of lines that is |
7087 be given as "%%". Up to 80 items can be specified. *E541* | 7089 be given as "%%". Up to 80 items can be specified. *E541* |
7088 | 7090 |
7089 When the option starts with "%!" then it is used as an expression, | 7091 When the option starts with "%!" then it is used as an expression, |
7090 evaluated and the result is used as the option value. Example: > | 7092 evaluated and the result is used as the option value. Example: > |
7091 :set statusline=%!MyStatusLine() | 7093 :set statusline=%!MyStatusLine() |
7092 < The result can contain %{} items that will be evaluated too. | 7094 < The *g:statusline_winid* variable will be set to the |window-ID| of the |
7095 window that the status line belongs to. | |
7096 The result can contain %{} items that will be evaluated too. | |
7093 Note that the "%!" expression is evaluated in the context of the | 7097 Note that the "%!" expression is evaluated in the context of the |
7094 current window and buffer, while %{} items are evaluated in the | 7098 current window and buffer, while %{} items are evaluated in the |
7095 context of the window that the statusline belongs to. | 7099 context of the window that the statusline belongs to. |
7096 | 7100 |
7097 When there is error while evaluating the option then it will be made | 7101 When there is error while evaluating the option then it will be made |
7190 When all items in a group becomes an empty string (i.e. flags that are | 7194 When all items in a group becomes an empty string (i.e. flags that are |
7191 not set) and a minwid is not set for the group, the whole group will | 7195 not set) and a minwid is not set for the group, the whole group will |
7192 become empty. This will make a group like the following disappear | 7196 become empty. This will make a group like the following disappear |
7193 completely from the statusline when none of the flags are set. > | 7197 completely from the statusline when none of the flags are set. > |
7194 :set statusline=...%(\ [%M%R%H]%)... | 7198 :set statusline=...%(\ [%M%R%H]%)... |
7195 < *g:actual_curbuf* | 7199 < Beware that an expression is evaluated each and every time the status |
7196 Beware that an expression is evaluated each and every time the status | 7200 line is displayed. |
7197 line is displayed. The current buffer and current window will be set | 7201 *g:actual_curbuf* *g:actual_curwin* |
7198 temporarily to that of the window (and buffer) whose statusline is | 7202 The current buffer and current window will be set temporarily to that |
7199 currently being drawn. The expression will evaluate in this context. | 7203 of the window (and buffer) whose statusline is currently being drawn. |
7200 The variable "g:actual_curbuf" is set to the `bufnr()` number of the | 7204 The expression will evaluate in this context. The variable |
7201 real current buffer. | 7205 "g:actual_curbuf" is set to the `bufnr()` number of the real current |
7206 buffer and "g:actual_curwin" to the |window-ID| of the real current | |
7207 window. These values are strings. | |
7202 | 7208 |
7203 The 'statusline' option will be evaluated in the |sandbox| if set from | 7209 The 'statusline' option will be evaluated in the |sandbox| if set from |
7204 a modeline, see |sandbox-option|. | 7210 a modeline, see |sandbox-option|. |
7205 This option cannot be set in a modeline when 'modelineexpr' is off. | 7211 This option cannot be set in a modeline when 'modelineexpr' is off. |
7206 | 7212 |