summaryrefslogtreecommitdiff
path: root/extension/react-app/src/components
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-08-29 19:13:46 -0700
committerNate Sesti <sestinj@gmail.com>2023-08-29 19:13:46 -0700
commit850c8aea7f3d9c46ff8e98bde936b92282376dae (patch)
tree35fc18f48c442af92f4d62f3dbe6a4a1aada1126 /extension/react-app/src/components
parentb144d21b48a94aa8c203469eb7667bd22fc4e243 (diff)
downloadsncontinue-850c8aea7f3d9c46ff8e98bde936b92282376dae.tar.gz
sncontinue-850c8aea7f3d9c46ff8e98bde936b92282376dae.tar.bz2
sncontinue-850c8aea7f3d9c46ff8e98bde936b92282376dae.zip
fix: :bug: fix inability to copy/paste when ipynb is open
Diffstat (limited to 'extension/react-app/src/components')
-rw-r--r--extension/react-app/src/components/Layout.tsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/extension/react-app/src/components/Layout.tsx b/extension/react-app/src/components/Layout.tsx
index 143b2302..500dc921 100644
--- a/extension/react-app/src/components/Layout.tsx
+++ b/extension/react-app/src/components/Layout.tsx
@@ -101,6 +101,15 @@ const Layout = () => {
if (event.metaKey && event.altKey && event.code === "KeyN") {
client?.loadSession(undefined);
}
+ if (event.metaKey && event.code === "KeyC") {
+ const selection = window.getSelection()?.toString();
+ if (selection) {
+ // Copy to clipboard
+ setTimeout(() => {
+ navigator.clipboard.writeText(selection);
+ }, 100);
+ }
+ }
};
window.addEventListener("keydown", handleKeyDown);