mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
style: format
This commit is contained in:
parent
40a34549b1
commit
19ff343a16
3 changed files with 13 additions and 13 deletions
|
|
@ -910,11 +910,11 @@ function M.sections.projects(opts)
|
|||
file = dir,
|
||||
icon = "directory",
|
||||
action = function(self)
|
||||
if opts.action then
|
||||
return opts.action(dir)
|
||||
end
|
||||
vim.fn.chdir(dir)
|
||||
local session = M.sections.session()
|
||||
if opts.action then
|
||||
return opts.action(dir)
|
||||
end
|
||||
vim.fn.chdir(dir)
|
||||
local session = M.sections.session()
|
||||
-- stylua: ignore
|
||||
if opts.session and session then
|
||||
local session_loaded = false
|
||||
|
|
@ -924,8 +924,8 @@ function M.sections.projects(opts)
|
|||
elseif opts.pick then
|
||||
M.pick()
|
||||
end
|
||||
end,
|
||||
autokey = true,
|
||||
end,
|
||||
autokey = true,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ function M:render_fallback(state)
|
|||
self:debug("render_fallback", win)
|
||||
local border = setmetatable({ opts = vim.api.nvim_win_get_config(win) }, { __index = Snacks.win }):border_size()
|
||||
local pos = vim.api.nvim_win_get_position(win)
|
||||
if ( vim.o.showtabline == 2 ) or ( vim.o.showtabline == 1 and vim.fn.tabpagenr('$') > 1 ) then
|
||||
if (vim.o.showtabline == 2) or (vim.o.showtabline == 1 and vim.fn.tabpagenr("$") > 1) then
|
||||
terminal.set_cursor({ pos[1] + border.top, pos[2] + border.left })
|
||||
else
|
||||
terminal.set_cursor({ pos[1] + 1 + border.top, pos[2] + border.left })
|
||||
|
|
|
|||
|
|
@ -29,18 +29,18 @@ describe("terminal.open", function()
|
|||
-- Create a test buffer with content
|
||||
vim.cmd("enew")
|
||||
local test_buf = vim.api.nvim_get_current_buf()
|
||||
vim.api.nvim_buf_set_lines(test_buf, 0, -1, false, {"test content"})
|
||||
|
||||
vim.api.nvim_buf_set_lines(test_buf, 0, -1, false, { "test content" })
|
||||
|
||||
-- Open terminal with position='current'
|
||||
local term = terminal.open(nil, { win = { position = "current" } })
|
||||
|
||||
|
||||
-- Check that the current window now has the terminal buffer
|
||||
local current_win = vim.api.nvim_get_current_win()
|
||||
local current_buf = vim.api.nvim_win_get_buf(current_win)
|
||||
|
||||
|
||||
assert.are.equal(term.buf, current_buf, "Terminal buffer should be set in current window")
|
||||
assert.are.equal("terminal", vim.bo[current_buf].buftype, "Buffer should be a terminal")
|
||||
|
||||
|
||||
-- Clean up
|
||||
term:close()
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue