From 355402e2100a5e537c1bc3baedeb974621a38711 Mon Sep 17 00:00:00 2001
From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com>
Date: Thu, 6 Feb 2025 16:57:49 +0000
Subject: [PATCH] fix: number indicators rendering on top of statusline

---
 helix-term/src/ui/editor.rs | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index ff449fdf..3ca5fd2d 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -1570,9 +1570,15 @@ impl Component for EditorView {
             } else {
                 0
             };
+            let y_offset = if config.statusline.merge_with_commandline {
+                // render macros and key sequences 1 line above
+                1
+            } else {
+                0
+            };
             surface.set_string(
                 area.x + area.width.saturating_sub(key_width + macro_width),
-                area.y + area.height.saturating_sub(1),
+                (area.y + area.height.saturating_sub(1)).saturating_sub(y_offset),
                 disp.get(disp.len().saturating_sub(key_width as usize)..)
                     .unwrap_or(&disp),
                 style,
@@ -1584,7 +1590,7 @@ impl Component for EditorView {
                     .add_modifier(Modifier::BOLD);
                 surface.set_string(
                     area.x + area.width.saturating_sub(3),
-                    area.y + area.height.saturating_sub(1),
+                    (area.y + area.height.saturating_sub(1)).saturating_sub(y_offset),
                     &disp,
                     style,
                 );