From 2d32201afa2390ef2a2f97f33f82b5ae8992447c Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Fri, 31 Jan 2025 08:51:46 +0100 Subject: [PATCH] revert(termopen): replace termopen with jobstart (#675) --- lua/rustaceanvim/executors/termopen.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/rustaceanvim/executors/termopen.lua b/lua/rustaceanvim/executors/termopen.lua index 043e16c1..f0ad9830 100644 --- a/lua/rustaceanvim/executors/termopen.lua +++ b/lua/rustaceanvim/executors/termopen.lua @@ -29,8 +29,15 @@ local M = { -- close the buffer when escape is pressed :) vim.keymap.set('n', '', 'q', { 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