lukas-reineke / indent-blankline.nvim

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

docs: note that overwrite should be after setup #780

Closed Danielkonge closed 10 months ago

Danielkonge commented 10 months ago

I think adding this to the docs will help clarify the use of ibl.overwrite().

lukas-reineke commented 10 months ago

Hm this isn't really correct either. You can use overwrite without setup. The important point is that setup resets everything, and that is already covered in the documentation.

Maybe the documentation for setup can include overwrite.

`setup` is idempotent, meaning you can call it multiple times, and each call
will reset indent-blankline. If you want to only update the current
- configuration, use |ibl.update()|.
+ configuration, use |ibl.update()| or |ibl.overwrite()|.
Danielkonge commented 10 months ago

Hm this isn't really correct either. You can use overwrite without setup. The important point is that setup resets everything, and that is already covered in the documentation.

Maybe the documentation for setup can include overwrite.

`setup` is idempotent, meaning you can call it multiple times, and each call
will reset indent-blankline. If you want to only update the current
- configuration, use |ibl.update()|.
+ configuration, use |ibl.update()| or |ibl.overwrite()|.

That would be a good addition too, but I still think it makes sense to include something under ibl.overwrite() too. What about something like:

-  Note that |ibl.overwrite| should be called after |ibl.setup|.
+  Note: Since |ibl.setup()| resets indent-blankline, you will need to call 
+  |ibl.overwrite()| after |ibl.setup()| to avoid loosing your overwrites.

Would that be better?

I assume that most users of the plugin use |ibl.setup()|, so I think it makes sense to mention this under |ibl.overwrite()| too.

lukas-reineke commented 10 months ago

I want to avoid making it sound like you have to use setup.

Maybe something like In case you use both |ibl.setup()|, and |ibl.overwrite()|, make sure to call setup first

Danielkonge commented 10 months ago

I want to avoid making it sound like you have to use setup.

Maybe something like In case you use both |ibl.setup()|, and |ibl.overwrite()|, make sure to call setup first

I have changed it to this now + added the other comment you wrote under the setup docs.

lukas-reineke commented 10 months ago

LGTM, thanks