mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-01 06:31:10 +01:00
Added: Add SCROLL extra key to toggle auto scrolling of terminal to bottom on terminal text updates and termux activity return
The toggle will apply to each terminal session separately. Closes #2535
This commit is contained in:
parent
a2df7d791a
commit
5fc2b4cd4a
4 changed files with 30 additions and 3 deletions
|
|
@ -409,19 +409,29 @@ public final class TerminalView extends View {
|
|||
}
|
||||
|
||||
public void onScreenUpdated() {
|
||||
onScreenUpdated(false);
|
||||
}
|
||||
|
||||
public void onScreenUpdated(boolean skipScrolling) {
|
||||
if (mEmulator == null) return;
|
||||
|
||||
int rowsInHistory = mEmulator.getScreen().getActiveTranscriptRows();
|
||||
if (mTopRow < -rowsInHistory) mTopRow = -rowsInHistory;
|
||||
|
||||
boolean skipScrolling = false;
|
||||
if (isSelectingText()) {
|
||||
if (isSelectingText() || mEmulator.isAutoScrollDisabled()) {
|
||||
|
||||
// Do not scroll when selecting text.
|
||||
int rowShift = mEmulator.getScrollCounter();
|
||||
if (-mTopRow + rowShift > rowsInHistory) {
|
||||
// .. unless we're hitting the end of history transcript, in which
|
||||
// case we abort text selection and scroll to end.
|
||||
stopTextSelectionMode();
|
||||
if (isSelectingText())
|
||||
stopTextSelectionMode();
|
||||
|
||||
if (mEmulator.isAutoScrollDisabled()) {
|
||||
mTopRow = -rowsInHistory;
|
||||
skipScrolling = true;
|
||||
}
|
||||
} else {
|
||||
skipScrolling = true;
|
||||
mTopRow -= rowShift;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue