dasupradyumna/midnight.nvim

Bug: indent guides not visible with Midnight -- but appear after switching between different color schemes

Closed this issue ยท 4 comments

Did you check documentation and existing issues?

  • I have read all the midnight.nvim documentation
  • I have searched through all existing issues of midnight.nvim
  • My issue is non-trivial and does not belong in the Discussions section

Neovim version (nvim -v)

0.9.5

Operating system / version (for eg., uname -sro)

Linux 6.7.1-arch1-1 GNU/Linux

Describe the bug

No indent guide bars are shown when using midnight.nvim. However, changing 'colorscheme' to another scheme and then back to midnight will show the guide bars. Indent bars courtesy of indent-blankline.nvim.

Steps To Reproduce

  1. Start nvim with only indent-blankline.nvim and midnight.nvim modules loading via Lazy.
  2. Open midnight.lua. No guidebars shown for indented code sections. (1-midnight-no-guidebars.png)
  3. Change colorscheme to Default. Guidebars are shown. (2-default-guidebars.png)
  4. Change colorscheme back to midnight. Guidebars are shown. (3-midnight-with-guidebars.png)
    1-midnight-without-guidebars
    2-default-guidebars
    3-midnight-with-guidebars

Expected Behavior

Guidebars should be visible in midnight without having to change colorschemes.

Additional, unrelated: I really enjoy this color scheme and it is my daily driver. Thank you for your time and effort putting it together for the Neovim gang. Only fine-tune selection I made was to have matching parens show up better against the dark background:

MatchParen = { fg = require('midnight.colors').palette.orange[1] },
This was commented out in my tests so it does not appear to affect the guidebars.

Any additional info you need, LMK!

Repro

-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system {
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  }
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
require("lazy").setup({
  {
    "dasupradyumna/midnight.nvim",
    lazy = false,
    priority = 1000,
    config = function()
      require('midnight').setup {
        --- add code here
      }
    end,
  }
}, { root = root .. "/plugins" })

vim.cmd.colorscheme "midnight"

Thanks for the issue!
I use my custom indent guide logic, so it seems I did not add support for this plugin.
Will be done within the next week.

Cheers ~

Hello, I have tried reproducing your issue but I couldn't.
indent-blankline.nvim seems to work fine. Plus I went through the plugin documentation and found that every highlight has a fallback if a colorscheme does not define it. So, it is working as expected.

Can you open neovim using this command $ nvim -u repro.lua in a test directory and see if your bug persists?

Below is the config repro.lua which I used to try to reproduce your issue.

-- repro.lua

-- DO NOT change the paths
local root = vim.fn.fnamemodify('./.repro', ':p')

-- set stdpaths to use .repro
for _, name in ipairs { 'config', 'data', 'state', 'cache' } do
  vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end

-- bootstrap lazy
local lazypath = root .. '/plugins/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system {
    'git',
    'clone',
    '--filter=blob:none',
    'https://github.com/folke/lazy.nvim.git',
    lazypath,
  }
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
require('lazy').setup({
  {
    'dasupradyumna/midnight.nvim',
    lazy = false,
    priority = 1000,
    config = function() require('midnight').setup {} end,
  },
  {
    'lukas-reineke/indent-blankline.nvim',
    main = 'ibl',
    opts = {},
  },
}, { root = root .. '/plugins' })

vim.cmd.colorscheme 'midnight'

This is how the above config renders the indents

image

Welp, you're right. It's working now. Attached are two repro dirs, one with Kitty (my daily driver) and one with xterm. If I had to guess, something in the treesitter stuff going on the past couple of weeks changed things just enough so the lines weren't showing up. I'm usually pretty good about synching plugins; I could have missed an update and thus the "problem."

Go ahead and close this bug -- mark it fixed if you're feeling generous, "delusional user" if you're not. :D Again, thank you for the great theme and my gratitude for your work on the "bug." --Mike

kitty-repro.tar.gz
xterm-repro.tar.gz