Skip to content

Commit 4609834

Browse files
SiegeLordExSiegeLord
authored andcommitted
Use the block_indent inside visit_expr.
This seems to pass all the tests and greatly improves the formatting output when using hard tabs.
1 parent f51ee1c commit 4609834

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/visitor.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ impl<'a, 'v> visit::Visitor<'v> for FmtVisitor<'a> {
4040
self.format_missing(ex.span.lo);
4141

4242
let offset = self.buffer.cur_offset();
43-
// FIXME: We put the entire offset into the block_indent, which might not be correct in all
44-
// situations.
4543
let rewrite = ex.rewrite(&self.get_context(),
4644
self.config.max_width - offset,
47-
Indent::new(offset, 0));
45+
self.block_indent);
4846

4947
if let Some(new_str) = rewrite {
5048
self.buffer.push_str(&new_str);

0 commit comments

Comments
 (0)