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

Blockquote incorrectly displayed when it contains a list #115

Closed
3 tasks done
YodaEmbedding opened this issue Aug 20, 2024 · 5 comments · Fixed by #90
Closed
3 tasks done

Blockquote incorrectly displayed when it contains a list #115

YodaEmbedding opened this issue Aug 20, 2024 · 5 comments · Fixed by #90
Labels
bug Something isn't working

Comments

@YodaEmbedding
Copy link

YodaEmbedding commented Aug 20, 2024

Have you done all of these?

  • I am using the latest version of the plugin.
  • I have checked the wiki.
  • I have checked previous issues(even closed ones).

Describe the bug
Blockquote doesn't show in correct location when it contains a list item.

Neovim version

nvim --version
# Output
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478
Run "nvim -V1 -v" for more info

Are you using a distro?
No

To Reproduce
Steps to reproduce the bug:

  1. Install markview.nvim.
  2. Open a markdown document.
  3. Type in:
> Workers are created as daemon threads. This is done to allow the interpreter
> to exit when there are still idle threads in a ThreadPoolExecutor's thread
> pool (i.e. shutdown() was not called). However, allowing workers to die with
> the interpreter has two undesirable properties:
>
> - The workers would still be running during interpretor shutdown,
>   meaning that they would fail in unpredictable ways.
> - The workers could be killed while evaluating a work item, which could
>   be bad if the callable being evaluated has external side-effects e.g.
>   writing to a file.
>
> To work around this problem, an exit handler is installed which tells the
> workers to exit when their work queues are empty and then waits until the
> threads finish.

Configuration table

If you have configured the plugin then you must share your config.

require("markview").setup({
    -- Your config table
});

Expected behavior
Blockquote marker before list bullets.
Screenshot 2024-08-19 at 8 16 43 PM

Actual behavior
Incorrect list/quotes.
Screenshot 2024-08-19 at 8 08 40 PM

Additional context
nvim-scrollview nvim-scrollbar, but I disabled it, and the bug still occurs.

Full list of plugins here:

  Loaded (73)
    ● actions-preview.nvim 0.03ms  start
    ● aerial.nvim 0.96ms  start
    ● alpha-nvim 2.56ms  start
    ● before.nvim 0.93ms  start
    ● blame.nvim 3.5ms  start
    ● cmp-buffer 0.07ms  nvim-cmp
    ● cmp-latex-symbols 0.22ms  nvim-cmp
    ● cmp-nvim-lsp 0.22ms  nvim-cmp
    ● cmp-nvim-lsp-signature-help 0.21ms  nvim-cmp
    ● cmp-path 0.21ms  nvim-cmp
    ● cmp-tmux 0.22ms  nvim-cmp
    ● cmp-vsnip 0.2ms  nvim-cmp
    ● copilot-cmp 10.48ms  nvim-cmp
    ● copilot.lua 9.63ms  copilot-cmp
    ● delimited.nvim 0.05ms  start
    ● diffview.nvim 6.26ms  start
    ● flash.nvim 2.12ms  VeryLazy
    ● friendly-snippets 0.06ms  start
    ● garbage-day.nvim 2.04ms  VeryLazy
    ● git-conflict.nvim 1.06ms  start
    ● gitsigns.nvim 3.68ms  start
    ● indent-blankline.nvim 4.4ms  start
    ● indent-o-matic 1.65ms  start
    ● jsonfly.nvim 0.22ms  telescope.nvim
    ● kommentary 2.11ms  start
    ● lazy.nvim 7.76ms  init.lua
    ● local-highlight.nvim 1.25ms  start
    ● lsp-lens.nvim 2.03ms  start
    ● lsp-progress.nvim 2.65ms  lualine.nvim
    ● lspkind-nvim 0.27ms  start
    ● ltex-utils.nvim 4.19ms  start
    ● lualine.nvim 10.59ms  start
    ● marks.nvim 3.33ms  start
    ● markview.nvim 0.81ms  start
    ● mason-lspconfig.nvim 62.05ms  start
    ● mason.nvim 3.63ms  mason-lspconfig.nvim
    ● neodev.nvim 0.05ms  nvim-lspconfig
    ● neogit 10.13ms  start
    ● nvim-cmp 20.83ms  nvim-lspconfig
    ● nvim-lastplace 0.53ms  start
    ● nvim-lightbulb 1.22ms  start
    ● nvim-lspconfig 46.59ms 󰢱 lspconfig.util  mason-lspconfig.nvim
    ● nvim-prose 0.79ms  start
    ● nvim-scrollbar 1.84ms  start
    ● nvim-tree.lua 32.74ms  start
    ● nvim-treesitter 33.2ms  start
    ● nvim-treesitter-context 1.54ms  start
    ● nvim-treesitter-textobjects 9.51ms  nvim-treesitter
    ● nvim-various-textobjs 1.94ms  start
    ● nvim-web-devicons 0.78ms  markview.nvim
    ● plenary.nvim 0.64ms  telescope.nvim
    ● quick-scope 1.83ms  start
    ● sqlite.lua 0.32ms  telescope-all-recent.nvim
    ● targets.vim 0.65ms  start
    ● telescope-all-recent.nvim 24.84ms  start
    ● telescope-smart-history.nvim 0.24ms  telescope.nvim
    ● telescope.nvim 18.78ms  telescope-all-recent.nvim
    ● tmux-navigate 0.49ms  start
    ● todo-comments.nvim 2.54ms  start
    ● tokyonight.nvim 11.46ms  start
    ● trouble.nvim 3.67ms  start
    ● vim-bbye 0.66ms  start
    ● vim-eunuch 0.88ms  start
    ● vim-fugitive 1.57ms  start
    ● vim-lion 0.82ms  start
    ● vim-python-pep8-indent 0.02ms  start
    ● vim-repeat 0.06ms  start
    ● vim-surround 0.94ms  start
    ● vim-trailing-whitespace 0.56ms  start
    ● vim-visual-star-search 0.43ms  start
    ● vim-vsnip 6.06ms  nvim-cmp
    ● vimtex 1.29ms  start
    ● virt-column.nvim 1.88ms  start

  Not Loaded (3)
    ○ smart-open.nvim 
    ○ telescope-fzf-native.nvim  smart-open.nvim 
    ○ telescope-fzy-native.nvim  smart-open.nvim 
@YodaEmbedding YodaEmbedding added the bug Something isn't working label Aug 20, 2024
@OXY2DEV
Copy link
Owner

OXY2DEV commented Aug 20, 2024

This will probably not be fixed since there's no easy(and consistent) way to get the indentation of the list without using the spaces.

@YodaEmbedding
Copy link
Author

The main issue is that the parent-level blockquotes are not displayed in the leftmost column:

Screenshot 2024-08-19 at 8 08 40 PM

@OXY2DEV
Copy link
Owner

OXY2DEV commented Aug 20, 2024

There's no text where the extmark can be placed so it shifts to the position where it can find some text.

In this case, that's after the -.

@YodaEmbedding
Copy link
Author

YodaEmbedding commented Aug 20, 2024

I don't know much about this stuff, but possible solutions:

  • Ask upstream (neovim/neovim) to introduce API for extmarks that can occur anywhere on the line.
  • Use virtual text for the blockquote guides. (See related project: https://github.com/lukas-reineke/indent-blankline.nvim )
  • Use some combination of virtual text AND extmarks (with blank spaces if the formatting is weird).

@OXY2DEV
Copy link
Owner

OXY2DEV commented Aug 20, 2024

I don't know much about this stuff, but possible solutions:

  • Ask upstream (neovim/neovim) to introduce API for extmarks that can occur anywhere on the line.
  • Use virtual text for the blockquote guides. (See related project: https://github.com/lukas-reineke/indent-blankline.nvim )
  • Use some combination of virtual text AND extmarks (with blank spaces if the formatting is weird).

If only it was that easy. It's a lot harder then that as the plugin needs to calculate where a list item starts(tree-sitter is unreliable here, so using it is simply not possible). Finding a proper lua-pattern, adding support for nested lists(lists inside block quotes inside lists inside block quotes) etc. made it a very hard job.

Hopefully, this early version should work most of the time.

Screenshot_2024-08-20-14-32-21-405_com termux-edit

Warning

Items inside block elements may be larger then they appear. So, some edge-cases is bound to happen.

Screenshot_2024-08-20-14-30-30-102_com termux-edit
E.g. block quotes existing without >.

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

Successfully merging a pull request may close this issue.

2 participants