Closed luiz00martins closed 1 year ago
So to be clear, you want to flexibly enable/disable the number
via the setup
function:
require("relative-toggle").setup({
set_number = true | false, -- set number | set nonumber
}
or do you just want it to always enable the number
when relative-toggle
is active?
More options is always better :)
I'd go for the first one.
More options is always better :)
I'd go for the first one.
Thanks, let me think about it. Please let me know if you have any better ideas or if you can even make your own PR, I am always open to it. 😁
Actually, I think I wasn't clear in my original message. What I'm looking for is the syncronization of number
and relativenumber
.
Currently in my setup, I have relativenumber
and nonumber
, as I don't like the "current-line-only" behaviour of both of them together. However, I like the concept of the plugin of enabling it on certain occasions/unused buffers.
Currently, the plugin would force me to enable number
, which results in the current focused buffer to display the current line's number, which I don't like (I prefer the 0
).
Here's the behaviour that I would like:
set_number = true
: Whenever relative-toggle toggles relativenumber
for a buffer, it also toggles number
. So, if the user has the options relativenumber
and nonumber
, the focused buffer will have relativenumber
and nonumber
, while the unfocused one will have norelativebuffer
and number
.set_number = nil | false
: number
is untouched (or maybe always active, if that's a better behaviour)The latest update is available now. I came up with a decision to not let users call any redundant setup and this should be a default behavior.
Thanks for your suggestion! Please let me know if you see something unexpected happen. 😄
I've got a small bug, which I think was introduced by #8, although I'm not sure.
Basically, my dashboard (and other buffer types which are naturally nonumber
and norelativenumber
) is made to show numbers when it's unfocused:
Perhaps buffers which are nonumber
and norelativenumber
should be left alone by default? I don't know if that would break some current behaviour.
I've got a small bug, which I think was introduced by #8, although I'm not sure.
Basically, my dashboard (and other buffer types which are naturally
nonumber
andnorelativenumber
) is made to show numbers when it's unfocused:
I just notice this bug. 🥲
Perhaps buffers which are
nonumber
andnorelativenumber
should be left alone by default? I don't know if that would break some current behaviour.
That is why we have to check if a buffer set vim.o.number
in the first place. I have reverted all of the changes made before and will try to find another approach in the future, sorry 😭
I have just pushed a new fix that ignores those buffers which set nonumber
and norelativenumber
by default, I just need to make sure relative
number are always set when first enter main buffer. Sorry for the unexpected result you have 🥲
Yep, it's working!
Thank you for the fix, and thank you for the great plugin 😄
Is your feature request related to a problem? Please describe.
Currently, you need to have the option
set number
enabled for the functionality of relative-toggle to work.Describe the solution you'd like
Add an option to also automatically enable/disable the
number
option together withrelativenumber
.Describe alternatives you've considered
\<none>
Additional context
No response