Merge pull request #3101 from nrc/pair-newline

Simplify multi-lining binop exprs
This commit is contained in:
Nick Cameron 2018-10-16 09:01:40 +13:00 committed by GitHub
commit bc4414e53c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 70 additions and 68 deletions

View file

@ -291,11 +291,12 @@ fn break_string(max_chars: usize, trim_end: bool, line_end: &str, input: &[&str]
return break_at(max_chars - 1);
}
if let Some(url_index_end) = detect_url(input, max_chars) {
let index_plus_ws = url_index_end + input[url_index_end..]
.iter()
.skip(1)
.position(|grapheme| not_whitespace_except_line_feed(grapheme))
.unwrap_or(0);
let index_plus_ws = url_index_end
+ input[url_index_end..]
.iter()
.skip(1)
.position(|grapheme| not_whitespace_except_line_feed(grapheme))
.unwrap_or(0);
return if trim_end {
SnippetState::LineEnd(
input[..=url_index_end].join("").to_string(),