Fix Terminal cursor Save/Restore behaviour
Yet another fix for the terminal cursor save/restore functionality. Fixes wrong cursor positions observed in modern versions of the Midnight Commander during switching between Alternate and Normal buffers.
This commit is contained in:
@@ -181,8 +181,6 @@ BasicTerminalBuffer::Init(int32 width, int32 height, int32 historySize)
|
|||||||
|
|
||||||
fDirtyInfo.Reset();
|
fDirtyInfo.Reset();
|
||||||
|
|
||||||
fSavedCursors.push(TermPos(0, 0));
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -926,8 +924,10 @@ BasicTerminalBuffer::SaveCursor()
|
|||||||
void
|
void
|
||||||
BasicTerminalBuffer::RestoreCursor()
|
BasicTerminalBuffer::RestoreCursor()
|
||||||
{
|
{
|
||||||
|
if (fSavedCursors.size() == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
_SetCursor(fSavedCursors.top().x, fSavedCursors.top().y, true);
|
_SetCursor(fSavedCursors.top().x, fSavedCursors.top().y, true);
|
||||||
if (fSavedCursors.size() > 1)
|
|
||||||
fSavedCursors.pop();
|
fSavedCursors.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user