-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: restore window options on split windows (#36)
- Loading branch information
Showing
2 changed files
with
86 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
local oil = require("oil") | ||
local test_util = require("tests.test_util") | ||
|
||
describe("window options", function() | ||
after_each(function() | ||
test_util.reset_editor() | ||
end) | ||
|
||
it("Restores window options on close", function() | ||
vim.cmd.edit({ args = { "README.md" } }) | ||
oil.open() | ||
assert.equals("no", vim.o.signcolumn) | ||
oil.close() | ||
assert.equals("auto", vim.o.signcolumn) | ||
end) | ||
|
||
it("Restores window options on edit", function() | ||
oil.open() | ||
assert.equals("no", vim.o.signcolumn) | ||
vim.cmd.edit({ args = { "README.md" } }) | ||
assert.equals("auto", vim.o.signcolumn) | ||
end) | ||
|
||
it("Restores window options on split <filename>", function() | ||
oil.open() | ||
assert.equals("no", vim.o.signcolumn) | ||
vim.cmd.split({ args = { "README.md" } }) | ||
assert.equals("auto", vim.o.signcolumn) | ||
end) | ||
|
||
it("Restores window options on split", function() | ||
oil.open() | ||
assert.equals("no", vim.o.signcolumn) | ||
vim.cmd.split() | ||
vim.cmd.edit({ args = { "README.md" } }) | ||
assert.equals("auto", vim.o.signcolumn) | ||
end) | ||
end) |