From f4ea9cef92809f18c486d15291de2e4e34d24f5f Mon Sep 17 00:00:00 2001 From: h-east Date: Thu, 10 Jul 2025 20:36:26 +0900 Subject: [PATCH] Update fold.{txt,jax} --- doc/fold.jax | 10 +++++++--- en/fold.txt | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/fold.jax b/doc/fold.jax index 189b8a228..aee28e781 100644 --- a/doc/fold.jax +++ b/doc/fold.jax @@ -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 @@ -633,13 +633,17 @@ zk カーソルより上方の折り畳みへ移動する。閉じられた折 オペレータを使用したときには、閉じた折り畳みは全体が含まれる。だから "dl" は カーソルの下の閉じた折り畳みの全体を削除してしまう。 -バッファの行に作用するExコマンドの作用範囲は、開始位置と終了位置ともに閉じられ -た折り畳みのそれらへ、それぞれ補正される。よって以下のコマンドを: > +バッファ行を操作する Ex コマンドの場合、範囲は常に閉じた折り畳みの最初の行から +始まり、閉じた折り畳みの最後の行で終わるように調整される。つまり、以下のコマン +ドは: > :s/foo/bar/g 閉じた折り畳みへカーソルを合わせて実行すると、折り畳み内の全ての行にある "foo" が "bar" へ置き換えられてしまう。 これは|:folddoopen|と|:folddoclosed|に対してはあてはまらない。 +Note |:source| のような一部の Ex コマンドでは、範囲は 2 つのアドレスの [range] +を使用する場合にのみ調整されることに注意。 + (同一セッション中で)以前に編集したバッファに対しては、最後の折り畳み設定が再び 使用される。手動折り畳みでは以前に定義された折り畳みが復元される。全ての折り畳 み方法で、手動で開閉した折り畳みは復元される。同じウィンドウで同じバッファが編 diff --git a/en/fold.txt b/en/fold.txt index b6cb2a440..961fa57c9 100644 --- a/en/fold.txt +++ b/en/fold.txt @@ -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 @@ -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.