mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 17:31:14 -03:00
handle_command_not_found: extract constant
This commit is contained in:
@@ -344,8 +344,9 @@ fn handle_command_not_found(
|
||||
));
|
||||
io.append_from_specs(&list, L!(""));
|
||||
|
||||
if function::exists(L!("fish_command_not_found"), ctx.parser()) {
|
||||
let mut buffer = L!("fish_command_not_found").to_owned();
|
||||
let function_name = L!("fish_command_not_found");
|
||||
if function::exists(function_name, ctx.parser()) {
|
||||
let mut buffer = function_name.to_owned();
|
||||
for arg in &event_args {
|
||||
buffer.push(' ');
|
||||
buffer.push_utfstr(&escape(arg));
|
||||
@@ -353,7 +354,7 @@ fn handle_command_not_found(
|
||||
let parser = ctx.parser();
|
||||
let prev_statuses = parser.last_statuses();
|
||||
|
||||
let event = Event::generic(L!("fish_command_not_found").to_owned());
|
||||
let event = Event::generic(function_name.to_owned());
|
||||
let b = parser.push_block(Block::event_block(event));
|
||||
parser.eval(&buffer, &io);
|
||||
parser.pop_block(b);
|
||||
|
||||
Reference in New Issue
Block a user