Skip to content

runtime(crontab): entries starting with * are incorrectly wrapped - #21957

Open
xudongzheng wants to merge 1 commit into
vim:masterfrom
xudongzheng:crontab-comment-pr
Open

xudongzheng wants to merge 1 commit into
vim:masterfrom
xudongzheng:crontab-comment-pr

Conversation

@xudongzheng

Copy link
Copy Markdown
Contributor

Problem: Cron entries starting with * are treated as comments and wrapped
Solution: Set "comments" to :# (Xudong Zheng)

The crontab ftplugin sets "commentstring" but inherits the default "comments", which includes * as a C-style comment leader.

To reproduce, start vim -Nu NONE and run:

:filetype plugin on
:setlocal filetype=crontab textwidth=40 formatoptions=cq
:call setline(1, '* * * * * echo echo echo echo echo echo')
:normal! A more words

The entry is incorrectly split into two lines:

* * * * * echo echo echo echo echo echo
* more words

Problem:  Cron entries starting with * are treated as comments and wrapped
Solution: Set "comments" to :# (Xudong Zheng)

The crontab ftplugin sets "commentstring" but inherits the default
"comments", which includes * as a C-style comment leader.

Assisted-by: OpenAI Codex
Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant