summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2017-09-09 13:10:29 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2017-09-09 13:10:29 +0000
commite3537178c88e8db28989177f7fc44a149d088a20 (patch)
tree9f9f636c1b3719c5ffdec3c0fd6bc75e6d1a0360
parente4fcdb24d0da6b5a9934b6e6a04774d606e3805c (diff)
When inserting a newline, only increment dotline for windows that are
displaying the same buffer as the current one. From Martin Wanvik (martin.kr.wanvik AT gmail), thanks! OK bcallah
-rw-r--r--usr.bin/mg/line.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c
index c63ef293f98..ae5d4a7e3bb 100644
--- a/usr.bin/mg/line.c
+++ b/usr.bin/mg/line.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: line.c,v 1.58 2015/12/11 20:21:23 mmcc Exp $ */
+/* $OpenBSD: line.c,v 1.59 2017/09/09 13:10:28 florian Exp $ */
/* This file is in the public domain. */
@@ -264,7 +264,8 @@ lnewline_at(struct line *lp1, int doto)
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) {
if (wp->w_linep == lp1)
wp->w_linep = lp2;
- if (wp->w_dotline >= tcurwpdotline)
+ if (wp->w_dotline >= tcurwpdotline &&
+ wp->w_bufp == curwp->w_bufp)
wp->w_dotline++;
}
undo_add_boundary(FFRAND, 1);
@@ -292,7 +293,8 @@ lnewline_at(struct line *lp1, int doto)
wp->w_dotp = lp2;
wp->w_doto -= doto;
wp->w_dotline++;
- } else if (wp->w_dotline > tcurwpdotline)
+ } else if (wp->w_dotline > tcurwpdotline &&
+ wp->w_bufp == curwp->w_bufp)
wp->w_dotline++;
if (wp->w_markp == lp1 && wp->w_marko >= doto) {
wp->w_markp = lp2;