Skip to content

Commit 6089843

Browse files
committed
fix spaces position
1 parent 0e515de commit 6089843

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/status_view/render.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ impl ViewContainer for Hunk {
734734
}
735735
}
736736

737+
pub const LINENO_MARGIN: &str = " ";
738+
737739
impl ViewContainer for Line {
738740
fn is_empty(&self, _context: &mut StatusRenderContext<'_>) -> bool {
739741
// lines could not be empty
@@ -886,7 +888,7 @@ impl ViewContainer for Line {
886888
}
887889
} else {
888890
// MARGIN FOR LINENO
889-
buffer.insert(iter, " ");
891+
buffer.insert(iter, LINENO_MARGIN);
890892
buffer.insert(iter, content);
891893
}
892894
}
@@ -923,7 +925,8 @@ impl ViewContainer for Line {
923925
};
924926
// do not add tag twice
925927
// magic 1 is for label
926-
start_iter.forward_chars(stripped_len as i32 + 1);
928+
println!("‼️ line_offset {:?} stripped_len {:?}", start_iter.line_offset(), stripped_len);
929+
start_iter.forward_chars((stripped_len + LINENO_MARGIN.len()) as i32 );
927930
self.add_tag(
928931
buffer,
929932
spaces_tag,

0 commit comments

Comments
 (0)