summaryrefslogtreecommitdiff
path: root/extension/react-app/src/tabs/gui.tsx
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-06 00:25:41 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-06 00:25:41 -0700
commit1f4878f89549e6c9ccc3483a47b9f3a95c6ee9f4 (patch)
tree8b5e973a31e95009f975e8fadf1521d044c6ac27 /extension/react-app/src/tabs/gui.tsx
parent9371b7da2122ad3525b00f377ecf829b0d904b47 (diff)
downloadsncontinue-1f4878f89549e6c9ccc3483a47b9f3a95c6ee9f4.tar.gz
sncontinue-1f4878f89549e6c9ccc3483a47b9f3a95c6ee9f4.tar.bz2
sncontinue-1f4878f89549e6c9ccc3483a47b9f3a95c6ee9f4.zip
fixing command history and dropdown
Diffstat (limited to 'extension/react-app/src/tabs/gui.tsx')
-rw-r--r--extension/react-app/src/tabs/gui.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx
index 3cce30de..ca369547 100644
--- a/extension/react-app/src/tabs/gui.tsx
+++ b/extension/react-app/src/tabs/gui.tsx
@@ -139,9 +139,16 @@ function GUI(props: GUIProps) {
useEffect(() => {
const listener = (e: any) => {
- // Cmd + J to toggle fast model
+ // Cmd + i to toggle fast model
if (e.key === "i" && e.metaKey && e.shiftKey) {
setUsingFastModel((prev) => !prev);
+ // Cmd + backspace to stop currently running step
+ } else if (
+ e.key === "Backspace" &&
+ e.metaKey &&
+ typeof history?.current_index !== "undefined"
+ ) {
+ client?.deleteAtIndex(history.current_index);
}
};
window.addEventListener("keydown", listener);
@@ -149,7 +156,7 @@ function GUI(props: GUIProps) {
return () => {
window.removeEventListener("keydown", listener);
};
- }, []);
+ }, [client, history]);
useEffect(() => {
client?.onStateUpdate((state: FullState) => {