Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 459304 - dev-libs/protobuf-2.4.0a breaks vim filetype autodetection
Summary: dev-libs/protobuf-2.4.0a breaks vim filetype autodetection
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All All
: Normal normal with 1 vote (vote)
Assignee: Tim Harder
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-26 13:38 UTC by Laurent Bachelier
Modified: 2013-03-05 17:57 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Bachelier 2013-02-26 13:38:55 UTC
When present /usr/share/vim/vimfiles/ftdetect/proto.vim makes vim detect files starting with a # as "conf" instead of their proper types.

I don't understand why there is a augroup and a ! in the proto.vim file.

Having only "au BufRead,BufNewFile *.proto setfiletype proto" fixes the issue.

Reproducible: Always
Comment 1 Tim Harder gentoo-dev 2013-03-05 05:33:12 UTC
I'm pretty sure this isn't an issue anymore with recent vim versions (see below). However, if the file isn't detected as any other file type it will fallback to conf which isn't a bug with proto.vim.

Pulled from vim patch changelog:

Patch 7.2.310                                                                                                                                
Problem:    When a filetype plugin in ~/.vim/ftdetect uses ":setfiletype" and                                                                
            the file starts with a "# comment" it gets "conf" filetype.                                                                      
Solution:   Check for "conf" filetype after using ftdetect plugins.                                                                          
Files:      runtime/filetype.vim
Comment 2 Laurent Bachelier 2013-03-05 08:36:41 UTC
No, this is not the bug.
I am using vim 7.3.409.
dev-libs/protobuf 2.4.0a

Please check the contents of /usr/share/vim/vimfiles/ftdetect/proto.vim, it's the one causing the issue, not vim. In my system vim config, conf is already detected after all other filetypes, BUT proto.vim screws all that with the directives *around* "au BufRead,BufNewFile *.proto setfiletype proto".
Comment 3 Tim Harder gentoo-dev 2013-03-05 17:57:21 UTC
(In reply to comment #2)
> No, this is not the bug.
> I am using vim 7.3.409.
> dev-libs/protobuf 2.4.0a
> 
> Please check the contents of /usr/share/vim/vimfiles/ftdetect/proto.vim,
> it's the one causing the issue, not vim. In my system vim config, conf is
> already detected after all other filetypes, BUT proto.vim screws all that
> with the directives *around* "au BufRead,BufNewFile *.proto setfiletype
> proto".

I had already checked with these stable versions since that's what I assumed you were using but I couldn't reproduce the bug using them or the latest ~arch versions. It might be an issue with your config or interaction with other plugins on your system since those versions have both been stable for a long time without anyone else noticing any related issue.

Anyway, I altered the file in CVS, but without a revbump so re-emerge protobuf if you want it fixed or alter the file manually.