Skip to content

Commit 4c50ce5

Browse files
authored
Merge pull request #609 from 0Delta/update_autocmd
update autocmd.{txt,jax}
2 parents 54c7b9f + 8adeeee commit 4c50ce5

File tree

2 files changed

+57
-17
lines changed

2 files changed

+57
-17
lines changed

doc/autocmd.jax

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim バージョン 8.1. Last change: 2019 Jun 02
1+
*autocmd.txt* For Vim バージョン 8.1. Last change: 2019 Jun 15
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -865,14 +865,36 @@ MenuPopup (マウス右ボタンで)ポップアップメニューを表示す
865865
*OptionSet*
866866
OptionSet オプションが設定された後。パターンは長い(短縮
867867
しない)オプション名に対してマッチする。
868-
変数 |v:option_old| に変更前の値が格納され、
869-
|v:option_new| には新しく設定された値が格納さ
870-
れ、 |v:option_type| にはオプションの変更のス
871-
コープがグローバルかローカルかが格納される。
872868
|<amatch>| は対象のオプション名が設定される。
873869

874-
'key' の変更の際にはあえてイベントが発生しない
875-
ようにしている。
870+
|v:option_type| はオプションの変更のスコープが
871+
グローバルかローカルかが格納される。
872+
|v:option_command| はどのコマンドで値が設定さ
873+
れたかが格納される。(タグのジャンプ先にある表
874+
を参照)
875+
|v:option_new| は新しく設定された値が格納され
876+
る。
877+
|v:option_oldlocal| は変更前のローカルの値が格
878+
納される。
879+
|v:option_oldglobal| は変更前のグローバルの値
880+
が格納される。
881+
|v:option_old| は変更前の値が格納される。
882+
883+
|v:option_oldlocal| には |:set|
884+
|:setlocal||modeline| のいずれかが使用された
885+
場合に値が格納される。同様に
886+
|v:option_oldglobal| には |:set|
887+
|:setglobal| が使用された場合に値が格納される。
888+
889+
|global-local| なオプションと |:set| を利用し
890+
て文字列をセットした場合、|v:option_old| には
891+
古いグローバルの値が格納されるが、それ以外の場
892+
合(例えばローカルな文字列や |global-local|
893+
数値、等)は古いローカルの値が格納されるので注
894+
意。
895+
896+
OptionSet は起動時と 'key' の変更の際にはあえ
897+
てイベントが発生しないようにしている。
876898

877899
使用例: 'backupdir''undodir' で指定された
878900
ディレクトリが存在しているかチェックし、もしな

en/autocmd.txt

Lines changed: 28 additions & 10 deletions
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'

0 commit comments

Comments
 (0)