chomosuke / typst-preview.nvim

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

Add mode argument to :TypstPreview to support slide mode #25

Closed wisp3rwind closed 4 months ago

wisp3rwind commented 5 months ago

This augments the :TypstPreview command such that it supports the different preview modes from Enter-tainer/typst-preview:

I know only a minimal amount of lua and the nvim API, let me know if I implemented anything in an usual way!

A possible future improvement could be to check whether the document seems to be using polylux and choose the default mode accordingly.

chomosuke commented 5 months ago

Thank you for bringing this to my attention.

It'll take me some time to think about how to approach this. I think perhaps this is a good opportunity to rewrite this plugin in a more OOP fashion. I feel like the way that so many different tables are indexed by bufnr makes me very uncomfortable.

I might never take any commit in this PR but I'll make sure to credit you when I reimplement this functionality after the OOP rewrite. Alternatively, if you'd like to rewrite this PR yourself I can let you know when I finish the OOP rewrite :).

wisp3rwind commented 5 months ago

Sounds good! Feel free to just implement this yourself, but if you want some help, ping me and I'll see whether I can find some time.

chomosuke commented 4 months ago

Completed as a part of #31.