Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test for moving the cursor into floating window
  • Loading branch information
rhysd committed Mar 21, 2019
commit 372939dd23d779ac8eb2d2dd842f65b02f1f7ead
24 changes: 24 additions & 0 deletions tests/LanguageClient_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,27 @@ def test_textDocument_hover_float_window_closed_on_switching_to_buffer(nvim):
if not b.name.endswith("__LanguageClient__"))
finally:
nvim.command("bdelete! {}".format(another_bufnr))


def test_textDocument_hover_float_window_move_cursor_into_window(nvim):
if not nvim.funcs.exists("*nvim_open_win"):
pytest.skip("Neovim 0.3.0 or earlier does not support floating window")

nvim.command("edit! {}".format(PATH_INDEXJS))
time.sleep(1)

prev_bufnr = nvim.current.buffer.number

_open_float_window(nvim)

# Moves cursor into floating window
nvim.funcs.LanguageClient_textDocument_hover()
assert nvim.current.buffer.name.endswith("__LanguageClient__")

# Close the window
nvim.command('close')
assert nvim.current.buffer.number == prev_bufnr

# Check float window buffer was closed by :close in the window
assert all(
b for b in nvim.buffers if not b.name.endswith("__LanguageClient__"))