A Neovim plugin enabling you to solve LeetCode problems.
fix: detach open command execution (#80)
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.
1 file changed, +1 -1
+1-1lua/leetcode/command/init.lua
| @@ -313,7 +313,7 @@ function cmd.open() | ||
| 313 | 313 | command = string.format("start \"\" \"%s\"", q.cache.link) |
| 314 | 314 | end |
| 315 | 315 | |
| 316 | - os.execute(command) | |
| 316 | + vim.fn.jobstart(command, { detach = true }) | |
| 317 | 317 | end |
| 318 | 318 | end |
| 319 | 319 |