mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-03 01:41:15 -03:00
Make ESCAPE_ALL the default and call its inverse ESCAPE_NO_PRINTABLES
ESCAPE_ALL is not really a helpful name. Also it's the most common flag. Let's make it the default so we can remove this unhelpful name. While at it, let's add a default value for the flags argument, which helps most callers. The absence of ESCAPE_ALL makes it only escape nonprintable characters (with some exceptions). We use this for displaying strings in the completion pager as well as for the human-readable output of "set", "set -S", "bind" and "functions". No functional change.
This commit is contained in:
@@ -1330,8 +1330,7 @@ void reader_write_title(const wcstring &cmd, parser_t &parser, bool reset_cursor
|
||||
fish_title_command = L"fish_title";
|
||||
if (!cmd.empty()) {
|
||||
fish_title_command.append(L" ");
|
||||
fish_title_command.append(
|
||||
escape_string(cmd, ESCAPE_ALL | ESCAPE_NO_QUOTED | ESCAPE_NO_TILDE));
|
||||
fish_title_command.append(escape_string(cmd, ESCAPE_NO_QUOTED | ESCAPE_NO_TILDE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1650,8 +1649,8 @@ wcstring completion_apply_to_command_line(const wcstring &val, complete_flags_t
|
||||
wcstring sb(buff, begin - buff);
|
||||
|
||||
if (do_escape) {
|
||||
wcstring escaped = escape_string(
|
||||
val, ESCAPE_ALL | ESCAPE_NO_QUOTED | (no_tilde ? ESCAPE_NO_TILDE : 0));
|
||||
wcstring escaped =
|
||||
escape_string(val, ESCAPE_NO_QUOTED | (no_tilde ? ESCAPE_NO_TILDE : 0));
|
||||
sb.append(escaped);
|
||||
move_cursor = escaped.size();
|
||||
} else {
|
||||
@@ -2858,8 +2857,7 @@ expand_result_t::result_t reader_data_t::try_expand_wildcard(wcstring wc, size_t
|
||||
} else {
|
||||
complete_flags_t tildeflag =
|
||||
(match.flags & COMPLETE_DONT_ESCAPE_TILDES) ? ESCAPE_NO_TILDE : 0;
|
||||
joined.append(
|
||||
escape_string(match.completion, ESCAPE_ALL | ESCAPE_NO_QUOTED | tildeflag));
|
||||
joined.append(escape_string(match.completion, ESCAPE_NO_QUOTED | tildeflag));
|
||||
}
|
||||
joined.push_back(L' ');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user