-
Notifications
You must be signed in to change notification settings - Fork 187
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
(mini.indentscope) Add option for a prefix symbol #161
Conversation
This small change adds an ability to use a user-defined symbol for a prefix instead of only a hard-coded space character. The idea is to allow the usage of this plugin with a leading space 'listchar' option enabled.
Hi! Thanks for the PR! This is an interesting idea. Seems like related to #125. Would you mind sharing relevant config parts with which you achieved the second screenshot? |
@echasnovski Sure, here's options I've used: vim.o.listchars = 'lead:┆'
require('mini.indentscope').setup { prefix = '┆' } |
Ok, I see now. I personally don't use it, so didn't know you should also set 'list' option. The two main drawbacks I see with this approach:
Hmm... Maybe allow general string instead of single character would fix it? I'll think about pros and cons of this approach (might be a few days). |
I think I found a way to handle nicely all possible Here how it looks with I've updated PR and added a remark about empty string value case handling in the documentation. Tested on Neovim 0.8. |
Move string.rep to 'if' condition so it won't be called when it isn't needed.
I am a little bit confused right now... Using I'll need to investigate this further. Maybe your PR will indirectly lead to removing some code instead of adding one, which is even better :) |
Without at least some option it will make require('mini.indentscope').setup { symbol = ' ', prefix = ' ' }
vim.cmd [[hi MiniIndentscopeSymbol ctermbg=203 | hi MiniIndentscopePrefix ctermbg=210]] So I think keeping this option may provide a benefit :) (and also allows to keep the old behavior, since the default value is |
True. But the only reason for |
In the end, I decided to make a breaking change of removing Thanks for making PR and showing |
This small change adds an ability to use a user-defined symbol for a prefix instead of only a hard-coded space character. The idea is to allow the usage of this plugin with a leading space 'listchar' option enabled.
Context
Hi! Thanks a lot for a very cool and minimalistic plugin to provide a nice indent visualization without introducing a performance penalty!
I've been using a
listchars
vim option for a while to visualize leading tabs and whitespaces, so when I've stared usingmini.indentscope
plugin, I've noticed that it overwrites existingNonText
marks with a blank space:I think the option to provide a user-defined prefix character instead of hard-coded
' '
could be useful tolistchars
users without introducing a performance penalty. With this patch it's possible to keep the visible whitespaces while getting a highlighted scope under cursor (using the following config):It can also provide users with ability to customize scope visualization with existing
MiniIndentscopePrefix
highlight.In any case, thanks again for a great and very useful Neovim plugin!