Disallow exiting from rename: mode with backspace (#1060)

After looking at the list of possibilities for `app.ui.cmdPrefix` by searching
through the code, renaming looks to be the only remaining mode where exiting
via backspace doesn't make sense.

In particular, I don't think any commands other than `rename` commonly start
out with some editable text in the prompt. The other dangerous mode is the `>`
mode, but there exit-on-backspace was already disabled.

Fixes #1052, #1059
This commit is contained in:
Ilya Grigoriev authored and GitHub committed 2023-02-11 20:00:08 +03:00
1 parent 2fe5e4d54e
commit 6440281e82
1 file changed
+3 -2
+3 -2
View File
@@ -1887,8 +1887,9 @@ func (e *callExpr) eval(app *app, args []string) {
switch app.ui.cmdPrefix {
case "!", "$", "%", "&":
app.ui.cmdPrefix = ":"
case ">":
// Don't mess with the program waiting for input
case ">", "rename: ":
// Don't mess with programs waiting for input.
// Exiting on backspace is also inconvenient for renames since the text field starts out nonempty.
default:
normal(app)
}