Skip to content

Commit

Permalink
fix: detach open command execution (#80)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlOwain committed Apr 7, 2024
1 parent 765cc76 commit a92e764
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/leetcode/command/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a92e764

Please sign in to comment.