@@ -14,8 +14,8 @@ function! LspFloatwinSyntaxShouldUpdate(bufnr) abort
14
14
return v: true
15
15
endif
16
16
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 ) ||
19
19
\ ! has_key (b: lsp_floatwin_state .fenced_mark_syntaxes, l: mark )
20
20
return v: true
21
21
endif
@@ -39,7 +39,7 @@ function! s:update()
39
39
" initialize state.
40
40
let b: lsp_floatwin_state = get (b: , ' lsp_floatwin_state' , {
41
41
\ ' markdown_syntax' : v: false ,
42
- \ ' fenced_language_syntaxes ' : {},
42
+ \ ' fenced_filetype_syntaxes ' : {},
43
43
\ ' fenced_mark_syntaxes' : {},
44
44
\ })
45
45
@@ -52,17 +52,17 @@ function! s:update()
52
52
syntax include @Markdown syntax/markdown.vim
53
53
endif
54
54
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 ))
57
57
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
61
61
62
62
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 )
64
64
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 )
66
66
endfor
67
67
catch /.*/
68
68
continue
@@ -86,7 +86,7 @@ function! s:update()
86
86
\ l: start_mark ,
87
87
\ l: mark_end_group ,
88
88
\ l: end_mark ,
89
- \ l: language_group
89
+ \ l: filetype_group
90
90
\ )
91
91
endif
92
92
endfor
@@ -115,10 +115,10 @@ function! s:find_marks(bufnr) abort
115
115
endfunction
116
116
117
117
"
118
- " get_syntax_map
118
+ " get_filetype_map
119
119
"
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 = {}
122
122
123
123
for l: mark in a: marks
124
124
@@ -127,27 +127,27 @@ function! s:get_language_map(marks) abort
127
127
" Supports `let g:markdown_fenced_languages = ['sh']`
128
128
if l: config !~# ' ='
129
129
if l: config == # l: mark
130
- let l: language_map [l: mark ] = l: mark
130
+ let l: filetype_map [l: mark ] = l: mark
131
131
break
132
132
endif
133
133
134
134
" Supports `let g:markdown_fenced_languages = ['bash=sh']`
135
135
else
136
136
let l: config = split (l: config , ' =' )
137
137
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 ]
139
139
break
140
140
endif
141
141
endif
142
142
endfor
143
143
144
144
" 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
147
147
endif
148
148
endfor
149
149
150
- return l: language_map
150
+ return l: filetype_map
151
151
endfunction
152
152
153
153
"
0 commit comments