1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-22 08:47:24 +00:00

fixed condition where blank lcp would create never ending strings

This commit is contained in:
2019-10-10 09:57:36 -06:00
parent 316fbfa9aa
commit ccf2136a61

View File

@ -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
}