mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
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:
committed by
SiegeLord
parent
03e1b27826
commit
620650219e
+2
-5
@@ -39,12 +39,9 @@ fn visit_expr(&mut self, ex: &'v ast::Expr) {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user