summaryrefslogtreecommitdiff
path: root/extension/react-app/src/tabs
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-06 23:10:18 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-06 23:10:18 -0700
commit19b38863c21656526e0729776682430e0fa277da (patch)
treeb72530369047ba9b90c06aa28310b74e5244ee78 /extension/react-app/src/tabs
parent54d4251ad948c8aab78e027a8fdf095dc8bebd89 (diff)
downloadsncontinue-19b38863c21656526e0729776682430e0fa277da.tar.gz
sncontinue-19b38863c21656526e0729776682430e0fa277da.tar.bz2
sncontinue-19b38863c21656526e0729776682430e0fa277da.zip
fix: :bug: fix command enter, stop streaming on reject
Diffstat (limited to 'extension/react-app/src/tabs')
-rw-r--r--extension/react-app/src/tabs/gui.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx
index 1ea70dd2..e1ecec9e 100644
--- a/extension/react-app/src/tabs/gui.tsx
+++ b/extension/react-app/src/tabs/gui.tsx
@@ -217,9 +217,13 @@ function GUI(props: GUIProps) {
[client]
);
- const onMainTextInput = () => {
+ const onMainTextInput = (event?: any) => {
if (mainTextInputRef.current) {
- const input = (mainTextInputRef.current as any).inputValue;
+ let input = (mainTextInputRef.current as any).inputValue;
+ // cmd+enter to /edit
+ if (event?.metaKey) {
+ input = `/edit ${input}`;
+ }
(mainTextInputRef.current as any).setInputValue("");
if (!client) return;
@@ -352,7 +356,7 @@ function GUI(props: GUIProps) {
// }
ref={mainTextInputRef}
onEnter={(e) => {
- onMainTextInput();
+ onMainTextInput(e);
e.stopPropagation();
e.preventDefault();
}}