Patchwork D6619: crecord: fix if -> elif when handling key presses

login
register
mail settings
Submitter phabricator
Date July 8, 2019, 8:29 p.m.
Message ID <differential-rev-PHID-DREV-mruk3eqe3idbr6lje4as-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/40829/
State Superseded
Headers show

Comments

phabricator - July 8, 2019, 8:29 p.m.
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This shouldn't actually change any behavior, I only noticed it since I started
  using KEY_UP in tests, and it was complaining when it got down to the ^L
  handler that initscr hadn't been called yet.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6619

AFFECTED FILES
  mercurial/crecord.py

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -1724,7 +1724,7 @@ 
         keypressed = pycompat.bytestr(keypressed)
         if keypressed in ["k", "KEY_UP"]:
             self.uparrowevent()
-        if keypressed in ["K", "KEY_PPAGE"]:
+        elif keypressed in ["K", "KEY_PPAGE"]:
             self.uparrowshiftevent()
         elif keypressed in ["j", "KEY_DOWN"]:
             self.downarrowevent()