Skip to content

Commit

Permalink
gh-1393, gh-1469: Fix jumbled output from git log/diff, reverse scrol…
Browse files Browse the repository at this point in the history
…ling speed.
  • Loading branch information
Maximus5 committed Mar 9, 2018
1 parent dc51dc3 commit c20bf9d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ConEmuHk/Ansi.cpp
Expand Up @@ -1937,9 +1937,11 @@ BOOL CEAnsi::LinesInsert(HANDLE hConsoleOutput, const int LinesCount)
}
else
{
TODO("What we need to scroll? Buffer or visible rect?");
// What we need to scroll? Buffer or visible rect?
TopLine = csbi.dwCursorPosition.Y;
BottomLine = csbi.dwSize.Y - 1;
BottomLine = (csbi.dwCursorPosition.Y <= csbi.srWindow.Bottom)
? csbi.srWindow.Bottom
: csbi.dwSize.Y - 1;
}

// Apply default color before scrolling!
Expand Down Expand Up @@ -1972,9 +1974,11 @@ BOOL CEAnsi::LinesDelete(HANDLE hConsoleOutput, const int LinesCount)
}
else
{
TODO("What we need to scroll? Buffer or visible rect?");
// What we need to scroll? Buffer or visible rect?
TopLine = csbi.dwCursorPosition.Y;
BottomLine = csbi.dwSize.Y - 1;
BottomLine = (csbi.dwCursorPosition.Y <= csbi.srWindow.Bottom)
? csbi.srWindow.Bottom
: csbi.dwSize.Y - 1;
}

if (BottomLine < TopLine)
Expand Down

0 comments on commit c20bf9d

Please sign in to comment.