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

Different bullets have different formatting behavior #287

Open
Tuplanolla opened this issue May 3, 2022 · 3 comments
Open

Different bullets have different formatting behavior #287

Tuplanolla opened this issue May 3, 2022 · 3 comments

Comments

@Tuplanolla
Copy link

Versions

Coq 8.15.0

Coqtail 1.6.2

Vim 8.2

Equations 1.3

Python 3.7.4

Description

If you try to open a new line after a line that starts with a bullet,
the new line will be a duplicate of the previous line if the bullet is * or
blank if the bullet is -, + or one of the others.

You can easily observe this by

  • opening coq/theories/Lists/List.v,
  • making sure to setlocal formatoptions+=o,
  • navigating to the definition of in_in_remove and
  • jumping to each of the bullets in turn and
    hitting o followed by <Esc>.
@whonore
Copy link
Owner

whonore commented May 3, 2022

That's because a line beginning with * could either be a bullet or a comment continuation, and I don't know of a way to teach Vim to recognize the difference with respect to formatoptions+=o. That's why I remove that option in the ftplugin.

I guess another option might be to define 'comments' without the middle part (comments=srn:(*,exn:*)), but I'm not entirely sure what other consequences that might have.

@Tuplanolla
Copy link
Author

I seem to keep bumping my head onto issues
that have already been considered; sorry about that.
In this case (and even in general), it would be helpful to know
which options are set by plugins and which ones I could or should customize.
For example, I prefer disabling middle parts of comments and
automatic indentation of lines as I am typing them,
because they are distracting,
but some plugins try to force them on me anyway.

@whonore
Copy link
Owner

whonore commented May 4, 2022

No need to apologize. I made a lot of these decisions a while ago when I was pretty much the only user so I'm glad to get more opinions on them. Part of the challenge with a language plugin like Coqtail is finding a good balance of setting certain options to sensible defaults without stepping on users' own custom setups too much.

In this case (and even in general), it would be helpful to know
which options are set by plugins and which ones I could or should customize.

I agree, and a good step would be to document all of the options that Coqtail sets by default along with simple instructions for overriding/disabling them.

If you feel up to it feel free to open a PR. The options for the main coq filetype are set in ftplugin/coq.vim, indent/coq.vim, and syntax/coq.vim, and the coq-infos and coq-goals filetypes are configured in autoload/coqtail/panels.vim.

Related: #282 (which I haven't forgotten about, I just haven't had a chance to get to it yet)

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

2 participants