Skip to content

Commit 4bd905c

Browse files
committed
Fix out of bounds issue
1 parent 8bfe05b commit 4bd905c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
CHANGELOG
22
=========
33

4-
main
5-
----
4+
0.0.4
5+
-----
6+
7+
- Fix out-of-bounds rendering issue
8+
9+
0.0.3
10+
-----
611

712
- Horizontal scrolling
813
- Improved property rendering

src/view/source.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ impl View for SourceComponent {
9494
frame.render_widget(Paragraph::new(lines.clone()).scroll((scroll, app.session_view.source_scroll.1)), rows[0]);
9595

9696
for (line_no, line_length, line) in annotations {
97+
let x_offset = rows[0].x + (line_length as u16).saturating_sub(app.session_view.source_scroll.1);
9798
let area = Rect {
98-
x: rows[0].x + (line_length as u16).saturating_sub(app.session_view.source_scroll.1),
99+
x: x_offset,
99100
y: (line_no as u32).saturating_sub(scroll as u32) as u16 + 1,
100-
width: rows[0].width,
101+
width: rows[0].width.saturating_sub(x_offset),
101102
height: 1,
102103
};
103104

0 commit comments

Comments
 (0)