package action
import (
+ "log"
"regexp"
"runtime"
"strings"
return b.Autocomplete(buffer.BufferComplete)
}
+// CycleAutocompleteBack cycles back in the autocomplete suggestion list
+func (h *BufPane) CycleAutocompleteBack() bool {
+ if h.Cursor.HasSelection() {
+ return false
+ }
+ log.Println(h.Buf.HasSuggestions)
+
+ if h.Buf.HasSuggestions {
+ h.Buf.CycleAutocomplete(false)
+ log.Println("TRUE")
+ return true
+ }
+ return false
+}
+
// InsertTab inserts a tab or spaces
func (h *BufPane) InsertTab() bool {
b := h.Buf
"Alt-CtrlH": "DeleteWordLeft",
"Alt-Backspace": "DeleteWordLeft",
"Tab": "Autocomplete|IndentSelection|InsertTab",
- "Backtab": "OutdentSelection|OutdentLine",
+ "Backtab": "CycleAutocompleteBack|OutdentSelection|OutdentLine",
"CtrlO": "OpenFile",
"CtrlS": "Save",
"CtrlF": "Find",
}
func (h *BufPane) execAction(action func(*BufPane) bool, name string, cursor int) bool {
- if name != "Autocomplete" {
+ if name != "Autocomplete" && name != "CycleAutocompleteBack" {
h.Buf.HasSuggestions = false
}
"IndentSelection": (*BufPane).IndentSelection,
"OutdentSelection": (*BufPane).OutdentSelection,
"Autocomplete": (*BufPane).Autocomplete,
+ "CycleAutocompleteBack": (*BufPane).CycleAutocompleteBack,
"OutdentLine": (*BufPane).OutdentLine,
"Paste": (*BufPane).Paste,
"PastePrimary": (*BufPane).PastePrimary,
"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 {