Use the block_indent inside visit_expr.
This seems to pass all the tests and greatly improves the formatting output when using hard tabs.
This commit is contained in:
parent
03e1b27826
commit
620650219e
1 changed files with 2 additions and 5 deletions
|
|
@ -39,12 +39,9 @@ impl<'a, 'v> visit::Visitor<'v> for FmtVisitor<'a> {
|
|||
self.codemap.lookup_char_pos(ex.span.hi));
|
||||
self.format_missing(ex.span.lo);
|
||||
|
||||
let offset = self.buffer.cur_offset();
|
||||
// FIXME: We put the entire offset into the block_indent, which might not be correct in all
|
||||
// situations.
|
||||
let rewrite = ex.rewrite(&self.get_context(),
|
||||
self.config.max_width - offset,
|
||||
Indent::new(offset, 0));
|
||||
self.config.max_width - self.block_indent.width(),
|
||||
self.block_indent);
|
||||
|
||||
if let Some(new_str) = rewrite {
|
||||
self.buffer.push_str(&new_str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue