From 5632a7c0758167014ddac5283720f235cb08f184 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Tue, 5 Dec 2017 17:14:30 +0900 Subject: [PATCH] Process blank lines if only they're within file lines range --- src/missed_spans.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/missed_spans.rs b/src/missed_spans.rs index b25f15b4880..ba99bdd92c0 100644 --- a/src/missed_spans.rs +++ b/src/missed_spans.rs @@ -13,6 +13,7 @@ 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 @@ fn format_missing_inner( 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); -- 2.44.0