소스 검색

Add keys.input_view.send_message field to configuration

ayn2op 3 년 전
부모
커밋
2c51b9a41d
2개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 0
      config/config.go
  2. 1 1
      ui/input_view.go

+ 2 - 0
config/config.go

@@ -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",
 			},

+ 1 - 1
ui/input_view.go

@@ -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()