beginning to add autocomplete to textareainput

This commit is contained in:
Evan Simkowitz
2024-04-02 18:35:12 -07:00
parent 239933be3e
commit 12f9a50686
4 changed files with 14 additions and 32 deletions
-13
View File
@@ -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>
+14 -17
View File
@@ -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) => {
-1
View File
@@ -69,7 +69,6 @@ var electronCommon = {
"@/plugins": path.resolve(__dirname, "../src/plugins/"),
"@/autocomplete": path.resolve(__dirname, "../src/autocomplete/"),
},
modules: [path.resolve(__dirname, "../node_modules")],
},
};
-1
View File
@@ -90,7 +90,6 @@ var webCommon = {
"@/plugins": path.resolve(__dirname, "../src/plugins/"),
"@/autocomplete": path.resolve(__dirname, "../src/autocomplete/"),
},
modules: [path.resolve(__dirname, "../node_modules")],
},
};