From 50295165238224bd2f59632c72d6d73a74a11b55 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sat, 21 Dec 2024 20:03:17 +0530 Subject: [PATCH] add next line hotkey in text area intent hook --- src/app/hooks/useTextAreaIntent.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/hooks/useTextAreaIntent.ts b/src/app/hooks/useTextAreaIntent.ts index 90f1cc37..113316ec 100644 --- a/src/app/hooks/useTextAreaIntent.ts +++ b/src/app/hooks/useTextAreaIntent.ts @@ -36,6 +36,11 @@ export const useTextAreaIntentHandler = ( target.focus(); } if (isKeyHotkey('enter', evt) || isKeyHotkey('shift+enter', evt)) { + evt.preventDefault(); + const cursor = Cursor.fromTextAreaElement(target); + operations.select(intent.addNewLine(cursor)); + } + if (isKeyHotkey('mod+enter', evt)) { evt.preventDefault(); const cursor = Cursor.fromTextAreaElement(target); operations.select(intent.addNextLine(cursor));