mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-09 13:54:00 +08:00
Don't hardcode enum numbers
"1" in the context of `escape_string(..., 1)` is referring to `ESCAPE_ALL`, so we should use that.
This commit is contained in:
parent
711260593c
commit
d0bd238657
|
@ -593,7 +593,7 @@ void completer_t::complete_cmd_desc(const wcstring &str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
wcstring lookup_cmd(L"__fish_describe_command ");
|
wcstring lookup_cmd(L"__fish_describe_command ");
|
||||||
lookup_cmd.append(escape_string(cmd, 1));
|
lookup_cmd.append(escape_string(cmd, ESCAPE_ALL));
|
||||||
|
|
||||||
// First locate a list of possible descriptions using a single call to apropos or a direct
|
// First locate a list of possible descriptions using a single call to apropos or a direct
|
||||||
// search if we know the location of the whatis database. This can take some time on slower
|
// search if we know the location of the whatis database. This can take some time on slower
|
||||||
|
@ -1603,7 +1603,7 @@ void complete(const wcstring &cmd_with_subcmds, std::vector<completion_t> *out_c
|
||||||
static void append_switch(wcstring &out, const wcstring &opt, const wcstring &argument) {
|
static void append_switch(wcstring &out, const wcstring &opt, const wcstring &argument) {
|
||||||
if (argument.empty()) return;
|
if (argument.empty()) return;
|
||||||
|
|
||||||
wcstring esc = escape_string(argument, 1);
|
wcstring esc = escape_string(argument, ESCAPE_ALL);
|
||||||
append_format(out, L" --%ls %ls", opt.c_str(), esc.c_str());
|
append_format(out, L" --%ls %ls", opt.c_str(), esc.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user