Remove ctrl+a from default keybindings and fix esc
This commit is contained in:
		@@ -226,6 +226,10 @@ func parseKeybindings(input map[string]string) (output map[Keybind]string) {
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			panic(fmt.Errorf("failed to parse keybinding %s -> %s: %w", shortcut, action, err))
 | 
			
		||||
		}
 | 
			
		||||
		// TODO find out if other keys are parsed incorrectly like this
 | 
			
		||||
		if key == tcell.KeyEscape {
 | 
			
		||||
			ch = 0
 | 
			
		||||
		}
 | 
			
		||||
		parsedShortcut := Keybind{
 | 
			
		||||
			Mod: mod,
 | 
			
		||||
			Key: key,
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,6 @@ main:
 | 
			
		||||
  'Ctrl+Home': scroll_up
 | 
			
		||||
  'Ctrl+End': scroll_down
 | 
			
		||||
  'Ctrl+Enter': add_newline
 | 
			
		||||
  'Ctrl+a': next_active_room
 | 
			
		||||
  'Ctrl+l': show_bare
 | 
			
		||||
  'Alt+Down': next_room
 | 
			
		||||
  'Alt+Up': prev_room
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
package ui
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"maunium.net/go/gomuks/config"
 | 
			
		||||
	"maunium.net/go/mauview"
 | 
			
		||||
	"maunium.net/go/tcell"
 | 
			
		||||
 | 
			
		||||
	"maunium.net/go/mauview"
 | 
			
		||||
	"maunium.net/go/gomuks/config"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const helpText = `# General
 | 
			
		||||
@@ -100,7 +100,8 @@ func (hm *HelpModal) OnKeyEvent(event mauview.KeyEvent) bool {
 | 
			
		||||
		Ch:  event.Rune(),
 | 
			
		||||
		Mod: event.Modifiers(),
 | 
			
		||||
	}
 | 
			
		||||
	if hm.parent.config.Keybindings.Room[kb] == "cancel" {
 | 
			
		||||
	// TODO unhardcode q
 | 
			
		||||
	if hm.parent.config.Keybindings.Modal[kb] == "cancel" || event.Rune() == 'q' {
 | 
			
		||||
		hm.parent.HideModal()
 | 
			
		||||
		return true
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user