mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 05:04:24 +00:00
Process blank lines if only they're within file lines range
This commit is contained in:
parent
53616f63b1
commit
5632a7c075
@ -13,6 +13,7 @@ use std::iter::repeat;
|
||||
|
||||
use syntax::codemap::{BytePos, Pos, Span};
|
||||
|
||||
use codemap::LineRangeUtils;
|
||||
use comment::{rewrite_comment, CodeCharKind, CommentCodeSlices};
|
||||
use config::WriteMode;
|
||||
use shape::{Indent, Shape};
|
||||
@ -76,7 +77,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
self.last_pos = end;
|
||||
let span = mk_sp(start, end);
|
||||
let snippet = self.snippet(span);
|
||||
if snippet.trim().is_empty() {
|
||||
if snippet.trim().is_empty() && !out_of_file_lines_range!(self, span) {
|
||||
// Keep vertical spaces within range.
|
||||
self.push_vertical_spaces(count_newlines(&snippet));
|
||||
process_last_snippet(self, "", &snippet);
|
||||
|
Loading…
Reference in New Issue
Block a user