@@ -85,7 +85,15 @@ func doLongShortInternal(p LongShortCompleter, line []rune, pos int, origLine []
85
85
newLine = append (newLine , []rune {' ' })
86
86
}
87
87
} else {
88
- newLine = append (newLine , []rune (fmt .Sprintf ("%s\t %s" , childName , string (child .Text ))))
88
+ if long {
89
+ newLine = append (newLine , []rune (fmt .Sprintf ("%s\t \t %s" , childName , string (child .Text ))))
90
+ } else {
91
+ if newLine == nil {
92
+ newLine = [][]rune {[]rune (childName )}
93
+ } else {
94
+ newLine [0 ] = []rune (fmt .Sprintf ("%s\t %s" , string (newLine [0 ]), childName ))
95
+ }
96
+ }
89
97
}
90
98
offset = len (childName )
91
99
lineCompleter = child
@@ -95,8 +103,15 @@ func doLongShortInternal(p LongShortCompleter, line []rune, pos int, origLine []
95
103
// check if whole line matches a child
96
104
if runes .HasPrefix ([]rune (childName ), line ) {
97
105
// the entire line already matches a child
98
- // newLine = append(newLine, []rune(childName[len(line):]))
99
- newLine = append (newLine , []rune (fmt .Sprintf ("%s\t \t %s" , childName [len (line ):], string (child .Text ))))
106
+ if long {
107
+ newLine = append (newLine , []rune (fmt .Sprintf ("%s\t \t %s" , childName [len (line ):], string (child .Text ))))
108
+ } else {
109
+ if newLine == nil {
110
+ newLine = [][]rune {[]rune (childName )}
111
+ } else {
112
+ newLine [0 ] = []rune (fmt .Sprintf ("%s\t %s" , string (newLine [0 ]), childName ))
113
+ }
114
+ }
100
115
101
116
offset = len (line )
102
117
lineCompleter = child
0 commit comments