changeset 27937:3d3b4ac369f2 stable

crecord: fix help bar display issue (issue5063) Before this patch, the help bar in crecord wouldn't be printed correctly when the terminal window didn't have enough column to display it. This patch adds logic to make sure that the help bar message is always displayed. We use an ellipsis when it is not possible to display the complete message.
author Laurent Charignon <lcharignon@fb.com>
date Mon, 25 Jan 2016 11:37:02 -0800
parents fedd81659643
children cabac7dfc621
files mercurial/crecord.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/crecord.py	Mon Jan 25 10:13:03 2016 -0800
+++ b/mercurial/crecord.py	Mon Jan 25 11:37:02 2016 -0800
@@ -1010,13 +1010,16 @@
                             pairname='legend')
                 self.statuswin.refresh()
                 return
+            line1 = ("SELECT CHUNKS: (j/k/up/dn/pgup/pgdn) move cursor; "
+                   "(space/A) toggle hunk/all; (e)dit hunk;")
+            line2 = (" (f)old/unfold; (c)onfirm applied; (q)uit; (?) help "
+                   "| [X]=hunk applied **=folded, toggle [a]mend mode")
+
             printstring(self.statuswin,
-                        "SELECT CHUNKS: (j/k/up/dn/pgup/pgdn) move cursor; "
-                        "(space/A) toggle hunk/all; (e)dit hunk;",
+                        util.ellipsis(line1, self.xscreensize - 1),
                         pairname="legend")
             printstring(self.statuswin,
-                        " (f)old/unfold; (c)onfirm applied; (q)uit; (?) help "
-                        "| [X]=hunk applied **=folded, toggle [a]mend mode",
+                        util.ellipsis(line2, self.xscreensize - 1),
                         pairname="legend")
         except curses.error:
             pass