Run rustfmt. No functional changes.

This commit is contained in:
Nathan Vegdahl 2018-08-17 20:36:24 -07:00
parent 0ee183aa72
commit 2f5adfad75
3 changed files with 11 additions and 11 deletions

View File

@ -373,7 +373,8 @@ impl<T: LineFormatter> Editor<T> {
c.range.1 += offset; c.range.1 += offset;
// Figure out how many spaces to insert // 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); .index_to_horizontal_v2d(&self.buffer, c.range.0);
// TODO: handle tab settings // TODO: handle tab settings
let next_tab_stop = let next_tab_stop =

View File

@ -59,9 +59,7 @@ macro_rules! ui_loop {
// Check for screen resize // Check for screen resize
let (w, h) = termion::terminal_size().unwrap(); let (w, h) = termion::terminal_size().unwrap();
let needs_update = $term_ui let needs_update = $term_ui.editor.update_dim(h as usize - 1, w as usize);
.editor
.update_dim(h as usize - 1, w as usize);
if needs_update { if needs_update {
$term_ui.width = w as usize; $term_ui.width = w as usize;
$term_ui.height = h as usize; $term_ui.height = h as usize;
@ -415,9 +413,9 @@ impl TermUI {
let mut last_pos_y = 0; let mut last_pos_y = 0;
let mut lines_traversed: usize = 0; let mut lines_traversed: usize = 0;
let line_len = line.len_chars(); let line_len = line.len_chars();
let mut g_iter = editor.formatter.iter(RopeGraphemes::new(&line.slice( let mut g_iter = editor.formatter.iter(RopeGraphemes::new(
(line_block_index * LINE_BLOCK_LENGTH)..line_len, &line.slice((line_block_index * LINE_BLOCK_LENGTH)..line_len),
))); ));
loop { loop {
if let Some((g, (pos_y, pos_x), width)) = g_iter.next() { if let Some((g, (pos_y, pos_x), width)) = g_iter.next() {
@ -506,9 +504,9 @@ impl TermUI {
line_block_index += 1; line_block_index += 1;
line_g_index = 0; line_g_index = 0;
let line_len = line.len_chars(); let line_len = line.len_chars();
g_iter = editor.formatter.iter(RopeGraphemes::new(&line.slice( g_iter = editor.formatter.iter(RopeGraphemes::new(
(line_block_index * LINE_BLOCK_LENGTH)..line_len, &line.slice((line_block_index * LINE_BLOCK_LENGTH)..line_len),
))); ));
lines_traversed += 1; lines_traversed += 1;
} }
} }

View File

@ -156,7 +156,8 @@ impl<'a> Iterator for RopeGraphemes<'a> {
let a = self.cursor.cur_cursor(); let a = self.cursor.cur_cursor();
let b; let b;
loop { loop {
match self.cursor match self
.cursor
.next_boundary(self.cur_chunk, self.cur_chunk_start) .next_boundary(self.cur_chunk, self.cur_chunk_start)
{ {
Ok(None) => { Ok(None) => {