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

Toggling diagnostics resets my customization #11

Closed
oredaze opened this issue Apr 3, 2023 · 6 comments
Closed

Toggling diagnostics resets my customization #11

oredaze opened this issue Apr 3, 2023 · 6 comments

Comments

@oredaze
Copy link

oredaze commented Apr 3, 2023

When I <Plug>(toggle-lsp-diag) they turn off fine, but when I do that again the diagnostics lose any of the settings I have assigned. If I do <Plug>(toggle-lsp-diag-default) my customization is back again. This is unexpected behavior. I would like to toggle on/off without it changing any settings. Pressing two keys to turn them back on [properly] is also unacceptable.

@xfzv
Copy link

xfzv commented Apr 8, 2023

Can confirm the behavior described, same here. I setup toggle-lsp-diagnostics.nvim as follows with lazy.nvim:

{
    "WhoIsSethDaniel/toggle-lsp-diagnostics.nvim",
    event = { "BufReadPost", "BufNewFile" },
    config = function()
      require("toggle_lsp_diagnostics").init(vim.diagnostic.config())
    end,
},

@WhoIsSethDaniel
Copy link
Owner

If I understand your problem correctly this behavior is documented in the README:

You can toggle ALL settings, at once, to either on or off by using the appropriate mapping or command. The toggle-lsp-diag >
mapping toggles ALL settings either on or off. It does NOT toggle back to a previous state. So, if you toggle off underline, then
turn ALL settings off, and then turn ALL settings back on again, the underline will re-appear. To get the settings back to the
default you can use the toggle-lsp-diag-default mapping or the :ToggleDiagDefault command.

You shouldn't need to hit two different keys to go back to your settings. Just use :ToggleDiagOff for turning them off and :ToggleDiagDefault for toggling them back on. There is no need to use :ToggleDiagOn ever in your case.

The names are odd, but that's for historical reasons.

@WhoIsSethDaniel
Copy link
Owner

btw, sorry for such a long time to answer your bug report. Real-life got in the way.

@WhoIsSethDaniel
Copy link
Owner

I just realized what you were trying to say in your earlier comment. I'll see what I can do about the toggling.

@WhoIsSethDaniel
Copy link
Owner

I believe this issue is fixed.

@xfzv
Copy link

xfzv commented Jun 12, 2023

All good here now, thank you @WhoIsSethDaniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants