fix: textarea - Enter翻译/Ctrl+J换行,禁用Enter自动换行
This commit is contained in:
@@ -119,6 +119,11 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
m.errMsg = ""
|
||||
return m, m.doTranslate(text, m.targetLang)
|
||||
|
||||
case tea.KeyCtrlJ:
|
||||
m.textArea, cmd = m.textArea.Update(msg)
|
||||
m.updateTextAreaHeight()
|
||||
return m, cmd
|
||||
|
||||
case tea.KeyCtrlC:
|
||||
return m, tea.Quit
|
||||
|
||||
@@ -136,10 +141,15 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
case tea.KeyEsc:
|
||||
return m, tea.Quit
|
||||
}
|
||||
}
|
||||
|
||||
m.textArea, cmd = m.textArea.Update(msg)
|
||||
m.updateTextAreaHeight()
|
||||
m.textArea, cmd = m.textArea.Update(msg)
|
||||
m.updateTextAreaHeight()
|
||||
return m, cmd
|
||||
|
||||
default:
|
||||
m.textArea, cmd = m.textArea.Update(msg)
|
||||
m.updateTextAreaHeight()
|
||||
}
|
||||
return m, cmd
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user