Skip to content

Commit 588c934

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents d354527 + ae94315 commit 588c934

File tree

148 files changed

+3986
-1151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+3986
-1151
lines changed

Filelist

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ SRC_ALL = \
120120
src/testdir/sautest/autoload/*.vim \
121121
src/testdir/runtest.vim \
122122
src/testdir/summarize.vim \
123+
src/testdir/check.vim \
123124
src/testdir/shared.vim \
124125
src/testdir/screendump.vim \
125126
src/testdir/view_util.vim \

runtime/doc/autocmd.txt

+28-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim version 8.1. Last change: 2019 Jun 02
1+
*autocmd.txt* For Vim version 8.1. Last change: 2019 Jun 15
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -873,15 +873,33 @@ MenuPopup Just before showing the popup menu (under the
873873
*OptionSet*
874874
OptionSet After setting an option. The pattern is
875875
matched against the long option name.
876-
The |v:option_old| variable indicates the
877-
old option value, |v:option_new| variable
878-
indicates the newly set value, the
879-
|v:option_type| variable indicates whether
880-
it's global or local scoped and |<amatch>|
881-
indicates what option has been set.
882-
883-
Is not triggered on startup and for the 'key'
884-
option for obvious reasons.
876+
|<amatch>| indicates what option has been set.
877+
878+
|v:option_type| indicates whether it's global
879+
or local scoped
880+
|v:option_command| indicates what type of
881+
set/let command was used (follow the tag to
882+
see the table).
883+
|v:option_new| indicates the newly set value.
884+
|v:option_oldlocal| hass the old local value.
885+
|v:option_oldglobal| hass the old global
886+
value
887+
|v:option_old| indicates the old option value.
888+
889+
|v:option_oldlocal| is only set when |:set|
890+
or |:setlocal| or a |modeline| was used to set
891+
the option. Similarly |v:option_oldglobal| is
892+
only set when |:set| or |:setglobal| was used.
893+
894+
Note that when setting a |global-local| string
895+
option with |:set|, then |v:option_old| is the
896+
old global value. However, for all other kinds
897+
of options (local string options, global-local
898+
number options, ...) it is the old local
899+
value.
900+
901+
OptionSet is not triggered on startup and for
902+
the 'key' option for obvious reasons.
885903

886904
Usage example: Check for the existence of the
887905
directory in the 'backupdir' and 'undodir'

runtime/doc/eval.txt

+58-2
Original file line numberDiff line numberDiff line change
@@ -1943,10 +1943,29 @@ v:option_new New value of the option. Valid while executing an |OptionSet|
19431943
autocommand.
19441944
*v:option_old*
19451945
v:option_old Old value of the option. Valid while executing an |OptionSet|
1946-
autocommand.
1946+
autocommand. Depending on the command used for setting and the
1947+
kind of option this is either the local old value or the
1948+
global old value.
1949+
*v:option_oldlocal*
1950+
v:option_oldlocal
1951+
Old local value of the option. Valid while executing an
1952+
|OptionSet| autocommand.
1953+
*v:option_oldglobal*
1954+
v:option_oldglobal
1955+
Old global value of the option. Valid while executing an
1956+
|OptionSet| autocommand.
19471957
*v:option_type*
19481958
v:option_type Scope of the set command. Valid while executing an
19491959
|OptionSet| autocommand. Can be either "global" or "local"
1960+
*v:option_command*
1961+
v:option_command
1962+
Command used to set the option. Valid while executing an
1963+
|OptionSet| autocommand.
1964+
value option was set via ~
1965+
"setlocal" |:setlocal| or ":let l:xxx"
1966+
"setglobal" |:setglobal| or ":let g:xxx"
1967+
"set" |:set| or |:let|
1968+
"modeline" |modeline|
19501969
*v:operator* *operator-variable*
19511970
v:operator The last operator given in Normal mode. This is a single
19521971
character except for commands starting with <g> or <z>,
@@ -2173,6 +2192,17 @@ v:version Version number of Vim: Major version number times 100 plus
21732192
version 5.0 and 5.1 may have a patch 123, but these are
21742193
completely different.
21752194

2195+
*v:versionlong* *versionlong-variable*
2196+
v:versionlong Like v:version, but also including the patchlevel. Version
2197+
8.1 with patch 1234 has value 8011234. This can be used like
2198+
this: >
2199+
if v:versionlong >= 8011234
2200+
< However, if there are gaps in the list of patches included
2201+
this will not work well. This can happen if a recent patch
2202+
was included into an older version, e.g. for a security fix.
2203+
Use the has() function to make sure the patch is actually
2204+
included.
2205+
21762206
*v:vim_did_enter* *vim_did_enter-variable*
21772207
v:vim_did_enter Zero until most of startup is done. It is set to one just
21782208
before |VimEnter| autocommands are triggered.
@@ -11592,7 +11622,33 @@ text...
1159211622
No error message is given for a non-existing
1159311623
variable, also without !.
1159411624
If the system does not support deleting an environment
11595-
variable, it is made emtpy.
11625+
variable, it is made empty.
11626+
11627+
*:cons* *:const*
11628+
:cons[t] {var-name} = {expr1}
11629+
:cons[t] [{name1}, {name2}, ...] = {expr1}
11630+
:cons[t] [{name}, ..., ; {lastname}] = {expr1}
11631+
:cons[t] {var-name} =<< [trim] {marker}
11632+
text...
11633+
text...
11634+
{marker}
11635+
Similar to |:let|, but additionally lock the variable
11636+
after setting the value. This is the same as locking
11637+
the variable with |:lockvar| just after |:let|, thus: >
11638+
:const x = 1
11639+
< is equivalent to: >
11640+
:let x = 1
11641+
:lockvar 1 x
11642+
< This is useful if you want to make sure the variable
11643+
is not modified.
11644+
*E995*
11645+
|:const| does not allow to for changing a variable. >
11646+
:let x = 1
11647+
:const x = 2 " Error!
11648+
< *E996*
11649+
Note that environment variables, option values and
11650+
register values cannot be used here, since they cannot
11651+
be locked.
1159611652

1159711653
:lockv[ar][!] [depth] {name} ... *:lockvar* *:lockv*
1159811654
Lock the internal variable {name}. Locking means that

0 commit comments

Comments
 (0)