Skip to content

Commit 63406ac

Browse files
committed
Support offsetting the most recent break
1 parent 8bdf08f commit 63406ac

File tree

1 file changed

+6
-0
lines changed
  • compiler/rustc_ast_pretty/src

1 file changed

+6
-0
lines changed

compiler/rustc_ast_pretty/src/pp.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ impl Printer {
314314
}
315315
}
316316

317+
pub fn offset(&mut self, offset: isize) {
318+
if let Some(BufEntry { token: Token::Break(token), .. }) = &mut self.buf.last_mut() {
319+
token.offset += offset;
320+
}
321+
}
322+
317323
fn check_stream(&mut self) {
318324
while self.right_total - self.left_total > self.space {
319325
if *self.scan_stack.front().unwrap() == self.buf.index_of_first() {

0 commit comments

Comments
 (0)