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

login
register
mail settings
Submitter ccr@tnsp.org
Date June 19, 2018, 11:57 a.m.
Message ID <618235c638a22081ed7f.1529409444@nmos6502>
Download mbox | patch
Permalink /patch/32331/
State Accepted
Headers show

Comments

ccr@tnsp.org - June 19, 2018, 11:57 a.m.
# HG changeset patch
# User Matti Hamalainen <ccr@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.
Yuya Nishihara - June 20, 2018, 12:08 p.m.
On Tue, 19 Jun 2018 14:57:24 +0300, ccr@tnsp.org wrote:
> # HG changeset patch
> # User Matti Hamalainen <ccr@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

Folded the commit message per coding style.
https://www.mercurial-scm.org/wiki/ContributingChanges#Patch_descriptions

I don't know detail about the crecord, but this looks harmless.
Queued, thanks.

Patch

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):
         """