Skip to content

Update fold.{txt,jax} #2145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions doc/fold.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*fold.txt* For Vim バージョン 9.1. Last change: 2024 Dec 17
*fold.txt* For Vim バージョン 9.1. Last change: 2025 Jul 09


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

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

Note |:source| のような一部の Ex コマンドでは、範囲は 2 つのアドレスの [range]
を使用する場合にのみ調整されることに注意。
Comment on lines +644 to +645
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの two-address はアドレスとするより指定先 みたいに「指している」の意味を出したいですが、どの訳語もイマイチですね...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文 a two-address:h [range] の表現に寄せて a two line specifiers にしてみました。
vim-jp/issues#1433 (comment)


(同一セッション中で)以前に編集したバッファに対しては、最後の折り畳み設定が再び
使用される。手動折り畳みでは以前に定義された折り畳みが復元される。全ての折り畳
み方法で、手動で開閉した折り畳みは復元される。同じウィンドウで同じバッファが編
Expand Down
9 changes: 6 additions & 3 deletions en/fold.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*fold.txt* For Vim version 9.1. Last change: 2024 Dec 17
*fold.txt* For Vim version 9.1. Last change: 2025 Jul 09


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

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

Note that for some Ex commands like |:source| the range is only adjusted when
using a two-address [range].

When editing a buffer that has been edited before, the last used folding
settings are used again. For manual folding the defined folds are restored.
For all folding methods the manually opened and closed folds are restored.
Expand Down