mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 22:11:11 -03:00
fish_indent: Another crash
NUL at the end, which is now ignored. Not *great*, but better than crashing.
This commit is contained in:
@@ -647,11 +647,11 @@ fn visit_maybe_newlines(&mut self, node: &ast::MaybeNewlines) {
|
||||
// # something
|
||||
// cmd2
|
||||
// Treat it as gap text.
|
||||
if node.range().unwrap().length() == 0 {
|
||||
let Some(range) = node.range() else { return; };
|
||||
if range.length() == 0 {
|
||||
return;
|
||||
}
|
||||
let flags = self.gap_text_flags_before_node(node);
|
||||
let range = node.range().unwrap();
|
||||
self.current_indent = self.indent(range.start());
|
||||
let added_newline = self.emit_gap_text_before(range, flags);
|
||||
let mut gap_range = range;
|
||||
|
||||
@@ -446,3 +446,6 @@ echo b\|\{ | $fish_indent
|
||||
|
||||
echo "\'\\\\\x00\'" | string unescape | $fish_indent | string escape
|
||||
# CHECK: \'\\\x00\'
|
||||
|
||||
echo '\"\"\|\x00' | string unescape | $fish_indent | string unescape
|
||||
# CHECK: |
|
||||
|
||||
Reference in New Issue
Block a user