From b27ab4f0a19e04ec3d957367518852b55771fea8 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 22 Sep 2017 21:34:46 +0200
Subject: [PATCH] browser: place the cursor properly on the selected file when
 -g is used

Simply redraw the browser screen upon every keystroke when --showcursor
is in effect, to be certain that the cursor will be placed again at the
correct spot.

This fixes https://savannah.gnu.org/bugs/?52078
and fixes https://savannah.gnu.org/bugs/?52079.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
---
 src/browser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/browser.c b/src/browser.c
index 9f53bb94..3c978bce 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -109,7 +109,7 @@ char *do_browser(char *path)
 
 	/* Display (or redisplay) the file list if the list itself or
 	 * the selected file has changed. */
-	if (old_selected != selected)
+	if (old_selected != selected || ISSET(SHOW_CURSOR))
 	    browser_refresh();
 
 	old_selected = selected;
-- 
GitLab