summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-05-30 22:20:46 +0200
committerHampusM <hampus@hampusmat.com>2024-05-30 22:20:46 +0200
commit81105f3a91cffb32ae163ab3eb2446643d95b32e (patch)
tree7fc8be5eb64bc4f643868464b4a1f28a4bb4f867 /lua
parent9baf707465de96c28a5f3da8ce24dd71a9c586cc (diff)
remove useless check if terminal buffer exists
Diffstat (limited to 'lua')
-rw-r--r--lua/functions.lua12
1 files changed, 5 insertions, 7 deletions
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!")