Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion clap_complete/src/env/shells.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,18 @@ impl EnvCompleter for Fish {

writeln!(
buf,
r#"complete --keep-order --exclusive --command {bin} --arguments "({var}=fish "'{completer}'" -- (commandline --current-process --tokenize --cut-at-cursor) (commandline --current-token))""#
r#"
complete --keep-order --exclusive --command {bin} --arguments \
"({var}=fish "'{completer}'" -- (
set --local tokenize;
if commandline --tokens-expanded >/dev/null 2>&1;
set tokenize --tokens-expanded;
else;
set tokenize --tokenize;
end;
commandline --current-process $tokenize --cut-at-cursor
) (commandline --current-token))"
"#
Comment on lines +222 to +233
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you split this into two commits

  1. Reformats the output
  2. Adds the new flag

Comment on lines +222 to +233
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test for this?

)
}
fn write_complete(
Expand Down
Loading