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:
Siarzhuk Zharski 2013-03-16 07:21:40 +01:00
parent 15e83c4548
commit 0ac0b4d4a6

View File

@ -181,8 +181,6 @@ BasicTerminalBuffer::Init(int32 width, int32 height, int32 historySize)
fDirtyInfo.Reset();
fSavedCursors.push(TermPos(0, 0));
return B_OK;
}
@ -926,9 +924,11 @@ BasicTerminalBuffer::SaveCursor()
void
BasicTerminalBuffer::RestoreCursor()
{
if (fSavedCursors.size() == 0)
return;
_SetCursor(fSavedCursors.top().x, fSavedCursors.top().y, true);
if (fSavedCursors.size() > 1)
fSavedCursors.pop();
fSavedCursors.pop();
}