quote filenames in prompts

This commit is contained in:
Gokcehan 2020-07-17 02:17:24 +03:00
parent ffdcb71897
commit 9880104c12

View File

@ -763,9 +763,9 @@ func (e *callExpr) eval(app *app, args []string) {
} }
if selections := len(fileOrSelections); selections == 1 { if selections := len(fileOrSelections); selections == 1 {
app.ui.cmdPrefix = "delete " + fileOrSelections[0] + " [y/N]? " app.ui.cmdPrefix = "delete '" + fileOrSelections[0] + "' ? [y/N] "
} else { } else {
app.ui.cmdPrefix = "delete " + strconv.Itoa(selections) + " items [y/N]? " app.ui.cmdPrefix = "delete " + strconv.Itoa(selections) + " items? [y/N] "
} }
} }
app.ui.loadFile(app.nav) app.ui.loadFile(app.nav)
@ -1141,7 +1141,7 @@ func (e *callExpr) eval(app *app, args []string) {
newDir := filepath.Dir(newPath) newDir := filepath.Dir(newPath)
if _, err := os.Stat(newDir); os.IsNotExist(err) { if _, err := os.Stat(newDir); os.IsNotExist(err) {
app.ui.cmdPrefix = "create " + newDir + "?[y/N]" app.ui.cmdPrefix = "create '" + newDir + "' ? [y/N] "
return return
} }
@ -1152,7 +1152,7 @@ func (e *callExpr) eval(app *app, args []string) {
} }
if newStat, err := os.Stat(newPath); !os.IsNotExist(err) && !os.SameFile(oldStat, newStat) { if newStat, err := os.Stat(newPath); !os.IsNotExist(err) && !os.SameFile(oldStat, newStat) {
app.ui.cmdPrefix = "replace " + newPath + "?[y/N]" app.ui.cmdPrefix = "replace '" + newPath + "' ? [y/N] "
return return
} }