Skip to content

Commit 372939d

Browse files
committed
Add test for moving the cursor into floating window
1 parent 0fbded1 commit 372939d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/LanguageClient_test.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,3 +309,27 @@ def test_textDocument_hover_float_window_closed_on_switching_to_buffer(nvim):
309309
if not b.name.endswith("__LanguageClient__"))
310310
finally:
311311
nvim.command("bdelete! {}".format(another_bufnr))
312+
313+
314+
def test_textDocument_hover_float_window_move_cursor_into_window(nvim):
315+
if not nvim.funcs.exists("*nvim_open_win"):
316+
pytest.skip("Neovim 0.3.0 or earlier does not support floating window")
317+
318+
nvim.command("edit! {}".format(PATH_INDEXJS))
319+
time.sleep(1)
320+
321+
prev_bufnr = nvim.current.buffer.number
322+
323+
_open_float_window(nvim)
324+
325+
# Moves cursor into floating window
326+
nvim.funcs.LanguageClient_textDocument_hover()
327+
assert nvim.current.buffer.name.endswith("__LanguageClient__")
328+
329+
# Close the window
330+
nvim.command('close')
331+
assert nvim.current.buffer.number == prev_bufnr
332+
333+
# Check float window buffer was closed by :close in the window
334+
assert all(
335+
b for b in nvim.buffers if not b.name.endswith("__LanguageClient__"))

0 commit comments

Comments
 (0)