Browse Source

LibVT: Don't scroll to bottom for Ctrl/Alt/Shift

It's nice that we scroll the cursor into view when typing in a terminal
but it's not necessary when pressing only Ctrl, Alt of Shift.
Andreas Kling 5 years ago
parent
commit
5a84944dc8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Libraries/LibVT/TerminalWidget.cpp

+ 2 - 1
Libraries/LibVT/TerminalWidget.cpp

@@ -244,7 +244,8 @@ void TerminalWidget::keydown_event(GKeyEvent& event)
         write(m_ptm_fd, &ch, 1);
     }
 
-    m_scrollbar->set_value(m_scrollbar->max());
+    if (event.key() != Key_Control && event.key() != Key_Alt && event.key() != Key_Shift)
+        m_scrollbar->set_value(m_scrollbar->max());
 }
 
 void TerminalWidget::paint_event(GPaintEvent& event)