*info.InfoBuf
}
-func NewInfoPane(ib *info.InfoBuf, w display.BWindow) *InfoPane {
+func NewInfoPane(ib *info.InfoBuf, w display.BWindow, tab *Tab) *InfoPane {
ip := new(InfoPane)
ip.InfoBuf = ib
- ip.BufPane = NewBufPane(ib.Buffer, w)
+ ip.BufPane = NewBufPane(ib.Buffer, w, tab)
return ip
}
func NewInfoBar() *InfoPane {
ib := info.NewBuffer()
w := display.NewInfoWindow(ib)
- return NewInfoPane(ib, w)
+ return NewInfoPane(ib, w, nil)
}
func (h *InfoPane) Close() {
}
}
+// DoKeyEvent executes a key event for the command bar, doing any overridden actions
func (h *InfoPane) DoKeyEvent(e KeyEvent) bool {
done := false
if action, ok := BufKeyBindings[e]; ok {
for s, a := range InfoOverrides {
// TODO this is a hack and really we should have support
// for having binding overrides for different buffers
- if strings.Contains(estr, s) {
+ if strings.HasPrefix(estr, s) {
done = true
a(h)
break
"HalfPageDown",
"ToggleHelp",
"ToggleKeyMenu",
+ "ToggleDiffGutter",
"ToggleRuler",
"JumpLine",
"ClearStatus",
"CursorDown": (*InfoPane).CursorDown,
"InsertNewline": (*InfoPane).InsertNewline,
"Autocomplete": (*InfoPane).Autocomplete,
- "OutdentLine": (*InfoPane).CycleBack,
"Escape": (*InfoPane).Escape,
"Quit": (*InfoPane).Quit,
"QuitAll": (*InfoPane).QuitAll,
}
}
-// CycleBack cycles back in the autocomplete suggestion list
-func (h *InfoPane) CycleBack() {
- if h.Buf.HasSuggestions {
- h.Buf.CycleAutocomplete(false)
- }
-}
-
// InsertNewline completes the prompt
func (h *InfoPane) InsertNewline() {
if !h.HasYN {