mirror of
https://github.com/wavetermdev/backup.git
synced 2026-04-22 15:26:58 -07:00
beginning to add autocomplete to textareainput
This commit is contained in:
@@ -11,7 +11,6 @@ import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown, Button } from
|
||||
import { commandRtnHandler, isBlank } from "@/util/util";
|
||||
import { getTermThemes } from "@/util/themeutil";
|
||||
import * as appconst from "@/app/appconst";
|
||||
import { getSuggestions, Shell } from "@/autocomplete";
|
||||
|
||||
import "./clientsettings.less";
|
||||
import { MainView } from "@/common/elements/mainview";
|
||||
@@ -193,12 +192,6 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
|
||||
GlobalModel.clientSettingsViewModel.closeView();
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
async handleSubmitEphemeral() {
|
||||
const resp = await getSuggestions("ls -", "~", Shell.Zsh);
|
||||
console.log("resp", resp);
|
||||
}
|
||||
|
||||
render() {
|
||||
const isHidden = GlobalModel.activeMainView.get() != "clientsettings";
|
||||
if (isHidden) {
|
||||
@@ -361,12 +354,6 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="settings-field">
|
||||
<div className="settings-label">Submit Ephemeral Command</div>
|
||||
<div className="settings-input">
|
||||
<Button onClick={this.handleSubmitEphemeral}>Submit</Button>
|
||||
</div>
|
||||
</div>
|
||||
<SettingsError errorMessage={this.errorMessage} />
|
||||
</div>
|
||||
</MainView>
|
||||
|
||||
@@ -11,6 +11,7 @@ import cn from "classnames";
|
||||
import { GlobalModel, GlobalCommandRunner, Screen } from "@/models";
|
||||
import { getMonoFontSize } from "@/util/textmeasure";
|
||||
import * as appconst from "@/app/appconst";
|
||||
import { Shell, getSuggestions } from "@/autocomplete";
|
||||
|
||||
type OV<T> = mobx.IObservableValue<T>;
|
||||
|
||||
@@ -117,23 +118,19 @@ class CmdInputKeybindings extends React.Component<{ inputObject: TextAreaInput }
|
||||
this.lastTab = true;
|
||||
this.curPress = "tab";
|
||||
const curLine = inputModel.getCurLine();
|
||||
if (lastTab) {
|
||||
GlobalModel.submitCommand(
|
||||
"_compgen",
|
||||
null,
|
||||
[curLine],
|
||||
{ comppos: String(curLine.length), compshow: "1", nohist: "1" },
|
||||
true
|
||||
);
|
||||
} else {
|
||||
GlobalModel.submitCommand(
|
||||
"_compgen",
|
||||
null,
|
||||
[curLine],
|
||||
{ comppos: String(curLine.length), nohist: "1" },
|
||||
true
|
||||
);
|
||||
}
|
||||
// if (lastTab) {
|
||||
getSuggestions(curLine, "~", Shell.Zsh).then((resp) => {
|
||||
console.log("resp", resp);
|
||||
});
|
||||
// } else {
|
||||
// GlobalModel.submitCommand(
|
||||
// "_compgen",
|
||||
// null,
|
||||
// [curLine],
|
||||
// { comppos: String(curLine.length), nohist: "1" },
|
||||
// true
|
||||
// );
|
||||
// }
|
||||
return true;
|
||||
});
|
||||
keybindManager.registerKeybinding("pane", "cmdinput", "generic:confirm", (waveEvent) => {
|
||||
|
||||
@@ -69,7 +69,6 @@ var electronCommon = {
|
||||
"@/plugins": path.resolve(__dirname, "../src/plugins/"),
|
||||
"@/autocomplete": path.resolve(__dirname, "../src/autocomplete/"),
|
||||
},
|
||||
modules: [path.resolve(__dirname, "../node_modules")],
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ var webCommon = {
|
||||
"@/plugins": path.resolve(__dirname, "../src/plugins/"),
|
||||
"@/autocomplete": path.resolve(__dirname, "../src/autocomplete/"),
|
||||
},
|
||||
modules: [path.resolve(__dirname, "../node_modules")],
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user