File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -713,21 +713,25 @@ function! s:readable_calculate_file_type() dict abort
713713 return r
714714endfunction
715715
716- function ! s: buffer_type_name () dict abort
717- let var = getbufvar (self ._number,' rails_cached_file_type' )
718- if var == ' -'
719- return ' '
720- elseif var != ' '
721- return var
722- else
716+ function ! s: buffer_type_name (... ) dict abort
717+ let type = getbufvar (self ._number,' rails_cached_file_type' )
718+ if type == ' '
723719 let type = self .calculate_file_type ()
724- return type == ' -' ? ' ' : type
725720 endif
721+ return call (' s:match_type' ,[type == ' -' ? ' ' : type ] + a: 000 )
726722endfunction
727723
728724function ! s: readable_type_name () dict abort
729725 let type = self .calculate_file_type ()
730- return type == ' -' ? ' ' : type
726+ return call (' s:match_type' ,[type == ' -' ? ' ' : type ] + a: 000 )
727+ endfunction
728+
729+ function ! s: match_type (type ,... )
730+ if a: 0
731+ return ! empty (filter (copy (a: 000 ),' a:type =~# "^".v:val."\\>"' ))
732+ else
733+ return a: type
734+ endif
731735endfunction
732736
733737function ! s: app_environments () dict
You can’t perform that action at this time.
0 commit comments