Browse Source

fixed condition where blank lcp would create never ending strings

pull/2/head
David Haukeness 5 years ago
parent
commit
ccf2136a61
No known key found for this signature in database
GPG Key ID: A7F1091956853EF9
  1. 2
      main.go

2
main.go

@ -294,9 +294,11 @@ func handleTab() error {
// now call get the list of all possible cantidates that have that as a prefix // now call get the list of all possible cantidates that have that as a prefix
resultSlice := generateTabCompletionSlice(s) resultSlice := generateTabCompletionSlice(s)
lcp := longestCommonPrefix(resultSlice) lcp := longestCommonPrefix(resultSlice)
if lcp != "" {
remainder := stringRemainder(s, lcp) remainder := stringRemainder(s, lcp)
writeToView("Input", remainder) writeToView("Input", remainder)
} }
}
return nil return nil
} }

Loading…
Cancel
Save