chomosuke / typst-preview.nvim

Low latency typst preview for Neovim
GNU General Public License v3.0
254 stars 16 forks source link

Custom Port #34

Open floaterest opened 4 months ago

floaterest commented 4 months ago

Passing --static-file-host 127.0.0.1:0 as arguments to the typst preview binary will start the preview local server on a random port. This PR adds an option to the config that allows a user-specified port instead of a random one.

resolves #33

chomosuke commented 4 months ago

Hello there, thanks for this PR. I'll be happy to merge this PR if you add the port option to README's default config also. And please explain that 0 means any free port. Please also handle the error of when the port is already taken by notifying the user with utils.notify(...).

floaterest commented 4 months ago

Sure, I will work on that

floaterest commented 2 months ago

Sorry for the delay.

I implemented the error handling and added documention (in README.md and typst-preview.nvim.txt)