Some checks failed
Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
Detach Plugins / check (GitHub.vim) (push) Has been cancelled
Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
Detach Plugins / check (git.vim) (push) Has been cancelled
Detach Plugins / check (iedit.vim) (push) Has been cancelled
Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
Detach Plugins / check (vim-chat) (push) Has been cancelled
Detach Plugins / check (vim-cheat) (push) Has been cancelled
Detach Plugins / check (vim-todo) (push) Has been cancelled
Detach Plugins / check (xmake.vim) (push) Has been cancelled
test / Linux (nvim, nightly) (push) Has been cancelled
test / Linux (nvim, v0.3.8) (push) Has been cancelled
test / Linux (nvim, v0.4.0) (push) Has been cancelled
test / Linux (nvim, v0.4.2) (push) Has been cancelled
test / Linux (nvim, v0.4.3) (push) Has been cancelled
test / Linux (nvim, v0.4.4) (push) Has been cancelled
test / Linux (nvim, v0.5.0) (push) Has been cancelled
test / Linux (nvim, v0.5.1) (push) Has been cancelled
test / Linux (nvim, v0.6.0) (push) Has been cancelled
test / Linux (nvim, v0.6.1) (push) Has been cancelled
test / Linux (nvim, v0.7.0) (push) Has been cancelled
test / Linux (nvim, v0.7.2) (push) Has been cancelled
test / Linux (nvim, v0.8.0) (push) Has been cancelled
test / Linux (nvim, v0.8.1) (push) Has been cancelled
test / Linux (nvim, v0.8.2) (push) Has been cancelled
test / Linux (nvim, v0.8.3) (push) Has been cancelled
test / Linux (nvim, v0.9.0) (push) Has been cancelled
test / Linux (nvim, v0.9.1) (push) Has been cancelled
test / Linux (true, vim, v7.4.052) (push) Has been cancelled
test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
test / Linux (true, vim, v7.4.629) (push) Has been cancelled
test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
test / Linux (vim, nightly) (push) Has been cancelled
test / Linux (vim, v8.0.0184) (push) Has been cancelled
test / Linux (vim, v8.0.1453) (push) Has been cancelled
test / Linux (vim, v8.1.2269) (push) Has been cancelled
test / Linux (vim, v8.2.2434) (push) Has been cancelled
test / Linux (vim, v8.2.3995) (push) Has been cancelled
test / Windows (nvim, nightly) (push) Has been cancelled
test / Windows (nvim, v0.3.8) (push) Has been cancelled
test / Windows (nvim, v0.4.2) (push) Has been cancelled
test / Windows (nvim, v0.4.3) (push) Has been cancelled
test / Windows (nvim, v0.4.4) (push) Has been cancelled
test / Windows (nvim, v0.5.0) (push) Has been cancelled
test / Windows (nvim, v0.5.1) (push) Has been cancelled
test / Windows (nvim, v0.6.0) (push) Has been cancelled
test / Windows (nvim, v0.6.1) (push) Has been cancelled
test / Windows (nvim, v0.7.0) (push) Has been cancelled
test / Windows (nvim, v0.7.2) (push) Has been cancelled
test / Windows (nvim, v0.8.0) (push) Has been cancelled
test / Windows (nvim, v0.8.1) (push) Has been cancelled
test / Windows (nvim, v0.8.2) (push) Has been cancelled
test / Windows (nvim, v0.8.3) (push) Has been cancelled
test / Windows (nvim, v0.9.0) (push) Has been cancelled
test / Windows (nvim, v0.9.1) (push) Has been cancelled
test / Windows (vim, nightly) (push) Has been cancelled
test / Windows (vim, v7.4.1185) (push) Has been cancelled
test / Windows (vim, v7.4.1689) (push) Has been cancelled
test / Windows (vim, v8.0.0027) (push) Has been cancelled
test / Windows (vim, v8.0.1453) (push) Has been cancelled
test / Windows (vim, v8.1.2269) (push) Has been cancelled
test / Windows (vim, v8.2.2434) (push) Has been cancelled
test / Windows (vim, v8.2.3995) (push) Has been cancelled
docker / docker (push) Has been cancelled
mirror / check (coding) (push) Has been cancelled
mirror / check (gitee) (push) Has been cancelled
mirror / check (gitlab) (push) Has been cancelled
147 lines
3.3 KiB
Lua
147 lines
3.3 KiB
Lua
pcall(require, "luacov")
|
|
|
|
local ns_id = require("neo-tree.ui.highlights").ns_id
|
|
local u = require("tests.utils")
|
|
|
|
local config = {
|
|
renderers = {
|
|
directory = {
|
|
{
|
|
"container",
|
|
content = {
|
|
{ "indent", zindex = 10 },
|
|
{ "icon", zindex = 10 },
|
|
{ "name", zindex = 10 },
|
|
{ "name", zindex = 5, align = "right" },
|
|
},
|
|
},
|
|
},
|
|
file = {
|
|
{
|
|
"container",
|
|
content = {
|
|
{ "indent", zindex = 10 },
|
|
{ "icon", zindex = 10 },
|
|
{ "name", zindex = 10 },
|
|
{ "name", zindex = 20, align = "right" },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
window = {
|
|
width = 40,
|
|
},
|
|
}
|
|
|
|
local config_right = {
|
|
renderers = {
|
|
directory = {
|
|
{
|
|
"container",
|
|
enable_character_fade = false,
|
|
content = {
|
|
{ "indent", zindex = 10, align = "right" },
|
|
{ "icon", zindex = 10, align = "right" },
|
|
{ "name", zindex = 10, align = "right" },
|
|
},
|
|
},
|
|
},
|
|
file = {
|
|
{
|
|
"container",
|
|
enable_character_fade = false,
|
|
content = {
|
|
{ "indent", zindex = 10, align = "right" },
|
|
{ "icon", zindex = 10, align = "right" },
|
|
{ "name", zindex = 10, align = "right" },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
window = {
|
|
width = 40,
|
|
},
|
|
}
|
|
|
|
local test_dir = {
|
|
items = {
|
|
{
|
|
name = "foo",
|
|
type = "dir",
|
|
items = {
|
|
{
|
|
name = "bar",
|
|
type = "dir",
|
|
items = {
|
|
{ name = "bar1.txt", type = "file" },
|
|
{ name = "bar2.txt", type = "file" },
|
|
},
|
|
},
|
|
{ name = "foo1.lua", type = "file" },
|
|
},
|
|
},
|
|
{ name = "bazbazbazbazbazbazbazbazbazbazbazbazbazbazbazbazbaz", type = "dir" },
|
|
{ name = "1.md", type = "file" },
|
|
},
|
|
}
|
|
|
|
describe("sources/components/container", function()
|
|
local req_switch = u.get_require_switch()
|
|
|
|
local test = u.fs.init_test(test_dir)
|
|
test.setup()
|
|
|
|
after_each(function()
|
|
if req_switch then
|
|
req_switch.restore()
|
|
end
|
|
|
|
u.clear_environment()
|
|
end)
|
|
|
|
describe("should expand to width", function()
|
|
for pow = 4, 8 do
|
|
it(2 ^ pow, function()
|
|
config.window.width = 2 ^ pow
|
|
require("neo-tree").setup(config)
|
|
vim.cmd([[Neotree focus]])
|
|
u.wait_for(function()
|
|
return vim.bo.filetype == "neo-tree"
|
|
end)
|
|
|
|
assert.equals(vim.bo.filetype, "neo-tree")
|
|
|
|
local width = vim.api.nvim_win_get_width(0)
|
|
local lines = vim.api.nvim_buf_get_lines(0, 2, -1, false)
|
|
for _, line in ipairs(lines) do
|
|
assert.is_true(#line >= width)
|
|
end
|
|
end)
|
|
end
|
|
end)
|
|
|
|
describe("right-align should matches width", function()
|
|
for pow = 4, 8 do
|
|
it(2 ^ pow, function()
|
|
config_right.window.width = 2 ^ pow
|
|
require("neo-tree").setup(config_right)
|
|
vim.cmd([[Neotree focus]])
|
|
u.wait_for(function()
|
|
return vim.bo.filetype == "neo-tree"
|
|
end)
|
|
|
|
assert.equals(vim.bo.filetype, "neo-tree")
|
|
|
|
local width = vim.api.nvim_win_get_width(0)
|
|
local lines = vim.api.nvim_buf_get_lines(0, 1, -1, false)
|
|
for _, line in ipairs(lines) do
|
|
line = vim.fn.trim(line, " ", 2)
|
|
assert.equals(width, vim.fn.strchars(line))
|
|
end
|
|
end)
|
|
end
|
|
end)
|
|
|
|
test.teardown()
|
|
end)
|