Skip to content

Commit

Permalink
revert(termopen): replace termopen with jobstart (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Jan 31, 2025
1 parent 4a2f2d2 commit 2d32201
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/rustaceanvim/executors/termopen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ local M = {
-- close the buffer when escape is pressed :)
vim.keymap.set('n', '<Esc>', '<CMD>q<CR>', { buffer = latest_buf_id, noremap = true })

-- TODO(0.11): Replace with vim.fn.jobstart(full_command, { term = true })
-- run the command
vim.fn.jobstart(full_command, { term = true })
---@diagnostic disable-next-line: deprecated
if type(vim.fn.termopen) == 'function' then
---@diagnostic disable-next-line: deprecated
vim.fn.termopen(full_command)
else
vim.fn.jobstart(full_command, { term = true })
end

-- when the buffer is closed, set the latest buf id to nil else there are
-- some edge cases with the id being sit but a buffer not being open
Expand Down

0 comments on commit 2d32201

Please sign in to comment.