mirror of
https://github.com/vim/vim
synced 2025-07-16 01:01:58 +00:00
runtime(doc): clarify how ex ranges are adjusted when acting on folds
closes: #17696 Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@ -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
|
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"
|
When using an operator, a closed fold is included as a whole. Thus "dl"
|
||||||
deletes the whole closed fold under the cursor.
|
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
|
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
|
:s/foo/bar/g
|
||||||
when used with the cursor on a closed fold, will replace "foo" with "bar" in
|
when used with the cursor on a closed fold, will replace "foo" with "bar" in
|
||||||
all lines of the fold.
|
all lines of the fold.
|
||||||
This does not happen for |:folddoopen| and |:folddoclosed|.
|
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
|
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.
|
settings are used again. For manual folding the defined folds are restored.
|
||||||
For all folding methods the manually opened and closed folds are restored.
|
For all folding methods the manually opened and closed folds are restored.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
*repeat.txt* For Vim version 9.1. Last change: 2024 Oct 16
|
*repeat.txt* For Vim version 9.1. Last change: 2025 Jul 09
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@ -233,7 +233,12 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
|||||||
Examples: >
|
Examples: >
|
||||||
:4,5source
|
:4,5source
|
||||||
:10,18source ++clear
|
:10,18source ++clear
|
||||||
<
|
|
||||||
|
< Implementation detail: When sourcing a [range] of
|
||||||
|
lines that falls inside a folded region, the range
|
||||||
|
will be adjusted to the start and end of the fold,
|
||||||
|
but only if a two-address range was used.
|
||||||
|
|
||||||
*:source!*
|
*:source!*
|
||||||
:so[urce]! {file} Read Vim commands from {file}. These are commands
|
:so[urce]! {file} Read Vim commands from {file}. These are commands
|
||||||
that are executed from Normal mode, like you type
|
that are executed from Normal mode, like you type
|
||||||
|
Reference in New Issue
Block a user