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

comments vs formatlistpat #134

Open
memeplex opened this issue Apr 29, 2018 · 2 comments
Open

comments vs formatlistpat #134

memeplex opened this issue Apr 29, 2018 · 2 comments

Comments

@memeplex
Copy link

This is more of a question than a report: I can't figure out the point of the following sequence:

setlocal comments=fb:*,fb:-,fb:+,n:>
...
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
...
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:

My confusion is due to:

  1. After setting comments, r and o are removed from formatoptions so the comment leader is not auto-inserted after pressing enter nor o.
  2. Other effects of setting comments seem to be subsumed by the formatlistpat settings in conjunction with the other formatoptions flags.

Could you clarify this? Thanks!

@i-give-up
Copy link

From what I observed, the fact that [-*+] in 'formatlistpat' is missing space in front is causing 'formatoptions' n to not work on indented unordered lists such as nested lists.

Due to that, the fb:*,fb:-,fb:+ in 'comments' seems to have been added to serve as a workaround for the formatting issue with indented unordered lists.


To put it another way, modifying the lines as shown below seems to works fine and makes more sense to me.

setlocal comments=n:>
...
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:

@Chaitanyabsprip
Copy link

should it not be [-\\*+]?

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

No branches or pull requests

3 participants