@@ -73,6 +73,7 @@ function M.explain_error()
73
73
vim .notify (' No explainable errors found.' , vim .log .levels .INFO )
74
74
return
75
75
end
76
+ close_hover ()
76
77
local win_id = vim .api .nvim_get_current_win ()
77
78
local opts = {
78
79
cursor_position = vim .api .nvim_win_get_cursor (win_id ),
@@ -128,15 +129,11 @@ function M.explain_error()
128
129
table.insert (float_preview_lines , 1 , ' ---' )
129
130
table.insert (float_preview_lines , 1 , ' 1. Open in split' )
130
131
vim .schedule (function ()
131
- close_hover ()
132
132
local bufnr , winnr = vim .lsp .util .open_floating_preview (
133
133
float_preview_lines ,
134
134
' markdown' ,
135
135
vim .tbl_extend (' keep' , config .tools .float_win_config , {
136
- focus = false ,
137
- focusable = true ,
138
136
focus_id = ' rustc-explain-error' ,
139
- close_events = { ' CursorMoved' , ' BufHidden' , ' InsertCharPre' },
140
137
})
141
138
)
142
139
_window_state .float_winnr = winnr
@@ -203,15 +200,11 @@ function M.explain_error_current_line()
203
200
table.insert (float_preview_lines , 1 , ' ---' )
204
201
table.insert (float_preview_lines , 1 , ' 1. Open in split' )
205
202
vim .schedule (function ()
206
- close_hover ()
207
203
local bufnr , winnr = vim .lsp .util .open_floating_preview (
208
204
float_preview_lines ,
209
205
' markdown' ,
210
206
vim .tbl_extend (' keep' , config .tools .float_win_config , {
211
- focus = false ,
212
- focusable = true ,
213
207
focus_id = ' rustc-explain-error' ,
214
- close_events = { ' CursorMoved' , ' BufHidden' , ' InsertCharPre' },
215
208
})
216
209
)
217
210
_window_state .float_winnr = winnr
@@ -252,15 +245,11 @@ local function render_ansi_code_diagnostic(rendered_diagnostic)
252
245
table.insert (float_preview_lines , 1 , ' ---' )
253
246
table.insert (float_preview_lines , 1 , ' 1. Open in split' )
254
247
vim .schedule (function ()
255
- close_hover ()
256
248
local bufnr , winnr = vim .lsp .util .open_floating_preview (
257
249
float_preview_lines ,
258
- ' ' ,
250
+ ' plaintext ' ,
259
251
vim .tbl_extend (' keep' , config .tools .float_win_config , {
260
- focus = false ,
261
- focusable = true ,
262
252
focus_id = ' ra-render-diagnostic' ,
263
- close_events = { ' CursorMoved' , ' BufHidden' , ' InsertCharPre' },
264
253
})
265
254
)
266
255
vim .api .nvim_create_autocmd (' WinEnter' , {
@@ -322,6 +311,7 @@ function M.render_diagnostic()
322
311
vim .notify (' No renderable diagnostics found.' , vim .log .levels .INFO )
323
312
return
324
313
end
314
+ close_hover ()
325
315
local win_id = vim .api .nvim_get_current_win ()
326
316
local opts = {
327
317
cursor_position = vim .api .nvim_win_get_cursor (win_id ),
0 commit comments