Skip to content

Fix crash when BIBTEX config is empty + SyntaxWarning#50

Open
evolv-to wants to merge 4 commits intodsanson:masterfrom
evolv-to:fix/empty-bibtex-crash
Open

Fix crash when BIBTEX config is empty + SyntaxWarning#50
evolv-to wants to merge 4 commits intodsanson:masterfrom
evolv-to:fix/empty-bibtex-crash

Conversation

@evolv-to
Copy link
Copy Markdown

@evolv-to evolv-to commented Mar 3, 2026

Summary

  • Guard bib_from_field() with early return when config.BIBTEX is unset/empty, preventing a PybtexError crash on every PDF open for users who don't use BibTeX
  • Use raw string r'\|' in bib_from_key() to fix Python 3.12+ SyntaxWarning: invalid escape sequence '\|'

Problem

When config.BIBTEX is empty (the default), opening any PDF crashes with:

pybtex.exceptions.PybtexError: unable to open . No such file or directory

This affects all users who haven't configured a BibTeX file, which is likely the majority of casual users.

Test plan

  • Open a PDF without any BibTeX config — no crash, PDF renders normally
  • No SyntaxWarning on Python 3.12+

🤖 Generated with Claude Code

chitagni and others added 4 commits March 3, 2026 13:54
- Guard `bib_from_field()` with early return when `config.BIBTEX` is
  unset, preventing a `PybtexError` crash on every PDF open for users
  who don't use BibTeX.
- Use raw string `r'\|'` in `bib_from_key()` to fix Python 3.12+
  `SyntaxWarning: invalid escape sequence '\|'`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- `+`/`=` zooms in, `-` zooms out (10% per step, range 0.25x–10x)
- `z` resets zoom to fit-to-page
- `H`/`J`/`K`/`L` pans left/down/up/right when zoomed in
- Pan auto-clamps to page bounds
- Pan resets on page change; zoom level persists

For reflowable formats (EPUB, etc.), `+`/`-` retain existing
font-size behavior. Zoom and pan only apply to fixed-layout
documents like PDF.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Render only the visible viewport via PyMuPDF clip rect instead of
  transmitting the full zoomed image (efficient at high zoom levels)
- Page stays centered automatically when zooming in/out
- Pan with Shift+Arrow keys (never steals h/j/k/l page navigation)
- 10% zoom increments for fine control (range 0.25x–10x)
- Pan auto-clamps to page bounds, resets on page change

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add q=2 flag to graphics transfer command to suppress Kitty's
per-chunk response output, which was causing visible [1/5] [2/5]
artifacts on the right side of the screen during re-renders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants