reader: Remove a panic

The special input functions self-insert, self-insert-not-first, and
and or used to be handled by inputter_t::readch, but they aren't
anymore with `commandline -f`.

I am unsure if these *would* have worked, I can't come up with a use.

So, for now, do nothing instead of panicking.
This commit is contained in:
Fabian Boehm 2024-06-10 17:14:13 +02:00
parent c7d878a8d2
commit 652996124d
2 changed files with 6 additions and 1 deletions

View File

@ -3172,7 +3172,8 @@ impl ReaderData {
self.parser().libdata_mut().is_repaint = false; self.parser().libdata_mut().is_repaint = false;
} }
rl::SelfInsert | rl::SelfInsertNotFirst | rl::FuncAnd | rl::FuncOr => { rl::SelfInsert | rl::SelfInsertNotFirst | rl::FuncAnd | rl::FuncOr => {
panic!("should have been handled by inputter_t::readch"); // This can be reached via `commandline -f and` etc
// panic!("should have been handled by inputter_t::readch");
} }
} }
} }

View File

@ -375,6 +375,10 @@ expect_prompt("foobar")
# This should do nothing instead of crash # This should do nothing instead of crash
sendline("commandline -f backward-jump") sendline("commandline -f backward-jump")
expect_prompt() expect_prompt()
sendline("commandline -f self-insert")
expect_prompt()
sendline("commandline -f and")
expect_prompt()
# Check that the builtin version of `exit` works # Check that the builtin version of `exit` works
# (for obvious reasons this MUST BE LAST) # (for obvious reasons this MUST BE LAST)