kawre / leetcode.nvim

A Neovim plugin enabling you to solve LeetCode problems.
MIT License
654 stars 34 forks source link

Fix: Detach open command execution #80

Closed AlOwain closed 2 months ago

AlOwain commented 3 months ago

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.

AlOwain commented 3 months ago

For added context, the current behavior halts the editor; as os.execute runs sequentially; I believe it is the expected behavior, why would anyone not want to be able to edit till they close their browser?

kawre commented 2 months ago

thanks