-
Notifications
You must be signed in to change notification settings - Fork 49
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
tracking: breaking changes / regressions with neovim 0.11 #352
Comments
## Details This is some of the work needed to better handle the recent conceal_lines change added to neovim: #352 In order to better render code blocks, or at least have the ability to, we first need to figure out which lines are impacted by the change. To do this update the `conceal` module to process this additional metadata and store it. Expose this information again through the `context` module. This change does not include using this information to actually improve the rendering, but having it ready to go is useful, and the code block implementation to get around this is going to be pretty tedious. Some minor refactoring along the way to make these changes a little easier.
Thanks for the continued effort! |
I stumbled upon this issue from this issue #351 May I ask if we have any good news or updates? Thank you for your hard work. |
I have a working implementation but there are still strange behaviors with conceal lines & virtual lines, I'll need to create minimal repros for them and cut issues to neovim but do not have the time ATM. I'll likely release the change in whatever state it happens to be in when |
## Details Related issues: - #351 - #352 This change adds back the code border that currently gets removed by the default `conceal_lines` highlight that ships with `nvim-treesitter`. I tried to make this work using virtual lines at first but ran into quite a few issues with screen offset behavior and was unable to fix the fact that LSP hover docs are now truncated based on concealed lines leading to windows that did not take our virtual lines into account. Ultimately to get around this I've added a new option called `patterns` which takes a list of directive names & ids and runs the `disable_pattern` API to turn these off. The default value: ```lua { patterns = { markdown = { disable = true, directives = { { id = 17, name = 'conceal_lines' }, { id = 18, name = 'conceal_lines' }, }, }, }, } ``` Will disable markdown highlight patterns 17 & 18 if they correspond to a `conceal_lines` directive. There is not any guarantee that the ids will remain constant and users can override the highlights with their own which we do not want to break. Hopefully ensuring the ids & names match will work for most people and I can keep the default value working with the most common case going forward. This behavior can be disabled by users by setting `disable = false`. Since removing these highlight patterns also removes the regular character level concealing this plugin has been updated to add these for the delimiter and language nodes itself, rather than relying on the `nvim-treesitter` behavior. Disabling patterns can take a while at startup so this instead runs on just before this plugin actually attaches to a buffer rather than as part of the startup sequence. This behavior is specific to `0.11.0` so the logic is appropriately gated to prevent any older versions from running into errors, we should still be compatible down to `0.9.0`. There's also a new `code.border` value called `hide` which is the new default and applies the `conceal_lines` value to empty fenced code delimiters. Older versions of neovim will continue to use the `thin` border style as a fallback. This largely hides the bottom border, but will also hide the top one if no language icon / name is added or available.
After e6c8081, there should be no more regressions |
Thank you @MeanderingProgrammer for the fixes. For me, I prefer this option to have the same behavior as previously. {
"MeanderingProgrammer/render-markdown.nvim",
-- enabled = false,
opts = {
code = {
border = "none",
},
},
ft = { "markdown" },
}, |
@chiendo97 are you saying the behavior changed for |
@chiendo97 I think I see what you mean, the new behavior adds a highlight to the background of languages when border is none. I added a way to get the old behavior here: a1fc4e5, but its controlled by a new option. I needed to separate the language section from the border section to accommodate the new Anyway to get the old behavior use {
"MeanderingProgrammer/render-markdown.nvim",
-- enabled = false,
opts = {
code = {
highlight_border = false,
},
},
ft = { "markdown" },
}, |
Thank you @MeanderingProgrammer for the new option. It works well as usual.
Like you said, I prefer not to hide any line from the rendering of my Markdown. Because it would make me confused when I switch between modes or when I move to that line. What I love about your plugin is that by default, there is no hidden line (aka conceal_lines) with the default config. |
Neovim has been overhauling the internal treesitter logic to improve performance as well as adding new
extmark
options. Both of these are awesome and I'll need to take a closer look into what will be available and see how I can take advantage of these new features!However, separately from this, due to this plugins assumptions about how treesitter parsing works (sync) and how default highlights behave there are also going to be some breaking changes / regressions in behavior that I'll need to patch. I'll track these regressions as I find out about them as well as the progress on fixing them here.
fenced code block delimiters now hidden with
conceal_lines
rendering unfocussed lsp hover docs buffers
BufWinEnter
event is triggering before theFileType
event, not the case in0.10
.async parsing
parse
like we do now should result in synchronous parsing for the specified range, so I don't think any changes are needed, at least for now.The text was updated successfully, but these errors were encountered: