From 19ff343a16ab27fd2c9bb66176fcfc0468a6d0b4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 Oct 2025 15:29:47 +0200 Subject: [PATCH] style: format --- lua/snacks/dashboard.lua | 14 +++++++------- lua/snacks/image/placement.lua | 2 +- tests/terminal_spec.lua | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lua/snacks/dashboard.lua b/lua/snacks/dashboard.lua index dacf29f4..5833f469 100644 --- a/lua/snacks/dashboard.lua +++ b/lua/snacks/dashboard.lua @@ -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 diff --git a/lua/snacks/image/placement.lua b/lua/snacks/image/placement.lua index f07af64c..e34add8f 100644 --- a/lua/snacks/image/placement.lua +++ b/lua/snacks/image/placement.lua @@ -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 }) diff --git a/tests/terminal_spec.lua b/tests/terminal_spec.lua index 26b11545..47665f11 100644 --- a/tests/terminal_spec.lua +++ b/tests/terminal_spec.lua @@ -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)