Fix so that pressing ctrl-s a second time toggles off constrain height mode (#1306)
This commit is contained in:
parent
523aeec544
commit
156feff5b1
|
@ -295,11 +295,13 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
useInput((input: string, key: InkKeyType) => {
|
useInput((input: string, key: InkKeyType) => {
|
||||||
|
let enteringConstrainHeightMode = false;
|
||||||
if (!constrainHeight) {
|
if (!constrainHeight) {
|
||||||
// Automatically re-enter constrain height mode if the user types
|
// Automatically re-enter constrain height mode if the user types
|
||||||
// anything. When constrainHeight==false, the user will experience
|
// anything. When constrainHeight==false, the user will experience
|
||||||
// significant flickering so it is best to disable it immediately when
|
// significant flickering so it is best to disable it immediately when
|
||||||
// the user starts interacting with the app.
|
// the user starts interacting with the app.
|
||||||
|
enteringConstrainHeightMode = true;
|
||||||
setConstrainHeight(true);
|
setConstrainHeight(true);
|
||||||
|
|
||||||
// If our pending history item happens to exceed the terminal height we will most likely need to refresh
|
// If our pending history item happens to exceed the terminal height we will most likely need to refresh
|
||||||
|
@ -335,7 +337,7 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
handleExit(ctrlDPressedOnce, setCtrlDPressedOnce, ctrlDTimerRef);
|
handleExit(ctrlDPressedOnce, setCtrlDPressedOnce, ctrlDTimerRef);
|
||||||
} else if (key.ctrl && input === 's') {
|
} else if (key.ctrl && input === 's' && !enteringConstrainHeightMode) {
|
||||||
setConstrainHeight(false);
|
setConstrainHeight(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue