From 7561b1b02630a5389fb9cc7b31de6c093b062b0e Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 29 Mar 2016 12:14:00 +0000
Subject: [PATCH] Placing the cursor in the edit window also when
 --constantshow is in effect.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5770 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog  |  4 ++++
 src/nano.c | 12 +++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 44512556..6c4ee5f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-03-29  Benno Schulenberg  <bensberg@justemail.net>
+	* src/nano.c (main): Place the cursor in the edit window also when
+	--constantshow is in effect.
+
 2016-03-28  Benno Schulenberg  <bensberg@justemail.net>
 	* src/winio.c (statusbar): Don't bother putting back the cursor in
 	the edit window, as it is off anyway, and will be placed back in the
diff --git a/src/nano.c b/src/nano.c
index f4ae87b7..bcdfaf50 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2632,9 +2632,8 @@ int main(int argc, char **argv)
     display_buffer();
 
     while (TRUE) {
-	/* Make sure the cursor is in the edit window. */
-	reset_cursor();
-	wnoutrefresh(edit);
+	currmenu = MMAIN;
+	focusing = FALSE;
 
 	/* If constant cursor position display is on, and there are no
 	 * keys waiting in the input buffer, display the current cursor
@@ -2642,11 +2641,10 @@ int main(int argc, char **argv)
 	if (ISSET(CONST_UPDATE) && get_key_buffer_len() == 0)
 	    do_cursorpos(TRUE);
 
-	currmenu = MMAIN;
-	focusing = FALSE;
-
-	/* Turn the cursor on when waiting for input. */
+	/* Place the cursor in the edit window and make it visible. */
+	reset_cursor();
 	curs_set(1);
+	wnoutrefresh(edit);
 
 	/* Read in and interpret characters. */
 	do_input(TRUE);
-- 
2.39.5