Skip to content

Commit

Permalink
Remove 'n' flag from ending part of comments (whonore#307)
Browse files Browse the repository at this point in the history
Fixes whonore#305, whonore#306

I'm not 100% sure why this works, or whether the flag is actually doing anything useful in the comment opener, but I'll leave it for now.
  • Loading branch information
whonore authored Sep 16, 2022
1 parent 1394300 commit 4098ba5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased ([master])

### Fixed
- Joining comments with `J` while the `j` flag is set in `'formatoptions'` does
not delete the second line.
(PR #307)
- Formatting long comments (e.g., with `gqq`) does not stop after the second line.
(PR #307)

## [1.6.4]

### Added
Expand Down
2 changes: 1 addition & 1 deletion ftplugin/coq.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endif
" Comments
if has('comments')
setlocal commentstring=(*%s*)
setlocal comments=srn:(*,mb:*,exn:*)
setlocal comments=srn:(*,mb:*,ex:*)
" NOTE: The 'r' and 'o' flags mistake the '*' bullet as a middle comment and
" will automatically add an extra one after <Enter>, 'o' or 'O'.
setlocal formatoptions-=t formatoptions-=r formatoptions-=o formatoptions+=cql
Expand Down
28 changes: 28 additions & 0 deletions tests/vim/comments.vader
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
" Author: Wolf Honore
" Coq comment formatting unit tests.

Before:
set textwidth=40
set formatoptions+=qj

Given coq (join-comment):
(* Lorem ipsum dolor sit amet,
* consectetur adipiscing elit. *)

Do (join-comment):
J

Expect coq (join-comment):
(* Lorem ipsum dolor sit amet, consectetur adipiscing elit. *)

Given coq (format-long-comment):
(* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eleifend mauris et lectus rhoncus, at feugiat sapien euismod. *)

Do (format-long-comment):
gqq

Expect coq (format-long-comment):
(* Lorem ipsum dolor sit amet,
* consectetur adipiscing elit. Nam
* eleifend mauris et lectus rhoncus, at
* feugiat sapien euismod. *)

0 comments on commit 4098ba5

Please sign in to comment.