Mercurial > vim
comparison src/fold.c @ 1964:7d2641e6af75 v7.2.261
updated for version 7.2-261
author | vimboss |
---|---|
date | Fri, 18 Sep 2009 13:17:09 +0000 |
parents | 30534c76776a |
children | f018c759e4ed |
comparison
equal
deleted
inserted
replaced
1963:9edb57594942 | 1964:7d2641e6af75 |
---|---|
1605 else | 1605 else |
1606 fp->fd_top += amount; | 1606 fp->fd_top += amount; |
1607 } | 1607 } |
1608 else | 1608 else |
1609 { | 1609 { |
1610 /* 2, 3, or 5: need to correct nested folds too */ | |
1611 foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top, | |
1612 line2 - fp->fd_top, amount, amount_after); | |
1613 if (fp->fd_top < top) | 1610 if (fp->fd_top < top) |
1614 { | 1611 { |
1612 /* 2 or 3: need to correct nested folds too */ | |
1613 foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top, | |
1614 line2 - fp->fd_top, amount, amount_after); | |
1615 if (last <= line2) | 1615 if (last <= line2) |
1616 { | 1616 { |
1617 /* 2. fold contains line1, line2 is below fold */ | 1617 /* 2. fold contains line1, line2 is below fold */ |
1618 if (amount == MAXLNUM) | 1618 if (amount == MAXLNUM) |
1619 fp->fd_len = line1 - fp->fd_top; | 1619 fp->fd_len = line1 - fp->fd_top; |
1626 fp->fd_len += amount_after; | 1626 fp->fd_len += amount_after; |
1627 } | 1627 } |
1628 } | 1628 } |
1629 else | 1629 else |
1630 { | 1630 { |
1631 /* 5. fold is below line1 and contains line2 */ | 1631 /* 5. fold is below line1 and contains line2; need to |
1632 * correct nested folds too */ | |
1633 foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top, | |
1634 line2 - fp->fd_top, amount, | |
1635 amount_after + (fp->fd_top - top)); | |
1632 if (amount == MAXLNUM) | 1636 if (amount == MAXLNUM) |
1633 { | 1637 { |
1634 fp->fd_len -= line2 - fp->fd_top + 1; | 1638 fp->fd_len -= line2 - fp->fd_top + 1; |
1635 fp->fd_top = line1; | 1639 fp->fd_top = line1; |
1636 } | 1640 } |