@@ -14,8 +14,8 @@ function! LspFloatwinSyntaxShouldUpdate(bufnr) abort
1414 return v: true
1515 endif
1616
17- for [l: mark , l: language ] in items (s: get_language_map (s: find_marks (a: bufnr )))
18- if ! has_key (b: lsp_floatwin_state .fenced_language_syntaxes , l: language ) ||
17+ for [l: mark , l: filetype ] in items (s: get_filetype_map (s: find_marks (a: bufnr )))
18+ if ! has_key (b: lsp_floatwin_state .fenced_filetype_syntaxes , l: filetype ) ||
1919 \ ! has_key (b: lsp_floatwin_state .fenced_mark_syntaxes, l: mark )
2020 return v: true
2121 endif
@@ -39,7 +39,7 @@ function! s:update()
3939 " initialize state.
4040 let b: lsp_floatwin_state = get (b: , ' lsp_floatwin_state' , {
4141 \ ' markdown_syntax' : v: false ,
42- \ ' fenced_language_syntaxes ' : {},
42+ \ ' fenced_filetype_syntaxes ' : {},
4343 \ ' fenced_mark_syntaxes' : {},
4444 \ })
4545
@@ -52,17 +52,17 @@ function! s:update()
5252 syntax include @Markdown syntax/markdown.vim
5353 endif
5454
55- for [l: mark , l: language ] in items (s: get_language_map (s: find_marks (bufnr (' %' ))))
56- let l: language_group = printf (' @LspMarkdownFenced_%s' , s: escape (l: language ))
55+ for [l: mark , l: filetype ] in items (s: get_filetype_map (s: find_marks (bufnr (' %' ))))
56+ let l: filetype_group = printf (' @LspMarkdownFenced_%s' , s: escape (l: filetype ))
5757
58- " include syntax for language .
59- if ! has_key (b: lsp_floatwin_state .fenced_language_syntaxes , l: language )
60- let b: lsp_floatwin_state .fenced_language_syntaxes [l: language ] = v: true
58+ " include syntax for filetype .
59+ if ! has_key (b: lsp_floatwin_state .fenced_filetype_syntaxes , l: filetype )
60+ let b: lsp_floatwin_state .fenced_filetype_syntaxes [l: filetype ] = v: true
6161
6262 try
63- for l: syntax_path in s: find_syntax_path (l: language )
63+ for l: syntax_path in s: find_syntax_path (l: filetype )
6464 call s: clear ()
65- execute printf (' syntax include %s %s' , l: language_group , l: syntax_path )
65+ execute printf (' syntax include %s %s' , l: filetype_group , l: syntax_path )
6666 endfor
6767 catch /.*/
6868 continue
@@ -86,7 +86,7 @@ function! s:update()
8686 \ l: start_mark ,
8787 \ l: mark_end_group ,
8888 \ l: end_mark ,
89- \ l: language_group
89+ \ l: filetype_group
9090 \ )
9191 endif
9292 endfor
@@ -115,10 +115,10 @@ function! s:find_marks(bufnr) abort
115115endfunction
116116
117117"
118- " get_syntax_map
118+ " get_filetype_map
119119"
120- function ! s: get_language_map (marks ) abort
121- let l: language_map = {}
120+ function ! s: get_filetype_map (marks ) abort
121+ let l: filetype_map = {}
122122
123123 for l: mark in a: marks
124124
@@ -127,27 +127,27 @@ function! s:get_language_map(marks) abort
127127 " Supports `let g:markdown_fenced_languages = ['sh']`
128128 if l: config !~# ' ='
129129 if l: config == # l: mark
130- let l: language_map [l: mark ] = l: mark
130+ let l: filetype_map [l: mark ] = l: mark
131131 break
132132 endif
133133
134134 " Supports `let g:markdown_fenced_languages = ['bash=sh']`
135135 else
136136 let l: config = split (l: config , ' =' )
137137 if l: config [1 ] == # l: mark
138- let l: language_map [l: config [1 ]] = l: config [0 ]
138+ let l: filetype_map [l: config [1 ]] = l: config [0 ]
139139 break
140140 endif
141141 endif
142142 endfor
143143
144144 " add as-is if can't resolved.
145- if ! has_key (l: language_map , l: mark )
146- let l: language_map [l: mark ] = l: mark
145+ if ! has_key (l: filetype_map , l: mark )
146+ let l: filetype_map [l: mark ] = l: mark
147147 endif
148148 endfor
149149
150- return l: language_map
150+ return l: filetype_map
151151endfunction
152152
153153"
0 commit comments