Add keys.input_view.send_message field to configuration

This commit is contained in:
ayn2op 2022-12-16 19:21:42 +05:30
parent 069599984b
commit 2c51b9a41d
2 changed files with 3 additions and 1 deletions

View file

@ -21,6 +21,7 @@ type MessagesViewKeysConfig struct {
}
type InputViewKeysConfig struct {
SendMessage string `yaml:"send_message"`
OpenExternalEditor string `yaml:"open_external_editor"`
PasteClipboard string `yaml:"paste_clipboard"`
}
@ -72,6 +73,7 @@ func New() *Config {
SelectLastMessage: "End",
},
InputView: InputViewKeysConfig{
SendMessage: "Enter",
OpenExternalEditor: "Ctrl+E",
PasteClipboard: "Ctrl+V",
},

View file

@ -42,7 +42,7 @@ func newInputView(app *Application) *InputView {
func (v *InputView) inputCapture(event *tcell.EventKey) *tcell.EventKey {
switch event.Name() {
case "Enter":
case v.app.config.Keys.InputView.SendMessage:
return v.sendMessage()
case v.app.config.Keys.InputView.OpenExternalEditor:
return v.openExternalEditor()