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