Expand tilde during autocompletion (#1246)
This commit is contained in:
1 parent
346c439f76
commit
5b934c2b91
2 files changed
+6
-1
No files matched your search
+1
-1
@@ -335,7 +335,7 @@ func matchFile(s string) (matches []string, longest []rune) {
|
||||
if isRoot(s) || filepath.Base(s) != s {
|
||||
name = filepath.Join(filepath.Dir(unescape(s)), f.Name())
|
||||
}
|
||||
name = escape(name)
|
||||
name = escape(replaceTilde(name))
|
||||
|
||||
item := f.Name()
|
||||
if f.Mode().IsDir() {
|
||||
|
||||
@@ -947,6 +947,11 @@ func doComplete(app *app) (matches []string) {
|
||||
|
||||
func menuComplete(app *app, dir int) {
|
||||
if !app.menuCompActive {
|
||||
toks := tokenize(string(app.ui.cmdAccLeft))
|
||||
for i, tok := range toks {
|
||||
toks[i] = replaceTilde(tok)
|
||||
}
|
||||
app.ui.cmdAccLeft = []rune(strings.Join(toks, " "))
|
||||
app.ui.cmdTmp = app.ui.cmdAccLeft
|
||||
app.menuComps = doComplete(app)
|
||||
if len(app.menuComps) > 1 {
|
||||
|
||||
Reference in new issue
Block a user