Skip to content

Commit a330695

Browse files
committed
patch 7.4.1035
Problem: An Ex range gets adjusted for folded lines even when the range is not using line numbers. Solution: Only adjust line numbers for folding. (Christian Brabandt)
1 parent 27a82e3 commit a330695

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

runtime/doc/fold.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*fold.txt* For Vim version 7.4. Last change: 2015 Nov 24
1+
*fold.txt* For Vim version 7.4. Last change: 2016 Jan 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -585,8 +585,9 @@ what you type!
585585
When using an operator, a closed fold is included as a whole. Thus "dl"
586586
deletes the whole closed fold under the cursor.
587587

588-
For Ex commands the range is adjusted to always start at the first line of a
589-
closed fold and end at the last line of a closed fold. Thus this command: >
588+
For Ex commands that work on buffer lines the range is adjusted to always
589+
start at the first line of a closed fold and end at the last line of a closed
590+
fold. Thus this command: >
590591
:s/foo/bar/g
591592
when used with the cursor on a closed fold, will replace "foo" with "bar" in
592593
all lines of the fold.

src/ex_docmd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,8 @@ do_one_cmd(cmdlinep, sourcing,
25432543
correct_range(&ea);
25442544

25452545
#ifdef FEAT_FOLDING
2546-
if (((ea.argt & WHOLEFOLD) || ea.addr_count >= 2) && !global_busy)
2546+
if (((ea.argt & WHOLEFOLD) || ea.addr_count >= 2) && !global_busy
2547+
&& ea.addr_type == ADDR_LINES)
25472548
{
25482549
/* Put the first line at the start of a closed fold, put the last line
25492550
* at the end of a closed fold. */

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
1035,
744746
/**/
745747
1034,
746748
/**/

0 commit comments

Comments
 (0)