Skip to content

feat: add setup opts, callbacks, persistent bookmarks, text search and menu UI - #6

Open
MadKuntilanak wants to merge 26 commits into
basola21:mainfrom
MadKuntilanak:feature/update_pdfview
Open

MadKuntilanak wants to merge 26 commits into
basola21:mainfrom
MadKuntilanak:feature/update_pdfview

Conversation

@MadKuntilanak

@MadKuntilanak MadKuntilanak commented Jul 9, 2026 •

Copy link
Copy Markdown

Fixes: #5

PDFview hasn't been updated in a while, so this PR brings it more in line with common Neovim plugin configuration conventions and adds several new features.

  • ✅ Allow users to configure the plugin via setup(opts)
  • ✅ Add callback support when opening PDFs (open.cb)
  • ✅ Add a go_to command for jumping to a specific page
  • ✅ Add a show_page_in_zathura command
  • ✅ Support multiple picker backends: fzf-lua, telescope.nvim, and the default vim.ui.select (Telescope support still needs attention; see notes below)
  • ✅ Add persistent bookmarks (saved across sessions)
  • ✅ Add a menu UI for PDFview
  • ✅ Fix the demo (the previous image was broken)

### Notes for the maintainer

* Bookmark support for the telescope.nvim picker is not implemented yet. I'm not familiar enough with the Telescope picker API, as I primarily use fzf-lua.

MadKuntilanak and others added 6 commits July 9, 2026 12:57
- Update README with new configuration options
- Clarify `next_page`/`prev_page` keymaps are already set via opts.keymaps
- Add Zathura installation instructions
- Add example for `open.cb` callback (e.g. integrating with codecompanion.nvim)
- Add example for statusline integration (e.g. heirline.nvim)
- Remove `lines_per_page`
@MadKuntilanak
MadKuntilanak force-pushed the feature/update_pdfview branch from 77e7455 to 66da9d4 Compare July 10, 2026 05:53
@MadKuntilanak

MadKuntilanak commented Jul 13, 2026 •

Copy link
Copy Markdown
Author
  • ✅ Implement text search
  • ✅ Add picker snacks.nvim
  • ✅ Add text search status indicator (press Esc or q to close)
  • ✅ Add a jumplist page
  • ✅ Ensure feature stability, handle invalid pages/page ranges and improve cache handling

@MadKuntilanak MadKuntilanak changed the title feat: add setup opts, callbacks, persistent bookmarks, and menu UI feat: add setup opts, callbacks, persistent bookmarks, text search and menu UI Jul 13, 2026
@MadKuntilanak
MadKuntilanak marked this pull request as draft July 13, 2026 22:29
@MadKuntilanak
MadKuntilanak force-pushed the feature/update_pdfview branch from ea910a0 to 94c6494 Compare July 14, 2026 21:01
…tructure

Bookmark storage is restructured from a flat list into a table with two
fields: `items` (list of PDFviewBookmarkSavedData) and `__o` (per-pdf
cached pages + mtime keyed by pdf_path). This allows pages to be reused
across sessions without re-extracting text on every open.

Renderer gains `state.o`,a per-pdf cache table populated by
`update_state_o()` after every `display_text()` call. On subsequent
opens, cached pages are passed directly to `display_text()` and mtime
is checked against the current file; a mismatch triggers re-extraction.
`get_mtime()` is added to utils for this purpose.
@MadKuntilanak
MadKuntilanak force-pushed the feature/update_pdfview branch from 01ac1a3 to 602722c Compare July 27, 2026 00:47
go_to() now records jumps by default (skip_record now correctly
used only for jumplist replay), fixing the previous behavior where
go_to_page jumps were never recorded.

add M.jumplist(step) for <C-i>/<C-o> navigation and M.select_jumplist()
to pick a jump target directly via picker, keeping hist.pointer in
sync with the selection
@MadKuntilanak
MadKuntilanak marked this pull request as ready for review August 8, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is this repository still actively maintained?

1 participant