comparison src/mark.c @ 11140:6b26e044b6f5 v8.0.0457

patch 8.0.0457: using :move messes up manual folds commit https://github.com/vim/vim/commit/88d298aed8682eac872ebfe40df3112a6acd83e8 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 14 21:53:58 2017 +0100 patch 8.0.0457: using :move messes up manual folds Problem: Using :move messes up manual folds. Solution: Split adjusting marks and folds. Add foldMoveRange(). (neovim patch #6221)
author Christian Brabandt <cb@256bit.org>
date Tue, 14 Mar 2017 22:00:05 +0100
parents 506f5d8b7d8b
children 501f46f7644c
comparison
equal deleted inserted replaced
11139:30a2d8730a13 11140:6b26e044b6f5
35 static void cleanup_jumplist(void); 35 static void cleanup_jumplist(void);
36 #endif 36 #endif
37 #ifdef FEAT_VIMINFO 37 #ifdef FEAT_VIMINFO
38 static void write_one_filemark(FILE *fp, xfmark_T *fm, int c1, int c2); 38 static void write_one_filemark(FILE *fp, xfmark_T *fm, int c1, int c2);
39 #endif 39 #endif
40 static void mark_adjust_internal(linenr_T line1, linenr_T line2, long amount,
41 long amount_after, int adjust_folds);
40 42
41 /* 43 /*
42 * Set named mark "c" at current cursor position. 44 * Set named mark "c" at current cursor position.
43 * Returns OK on success, FAIL if bad name given. 45 * Returns OK on success, FAIL if bad name given.
44 */ 46 */
1027 linenr_T line1, 1029 linenr_T line1,
1028 linenr_T line2, 1030 linenr_T line2,
1029 long amount, 1031 long amount,
1030 long amount_after) 1032 long amount_after)
1031 { 1033 {
1034 mark_adjust_internal(line1, line2, amount, amount_after, TRUE);
1035 }
1036
1037 void
1038 mark_adjust_nofold(
1039 linenr_T line1,
1040 linenr_T line2,
1041 long amount,
1042 long amount_after)
1043 {
1044 mark_adjust_internal(line1, line2, amount, amount_after, FALSE);
1045 }
1046
1047 static void
1048 mark_adjust_internal(
1049 linenr_T line1,
1050 linenr_T line2,
1051 long amount,
1052 long amount_after,
1053 int adjust_folds UNUSED)
1054 {
1032 int i; 1055 int i;
1033 int fnum = curbuf->b_fnum; 1056 int fnum = curbuf->b_fnum;
1034 linenr_T *lp; 1057 linenr_T *lp;
1035 win_T *win; 1058 win_T *win;
1036 #ifdef FEAT_WINDOWS 1059 #ifdef FEAT_WINDOWS
1172 win->w_cursor.lnum += amount_after; 1195 win->w_cursor.lnum += amount_after;
1173 } 1196 }
1174 1197
1175 #ifdef FEAT_FOLDING 1198 #ifdef FEAT_FOLDING
1176 /* adjust folds */ 1199 /* adjust folds */
1177 foldMarkAdjust(win, line1, line2, amount, amount_after); 1200 if (adjust_folds)
1201 foldMarkAdjust(win, line1, line2, amount, amount_after);
1178 #endif 1202 #endif
1179 } 1203 }
1180 } 1204 }
1181 1205
1182 #ifdef FEAT_DIFF 1206 #ifdef FEAT_DIFF