-
Notifications
You must be signed in to change notification settings - Fork 15
Support buffer-local show_sign and enable_virtual_text options #64
base: master
Are you sure you want to change the base?
Conversation
* b:diagnostic_show_sign * b:diagnostic_enable_virtual_text
I like the idea which this is going in as it appears to be (at least partially) a solution to #60. |
In this case that was partly because I wanted a local configuration that handled this with minimal changes to If you'd be interested I can work on a more complete pull request that includes a Toggle command like what #60 is asking for; I already have that working locally, more or less... |
FWIW, whilst we wait for a reply from one of the plugin maintainers, here's (roughly speaking) the toggle command I have elsewhere.... just add keybindings as appropriate.
|
I would definitely be interested in that, but before putting more work on it you should probably also wait for the input from one of the maintainers of this plugin. I also think the minimal example above is a good starting point 👍 One question about the |
@mrossinek no, it's something I invented for this change. It seemed like a logical name. |
Okay thanks for clarifying! Because I was looking for something like that to use inside my |
@andrewferrier A quick update: I checked with @tjdevries who is in the progress of merging diagnostics-nvim into Neovim (see #73 and neovim/neovim#12655). |
This pull request may not be merged exactly as-is. But I'm including it here to show a principle and hopefully start a debate.
One of the things I like to/want to do is enable and disable the LSP support on a per-buffer basis ("this virtual text is annoying, hide it!"). Currently that's not really practical. What this pull request does is introduce two-buffer local variables,
vim.b.diagnostic_enable_virtual_text
andvim.b.diagnostic_show_sign
, which can be turned on or off per-buffer. This enables me to create a toggle function (not included in this pull request, as it sits outside the plugin) which turns them on or off.Is this the kind of thing which you'd be open to see being included in
diagnostic-nvim
? Currently one big limitation I see with LSP support in Nvim is it's kinda 'all or nothing' on a per-filetype basis - you can't temporarily disable it for one buffer. This would allow for that (and other patterns).