less/backport-Reset-horizontal-shift-when-opening-a-new-file.patch

32 lines
811 B
Diff
Raw Normal View History

From 3bb781ea44461dea611c4b1c5b414f97fc396cbe Mon Sep 17 00:00:00 2001
From: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Sun, 29 Nov 2020 09:21:53 -0800
Subject: [PATCH] Reset horizontal shift when opening a new file.
---
edit.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/edit.c b/edit.c
index 3676971..679ae0b 100644
--- a/edit.c
+++ b/edit.c
@@ -20,6 +20,7 @@ extern int any_display;
extern int force_open;
extern int is_tty;
extern int sigs;
+extern int hshift;
extern IFILE curr_ifile;
extern IFILE old_ifile;
extern struct scrpos initial_scrpos;
@@ -478,6 +479,7 @@ edit_ifile(ifile)
#if HILITE_SEARCH
clr_hilite();
#endif
+ hshift = 0;
if (strcmp(filename, FAKE_HELPFILE) && strcmp(filename, FAKE_EMPTYFILE))
{
char *qfilename = shell_quote(filename);
--
1.8.3.1