Commit graph

18 commits

Author SHA1 Message Date
Barrett Ruth
7895b67c21
docs: replace all setup() references with vim.g.preview (#43) 2026-03-04 19:39:00 -05:00
Barrett Ruth
f1aed82f42
feat: add detach provider field and vim.g.preview config support (#42)
Problem: viewer processes launched via a string[] `open` command were
always killed on buffer deletion with no way to opt out. Configuring
the plugin also required an explicit `setup()` call in a `config`
hook, preventing config from being declared before the plugin loads.

Solution: add a `detach` boolean to `ProviderConfig` that skips
SIGTERM on buffer unload. Auto-call `setup()` from `vim.g.preview`
at module load time, enabling config via lazy.nvim's `init` hook.
Update vimdoc and README accordingly.
2026-03-04 19:30:56 -05:00
Barrett Ruth
bb9ca987e1
Add note about previewer auto-close feature
Some checks are pending
luarocks / quality (push) Waiting to run
luarocks / publish (push) Blocked by required conditions
2026-03-04 19:12:33 -05:00
8107f8c0ac
doc: improve error phrasing, remove redundant feautre
Some checks are pending
quality / changes (push) Waiting to run
quality / Lua Format Check (push) Blocked by required conditions
quality / Lua Lint Check (push) Blocked by required conditions
quality / Lua Type Check (push) Blocked by required conditions
quality / Markdown Format Check (push) Blocked by required conditions
test / Test (Neovim nightly) (push) Waiting to run
test / Test (Neovim stable) (push) Waiting to run
2026-03-04 17:28:07 -05:00
Barrett Ruth
cf8fd02e6d
Add video demonstration to README
Some checks are pending
luarocks / quality (push) Waiting to run
luarocks / publish (push) Blocked by required conditions
Added a video demonstration to the README.
2026-03-04 17:23:57 -05:00
Barrett Ruth
3e6ba580e4
fix: quickfix support for long-running providers (#41)
* fix(compiler): open quickfix in background, retain focus on source buffer

* fix(compiler): use cwindow and win_gotoid for quickfix focus management

* fix: unused var warning and update typst reload test for short format

* fix: remove testing files
2026-03-04 17:23:06 -05:00
df0765a27f
doc: cleanup 2026-03-04 15:11:44 -05:00
934ef03728
doc: cleanup readme 2026-03-04 15:10:40 -05:00
e8f93fb47e
doc: readme typo 2026-03-04 15:09:45 -05:00
Barrett Ruth
7a11f39341
docs: pre-release polish (#36)
* docs: pre-release polish

Update README preset list to include pdflatex, tectonic, asciidoctor,
and quarto. Fix custom provider FAQ example to use a non-preset key.
Clarify open field fires on toggle/watch mode only, not :Preview compile.
Expand intro to mention AsciiDoc and Quarto alongside existing tools.

* docs: update slogan to universal document previewer

* ci: format
2026-03-04 15:09:07 -05:00
87fc00059c
doc: cleanup readme 2026-03-03 13:44:43 -05:00
Barrett Ruth
0b16ff7178
Refactor/preset name true syntax (#4)
* refactor(config): replace array preset syntax with preset_name = true

Problem: setup() mixed array entries (preset names) and hash entries
(custom providers keyed by filetype), requiring verbose
vim.tbl_deep_extend boilerplate to override presets.

Solution: unify under a single key=value model. Keys are preset names
or filetypes; true registers the preset as-is, a table deep-merges
with the matching preset (or registers a custom provider if no preset
matches), and false is a no-op. Array entries are dropped. Also adds
-f gfm to presets.github args so pandoc parses input as GFM.

* ci: format

* fix(presets): parenthesize gsub output to suppress redundant-return-value

* ci: remove superfluous things

* refactor: remove PreviewWatch* events and clean up docs

Problem: PreviewWatchStarted/PreviewWatchStopped were redundant with
the status() API, and the doc had a wrong author, stale INSTALLATION
format, and "watch mode" language left over from the watch → toggle
rename.

Solution: Remove the events and their tests. Fix the doc author,
rename INSTALLATION → SETUP to match sibling plugins, replace "watch
mode" with "auto-compile" throughout, and drop the events from EVENTS.
2026-03-03 00:49:10 -05:00
Barrett Ruth
2d212aa220
refactor(config): replace array preset syntax with preset_name = true (#3)
* refactor(config): replace array preset syntax with preset_name = true

Problem: setup() mixed array entries (preset names) and hash entries
(custom providers keyed by filetype), requiring verbose
vim.tbl_deep_extend boilerplate to override presets.

Solution: unify under a single key=value model. Keys are preset names
or filetypes; true registers the preset as-is, a table deep-merges
with the matching preset (or registers a custom provider if no preset
matches), and false is a no-op. Array entries are dropped. Also adds
-f gfm to presets.github args so pandoc parses input as GFM.

* ci: format

* fix(presets): parenthesize gsub output to suppress redundant-return-value
2026-03-03 00:25:49 -05:00
673573044f
feat: rename watch → toggle, auto-compile on start, built-in opener
Problem: :Preview watch only registered a BufWritePost autocmd without
compiling immediately, required boilerplate to open output files after
first compilation, and was misleadingly named.

Solution: Rename watch → toggle throughout. M.toggle now compiles
immediately on activation. Add an open field to ProviderConfig: true
calls vim.ui.open(), a string[] runs the command with the output path
appended, tracked per-buffer so the file opens only once. All presets
default to { 'xdg-open' }. Health check validates opener binaries.
Guard the async compile callback against invalid buffer ids.
2026-03-02 23:37:44 -05:00
c62c930454
ci: format 2026-03-02 21:30:11 -05:00
942438f817
feat: rename 2026-03-02 21:23:40 -05:00
b905ed04ed
ci: format 2026-03-01 17:25:34 -05:00
e49a664d48
ci: format 2026-03-01 17:22:59 -05:00