mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
add control-P and control-N
This commit is contained in:
@@ -241,6 +241,16 @@ class TextAreaInput extends React.Component<{onHeightChange : () => void}, {}> {
|
||||
this.controlU();
|
||||
return;
|
||||
}
|
||||
if (e.code == "KeyP" && e.getModifierState("Control")) {
|
||||
e.preventDefault();
|
||||
this.controlP();
|
||||
return;
|
||||
}
|
||||
if (e.code == "KeyN" && e.getModifierState("Control")) {
|
||||
e.preventDefault();
|
||||
this.controlN();
|
||||
return;
|
||||
}
|
||||
if (e.code == "KeyW" && e.getModifierState("Control")) {
|
||||
e.preventDefault();
|
||||
this.controlW();
|
||||
@@ -379,6 +389,16 @@ class TextAreaInput extends React.Component<{onHeightChange : () => void}, {}> {
|
||||
inputModel.moveHistorySelection(e.code == "PageUp" ? 10 : -10);
|
||||
return;
|
||||
}
|
||||
if (e.code == "KeyP" && e.getModifierState("Control")) {
|
||||
e.preventDefault();
|
||||
inputModel.moveHistorySelection(1);
|
||||
return;
|
||||
}
|
||||
if (e.code == "KeyN" && e.getModifierState("Control")) {
|
||||
e.preventDefault();
|
||||
inputModel.moveHistorySelection(-1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
@@ -399,6 +419,25 @@ class TextAreaInput extends React.Component<{onHeightChange : () => void}, {}> {
|
||||
GlobalModel.inputModel.updateCmdLine(cmdLineUpdate);
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
controlP(e : any) {
|
||||
let inputModel = GlobalModel.inputModel;
|
||||
if (!inputModel.isHistoryLoaded()) {
|
||||
this.lastHistoryUpDown = true;
|
||||
inputModel.loadHistory(false, 1, "screen");
|
||||
return;
|
||||
}
|
||||
inputModel.moveHistorySelection(1);
|
||||
this.lastHistoryUpDown = true;
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
controlN(e : any) {
|
||||
let inputModel = GlobalModel.inputModel;
|
||||
inputModel.moveHistorySelection(-1);
|
||||
this.lastHistoryUpDown = true;
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
controlW() {
|
||||
if (this.mainInputRef.current == null) {
|
||||
|
||||
Reference in New Issue
Block a user