Skip to content

Commit 8868f07

Browse files
committed
Update by original
1 parent 86042fa commit 8868f07

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

doc/fold.jax

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

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -474,7 +474,7 @@ zk カーソルより上方の折り畳みへ移動する。閉じられた折
474474

475475
折り畳みに対してコマンドを実行する ~
476476

477-
:[range]foldd[oopen] {cmd} *:foldd* *:folddo* *:folddoopen*
477+
:[range]foldd[oopen] {cmd} *:foldd* *:folddo* *:folddoopen*
478478
閉じた折り畳みの中以外の全ての行に対して{cmd}を実行する。
479479
[range]が与えられた時は、その範囲だけが対象となる。
480480
コマンドが各行に対して実行される時にはカーソルはその対象となる

en/fold.txt

Lines changed: 20 additions & 16 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 16
1+
*fold.txt* For Vim version 9.1. Last change: 2024 Dec 17
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -106,7 +106,8 @@ The result of foldexpr then determines the fold level as follows:
106106
"<1", "<2", .. a fold with this level ends at this line
107107
">1", ">2", .. a fold with this level starts at this line
108108

109-
The result values "=", "s" and "a" are more expensive, please see |fold-expr-slow|.
109+
The result values "=", "s" and "a" are more expensive, please see
110+
|fold-expr-slow|.
110111

111112
It is not required to mark the start (end) of a fold with ">1" ("<1"), a fold
112113
will also start (end) when the fold level is higher (lower) than the fold
@@ -122,7 +123,7 @@ For debugging the 'debug' option can be set to "msg", the error messages will
122123
be visible then.
123124

124125
If the 'foldexpr' expression starts with s: or |<SID>|, then it is replaced
125-
with the script ID (|local-function|). Examples: >
126+
with the script ID (|local-function|). Examples: >
126127
set foldexpr=s:MyFoldExpr()
127128
set foldexpr=<SID>SomeFoldExpr()
128129
<
@@ -146,21 +147,23 @@ end in that line.
146147
It may happen that folds are not updated properly. You can use |zx| or |zX|
147148
to force updating folds.
148149

149-
Minimizing Computational Cost *fold-expr-slow*
150+
MINIMIZING COMPUTATIONAL COST *fold-expr-slow*
150151

151152
Due to its computational cost, this fold method can make Vim unresponsive,
152153
especially when the fold level of all lines have to be initially computed.
153154
Afterwards, after each change, Vim restricts the computation of foldlevels
154155
to those lines whose fold level was affected by it (and reuses the known
155156
foldlevels of all the others).
156157

157-
The fold expression should therefore strive to minimize the number of dependent
158-
lines needed for the computation of a given line: For example, try to avoid the
159-
"=", "a" and "s" return values, because these will require the evaluation of the
160-
fold levels on previous lines until an independent fold level is found.
158+
The fold expression should therefore strive to minimize the number of
159+
dependent lines needed for the computation of a given line: For example, try
160+
to avoid the "=", "a" and "s" return values, because these will require the
161+
evaluation of the fold levels on previous lines until an independent fold
162+
level is found.
161163

162-
If this proves difficult, the next best thing could be to cache all fold levels
163-
in a buffer-local variable (b:foldlevels) that is only updated on |b:changedtick|:
164+
If this proves difficult, the next best thing could be to cache all fold
165+
levels in a buffer-local variable (b:foldlevels) that is only updated on
166+
|b:changedtick|:
164167
>vim
165168
vim9script
166169
def MyFoldFunc(): number
@@ -174,8 +177,9 @@ in a buffer-local variable (b:foldlevels) that is only updated on |b:changedtick
174177
enddef
175178
set foldexpr=s:MyFoldFunc()
176179
<
177-
In above example further speedup was gained by using a precompiled Vim9script
178-
function without arguments (that must still use v:lnum). See |expr-option-function|.
180+
In above example further speedup was gained by using a precompiled Vim9 script
181+
function without arguments (that must still use v:lnum). See
182+
|expr-option-function|.
179183

180184
SYNTAX *fold-syntax*
181185

@@ -412,8 +416,8 @@ zX Undo manually opened and closed folds: re-apply 'foldlevel'.
412416
Also forces recomputing folds, like |zx|.
413417

414418
*zm*
415-
zm Fold more: Subtract |v:count1| from 'foldlevel'. If 'foldlevel' was
416-
already zero nothing happens.
419+
zm Fold more: Subtract |v:count1| from 'foldlevel'. If
420+
'foldlevel' was already zero nothing happens.
417421
'foldenable' will be set.
418422

419423
*zM*
@@ -477,7 +481,7 @@ zk Move upwards to the end of the previous fold. A closed fold
477481

478482
EXECUTING COMMANDS ON FOLDS ~
479483

480-
:[range]foldd[oopen] {cmd} *:foldd* *:folddo* *:folddoopen*
484+
:[range]foldd[oopen] {cmd} *:foldd* *:folddo* *:folddoopen*
481485
Execute {cmd} on all lines that are not in a closed fold.
482486
When [range] is given, only these lines are used.
483487
Each time {cmd} is executed the cursor is positioned on the
@@ -567,7 +571,7 @@ When there is room after the text, it is filled with the character specified
567571
by 'fillchars'.
568572

569573
If the 'foldtext' expression starts with s: or |<SID>|, then it is replaced
570-
with the script ID (|local-function|). Examples: >
574+
with the script ID (|local-function|). Examples: >
571575
set foldtext=s:MyFoldText()
572576
set foldtext=<SID>SomeFoldText()
573577
<

0 commit comments

Comments
 (0)