lukas-reineke / indent-blankline.nvim

Indent guides for Neovim
MIT License
4.14k stars 102 forks source link

Indent char got disappeared when formatting using mason formatter. #865

Closed swahpy closed 4 months ago

swahpy commented 4 months ago

Problem

With indent-blankline running, the indent char will disappear after performing formatting using formatters downloaded via mason. Please take a look at the video, whenever the keymap is pressed to format, the indent char will be hidden.

https://github.com/lukas-reineke/indent-blankline.nvim/assets/57909991/7a1a43c7-7aa3-45d7-b7e6-8577200110d6

Steps to reproduce

My configuration for ibl is quite simple, which is as below,

{
  "lukas-reineke/indent-blankline.nvim",
  event = { "BufReadPre", "BufNewFile" },
  main = "ibl",
  opts = {
    indent = { char = "┇" },
    exclude = {
      filetypes = {
        "dashboard", -- disable indent line for dashboard
      },
    },
  },
},

Steps to reproduce: Each time to format current buffer.

Expected behavior

the indent char should be kept as it is.

Not sure if it is an issue from ibl, or should I have to config formatters locally? While after I searched a little bit online, I could see others have similar setup and have normal behavior. Thank you in advance for any hints.

Neovim version (nvim -v)

NVIM v0.9.5 Build type: Release LuaJIT 2.1.1692716794

lukas-reineke commented 4 months ago

Please use the minimal reproduction template and provide steps on how to cause the issue.

swahpy commented 4 months ago

Hi

Please use the minimal reproduction template and provide steps on how to cause the issue.

Thank you for your quick reply. Latest update: I've got this fixed via putting vim.opt.list = true line after vim.opt.listchars. I think the order should not be a problem, while it did work after I changed that. Maybe it is a temporary issue. I have no idea. Thank you again and apologize for any confusion.

lukas-reineke commented 4 months ago

The order of list and listchars does not matter.

I'll close, please feel free to reopen when you know how to reproduce it.