Skip to content

Commit

Permalink
Fix cursor invalidation, again (#17617)
Browse files Browse the repository at this point in the history
Regressed in #15500, incorrectly fixed in #17332, exposed by #17583.
My ineptitude on full display. If this isn't the last cursor
invalidation bug I'm going to cry.

Closes #17615

## Validation Steps Performed
* cmd.exe
* a directory with 6 files
* 80x24 viewport
* run `cls`
* run `dir` twice
  • Loading branch information
lhecker authored Jul 26, 2024
1 parent 54ef019 commit 295cd17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/renderer/base/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,9 @@ bool Renderer::_CheckViewportAndScroll()
auto coordCursor = _currentCursorOptions.coordCursor;

// `coordCursor` was stored in viewport-relative while `view` is in absolute coordinates.
// --> Turn it back into the absolute coordinates with the help of the old viewport.
coordCursor.y += srOldViewport.top;
// --> Turn it back into the absolute coordinates with the help of the viewport.
// We have to use the new viewport, because _ScrollPreviousSelection adjusts the cursor position to match the new one.
coordCursor.y += srNewViewport.top;

This comment has been minimized.

Copy link
@inoperable

inoperable Jul 27, 2024

🤣


// Note that we allow the X coordinate to be outside the left border by 1 position,
// because the cursor could still be visible if the focused character is double width.
Expand Down

0 comments on commit 295cd17

Please sign in to comment.