From f7b466c247cb85d4d07bdab175738bce4294b352 Mon Sep 17 00:00:00 2001 From: Abdulaziz AlOwain Date: Tue, 19 Mar 2024 08:10:39 +0300 Subject: [PATCH] Detach open command execution This commit simply switches `os.execute` with `vim.fn.jobstart` with `detach` set to `true`, making the editor available after opening the problems' url allowing you to edit, while the browser is running. The `detach` option keeps the browser open after the editor shuts down. It is not the default behavior (which would make the browser shut down with the editor, I find the introduced behavior to be more appropriate). NOTE: This commit has been tested only on Linux; but I don't suppose there would be any meaningful difference. --- lua/leetcode/command/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/leetcode/command/init.lua b/lua/leetcode/command/init.lua index 1472b51..fd56ae7 100644 --- a/lua/leetcode/command/init.lua +++ b/lua/leetcode/command/init.lua @@ -313,7 +313,7 @@ function cmd.open() command = string.format("start \"\" \"%s\"", q.cache.link) end - os.execute(command) + vim.fn.jobstart(command, { detach = true }) end end