From 81105f3a91cffb32ae163ab3eb2446643d95b32e Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 30 May 2024 22:20:46 +0200 Subject: remove useless check if terminal buffer exists --- lua/functions.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lua') diff --git a/lua/functions.lua b/lua/functions.lua index 3c19268..da238e4 100644 --- a/lua/functions.lua +++ b/lua/functions.lua @@ -48,15 +48,13 @@ function _G.toggle_terminal() vim.api.nvim_win_set_height(vim.fn.win_getid(), vim.g.terminal_height) - if not pcall(function() vim.cmd("buffer " .. vim.g.term_buf) end) then - vim.fn.termopen(vim.env.SHELL, {detach=0}) + vim.fn.termopen(vim.env.SHELL, {detach=0}) - vim.g.term_buf = vim.fn.bufnr("") + vim.g.term_buf = vim.fn.bufnr("") - vim.o.number = false - vim.o.relativenumber = false - vim.o.signcolumn = "no" - end + vim.o.number = false + vim.o.relativenumber = false + vim.o.signcolumn = "no" vim.cmd("startinsert!") -- cgit v1.2.3-18-g5258