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: bullet right pad conflicts with heading border #297

Closed
2 tasks done
b0o opened this issue Jan 14, 2025 · 2 comments
Closed
2 tasks done

bug: bullet right pad conflicts with heading border #297

b0o opened this issue Jan 14, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@b0o
Copy link

b0o commented Jan 14, 2025

Neovim version (nvim -v)

v0.11.0-dev-1545+ga4f575abd8

Neovim distribution

N/a

Operating system

Arch Linux

Terminal emulator / GUI

Ghostty

Describe the bug

When bullet.right_pad >= 1 and heading.border == true, if an ordered/unordered list appears directly before a heading, the first line of the heading border is offset to the right by the right_pad amount.

Here is an example:

2025-01-13_23-26-14_region

Note the gap at the beginning of lines 13 and 21.

Markdown from screenshot

# Hello

Hey!

## Stuff

Stuff is cool:

1. Plants
2. Animals
3. Rocks
4. Etc.

### Plants

Plants are cool:

- Trees
- Flowers
- Grass

### Animals

Animals are cool:

- Dogs
- Cows
- Frogs

Expected behavior

The heading border should start at the beginning of the line, regardless of the bullet.right_pad setting. It should look like this:

2025-01-13_23-27-54_region

Healthcheck output

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

render-markdown.nvim [version] ~
- OK plugin 7.8.6
- 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 [icons] ~
- OK using: nvim-web-devicons

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: installed but should not conflict

Plugin configuration

{
  bullet = {
    right_pad = 1,
  },
  heading = {
    border = true,
  },
}

Plugin error log

N/a

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

@b0o b0o added the bug Something isn't working label Jan 14, 2025
MeanderingProgrammer added a commit that referenced this issue Jan 14, 2025
## Details

Issue: #297

Tree sitter parser has the last list item extending to the next section.
Since heading borders are added as overlay lines when space is available
they will end up getting the padding that was added there for the list
item. Fix is to have a special case for the last line in a list when it
is empty, not the best but seems to work well enough.
@MeanderingProgrammer
Copy link
Owner

Should be fixed by: f0eb589

@b0o
Copy link
Author

b0o commented Jan 15, 2025

That fixed it, thank you!

@b0o b0o closed this as completed Jan 15, 2025
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