Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#17507 - [vim] c syntax_for_h variable ignored due to buggy filetype.vim

Attached to Project: Arch Linux
Opened by Alexey (Mr.Cat) - Monday, 14 December 2009, 21:19 GMT
Last edited by Dan Griffiths (Ghost1227) - Saturday, 27 February 2010, 01:09 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Tobias Kieslich (tobias)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Setting g:c_syntax_for_h variable in .vimrc does not make vim recognize .h files as c files.

c_syntax_for_h variable is checked in /usr/share/vim/vim72/filetype.vim as follows:
364 func! s:FTheader()
365 if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)' ) > -1
366 setf objc
367 elseif exists("c_syntax_for_h")
368 setf c
369 elseif exists("ch_syntax_for_h")
370 setf ch
371 else
372 setf cpp
373 endif
374 endfunc

This is incorrect, since it checks for local variables, while variables are going to be global: g:c_syntax_for_h and g:ch_syntax_for_h.

Additional info:
* Package version(s): vim-7.2.266-1-x86_64.
* Bug is not present in some other distros (e.g. debian unstable with vim 7.2.245).

Steps to reproduce:
1. Add "let g:c_syntax_for_h = 1" to .vimrc.
2. Open a .h file vim vim.
3. Execute ":set ft".
4. Vim reports that the filetype is cpp.
This task depends upon

Closed by  Dan Griffiths (Ghost1227)
Saturday, 27 February 2010, 01:09 GMT
Reason for closing:  Upstream
Additional comments about closing:  If this is fixed upstream then it will be fixed in the next update. However, if you find the patch somewhere upstream that we don't already include let us know.
Comment by Tobias Kieslich (tobias) - Tuesday, 15 December 2009, 16:37 GMT
This is clearly an upstream bug. We only patch filetype for PKGBUILD as shell file.
Comment by Alexey (Mr.Cat) - Tuesday, 15 December 2009, 20:45 GMT
Yes, and Bram Moolenaar seems to be aware of this bug (http://markmail.org/message/43tgkrcequoywsox) and the patch is available. Debian maillist claims (http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/2009-April/006692.html) that the bug is fixed upstream. But I could find neither fixed source in svn nor a patch for the release. I shall try to install vim-cvs from aur.

Loading...