improve handling for compound filetypes

now we check each part of the compound filetype until we find a part we
know how to handle

e.g. if the filetype is foo.bar.php.java then delimiters will get set
for php
This commit is contained in:
Martin Grenfell 2011-02-06 09:35:14 +13:00
parent f8be02f10a
commit 197ce731be

View File

@ -413,9 +413,15 @@ function s:SetUpForNewFiletype(filetype, forceReset)
let ft = a:filetype
"for compound filetypes, if we dont know how to handle the full filetype
"then just use the first part, e.g. 'foo.bar' is treated as 'foo'
"then break it down and use the first part that we know how to handle
if ft =~ '\.' && !has_key(s:delimiterMap, ft)
let ft = split(a:filetype, '\.')[0]
let filetypes = split(a:filetype, '\.')
for i in filetypes
if has_key(s:delimiterMap, i)
let ft = i
break
endif
endfor
endif
let b:NERDSexyComMarker = ''