File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -208,3 +208,35 @@ def test_languageClient_registerHandlers(nvim):
208
208
# if b.name.startswith('term://')), None) is None)
209
209
210
210
# assertRetry(lambda: len(nvim.funcs.getqflist()) == 0)
211
+
212
+
213
+ def test_textDocument_hover_float_window (nvim ):
214
+ if not nvim .funcs .exists ('*nvim_open_win' ):
215
+ pytest .skip ('Neovim 0.3.0 or earlier does not support floating window' )
216
+
217
+ nvim .command ("edit! {}" .format (PATH_INDEXJS ))
218
+ time .sleep (1 )
219
+
220
+ buf = nvim .current .buffer
221
+
222
+ nvim .funcs .cursor (13 , 19 )
223
+ pos = nvim .funcs .getpos ('.' )
224
+ nvim .funcs .LanguageClient_textDocument_hover ()
225
+ time .sleep (1 )
226
+ float_buf = next (
227
+ b for b in nvim .buffers if b .name .endswith ('__LanguageClient__' ))
228
+
229
+ # Check if float window is open
230
+ float_winnr = nvim .funcs .bufwinnr (float_buf .number )
231
+ assert float_winnr > 0
232
+
233
+ # Check if cursor is not moved
234
+ assert buf .number == nvim .current .buffer .number
235
+ assert pos == nvim .funcs .getpos ('.' )
236
+
237
+ # Move cursor to left
238
+ nvim .funcs .cursor (13 , 17 )
239
+
240
+ # Check float window buffer was closed by CursorMoved
241
+ assert all (
242
+ b for b in nvim .buffers if not b .name .endswith ('__LanguageClient__' ))
You can’t perform that action at this time.
0 commit comments