mini.nvim icon indicating copy to clipboard operation
mini.nvim copied to clipboard

indent: When the indent marker is displayed it removes 'listchar' for tabs before it.

Open cryptomilk opened this issue 3 years ago • 2 comments

Contributing guidelines

Module(s)

indent

Description

When the indent marker is displayed and you use:

vim.opt.listchars       = { tab     = '»·', }

Then the it will remove the listchar for indented code for more than one level.

ident_with_tab_listchar

Neovim version

0.7.2

Steps to reproduce

  1. In your config set:
vim.opt.listchars       = { tab     = '»·', }
  1. configure mini.nvim indent
  2. Open source code with tabs e.g. Samba source code

Expected behavior

The listchar should not be removed by the indent marker.

Actual behavior

The listchar is removed by the indent marker. See image above.

cryptomilk avatar Sep 08 '22 07:09 cryptomilk

Thanks for the issue!

Unfortunately, this is how extmarks (which are used for displaying scope) work right now, to the best of my knowledge. This is a combination of two limitations:

  • Marks can only be placed beside text, but can be arbitrary width. So to enable showing scope on empty lines, extmarks are placed in the first column and have padded text for them.
  • There is no way to have different priority for different parts of extmark text (highlight group - yes, priority - no). So until neovim/neovim#17366 is resolved, I can't see a way to solve this reliably. And even after that, I am not sure how priority of extmarks will interact with listchars.

echasnovski avatar Sep 08 '22 07:09 echasnovski

Thank you very much for looking into that.

cryptomilk avatar Sep 08 '22 08:09 cryptomilk

This should be fixed in latest main.

echasnovski avatar Dec 11 '22 09:12 echasnovski

Works great, thank you very much!

cryptomilk avatar Dec 16 '22 13:12 cryptomilk