Skip to content

Commit

Permalink
Fix horizontal scroll to end of line
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed May 30, 2024
1 parent 5709998 commit cb9d405
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,11 @@ impl Buffer {
if let Some(layout_cursor) = self.layout_cursor(font_system, cursor) {
if let Some(layout_lines) = self.line_layout(font_system, layout_cursor.line) {
if let Some(layout_line) = layout_lines.get(layout_cursor.layout) {
if let Some(glyph) = layout_line.glyphs.get(layout_cursor.glyph) {
if let Some(glyph) = layout_line
.glyphs
.get(layout_cursor.glyph)
.or_else(|| layout_line.glyphs.last())
{
//TODO: use code from cursor_glyph_opt?
let x_a = glyph.x;
let x_b = glyph.x + glyph.w;
Expand Down

0 comments on commit cb9d405

Please sign in to comment.