mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-03-29 14:21:48 +01:00
add next line hotkey in text area intent hook
This commit is contained in:
parent
64a5bf500f
commit
5029516523
1 changed files with 5 additions and 0 deletions
|
@ -36,6 +36,11 @@ export const useTextAreaIntentHandler = (
|
||||||
target.focus();
|
target.focus();
|
||||||
}
|
}
|
||||||
if (isKeyHotkey('enter', evt) || isKeyHotkey('shift+enter', evt)) {
|
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();
|
evt.preventDefault();
|
||||||
const cursor = Cursor.fromTextAreaElement(target);
|
const cursor = Cursor.fromTextAreaElement(target);
|
||||||
operations.select(intent.addNextLine(cursor));
|
operations.select(intent.addNextLine(cursor));
|
||||||
|
|
Loading…
Reference in a new issue