Skip to content

Commit 80d028e

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

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/LanguageClient_test.py

+22
Original file line numberDiff line numberDiff line change
@@ -309,3 +309,25 @@ 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+
buf = nvim.current.buffer
322+
323+
pos = _open_float_window(nvim)
324+
325+
# Moves cursor into floating window
326+
nvim.funcs.LanguageClient_textDocument_hover()
327+
328+
assert nvim.current.buffer.name.endswith("__LanguageClient__")
329+
nvim.command('close')
330+
331+
# Check float window buffer was closed by :close in the window
332+
assert all(
333+
b for b in nvim.buffers if not b.name.endswith("__LanguageClient__"))

0 commit comments

Comments
 (0)