Rebind escape to clear info and deselect

This commit is contained in:
Zachary Yedidia 2020-07-03 21:02:16 -04:00
parent b793e9bb92
commit 32c8517a90
4 changed files with 16 additions and 2 deletions

View file

@ -1443,6 +1443,18 @@ func (h *BufPane) Escape() bool {
return true
}
// Deselect deselects on the current cursor
func (h *BufPane) Deselect() bool {
h.Cursor.Deselect(true)
return true
}
// ClearInfo clears the infobar
func (h *BufPane) ClearInfo() bool {
InfoBar.Message("")
return true
}
// Quit this will close the current tab or view that is open
func (h *BufPane) Quit() bool {
quit := func() {

View file

@ -635,6 +635,8 @@ var BufKeyActions = map[string]BufKeyAction{
"SkipMultiCursor": (*BufPane).SkipMultiCursor,
"JumpToMatchingBrace": (*BufPane).JumpToMatchingBrace,
"JumpLine": (*BufPane).JumpLine,
"Deselect": (*BufPane).Deselect,
"ClearInfo": (*BufPane).ClearInfo,
"None": (*BufPane).None,
// This was changed to InsertNewline but I don't want to break backwards compatibility

View file

@ -88,7 +88,7 @@ func DefaultBindings() map[string]string {
"F4": "Quit",
"F7": "Find",
"F10": "Quit",
"Esc": "Escape",
"Esc": "Deselect,ClearInfo,RemoveAllMultiCursors",
// Mouse bindings
"MouseWheelUp": "ScrollUp",

View file

@ -90,7 +90,7 @@ func DefaultBindings() map[string]string {
"F4": "Quit",
"F7": "Find",
"F10": "Quit",
"Esc": "Escape",
"Esc": "Deselect,ClearInfo,RemoveAllMultiCursors",
// Mouse bindings
"MouseWheelUp": "ScrollUp",