patch 8.2.4911: the mode #defines are not clearly named
Problem: The mode #defines are not clearly named.
Solution: Prepend MODE_. Renumber them to put the mapped modes first.
diff --git a/src/fold.c b/src/fold.c
index 229cb2a..f94b389 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -1499,7 +1499,7 @@
line2 = line1 - amount_after - 1;
// If appending a line in Insert mode, it should be included in the fold
// just above the line.
- if ((State & INSERT) && amount == (linenr_T)1 && line2 == MAXLNUM)
+ if ((State & MODE_INSERT) && amount == (linenr_T)1 && line2 == MAXLNUM)
--line1;
foldMarkAdjustRecurse(&wp->w_folds, line1, line2, amount, amount_after);
}
@@ -1523,7 +1523,7 @@
// In Insert mode an inserted line at the top of a fold is considered part
// of the fold, otherwise it isn't.
- if ((State & INSERT) && amount == (linenr_T)1 && line2 == MAXLNUM)
+ if ((State & MODE_INSERT) && amount == (linenr_T)1 && line2 == MAXLNUM)
top = line1 + 1;
else
top = line1;