-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix clearing marks #17144
Fix clearing marks #17144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have this weird dejavu feeling as if we had talked about this bug in ClearScrollback
a month ago. Am I going nuts, or did we?
Edit: Probably going nuts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openQs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should revert 010e1f6 now that both Dustin and me realized our mistake. 😅
This reverts commit 010e1f6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why we don't need to take start
into account when we are clearing marks. Why did we revert 010e1f6 completely and throw out two fixes when we just wanted to throw out one?
What is happening with this PR? |
You know what, I think I got confused trying to revert this right as I was heading out the door. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enjoy your lunch, this one seems done :)
wait what is going on here. This version absolutely doesn't work. Why does it have to be ClearMarksInRange(til::point{ 0, 0 }, til::point{ _width, height }); and not the |
OH derp. ClearMarksInRange(til::point{ 0, start }, til::point{ _width, start + height }); That will only clear the marks in the active viewport. From |
This comment has been minimized.
This comment has been minimized.
Given that marks are now stored as attributes, do we even need to call |
It would appear that |
src/buffer/out/textBuffer.cpp
Outdated
@@ -1176,19 +1176,26 @@ void TextBuffer::Reset() noexcept | |||
_initialAttributes = _currentAttributes; | |||
} | |||
|
|||
// Arguments: | |||
// - start: The y-position of the viewport. We'll clear up until here. | |||
// - height: the number of rows to keep in the buffer. | |||
void TextBuffer::ClearScrollback(const til::CoordType start, const til::CoordType height) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHAT ON EARTH
I move that we rename both of these parameters, before they do more psychic damage to the team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clearUpToThisRow
,numberOfRowsToKeep
?currentViewportTop
,viewportHeight
?- ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newFirstRow, rowsToKeep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Also sorry for sending you chasing untamed ornithoids about start
)
src/buffer/out/textBuffer.cpp
Outdated
{ | ||
_decommit(); | ||
return; | ||
} | ||
|
||
ClearMarksInRange(til::point{ 0, 0 }, til::point{ _width, start + height }); | ||
ClearMarksInRange(til::point{ 0, 0 }, til::point{ _width, newFirstRow + rowsToKeep }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay for my next question... wouldn't we then want to only clear up to newFirstRow? The thing I thought was wrong to begin with is quite possibly correct.
Or do we want to clear even the rows we are keeping?
(The new names help so so much)
FWIW it probably shouldn't do that, and we may want to consider that another marks bug. |
Tests are good, I should write more of them.
Closes #17130