Skip to content

Commit 461a3ac

Browse files
authored
Merge pull request #2145 from h-east/update-fold
Update fold.{txt,jax}
2 parents 18a58a7 + f4ea9ce commit 461a3ac

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

doc/fold.jax

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*fold.txt* For Vim バージョン 9.1. Last change: 2024 Dec 17
1+
*fold.txt* For Vim バージョン 9.1. Last change: 2025 Jul 09
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -633,13 +633,17 @@ zk カーソルより上方の折り畳みへ移動する。閉じられた折
633633
オペレータを使用したときには、閉じた折り畳みは全体が含まれる。だから "dl" は
634634
カーソルの下の閉じた折り畳みの全体を削除してしまう。
635635

636-
バッファの行に作用するExコマンドの作用範囲は、開始位置と終了位置ともに閉じられ
637-
た折り畳みのそれらへ、それぞれ補正される。よって以下のコマンドを: >
636+
バッファ行を操作する Ex コマンドの場合、範囲は常に閉じた折り畳みの最初の行から
637+
始まり、閉じた折り畳みの最後の行で終わるように調整される。つまり、以下のコマン
638+
ドは: >
638639
:s/foo/bar/g
639640
閉じた折り畳みへカーソルを合わせて実行すると、折り畳み内の全ての行にある "foo"
640641
が "bar" へ置き換えられてしまう。
641642
これは|:folddoopen||:folddoclosed|に対してはあてはまらない。
642643

644+
Note |:source| のような一部の Ex コマンドでは、範囲は 2 つのアドレスの [range]
645+
を使用する場合にのみ調整されることに注意。
646+
643647
(同一セッション中で)以前に編集したバッファに対しては、最後の折り畳み設定が再び
644648
使用される。手動折り畳みでは以前に定義された折り畳みが復元される。全ての折り畳
645649
み方法で、手動で開閉した折り畳みは復元される。同じウィンドウで同じバッファが編

en/fold.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*fold.txt* For Vim version 9.1. Last change: 2024 Dec 17
1+
*fold.txt* For Vim version 9.1. Last change: 2025 Jul 09
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -642,14 +642,17 @@ what you type!
642642
When using an operator, a closed fold is included as a whole. Thus "dl"
643643
deletes the whole closed fold under the cursor.
644644

645-
For Ex commands that work on buffer lines the range is adjusted to always
645+
For Ex commands that operate on buffer lines, the range is adjusted to always
646646
start at the first line of a closed fold and end at the last line of a closed
647-
fold. Thus this command: >
647+
fold. Thus, this command: >
648648
:s/foo/bar/g
649649
when used with the cursor on a closed fold, will replace "foo" with "bar" in
650650
all lines of the fold.
651651
This does not happen for |:folddoopen| and |:folddoclosed|.
652652

653+
Note that for some Ex commands like |:source| the range is only adjusted when
654+
using a two-address [range].
655+
653656
When editing a buffer that has been edited before, the last used folding
654657
settings are used again. For manual folding the defined folds are restored.
655658
For all folding methods the manually opened and closed folds are restored.

0 commit comments

Comments
 (0)