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: Indented tables do not view correctly #191

Closed
2 tasks done
MinaMatta98 opened this issue Sep 30, 2024 · 2 comments
Closed
2 tasks done

bug: Indented tables do not view correctly #191

MinaMatta98 opened this issue Sep 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MinaMatta98
Copy link

MinaMatta98 commented Sep 30, 2024

Neovim version (nvim -v)

0.10.1

Neovim distribution

LazyVim

Operating system

Arch x86_64

Terminal emulator / GUI

Alacritty/Kitty

Describe the bug

When tables are indented, the top and bottom borders are omitted:

image

Expected behavior

It should show the border

Healthcheck output

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

render-markdown.nvim [version] ~

  • OK plugin 7.2.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 [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

return {
"MeanderingProgrammer/render-markdown.nvim",
opts = {},
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
}

Plugin error log

None

Confirmations

  • I have updated this plugin to the latest version using my plugin manager
  • I have provided text for all screenshots & understand that my issue will be closed if I have not

Additional information

No response

@MinaMatta98 MinaMatta98 added the bug Something isn't working label Sep 30, 2024
MeanderingProgrammer added a commit that referenced this issue Sep 30, 2024
## Details

Issue: #191

When calulating the leading spaces for a table row to determine how much
to indent a border only the node text was used. However if tables are
indented enough under a list item a leading continuation node eats some
of the spaces. This does not happen consistently between the heading and
other rows resulting in the number of spaces appearing different. When
this occurs we assume the table is not properly aligned on the left and
do not render a border.

To fix this caclulate the number of leadings spaces using the entire
line for the row and not just the node text.

Other unrelated changes:

- Move treesitter queries out of treesitter module and into where they
  are actually used
- Use the treesitter module to cache parsed queries to avoid parsing
  more than once per unique query
- This also avoid needing to do a vim.schedule in our state setup,
  instead the queries end up being naturally lazily evaluated
@MeanderingProgrammer
Copy link
Owner

Fixed here: efb4c48

@MinaMatta98
Copy link
Author

Can confirm fixed :).

Thank you!

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