Improve selection inside ligatures

This commit is contained in:
Jeremy Soller 2022-10-24 14:27:26 -06:00
parent 4107165128
commit ab56c52c73
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
2 changed files with 4 additions and 3 deletions

View file

@ -14,6 +14,7 @@ sys-locale = "0.2"
unicode-bidi = "0.3" unicode-bidi = "0.3"
unicode-linebreak = "0.1" unicode-linebreak = "0.1"
unicode-script = "0.5" unicode-script = "0.5"
unicode-segmentation = "1.7"
[workspace] [workspace]
members = [ members = [

View file

@ -900,7 +900,7 @@ impl<'a> TextBuffer<'a> {
if line_i == start.line.get() && line_i == end.line.get() { if line_i == start.line.get() && line_i == end.line.get() {
// On edge of start and end line, check if any contained glyphs are after start and before end // On edge of start and end line, check if any contained glyphs are after start and before end
for glyph in layout_line.glyphs.iter() { for glyph in layout_line.glyphs.iter() {
if glyph.start >= start.index && glyph.end <= end.index { if glyph.end > start.index && glyph.start < end.index {
inside = true; inside = true;
break; break;
} }
@ -908,7 +908,7 @@ impl<'a> TextBuffer<'a> {
} else if line_i == start.line.get() { } else if line_i == start.line.get() {
// On edge of start line, check if any contained glyphs are after start // On edge of start line, check if any contained glyphs are after start
for glyph in layout_line.glyphs.iter() { for glyph in layout_line.glyphs.iter() {
if glyph.start >= start.index { if glyph.end > start.index {
inside = true; inside = true;
break; break;
} }
@ -916,7 +916,7 @@ impl<'a> TextBuffer<'a> {
} else if line_i == end.line.get() { } else if line_i == end.line.get() {
// On edge of end line, check if any contained glyphs are before end // On edge of end line, check if any contained glyphs are before end
for glyph in layout_line.glyphs.iter() { for glyph in layout_line.glyphs.iter() {
if glyph.end <= end.index { if glyph.start < end.index {
inside = true; inside = true;
break; break;
} }