diff --git a/src/__tests__/expected/selectAllBug.txt b/src/__tests__/expected/selectAllBug.txt new file mode 100644 index 00000000..03596e68 --- /dev/null +++ b/src/__tests__/expected/selectAllBug.txt @@ -0,0 +1,30 @@ +=== diff --git |===>a/src/choose.py b/src/choose.py +/-\ index d184f91.|===>.5d7f2f9 100755 +\-/ --- a/src/choose.py + . +++ b/src/choose.py + . @@ -11,6 +11,7 @@ import curses + . import pickle + . import sys + . import os + . +import argparse + . + . import output + . import screenControl + . @@ -29,18 +30,16 @@ this error will go away) + . ''' + . + . + . -def doProgram(stdscr, cursesAPI=None, lineObjs=None, flags=None): + . +def doProgram(stdscr, flags, cursesAPI=None, lineObjs=None): + . # curses and lineObjs get dependency injected for + . # our tests, so init these if they are not provided + . if not cursesAPI: + . cursesAPI = CursesAPI() + . if not lineObjs: + . lineObjs = getLineObjs() + . - if not flags: + . - flags = ScreenFlags.initFromArgs() + . + . + . ___________________________________________________________________________ +=== [f|A] selection, [down|j|up|k|space|b] navigation, [enter] open, [x] quick \ No newline at end of file diff --git a/src/__tests__/testScreen.py b/src/__tests__/testScreen.py index c28e744a..b08bf94e 100755 --- a/src/__tests__/testScreen.py +++ b/src/__tests__/testScreen.py @@ -132,6 +132,10 @@ 'input': 'gitAbbreviatedFiles.txt', 'withAttributes': True, 'inputs': ['f', 'j'], +}, { + 'name': 'selectAllBug', + 'input': 'gitLongDiff.txt', + 'inputs': ['A'], }] diff --git a/src/screenControl.py b/src/screenControl.py index a3c23d68..6e896aa6 100755 --- a/src/screenControl.py +++ b/src/screenControl.py @@ -521,7 +521,7 @@ def processDirty(self): didClearLine = False for index in self.dirtyIndexes: y = miny + index + self.getScrollOffset() - if y >= miny or y < maxy: + if y >= miny and y < maxy: didClearLine = True self.clearLine(y) self.lineObjs[index].output(self.colorPrinter)