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. 6
      main.go

6
main.go

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

Loading…
Cancel
Save