A simple CPU rendered GUI IDE experience.
Diffstat (limited to 'src/text.rs')
| -rw-r--r-- | src/text.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/text.rs b/src/text.rs index 55cf331..580dab3 100644 --- a/src/text.rs +++ b/src/text.rs @@ -820,7 +820,7 @@ impl TextArea { _ = self.remove(f); } else { ceach!(self.cursor, |cursor| { - _ = self.remove((*cursor) - 1..*cursor); + _ = self.remove(cursor.saturating_sub(1)..*cursor); // FIXME: maybe? }); self.set_ho(); @@ -1460,6 +1460,10 @@ pub fn hl( if end == 4294967295 { break; } + if end < at { + at = end; + continue; + } for &h in &highlight_stack { let y1 = text.byte_to_line(at); let y2 = text.byte_to_line(end); |