From c1c3143532583b68b787dc7d78d7b97b38f8db1f Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 12 Apr 2026 16:39:47 -0600 Subject: [PATCH] fix: hide nvim's horiz window separator to stop the phantom dark row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pixel analysis of the user's screenshot confirmed the "second darker line" below/above our bars is nvim's built-in horizontal window separator. When `laststatus=3` (globalstatus=true), nvim draws `─` between every pair of stacked windows using `fillchars.horiz` painted with `WinSeparator.fg`. Nordfox's WinSeparator.fg is #232831 — dark — which reads as a dim phantom row adjacent to our own bright sep. On debug-mode enter, replace horiz/horizup/horizdown with space so nvim has nothing visible to draw; our bars' own top/bottom separator rows become the only visible chrome between them and neighboring panes. On exit, restore the user's original fillchars. --- lua/turbo-debug/mode.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lua/turbo-debug/mode.lua b/lua/turbo-debug/mode.lua index 80619fd..1e99c82 100644 --- a/lua/turbo-debug/mode.lua +++ b/lua/turbo-debug/mode.lua @@ -25,6 +25,18 @@ local cbar_win, cbar_buf = nil, nil -- installed[buf][name] = { key = lhs, prev_n = , prev_v = } local installed = {} +-- Saved across M.enter → M.exit so we can restore the user's global +-- fillchars. With `laststatus=3`, nvim draws a horizontal separator row +-- between every pair of stacked windows using the `horiz` fillchar +-- (default `─`) painted with WinSeparator.fg. In themes with dark +-- WinSeparator.fg (nordfox uses #232831) that renders as a dim grey row +-- sandwiched between our bright bar separator and the neighboring dapui +-- pane — the "second darker line below the status bar" the user sees. +-- We replace horiz/horizup/horizdown with space during debug mode so +-- nvim has nothing visible to draw between stacked windows; our own +-- bar rows serve as the only chrome. +local saved_fillchars = nil + local dapui_initialized = false local vt_initialized = false @@ -646,6 +658,22 @@ local function close_bars() sbar_zones, cbar_zones = {}, {} end +local function hide_horiz_separators() + if saved_fillchars ~= nil then return end + saved_fillchars = vim.o.fillchars + local fc = vim.opt.fillchars:get() + fc.horiz = " " + fc.horizup = " " + fc.horizdown = " " + vim.opt.fillchars = fc +end + +local function restore_horiz_separators() + if saved_fillchars == nil then return end + vim.o.fillchars = saved_fillchars + saved_fillchars = nil +end + -- nvim sometimes *squishes* a bar to 0 rows rather than closing it when -- grid pressure spikes (notably: bufferline's tabline flipping visible on -- buffer-count change reclaims one row from somewhere, and `winfixheight` @@ -1173,6 +1201,7 @@ function M.enter() if active then return end active = true define_highlights() + hide_horiz_separators() setup_actions() local group = vim.api.nvim_create_augroup("TurboDebugModalKeys", { clear = true }) @@ -1278,6 +1307,7 @@ function M.exit() if dapui_initialized then require("dapui").close() end close_bars() if vt_initialized then require("nvim-dap-virtual-text").disable() end + restore_horiz_separators() end function M.toggle()