From ccf2136a61a5a7356eac765d048289c19c880047 Mon Sep 17 00:00:00 2001 From: David Haukeness Date: Thu, 10 Oct 2019 09:57:36 -0600 Subject: [PATCH] fixed condition where blank lcp would create never ending strings --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index bb58795..293dc3d 100644 --- a/main.go +++ b/main.go @@ -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 }