Skip to content

bug: The icon for the indented code block is missing #60

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

Closed
MasouShizuka opened this issue Jul 11, 2024 · 7 comments
Closed

bug: The icon for the indented code block is missing #60

MasouShizuka opened this issue Jul 11, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@MasouShizuka
Copy link

Neovim version (nvim -v)

0.10.0

Operating system

Windows11

Terminal emulator / GUI

WezTerm

Describe the bug

Unindented code blocks behave normally, but the icon for indented code blocks is missing, like:
image

source code is:
image

Expected behavior

The icon for indented code blocks should exist.

Healthcheck output (:checkhealth render-markdown)

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

markdown.nvim [nvim-treesitter] ~
- OK installed
- OK markdown: parser installed
- OK markdown_inline: parser installed
- OK highlights enabled

markdown.nvim [executables] ~
- OK none to check

markdown.nvim [configuration] ~
- OK valid

Additional information

No response

@MasouShizuka MasouShizuka added the bug Something isn't working label Jul 11, 2024
@MeanderingProgrammer
Copy link
Owner

Can you provide the raw markdown for your example?

I am seeing the same when you put a slightly indented code block under another code block, but it actually works if I put it under a list. Am wondering if it has to do with how far indented things are.

There's also a separate issue of indented_code_block, which this plugin does not support.

@MasouShizuka
Copy link
Author

I found something strange. If the indent is 2, the icon will not be missing:
image

source code is:
image

@MeanderingProgrammer
Copy link
Owner

Yeah, I found the same thing.

I think I figured out the cause, not even sure why I even tried this, but it seems to be an interaction with indent-blankline.nvim.

If I disable indent blank line then everything starts working as expected, no random cutoff of language.

I'll try to see what's going on there.

@MasouShizuka
Copy link
Author

You are right, after I disabled indent-blankline.nvim, I can also see the icon when indent is 4.

MeanderingProgrammer added a commit that referenced this issue Jul 11, 2024
# Details

More info here: #60

When handling code blocks with leading spaces that lanuage gets left
shifted. When this is combined with a plugin that adds information
to leading spaces, such as indent blank lines, parts of the icon /
language can be overlayed and therefore hidden.

To fix this account for the leading spaces before placing icon above
code blocks.
@MeanderingProgrammer
Copy link
Owner

Ah it was a combination of indent blank lines overlaying the leading spaces as well as the code fence capturing the leading space. So when things got concealed they were left shifted then overlayed.

Handling it is pretty straightforward pushed a fix here: 48083f8.

LMK if it works for you as well!

@MasouShizuka
Copy link
Author

After taking a quick look at some of my notes, this should be able to display the icon normally.

@MeanderingProgrammer
Copy link
Owner

Sweet, closing the issue, feel free to re-open if you come across something.

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