add next line hotkey in text area intent hook

This commit is contained in:
Ajay Bura 2024-12-21 20:03:17 +05:30
parent 64a5bf500f
commit 5029516523

View file

@ -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));