vitorpy's Dotfiles

Fix :IDE command error handling with pcall

vitorpy c6451467 d63805c4

+5 -3
+5 -3
private_dot_config/nvim/lua/ide-layout.lua
··· 5 5 local M = {} 6 6 7 7 function M.setup_ide_layout() 8 - -- Close all windows except current 9 - vim.cmd("only") 8 + -- Close all windows except current (ignore errors from floating windows) 9 + pcall(function() vim.cmd("only") end) 10 + 11 + -- Close nvim-tree if open 12 + pcall(function() vim.cmd("NvimTreeClose") end) 10 13 11 14 -- Open nvim-tree on the left 12 15 vim.cmd("NvimTreeOpen") ··· 25 28 26 29 -- Open terminal in bottom split 27 30 vim.cmd("terminal") 28 - vim.cmd("startinsert") 29 31 30 32 -- Move back to top split (editor) 31 33 vim.cmd("wincmd k")