wip drawRect selection
@@ -1536,8 +1536,9 @@ class TextBuffer(BackingTextBuffer):
def drawOverlays(self, window, top, left, maxRow, maxCol, colorDelta):
if 1:
startRow = self.view.scrollRow + top
+ endRow = self.view.scrollRow + top + maxRow
startCol = self.view.scrollCol + left
- endCol = self.view.scrollCol + maxCol
+ endCol = self.view.scrollCol + left + maxCol
rowLimit = min(max(len(self.lines) - startRow, 0), maxRow)
if 1:
# Highlight brackets.
@@ -1646,6 +1647,7 @@ class TextBuffer(BackingTextBuffer):
if rowLimit and self.selectionMode != app.selectable.kSelectionNone:
# Highlight selected text.
upperRow, upperCol, lowerRow, lowerCol = self.startAndEnd()
+ if startRow <= upperRow < endRow or startRow <= lowerRow < endRow:
selStartCol = max(upperCol, startCol)
selEndCol = min(lowerCol - startCol, maxCol)
start = max(0, min(upperRow - startRow, maxRow))
