-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
In the XtermEngine::StartPaint method, there's some code that calculates the dirty area here:
terminal/src/renderer/vt/XtermEngine.cpp
Lines 85 to 97 in 183a895
| { | |
| std::span<const til::rect> dirty; | |
| RETURN_IF_FAILED(GetDirtyArea(dirty)); | |
| // If we have 0 or 1 dirty pieces in the area, set as appropriate. | |
| auto dirtyView = dirty.empty() ? Viewport::Empty() : Viewport::FromExclusive(til::at(dirty, 0)); | |
| // If there's more than 1, union them all up with the 1 we already have. | |
| for (size_t i = 1; i < dirty.size(); ++i) | |
| { | |
| dirtyView = Viewport::Union(dirtyView, Viewport::FromExclusive(til::at(dirty, i))); | |
| } | |
| } |
However, the result of that calculation is not actually used. There was a time when there was more code in that branch that compared the dirty area against the last viewport, but that was removed in PR #4741.
And in the XtermEngine::_MoveCursor method there's a local variable performedSoftWrap which is initially set to false at the start of the method here:
terminal/src/renderer/vt/XtermEngine.cpp
Line 249 in 183a895
| auto performedSoftWrap = false; |
And it's potentially changed to true later in the code:
terminal/src/renderer/vt/XtermEngine.cpp
Lines 273 to 278 in 183a895
| if (previousLineWrapped) | |
| { | |
| performedSoftWrap = true; | |
| _trace.TraceWrapped(); | |
| hr = S_OK; | |
| } |
However, the variable is otherwise never read. It looks like it was added as part of PR #5181, but even then it doesn't appear to have been used.
Unless there is something I'm missing, I'd suggest we should remove the unused code.