cyberkov/openhab-vim

Commentstring and comments strangely set for .rules files

marcvs opened this issue · 1 comments

Not sure if this bug stems from elsewhere.

To reproduce:
check the output of ":set comments" and ":set commentstring".

For me it was
comments=:#
commentstring=c# %s

Leading to nerdcommenter not commenting stuff correctly.

This patch fixed it for me:

` diff --git a/syntax/openhab.vim b/syntax/openhab.vim
index 20bd5c8..0d87328 100644
--- a/syntax/openhab.vim
+++ b/syntax/openhab.vim
@@ -137,6 +137,8 @@ if &filetype=='openhab-rules'
hi def link openhabOption Macro
hi def link openhabOption_quote Label
hi def link openhabParameter Operator

  • set commentstring /%s/
  • set comments="s1:/,mb:,ex:/,://,b:#,:%,:XCOMM,n:>,fb:-,:#,:+ ,: ,:o ,:-"
    endif

" .persist File
`

You can edit your first comment, mark the patch and click on Insert quote. This way Github formatting won't be applied to your patch.