mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-20 22:21:44 +08:00
fish_indent: Don't unescape backslash-escapes
This commit is contained in:
parent
2f56462e46
commit
dc228432d2
|
@ -253,10 +253,10 @@ void prettifier_t::prettify_node(const parse_node_tree_t &tree, node_offset_t no
|
|||
append_whitespace(node_indent);
|
||||
}
|
||||
wcstring unescaped{source, node.source_start, node.source_length};
|
||||
// Unescape the string - this leaves special markers around if there are any expansions or anything.
|
||||
// TODO: This also already computes backslash-escapes like \u or \x.
|
||||
// We probably don't want that - if someone picked `\x20` to spell space, they have a reason.
|
||||
unescape_string_in_place(&unescaped, UNESCAPE_SPECIAL);
|
||||
// Unescape the string - this leaves special markers around if there are any
|
||||
// expansions or anything. We specifically tell it to not compute backslash-escapes
|
||||
// like \U or \x, because we want to leave them intact.
|
||||
unescape_string_in_place(&unescaped, UNESCAPE_SPECIAL | UNESCAPE_NO_BACKSLASHES);
|
||||
|
||||
// Remove INTERNAL_SEPARATOR because that's a quote.
|
||||
auto quote = [](wchar_t ch) { return ch == INTERNAL_SEPARATOR; };
|
||||
|
|
Loading…
Reference in New Issue
Block a user