Skip to content

Commit 74e48f2

Browse files
committed
feat(ui): update side panel opening behavior
- Pass false to not run any command - vim-test: open vsplit when opening panel
1 parent 33205f5 commit 74e48f2

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

lua/plugins/vim-test.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ return {
1717
vim.g["test#custom_strategies"] = {
1818
my_neovim = function(cmd)
1919
-- Open a new vertical split for the terminal
20-
vim.ui.open_side_panel(false)
20+
vim.ui.open_side_panel()
2121

2222
-- Run the test command
2323
vim.fn.jobstart(cmd, {

lua/ruicsh/ui.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ vim.ui.open_side_panel = function(cmd)
2929
local current_tab = vim.api.nvim_win_get_tabpage(current_win)
3030
local wins = vim.api.nvim_tabpage_list_wins(current_tab)
3131

32-
local function run_command(c)
33-
if c then
32+
local function run_command()
33+
-- If the command is false, we don't run anything
34+
if cmd ~= false then
3435
-- If there's a commend to run or by default open a new vertical split on the right
35-
local command = c or "botright vnew"
36+
local command = cmd or "botright vnew"
3637
vim.cmd(command)
3738
end
3839
end
3940

4041
if #wins <= 1 then
41-
run_command(cmd)
42+
run_command()
4243
return
4344
end
4445

@@ -62,5 +63,5 @@ vim.ui.open_side_panel = function(cmd)
6263
vim.ui.close_windows_on_side("left")
6364
end
6465

65-
run_command(cmd)
66+
run_command()
6667
end

0 commit comments

Comments
 (0)