I notice this most with the 'comments' option. To reproduce, try

$ vim mymodule.module
:verbose set comments?
:e mymodule.info
:e mymodule.module
:verbose set comments?

This is not always reproducible. In fact, sometimes 'comments' is set incorrectly even the first time I check. :-(

I think it has to do with the changes in #1847306: Add configuration to disable automatic formatting feature..

Comments

benjifisher’s picture

Status: Active » Fixed
StatusFileSize
new1.45 KB

Fixed and committed: 451940b.

This is a partial revert of 95d5f69 and 955dba8.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

benjifisher’s picture

Status: Closed (fixed) » Fixed
StatusFileSize
new3.35 KB

I realized that even though 'comments' was set properly, my doc blocks were having trouble because 'formatoptions' was being reset. The problem was the b:undo_ftplugin variable. The attached patch fixes this by moving the conditional :finish line later in the file.

The patch also does two things to comply with Vim coding standards:

  1. Set and restore the 'cpo' option
  2. Define b:undo_ftplugin so that ftplugin.vim can undo the changes made here.

I have already committed the patch: 50066d5.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.