fix(tui): 交换 Enter 和 Ctrl+Enter 行为
Enter → 提交文本(handleKeyDown 拦截 return 键) Ctrl+Enter → 换行(handleKeyDown 拦截 ctrl+return,插入 \n) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -355,6 +355,18 @@ function AirCodingView(props: {
|
||||
return
|
||||
}
|
||||
|
||||
// Ctrl+Enter inserts newline at cursor
|
||||
if (event.ctrl && event.name === 'return') {
|
||||
event.preventDefault()
|
||||
if (textarea && !textarea.isDestroyed) {
|
||||
const pos = textarea.cursorOffset
|
||||
const current = textarea.plainText
|
||||
textarea.setText(current.slice(0, pos) + '\n' + current.slice(pos))
|
||||
textarea.cursorOffset = pos + 1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (event.ctrl && event.name === 'c') {
|
||||
event.preventDefault()
|
||||
if (textarea && !textarea.isDestroyed && textarea.plainText.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user