# HG changeset patch # User Jun Wu # Date 1479939795 0 # Node ID f3cff00c7a00d1d5b7850ceb0b96545a389139af # Parent d4035372db8dc0cc27dcc7145ce9b496f9cd4796 crecord: make _getstatuslines update numstatuslines We are going to make the text in the status window dynamically generated, so its size would be dynamic. Change getstatuslines to update "numstatuslines" automatically. Fix an issue where "numstatuslines" being 1 makes the chunkpad disappear. diff -r d4035372db8d -r f3cff00c7a00 mercurial/crecord.py --- a/mercurial/crecord.py Mon Nov 28 23:12:54 2016 +0000 +++ b/mercurial/crecord.py Wed Nov 23 22:23:15 2016 +0000 @@ -541,7 +541,7 @@ # keeps track of the number of lines in the pad self.numpadlines = None - self.numstatuslines = 2 + self.numstatuslines = 1 # keep a running count of the number of lines printed to the pad # (used for determining when the selected item begins/ends) @@ -955,6 +955,9 @@ "(space/A) toggle hunk/all; (e)dit hunk;"), _(" (f)old/unfold; (c)onfirm applied; (q)uit; (?) help " "| [X]=hunk applied **=folded, toggle [a]mend mode")] + if len(lines) != self.numstatuslines: + self.numstatuslines = len(lines) + self.statuswin.resize(self.numstatuslines, self.xscreensize) return [util.ellipsis(l, self.xscreensize - 1) for l in lines] def updatescreen(self): @@ -979,7 +982,7 @@ self.updatescroll() self.chunkpad.refresh(self.firstlineofpadtoprint, 0, self.numstatuslines, 0, - self.yscreensize + 1 - self.numstatuslines, + self.yscreensize - self.numstatuslines, self.xscreensize) except curses.error: pass