mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-12 19:53:47 -05: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:
@@ -413,9 +413,15 @@ function s:SetUpForNewFiletype(filetype, forceReset)
|
|||||||
let ft = a:filetype
|
let ft = a:filetype
|
||||||
|
|
||||||
"for compound filetypes, if we dont know how to handle the full 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)
|
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
|
endif
|
||||||
|
|
||||||
let b:NERDSexyComMarker = ''
|
let b:NERDSexyComMarker = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user