mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
updates for new compgen
This commit is contained in:
@@ -520,6 +520,14 @@ class TextAreaInput extends React.Component<{}, {}> {
|
||||
}
|
||||
this.lastFocusType = focusType;
|
||||
}
|
||||
let inputModel = GlobalModel.inputModel;
|
||||
if (inputModel.forceCursorPos.get() != null) {
|
||||
if (this.mainInputRef.current != null) {
|
||||
this.mainInputRef.current.selectionStart = inputModel.forceCursorPos.get();
|
||||
this.mainInputRef.current.selectionEnd = inputModel.forceCursorPos.get();
|
||||
}
|
||||
mobx.action(() => inputModel.forceCursorPos.set(null))();
|
||||
}
|
||||
}
|
||||
|
||||
getLinePos(elem : any) : {numLines : number, linePos : number} {
|
||||
@@ -768,6 +776,7 @@ class TextAreaInput extends React.Component<{}, {}> {
|
||||
let model = GlobalModel;
|
||||
let inputModel = model.inputModel;
|
||||
let curLine = inputModel.getCurLine();
|
||||
let fcp = inputModel.forceCursorPos.get(); // for reaction
|
||||
let numLines = curLine.split("\n").length;
|
||||
let displayLines = numLines;
|
||||
if (displayLines > 5) {
|
||||
|
||||
+5
-7
@@ -856,6 +856,9 @@ class InputModel {
|
||||
showNoInputTimeoutId : any = null;
|
||||
inputMode : OV<null | "comment" | "global"> = mobx.observable.box(null);
|
||||
|
||||
// cursor
|
||||
forceCursorPos : OV<number> = mobx.observable.box(null);
|
||||
|
||||
// focus
|
||||
inputFocused : OV<boolean> = mobx.observable.box(false);
|
||||
lineFocused : OV<boolean> = mobx.observable.box(false);
|
||||
@@ -1077,13 +1080,8 @@ class InputModel {
|
||||
|
||||
updateCmdLine(cmdLine : CmdLineUpdateType) : void {
|
||||
mobx.action(() => {
|
||||
let curLine = this.getCurLine();
|
||||
if (curLine.length < cmdLine.insertpos) {
|
||||
return;
|
||||
}
|
||||
let pos = cmdLine.insertpos;
|
||||
curLine = curLine.substr(0, pos) + cmdLine.insertchars + curLine.substr(pos);
|
||||
this.setCurLine(curLine);
|
||||
this.setCurLine(cmdLine.cmdline);
|
||||
this.forceCursorPos.set(cmdLine.cursorpos);
|
||||
})();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -284,8 +284,8 @@ type HistoryInfoType = {
|
||||
};
|
||||
|
||||
type CmdLineUpdateType = {
|
||||
insertchars : string,
|
||||
insertpos : number,
|
||||
cmdline : string,
|
||||
cursorpos : number,
|
||||
};
|
||||
|
||||
type RemoteEditType = {
|
||||
|
||||
Reference in New Issue
Block a user