[PATCH] crecord: properly re-center display in interactive curses commit when pageup/down are used

ccr at tnsp.org ccr at tnsp.org
Tue Jun 19 11:57:24 UTC 2018


# HG changeset patch
# User Matti Hamalainen <ccr at tnsp.org>
# Date 1529402838 -10800
#      Tue Jun 19 13:07:18 2018 +0300
# Node ID 618235c638a22081ed7f08506f60ac29f66a1e52
# Parent  26523316e4d076c244edd4e4d093ccdb15824dcb
crecord: properly re-center display in interactive curses commit when pageup/down are used

A long-standing issue in the crecord (interactive curses commit interface)
is that using PageUp/Down to move along longer-than current screen size
chunks would "lose" the cursor and not properly re-center.

There has been self.recenterdisplayedarea() to do that, but it has not been
in use for some reason. Add calls to the appropriate uparrowshiftevent()
and downarrowshiftevent() methods to fix this.

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -671,6 +671,7 @@
             nextitem = currentitem
 
         self.currentselecteditem = nextitem
+        self.recenterdisplayedarea()
 
     def downarrowevent(self):
         """
@@ -710,6 +711,7 @@
             nextitem = currentitem
 
         self.currentselecteditem = nextitem
+        self.recenterdisplayedarea()
 
     def rightarrowevent(self):
         """


More information about the Mercurial-devel mailing list