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

4 Space tabs does not align properly showing both icon and bullet dash #96

Closed
GitMurf opened this issue Aug 9, 2024 · 6 comments · Fixed by #90
Closed

4 Space tabs does not align properly showing both icon and bullet dash #96

GitMurf opened this issue Aug 9, 2024 · 6 comments · Fixed by #90
Labels
bug Something isn't working

Comments

@GitMurf
Copy link

GitMurf commented Aug 9, 2024

Describe the bug
Showing both the icon/symbol for bullet as well as the actual text/dash for the bullet.

Are you using a distro?
No

To Reproduce
Steps to reproduce the behavior:
Here is what I am using for the list items config:

        list_items = {
          enable = true,
          marker_minus = {
            add_padding = false,
            text = '',
          },
          marker_plus = { add_padding = false },
          marker_star = { add_padding = false },
          marker_dot = { add_padding = false },
        },

Here is the exact list item text to reproduce my screenshot:

- This is a new bullet
- And more bullets
    - And nested one
        - here its is
            - more stuff going
        - and more
    - and finally this too
    - and again
- and more

Expected behavior
Should not see the "dashes" from the list items when indented.

Actual behavior
There is duplication of the symbol/icon for the bullet and still showing the "-" dash list item.

Screenshots
This is what it looks like:

image

Here is what my actual content looks like with markview disabled (same as markdown pasted above):

image

Neovim version
0.10.0

@GitMurf GitMurf added the bug Something isn't working label Aug 9, 2024
@GitMurf
Copy link
Author

GitMurf commented Aug 9, 2024

It looks like it could be related to the add_padding = false as here is what it looks like if I turn the padding back on. But to me this is way to distracting and huge padding/margins that is not usable.

image

@GitMurf
Copy link
Author

GitMurf commented Aug 9, 2024

I noticed in the Wiki it mentions something about using 2 spaces instead of 4. The question is, does markview support 4 spaces or do we have to use 2 spaces? Here: https://github.com/OXY2DEV/markview.nvim/wiki/List%20items#-list-item-configuration

Probably related to #59

@OXY2DEV
Copy link
Owner

OXY2DEV commented Aug 10, 2024

I noticed in the Wiki it mentions something about using 2 spaces instead of 4.

Because treesitter will consider everything after the 2 spaces to be a list marker. The only reason this works with add_padding = true is due to the plugin removing all the whitespaces before the marker.

This is what a marker using a tab for indentation looks like.
Screenshot_2024-08-10-07-23-34-033_com termux-edit

And this is what a normal marker looks like.
Screenshot_2024-08-10-07-24-08-140_com termux-edit

As you can see the marker starts from after 2 spaces(regardless of where +, -,* is present).


This is not a bug this is just how lists work.

@OXY2DEV OXY2DEV closed this as completed Aug 10, 2024
@OXY2DEV OXY2DEV pinned this issue Aug 10, 2024
@GitMurf
Copy link
Author

GitMurf commented Aug 10, 2024

@OXY2DEV so does that mean "officially" the plugin does not support 4 space indents? Given 4 space tabs is the default for markdown tools such as Obsidian, this may be a common "issue" users run into.

An alternative that could probably work is being able to set in config the padding size similar to how you can with adding padding to headings. The problem for me is they are way too wide with my 4 space indents so if I could decrease the padding it should be sufficient. Is that something you would consider adding?

Thanks!

OXY2DEV added a commit that referenced this issue Aug 10, 2024
WARNING: This does not affect tree-sitter. Tree-sitter only considers
list items with 2n number of spaces.

Ref: #96
@OXY2DEV
Copy link
Owner

OXY2DEV commented Aug 10, 2024

Check the wiki page for the new option.

@GitMurf
Copy link
Author

GitMurf commented Aug 10, 2024

@OXY2DEV awesome! This is perfect. Thanks!

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