darlingm / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

Vim misidentifies polkit rules file as hog rules files #292

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you open up a rules file in /etc/polkit-1/rules.d the file type will be 
"hog", when it should be of type Javascript.

Original issue reported on code.google.com by khym.cha...@gmail.com on 3 Dec 2014 at 10:05

GoogleCodeExporter commented 9 years ago
This also applies to files in /usr/share/polkit-1/rules.d

Original comment by khym.cha...@gmail.com on 3 Dec 2014 at 10:06

GoogleCodeExporter commented 9 years ago
I think, this patch fixes it. 

diff --git a/runtime/filetype.vim b/runtime/filetype.vim
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -2026,6 +2026,10 @@ func! s:FTRules()
     setf conf  " Better than hog
     return
   endif
+  if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d'
+      setf javascript
+      return
+  endif
   try
     let config_lines = readfile('/etc/udev/udev.conf')
   catch /^Vim\%((\a\+)\)\=:E484/

Please confirm

Original comment by chrisbr...@googlemail.com on 4 Dec 2014 at 9:38

GoogleCodeExporter commented 9 years ago
That solved it.

Original comment by khym.cha...@gmail.com on 5 Dec 2014 at 3:21

GoogleCodeExporter commented 9 years ago
Bram, can we include that patch to filetype.vim?

Original comment by chrisbr...@googlemail.com on 9 Jan 2015 at 12:09

GoogleCodeExporter commented 9 years ago
I'll include the change, thanks.

Original comment by brammool...@gmail.com on 14 Jan 2015 at 3:44