From 2f5adfad758a06177855af39c0da900943fe7c20 Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Fri, 17 Aug 2018 20:36:24 -0700 Subject: [PATCH] Run rustfmt. No functional changes. --- src/editor/mod.rs | 3 ++- src/term_ui/mod.rs | 16 +++++++--------- src/utils.rs | 3 ++- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/editor/mod.rs b/src/editor/mod.rs index 08e5f45..887ad74 100644 --- a/src/editor/mod.rs +++ b/src/editor/mod.rs @@ -373,7 +373,8 @@ impl Editor { c.range.1 += offset; // Figure out how many spaces to insert - let vis_pos = self.formatter + let vis_pos = self + .formatter .index_to_horizontal_v2d(&self.buffer, c.range.0); // TODO: handle tab settings let next_tab_stop = diff --git a/src/term_ui/mod.rs b/src/term_ui/mod.rs index 011e5ca..5ddd025 100644 --- a/src/term_ui/mod.rs +++ b/src/term_ui/mod.rs @@ -59,9 +59,7 @@ macro_rules! ui_loop { // Check for screen resize let (w, h) = termion::terminal_size().unwrap(); - let needs_update = $term_ui - .editor - .update_dim(h as usize - 1, w as usize); + let needs_update = $term_ui.editor.update_dim(h as usize - 1, w as usize); if needs_update { $term_ui.width = w as usize; $term_ui.height = h as usize; @@ -415,9 +413,9 @@ impl TermUI { let mut last_pos_y = 0; let mut lines_traversed: usize = 0; let line_len = line.len_chars(); - let mut g_iter = editor.formatter.iter(RopeGraphemes::new(&line.slice( - (line_block_index * LINE_BLOCK_LENGTH)..line_len, - ))); + let mut g_iter = editor.formatter.iter(RopeGraphemes::new( + &line.slice((line_block_index * LINE_BLOCK_LENGTH)..line_len), + )); loop { if let Some((g, (pos_y, pos_x), width)) = g_iter.next() { @@ -506,9 +504,9 @@ impl TermUI { line_block_index += 1; line_g_index = 0; let line_len = line.len_chars(); - g_iter = editor.formatter.iter(RopeGraphemes::new(&line.slice( - (line_block_index * LINE_BLOCK_LENGTH)..line_len, - ))); + g_iter = editor.formatter.iter(RopeGraphemes::new( + &line.slice((line_block_index * LINE_BLOCK_LENGTH)..line_len), + )); lines_traversed += 1; } } diff --git a/src/utils.rs b/src/utils.rs index 040ca6c..d8d28bb 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -156,7 +156,8 @@ impl<'a> Iterator for RopeGraphemes<'a> { let a = self.cursor.cur_cursor(); let b; loop { - match self.cursor + match self + .cursor .next_boundary(self.cur_chunk, self.cur_chunk_start) { Ok(None) => {