Fix autocompletion using a slash

This commit is contained in:
Zachary Yedidia 2016-06-09 13:36:16 -04:00
parent e2079ac88e
commit f3f14193c2

View file

@ -186,7 +186,11 @@ func (m *Messenger) Prompt(prompt, historyType string, completionType Completion
}
}
if len(suggestions) == 1 {
m.response = strings.Join(dirs[:len(dirs)-1], "/") + "/" + suggestions[0]
if len(dirs) > 1 {
m.response = strings.Join(dirs[:len(dirs)-1], "/") + "/" + suggestions[0]
} else {
m.response = suggestions[0]
}
m.cursorx = Count(m.response)
}
}