summaryrefslogtreecommitdiff
path: root/src/mark.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-14 21:53:58 +0100
committerBram Moolenaar <Bram@vim.org>2017-03-14 21:53:58 +0100
commit88d298aed8682eac872ebfe40df3112a6acd83e8 (patch)
tree26123c3b8e8a4bdfae26c82d2eae76ad0bf16f33 /src/mark.c
parent84be8b66604ef28c0e249284da3c6f0cab1c25ae (diff)
downloadvim-git-88d298aed8682eac872ebfe40df3112a6acd83e8.tar.gz
patch 8.0.0457: using :move messes up manual foldsv8.0.0457
Problem: Using :move messes up manual folds. Solution: Split adjusting marks and folds. Add foldMoveRange(). (neovim patch #6221)
Diffstat (limited to 'src/mark.c')
-rw-r--r--src/mark.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/mark.c b/src/mark.c
index 194125eb0..0d21305bc 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -37,6 +37,8 @@ static void cleanup_jumplist(void);
#ifdef FEAT_VIMINFO
static void write_one_filemark(FILE *fp, xfmark_T *fm, int c1, int c2);
#endif
+static void mark_adjust_internal(linenr_T line1, linenr_T line2, long amount,
+ long amount_after, int adjust_folds);
/*
* Set named mark "c" at current cursor position.
@@ -1029,6 +1031,27 @@ mark_adjust(
long amount,
long amount_after)
{
+ mark_adjust_internal(line1, line2, amount, amount_after, TRUE);
+}
+
+ void
+mark_adjust_nofold(
+ linenr_T line1,
+ linenr_T line2,
+ long amount,
+ long amount_after)
+{
+ mark_adjust_internal(line1, line2, amount, amount_after, FALSE);
+}
+
+ static void
+mark_adjust_internal(
+ linenr_T line1,
+ linenr_T line2,
+ long amount,
+ long amount_after,
+ int adjust_folds UNUSED)
+{
int i;
int fnum = curbuf->b_fnum;
linenr_T *lp;
@@ -1174,7 +1197,8 @@ mark_adjust(
#ifdef FEAT_FOLDING
/* adjust folds */
- foldMarkAdjust(win, line1, line2, amount, amount_after);
+ if (adjust_folds)
+ foldMarkAdjust(win, line1, line2, amount, amount_after);
#endif
}
}