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

Odd behavior with wrap #70

Open
srsudar opened this issue Jul 31, 2018 · 3 comments · May be fixed by #71
Open

Odd behavior with wrap #70

srsudar opened this issue Jul 31, 2018 · 3 comments · May be fixed by #71

Comments

@srsudar
Copy link

srsudar commented Jul 31, 2018

My automatic wrapping at 80 characters disappears when enabling the plugin. It looks like in markdown.vim you setlocal textwidth=0, which I think is to blame.

To counteract this I have autocmd Filetype markdown setlocal textwidth=80 in my .vimrc. However, this has exposed an odd issue with wrapping.

When a previous line starts with a single alphanumeric character, the second line is indented by two spaces.

Before gwap (which wraps in a paragraph):

screen shot 2018-07-30 at 8 01 15 pm

After gwap:

screen shot 2018-07-30 at 8 01 24 pm

This, with ! as the first character, wraps as I would expect:

screen shot 2018-07-30 at 8 03 04 pm

I would expect indentation to only apply if the list began with 1. with a period. Is the behavior I'm seeing technically correct, or is it a bug?

@srsudar srsudar linked a pull request Jul 31, 2018 that will close this issue
@alexandreroberts
Copy link

I have noticed the same problem (with the most up-to-date version of vim-markdown and neovim). I think the problem happens when the first word of the paragraph is a single character.

@alexandreroberts
Copy link

Now I tested it a bit more (not at all comprehensively) with A, I, 1, and !. The hanging indent occurs (when I do gwap on the paragraph) with A, I, and 1 but not with ! (nor with a multi-letter word):

Screen Shot 2022-08-16 at 12 15 36 PM

Screen Shot 2022-08-16 at 12 16 05 PM

Screen Shot 2022-08-16 at 12 16 29 PM

Screen Shot 2022-08-16 at 12 16 18 PM

Screen Shot 2022-08-16 at 12 15 52 PM

This makes me think that the problem is that somehow vim-markdown (or nvim itself?) reads the paragraph as an item of an enumerated list when it's not supposed to, as if there were a . after A, I, and 1.

@alexandreroberts
Copy link

P.S. I see now that #71 is supposed to take care of this, but the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants