From 846d392c417484515f6f8e4211f5fc573e8bd352 Mon Sep 17 00:00:00 2001 From: Awalrus Date: Fri, 1 Jul 2022 16:16:42 +0300 Subject: [PATCH 1/2] Only highlight inner area of view with cursorline --- helix-term/src/ui/editor.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index a7c67a219b33..d1b9a5188cd9 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -717,9 +717,9 @@ impl EditorView { for line in view.offset.row..(last_line + 1) { let area = Rect::new( - view.area.x, - view.area.y + (line - view.offset.row) as u16, - view.area.width, + view.inner_area().x, + view.inner_area().y + (line - view.offset.row) as u16, + view.inner_area().width, 1, ); if primary_line == line { From f8239dabb7489a88041d2f6dcb3e6a9ee859846a Mon Sep 17 00:00:00 2001 From: Awalrus Date: Fri, 1 Jul 2022 18:03:38 +0300 Subject: [PATCH 2/2] Remove redundant calculations of inner_area --- helix-term/src/ui/editor.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index d1b9a5188cd9..0e1f553ff092 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -715,11 +715,12 @@ impl EditorView { let primary_style = theme.get("ui.cursorline.primary"); let secondary_style = theme.get("ui.cursorline.secondary"); + let inner_area = view.inner_area(); for line in view.offset.row..(last_line + 1) { let area = Rect::new( - view.inner_area().x, - view.inner_area().y + (line - view.offset.row) as u16, - view.inner_area().width, + inner_area.x, + inner_area.y + (line - view.offset.row) as u16, + inner_area.width, 1, ); if primary_line == line {