Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
cryptomilk opened this issue Sep 8, 2022 · 4 comments
Closed
3 tasks done
Labels
mini.indentscope neovim-upstream Related to how Neovim works

Comments

@cryptomilk
Copy link
Contributor

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 cryptomilk added the bug Something isn't working label Sep 8, 2022
@echasnovski
Copy link
Owner

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 Allow separate priority of virt_text entries in nvim_buf_set_extmark() 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 echasnovski added neovim-upstream Related to how Neovim works and removed bug Something isn't working labels Sep 8, 2022
@cryptomilk
Copy link
Contributor Author

Thank you very much for looking into that.

echasnovski added a commit that referenced this issue Dec 10, 2022
Details:
- It was more of a way to properly show scope indicator on empty lines. As the
  other, better approach was found by @mivort (use `virt_text_win_col`, which always
  was an option), use it.
- Resolves #125.
@echasnovski
Copy link
Owner

This should be fixed in latest main.

@cryptomilk
Copy link
Contributor Author

Works great, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mini.indentscope neovim-upstream Related to how Neovim works
Projects
None yet
Development

No branches or pull requests

2 participants