mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-01-20 02:32:46 +08:00
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:
parent
f8be02f10a
commit
197ce731be
|
@ -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 = ''
|
||||
|
|
Loading…
Reference in New Issue
Block a user