Skip to content

Commit 29b4e5b

Browse files
authored
fix: bunch of bugs related to text highlighting (#59)
- Fixes highlighting not clearing when you click somewhere else - Fixes autoscroll not working when you highlight and drag up or down - Fixes copy/paste related to highlighting
1 parent 2c9ea32 commit 29b4e5b

File tree

5 files changed

+985
-178
lines changed

5 files changed

+985
-178
lines changed

lib/renderer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,15 @@ export class CanvasRenderer {
308308
}
309309
}
310310

311-
// Always mark previous selection rows for redraw (to clear old overlay)
311+
// Always mark dirty selection rows for redraw (to clear old overlay)
312312
if (this.selectionManager) {
313-
const prevCoords = this.selectionManager.getPreviousSelectionCoords();
314-
if (prevCoords) {
315-
for (let row = prevCoords.startRow; row <= prevCoords.endRow; row++) {
313+
const dirtyRows = this.selectionManager.getDirtySelectionRows();
314+
if (dirtyRows.size > 0) {
315+
for (const row of dirtyRows) {
316316
selectionRows.add(row);
317317
}
318-
// Clear the previous selection tracking after marking for redraw
319-
this.selectionManager.clearPreviousSelection();
318+
// Clear the dirty rows tracking after marking for redraw
319+
this.selectionManager.clearDirtySelectionRows();
320320
}
321321
}
322322

0 commit comments

Comments
 (0)