From 7c60eab744926aa83eaee5f29ade56d5a6858e80 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Thu, 27 Jan 2005 06:35:56 +0000
Subject: [PATCH] tweak do_mouse() to work properly when -O/--morespace is used

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

diff --git a/ChangeLog b/ChangeLog
index 46cdd321..77b0b197 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -123,8 +123,9 @@ CVS code -
 	  used, the normally-unused blank line below the titlebar will
 	  be treated as part of the edit window.  New functions
 	  no_more_space() and blank_topbar(); changes to global_init(),
-	  window_init(), handle_sigwinch(), do_toggle(), etc. (DLR;
-	  suggested by Mike Frysinger, Rocco, and Robert Schultz)
+	  window_init(), handle_sigwinch(), do_toggle(), do_mouse(),
+	  etc. (DLR; suggested by Mike Frysinger, Rocco, and Robert
+	  Schultz)
 	- Add support for moving to the next or previous word at the
 	  statusbar prompt.  New functions do_statusbar_next_word() and
 	  do_statusbar_prev_word(); changes to do_statusbar_input().
diff --git a/src/nano.c b/src/nano.c
index 48a9f38e..5c83b2fa 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -3678,7 +3678,7 @@ bool do_mouse(void)
 
 	    /* Subtract out the size of topwin.  Perhaps we need a
 	     * constant somewhere? */
-	    mouse_y -= 2;
+	    mouse_y -= (2 - no_more_space());
 
 	    sameline = (mouse_y == current_y);
 
-- 
GitLab