Ticket #4651: term-partial-scroll-top.patch

File term-partial-scroll-top.patch, 878 bytes (added by joshe, 12 years ago)

Fix partial scroll regions anchored at line 0

  • src/apps/terminal/BasicTerminalBuffer.cpp

    commit 314ba1d37f1bd671653154db5c06e9aba52b5465
    Author: Joshua R. Elsasser <joshua@elsasser.org>
    Date:   Sat Sep 26 21:36:04 2009 +0000
    
        Fix upward scrolling of a partial screen which is anchored at line 0.
    
    diff --git a/src/apps/terminal/BasicTerminalBuffer.cpp b/src/apps/terminal/BasicTerminalBuffer.cpp
    index 41f85fa..a870b74 100644
    a b BasicTerminalBuffer::_Scroll(int32 top, int32 bottom, int32 numLines)  
    12191219                // TODO: It may be more efficient to actually move the scrolled
    12201220                // lines only (might depend on the number of scrolled/unscrolled
    12211221                // lines).
    1222                 for (int32 i = bottom + 1; i < fHeight; i++) {
     1222                for (int32 i = fHeight - 1; i > bottom; i--) {
    12231223                    std::swap(fScreen[_LineIndex(i)],
    12241224                        fScreen[_LineIndex(i + numLines)]);
    12251225                }