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

bug: conceallevel isn't togglable when render-markdown is toggled off #208

Closed
2 tasks done
fpohtmeh opened this issue Oct 17, 2024 · 4 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@fpohtmeh
Copy link

Neovim version (nvim -v)

0.10.1

Neovim distribution

LazyVim

Operating system

Windows 11

Terminal emulator / GUI

WezTerm

Describe the bug

LazyVim provides shortcuts to toggle render-markdown and conceal level.
Due to plugin configuration, it's not possible to have a toggleable conceal level for disabled render-markdown.

I always have 3 as the conceal level for any state of render-markdown

Expected behavior

Conceal level changes from 3 to 0 and back for disabled render-markdown

Healthcheck output

==============================================================================
render-markdown: require("render-markdown.health").check()

render-markdown.nvim [version] ~
- OK plugin 7.3.11
- OK neovim >= 0.10

render-markdown.nvim [configuration] ~
- OK valid

render-markdown.nvim [nvim-treesitter] ~
- OK installed
- OK markdown: parser installed
- OK markdown: highlight enabled
- OK markdown_inline: parser installed
- OK markdown_inline: highlight enabled
- WARNING latex: parser not installed
  - ADVICE:
    - Disable LaTeX support to avoid this warning by setting { latex = { enabled = false } }

render-markdown.nvim [executables] ~
- WARNING latex2text: not installed
  - ADVICE:
    - Disable LaTeX support to avoid this warning by setting { latex = { enabled = false } }

render-markdown.nvim [conflicts] ~
- OK headlines: not installed
- OK obsidian: not installed

Plugin configuration

Default LazyVim configuration

Plugin error log

Log is empty

Confirmations

  • I have updated this plugin to the latest version using my plugin manager
  • I have provided the text contained in all screenshots as raw text in this issue. This means if there is a screenshot below it is the copy pasted contents of the file in the screenshot. I understand that my issue will be closed if I have not.

Additional information

No response

@fpohtmeh fpohtmeh added the bug Something isn't working label Oct 17, 2024
@fpohtmeh fpohtmeh changed the title bug: conceallevel isn't togglable when render-markdown is toggled bug: conceallevel isn't togglable when render-markdown is toggled off Oct 17, 2024
@MeanderingProgrammer
Copy link
Owner

If I'm not understanding something let me know. But based on your wording are you saying that when this plugin is disabled you still expect it to modify the conceallevel on mode changes? Or are you saying that you can't manually change the conceallevel and this plugin locks it to 3 when it's disabled?

@fpohtmeh
Copy link
Author

Brief steps to reproduce:

  • Open markdown
  • Disable plugin with um
  • Conceal level is 3 at this point
  • Press uc to disable conceal level
    Result: conceal becomes zero but immediately returns to 3, this can be visually noticed

MeanderingProgrammer added a commit that referenced this issue Oct 17, 2024
## Details

Issue: #208

When state is disabled the update logic is still triggered. For the most
part this doesn't really do anything as it triggers the non rendered
view. However it does hijack the window options and prevents users from
changing them by constantly changing them back.

To fix this gate the event based callbacks on state being enabled. The
only case where state is disabled in the UI is from user commands.
@MeanderingProgrammer
Copy link
Owner

Ah, thanks, was able to reproduce this. Should be fixed by: bea6f20.

@fpohtmeh
Copy link
Author

Thank you a lot, man! ⚡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants