less/backport-Remove-unnecessary-call-to-pshift-in-pappend.patch
fuanan 106665619f [Backport]less:[add]backport patches from upstream
(cherry picked from commit a8a5443922ca981d8dade16e8981f4f415a3f7cc)
2021-05-28 17:35:58 +08:00

47 lines
1.3 KiB
Diff

From 65d73a2b54ddb390993738d9c6462af9a9661989 Mon Sep 17 00:00:00 2001
From: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Sun, 29 Nov 2020 09:02:29 -0800
Subject: [PATCH] Remove unnecessary call to pshift in pappend. The logic
doesn't work if the curr position is close to the point where pappend decides
to do the pshift. It's unnecessary because we call pshift in pdone at the end
of the line.
---
line.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/line.c b/line.c
index 93f1089..851fc28 100644
--- a/line.c
+++ b/line.c
@@ -299,8 +299,6 @@ pshift(shift)
if (ctldisp == OPT_ONPLUS && IS_CSI_START(c))
{
/* Keep cumulative effect. */
- linebuf[to] = c;
- attr[to++] = attr[from++];
while (from < curr && linebuf[from])
{
linebuf[to] = linebuf[from];
@@ -904,18 +902,6 @@ pappend(c, pos)
goto retry;
}
}
-
- /*
- * If we need to shift the line, do it.
- * But wait until we get to at least the middle of the screen,
- * so shifting it doesn't affect the chars we're currently
- * pappending. (Bold & underline can get messed up otherwise.)
- */
- if (cshift < hshift && column > sc_width / 2)
- {
- linebuf[curr] = '\0';
- pshift(hshift - cshift);
- }
if (r)
{
/* How many chars should caller back up? */
--
1.8.3.1