Skip to content

Commit

Permalink
Update cosmic-text, fixing CRLF handling (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Apr 30, 2024
1 parent 42cade3 commit 0fa09ab
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/line_number.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use cosmic_text::{
Align, Attrs, AttrsList, BufferLine, Family, FontSystem, LayoutLine, ShapeBuffer, Shaping, Wrap,
Align, Attrs, AttrsList, BufferLine, Family, FontSystem, LayoutLine, LineEnding, ShapeBuffer,
Shaping, Wrap,
};
use std::collections::HashMap;

Expand Down Expand Up @@ -32,7 +33,12 @@ impl LineNumberCache {
//TODO: do not repeat, used in App::init
let attrs = Attrs::new().family(Family::Monospace);
let text = format!("{:width$}", key.number, width = key.width);
let mut buffer_line = BufferLine::new(text, AttrsList::new(attrs), Shaping::Advanced);
let mut buffer_line = BufferLine::new(
text,
LineEnding::default(),
AttrsList::new(attrs),
Shaping::Advanced,
);
buffer_line.set_align(Some(Align::Left));
buffer_line
.layout_in_buffer(
Expand Down

0 comments on commit 0fa09ab

Please sign in to comment.