fixed try ling key processing

This commit is contained in:
Sergey Chernov 2025-11-22 20:01:16 +01:00
parent 5fbb1d5393
commit 4d1cd491e0

View File

@ -269,6 +269,13 @@ fun EditorWithOverlay(
onKeyDown?.invoke(ev) onKeyDown?.invoke(ev)
val ta = taEl ?: return@onKeyDown val ta = taEl ?: return@onKeyDown
val key = ev.key val key = ev.key
// If user pressed Ctrl/Cmd + Enter, treat it as a shortcut (e.g., Run)
// and DO NOT insert a newline here. Let the host handler act.
// Also prevent default so the textarea won't add a line.
if ((ev.ctrlKey || ev.metaKey) && key == "Enter") {
ev.preventDefault()
return@onKeyDown
}
if (key == "Tab") { if (key == "Tab") {
ev.preventDefault() ev.preventDefault()
val start = ta.selectionStart ?: 0 val start = ta.selectionStart ?: 0