# HG changeset patch # User Christian Brabandt # Date 1728328506 -7200 # Node ID 72c9938472569bddab90b2c73af6cc0d6d2a1d17 # Parent 6937334e99e94514dfd2ee3bb92aba6ae284d8a7 runtime(spec): set comments and commentstring options Commit: https://github.com/vim/vim/commit/4f51f3a5732725a25ff64f509506c9c81b1c96a5 Author: Andreas Schneider Date: Mon Oct 7 21:02:10 2024 +0200 runtime(spec): set comments and commentstring options closes: https://github.com/vim/vim/issues/15817 Signed-off-by: Andreas Schneider Signed-off-by: Christian Brabandt diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim --- a/runtime/ftplugin/spec.vim +++ b/runtime/ftplugin/spec.vim @@ -5,6 +5,7 @@ " Last Change: 2015 Jun 01 " Update by Zdenek Dohnal, 2022 May 17 " 2024 Sep 10 by Vim Project: add epoch support for spec changelog, #15537 +" 2024 Oct 07 by Vim Project: add comment support, #15817 if exists("b:did_ftplugin") finish @@ -14,6 +15,11 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim +setlocal comments=b:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" + if !exists("no_plugin_maps") && !exists("no_spec_maps") if !hasmapto("SpecChangelog") map c SpecChangelog @@ -216,4 +222,4 @@ let b:match_words = let &cpo = s:cpo_save unlet s:cpo_save -let b:undo_ftplugin = "unlet! b:match_ignorecase b:match_words" +let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"