-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #373 from funemy/main
fix goto_last_window
- Loading branch information
Showing
3 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
---@brief [[ | ||
--- Tests for jumping from Lean file to infoview and back | ||
---@brief ]] | ||
|
||
local fixtures = require 'spec.fixtures' | ||
local helpers = require 'spec.helpers' | ||
local infoview = require 'lean.infoview' | ||
|
||
require('lean').setup {} | ||
|
||
describe('infoview jumping', function() | ||
local lean_window | ||
|
||
it('jumps from Lean file to infoview', function() | ||
assert.is.equal(1, #vim.api.nvim_tabpage_list_wins(0)) | ||
lean_window = vim.api.nvim_get_current_win() | ||
|
||
vim.cmd('edit! ' .. fixtures.project.some_existing_file) | ||
local current_infoview = infoview.get_current_infoview() | ||
|
||
current_infoview:open() | ||
-- Both Lean and infoview windows exist | ||
assert.windows.are(lean_window, current_infoview.window) | ||
|
||
vim.cmd.LeanGotoInfoview() | ||
assert.current_window.is(current_infoview.window) | ||
end) | ||
|
||
it('jumps back from infoview to the associated Lean file', function() | ||
helpers.feed '<LocalLeader><Tab>' | ||
assert.current_window.is(lean_window) | ||
end) | ||
end) |