mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 00:01:15 -03:00
fish_indent: Don't panic for gap text
It should be fine to just write the space out here.
This one triggered by `echo b\|\{ | ./fish_indent`
This commit is contained in:
@@ -446,8 +446,9 @@ fn emit_gap_text(&mut self, range: SourceRange, flags: GapFlags) -> bool {
|
||||
self.emit_newline();
|
||||
}
|
||||
} else {
|
||||
panic!("Gap text should only have comments and newlines - instead found token type {:?} with text: {}",
|
||||
tok.type_, tok_text);
|
||||
// Anything else we write a space.
|
||||
self.emit_space_or_indent(GapFlags::default());
|
||||
self.output.push_utfstr(tok_text);
|
||||
}
|
||||
}
|
||||
if needs_nl {
|
||||
|
||||
Reference in New Issue
Block a user