diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-23 16:32:15 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-08-23 18:24:14 +0800 |
commit | 0ba27bb51d3297aec43e78050cc3adcf6879db22 (patch) | |
tree | 9ea8990c9bebeca06d5a5e3989f0a70239797610 /runtime | |
parent | 99265d099c2c366eea936438734a323d1fb9b341 (diff) | |
download | rneovim-0ba27bb51d3297aec43e78050cc3adcf6879db22.tar.gz rneovim-0ba27bb51d3297aec43e78050cc3adcf6879db22.tar.bz2 rneovim-0ba27bb51d3297aec43e78050cc3adcf6879db22.zip |
vim-patch:9.0.1710: scrolloff options work slightly different
Problem: sidescrolloff and scrolloff options work slightly
different than other global-local options
Solution: Make it behave consistent for all global-local options
It was noticed, that sidescrolloff and scrolloff options behave
differently in comparison to other global-local window options like
'listchars'
So make those two behave like other global-local options. Also add some
extra documentation for a few special local-window options.
Add a few tests to make sure all global-local window options behave
similar
closes: vim/vim#12956
closes: vim/vim#12643
https://github.com/vim/vim/commit/4a8eb6e7a9df10f79bf95301ced012f0d6a13088
Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/options.txt | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index f04fb2fb51..eea9f2cf4b 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -189,6 +189,8 @@ opt+=val" the expansion is done before the adding or removing. Handling of local options *local-options* +Note: The following also applies to |global-local| options. + Some of the options only apply to a window or buffer. Each window or buffer has its own copy of this option, thus each can have its own value. This allows you to set 'list' in one window but not in another. And set @@ -238,6 +240,30 @@ The options local to a window are remembered for each buffer. This also happens when the buffer is not loaded, but they are lost when the buffer is wiped out |:bwipe|. +Special local window options *special-local-window-option* + +The following local window options won't be copied over when new windows are +created, thus they behave slightly differently: + + Option Reason ~ + 'previewwindow' there can only be a single one + 'scroll' specific to existing window + 'winfixheight' specific to existing window + 'winfixwidth' specific to existing window + +Special local buffer options *special-local-buffer-option* + +The following local buffer options won't be copied over when new buffers are +created, thus they behave slightly differently: + + Option Reason ~ + 'filetype' explicitly set by autocommands + 'syntax' explicitly set by autocommands + 'bufhidden' denote |special-buffers| + 'buftype' denote |special-buffers| + 'readonly' will be detected automatically + 'modified' will be detected automatically + *:setl* *:setlocal* :setl[ocal][!] ... Like ":set" but set only the value local to the current buffer or window. Not all options have a @@ -311,7 +337,6 @@ used. Thus it does the same as: > Note: In the future more global options can be made |global-local|. Using ":setlocal" on a global option might work differently then. - *option-value-function* Some options ('completefunc', 'omnifunc', 'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to a function name or a function @@ -1070,7 +1095,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'bufhidden'* *'bh'* 'bufhidden' 'bh' string (default "") - local to buffer + local to buffer |special-local-buffer-option| This option specifies what happens when a buffer is no longer displayed in a window: <empty> follow the global 'hidden' option @@ -1102,7 +1127,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'buftype'* *'bt'* *E382* 'buftype' 'bt' string (default "") - local to buffer + local to buffer |special-local-buffer-option| The value of this option specifies the type of a buffer: <empty> normal buffer acwrite buffer will always be written with |BufWriteCmd|s @@ -2408,7 +2433,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'filetype'* *'ft'* 'filetype' 'ft' string (default "") - local to buffer + local to buffer |special-local-buffer-option| When this option is set, the FileType autocommand event is triggered. All autocommands that match with the value of this option will be executed. Thus the value of 'filetype' is used in place of the file @@ -4084,7 +4109,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'modified'* *'mod'* *'nomodified'* *'nomod'* 'modified' 'mod' boolean (default off) - local to buffer + local to buffer |special-local-buffer-option| When on, the buffer is considered to be modified. This option is set when: 1. A change was made to the text since it was last written. Using the @@ -4532,7 +4557,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'previewwindow'* *'pvw'* *'nopreviewwindow'* *'nopvw'* *E590* 'previewwindow' 'pvw' boolean (default off) - local to window + local to window |special-local-window-option| Identifies the preview window. Only one window can have this option set. It's normally not set directly, but by using one of the commands |:ptag|, |:pedit|, etc. @@ -4602,7 +4627,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'readonly'* *'ro'* *'noreadonly'* *'noro'* 'readonly' 'ro' boolean (default off) - local to buffer + local to buffer |special-local-buffer-option| If on, writes fail unless you use a '!'. Protects you from accidentally overwriting a file. Default on when Vim is started in read-only mode ("vim -R") or when the executable is called "view". @@ -4864,7 +4889,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'scroll'* *'scr'* 'scroll' 'scr' number (default half the window height) - local to window + local to window |special-local-window-option| Number of lines to scroll with CTRL-U and CTRL-D commands. Will be set to half the number of lines in the window when the window size changes. This may happen when enabling the |status-line| or @@ -6214,7 +6239,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'syntax'* *'syn'* 'syntax' 'syn' string (default "") - local to buffer + local to buffer |special-local-buffer-option| When this option is set, the syntax with this name is loaded, unless syntax highlighting has been switched off with ":syntax off". Otherwise this option does not always reflect the current syntax (the @@ -7081,7 +7106,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'* 'winfixheight' 'wfh' boolean (default off) - local to window + local to window |special-local-window-option| Keep the window height when windows are opened or closed and 'equalalways' is set. Also for |CTRL-W_=|. Set by default for the |preview-window| and |quickfix-window|. @@ -7089,7 +7114,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'winfixwidth'* *'wfw'* *'nowinfixwidth'* *'nowfw'* 'winfixwidth' 'wfw' boolean (default off) - local to window + local to window |special-local-window-option| Keep the window width when windows are opened or closed and 'equalalways' is set. Also for |CTRL-W_=|. The width may be changed anyway when running out of room. |