@@ -79,11 +79,15 @@ function! s:clear_all_highlights() abort
79
79
80
80
for l: bufnr in range (1 , bufnr (' $' ))
81
81
if bufexists (l: bufnr ) && bufloaded (l: bufnr )
82
- call prop_remove ({
83
- \ ' type' : l: prop_type ,
84
- \ ' bufnr' : l: bufnr ,
85
- \ ' all' : v: true ,
86
- \ }, 1 , len (getbufline (l: bufnr , 1 , ' $' )))
82
+ try
83
+ call prop_remove ({
84
+ \ ' type' : l: prop_type ,
85
+ \ ' bufnr' : l: bufnr ,
86
+ \ ' all' : v: true ,
87
+ \ }, 1 , len (getbufline (l: bufnr , 1 , ' $' )))
88
+ catch
89
+ call lsp#log (' clear_all_highlights' , v: exception )
90
+ endtry
87
91
endif
88
92
endfor
89
93
@@ -103,11 +107,15 @@ function! s:clear_highlights(server_name, path) abort
103
107
104
108
for l: severity in keys (s: severity_sign_names_mapping )
105
109
let l: prop_type = s: get_prop_type (a: server_name , l: severity )
106
- call prop_remove ({
107
- \ ' type' : l: prop_type ,
108
- \ ' bufnr' : l: bufnr ,
109
- \ ' all' : v: true ,
110
- \ }, 1 , len (getbufline (l: bufnr , 1 , ' $' )))
110
+ try
111
+ call prop_remove ({
112
+ \ ' type' : l: prop_type ,
113
+ \ ' bufnr' : l: bufnr ,
114
+ \ ' all' : v: true ,
115
+ \ }, 1 , len (getbufline (l: bufnr , 1 , ' $' )))
116
+ catch
117
+ call lsp#log (' clear_highlights' , v: exception )
118
+ endtry
111
119
endfor
112
120
endfunction
113
121
@@ -121,12 +129,16 @@ function! s:place_highlights(server_name, path, diagnostics) abort
121
129
let [l: end_line , l: end_col ] = lsp#utils#position#_lsp_to_vim (l: bufnr , l: item [' range' ][' end' ])
122
130
123
131
let l: prop_type = s: get_prop_type (a: server_name , get (l: item , ' severity' , 1 ))
124
- call prop_add (l: start_line , l: start_col , {
125
- \ ' end_lnum' : l: end_line ,
126
- \ ' end_col' : l: end_col ,
127
- \ ' bufnr' : l: bufnr ,
128
- \ ' type' : l: prop_type ,
129
- \ })
132
+ try
133
+ call prop_add (l: start_line , l: start_col , {
134
+ \ ' end_lnum' : l: end_line ,
135
+ \ ' end_col' : l: end_col ,
136
+ \ ' bufnr' : l: bufnr ,
137
+ \ ' type' : l: prop_type ,
138
+ \ })
139
+ catch
140
+ call lsp#log (' place_highlights' , v: exception )
141
+ endtry
130
142
endfor
131
143
endif
132
144
endfunction
0 commit comments