github dheerajshenoy/lektra v0.8.1

47 minutes ago

Breaking Changes

  • Hover preview options moved into their own table: links.hover_preview is now links.hover_preview.enabled, and hover_preview_delay, hover_preview_width and hover_preview_height are now delay, width and height inside it (Lua: lektra.opt.links.hover_preview.enabled, ...). The old names are ignored.
  • More options moved into sub-tables, with enabled for the on/off switch (the old names are ignored; in Lua it is the same path, e.g. lektra.opt.split.focus_border.width):
    • split.dim_inactive, split.focus_border and split.maximize_indicator (was dim_inactive, dim_inactive_opacity, focus_border_color, ...)
    • annotations.<type>.glow (was hover_glow, glow_width, glow_color) and annotations.<type>.comment (was comment, comment_marker, comment_font_size; now tooltip, marker, font_size)
    • behavior.high_contrast, laser_pointer.trail and rendering.antialiasing (was high_contrast_black_point, trail_fade_ms, antialiasing_bits, ...)
    • highlight_matches of picker, outline, command_palette and highlight_search (was highlight_matches and highlight_matches_color)
  • The statusbar's filename module now shows only the file name, not the whole path. Set statusbar.components.filename.full_path = true to get the path back.
  • Lua: event callbacks now receive one table, event, instead of separate arguments: use event.view (was the view argument), event.index, event.name, event.bookmark, event.screen, event.link, and so on.

New Features

  • --sync-views syncs zoom and scroll of the opened splits, e.g. lektra --vsplit --sync-views a.pdf a.pdf. --command now also runs with --vsplit and --hsplit (it was skipped before).
  • annotations.glow (enabled, color, width) sets the hover glow of every annotation type at once; annotations.<type>.glow still overrides it for one type.
  • llm_view.max_history_messages sends only the last N of your messages (with the replies after them) to the model; the chat itself stays complete.
  • Markdown files show the images next to them (![](pic.png)).
  • picker.style = "emacs" shows pickers as a full-width strip along the bottom of the window, like the Emacs minibuffer, picker.max_lines rows high. The default, "floating", is the card in the middle. picker.scrolloff keeps some rows between the selection and the edge of the list.
  • links.hover_preview.page_number = false hides the page number under the link hover preview, and its frame is tighter around the picture.
  • The link hover preview now shows just the entry or paragraph the link points at (a reference, say), not the text around it; links.hover_preview.height is the most it shows and links.hover_preview.context (default 12 points) keeps a little above and below, and a short entry is centred in at least 40% of the height.
  • show_header = false hides the column headers of pickers. Set it in picker for all of them, or in outline, highlight_search or command_palette for just that one.
  • count_format shows how many rows match next to the picker's search box: the first %s is the number of matches, the second the total, so "%s/%s" shows 12/340. Same places as show_header; empty (the default) shows nothing.
  • caret.shape sets the caret in caret mode: a block over the character ("block", the default) or a thin line before it ("beam").
  • grep command: lists the lines of the document that match a regular expression (smart-case) and jumps to the one you pick. grep PATTERN starts with the pattern typed.
  • The default layout.spacing (gap between pages) is now 12 pixels instead of 10, to leave room for the page shadow.
  • Pages have a soft shadow. Tune or turn it off with rendering.page_shadow (enabled, radius, offset_y, color).
  • Lua: view:search_hits() now returns the location of each search hit (it returned nothing before).
  • rendering.antialiasing.bits now takes effect: it sets how smooth MuPDF draws pages (0 turns antialiasing off).
  • The message bar is tinted by level: blue for info, amber for warnings, red for errors. lektra.ui.message takes an optional level.
  • Updated bundled MuPDF to 1.28.6.
  • --no-config starts lektra with the default configuration, ignoring config.toml and init.lua.
  • Link hints can use letters: set link_hints.charset (e.g. "asdfghjkl").
  • Lua: view:link_hints("pick", callback) gives the chosen link to a script, and view:follow_link() accepts it.
  • Lua: OnLinkClicked gives the followed link as event.link.
  • Lua: view:preview(target), view:open_portal(target) and view:close_portal().
  • New options behavior.text_cache_size and behavior.stext_page_cache_size set how many pages of text are kept in memory for search and text selection.
  • Printing: the new print command (Ctrl+P, File ▸ Print…) prints the document, or a range of its pages, to a printer or a PDF file. Lua: view:print(opts, callback). Not available for DjVu yet.
  • config.toml and Lua now accept the same options. New in config.toml: prompt for every picker, outline.generate_heading_ratio, outline.generate_max_levels and behavior.open_last_visited. New in Lua: width, height, border, alternating_row_color and shadow of outline, highlight_search and command_palette.
  • Unknown keys in config.toml are now reported, as are enum values that are not one of the choices (they used to fall back to the default silently).
  • Lua: writing an option a value of the wrong type, or an option that does not exist, now shows a warning and leaves the option unchanged (it used to be turned into false or 0). Enum options such as layout.mode also accept their name, e.g. "book".
  • New messages command opens a Messages tab listing every message shown so far, including config.toml problems and Lua errors, so you can read them after they disappear. behavior.message_log_size (default 1000) sets how many are kept. Lua: lektra.ui.messages().
  • The link hover preview now marks what the link points at: it shades the paragraph or reference entry there and dims the rest, and shows the full width of the column the target is in (lines used to be cut off on the right). links.hover_preview.highlight picks block (default), line, marker (a square like the jump marker) or none; the color is jump_marker.color.

Bug Fixes

  • Fix a page sitting off-centre after zooming far out with the mouse wheel in the vertical layouts, which also made synced views drift apart.
  • Fix the colors of split.focus_border, split.maximize_indicator and portal.border_color being read in the wrong order: they now take #RRGGBB or #RRGGBBAA like every other color. The default portal border is now the translucent white it was meant to be.
  • Fix a zoomed-in page staying blank after panning sideways in the vertical layouts (or up/down in the horizontal one).
  • A zoomed-in page now shows a blurry preview of the part that is still rendering instead of a blank area.
  • Pressing Enter on a directory in the file picker now opens it instead of closing the picker.
  • Fix a long delay before the first window when a recent file is on an unreachable network mount.
  • Dropping several files onto the window now respects tabs.lazy_load instead of opening them all.
  • Fix a possible crash when a document is closed while it is still opening (slow EPUBs in particular).
  • Fix the minimap becoming wider and fatter right after changing page.
  • Fix a crash with a document that has no pages, such as a PDF that is still being written. It is no longer opened, and a reload keeps the current document.
  • Closing the last tab no longer leaves "Start Page" or "Messages" in the statusbar.
  • Fix lektra freezing when selecting text in highlight mode on an EPUB. Text markup is only available for PDFs.
  • The bookmark_remove command now lists your bookmarks and deletes the one you pick (it did nothing before).
  • Fix the Nix flake failing with "MuPDF source not found". Use git+https://github.com/dheerajshenoy/lektra?submodules=1 as the flake URL.
  • preview.size_ratio now accepts fractions such as 0.6 (only whole numbers were read).
  • Fix lektra.opt.picker.keys.<action> = ... writing to the wrong memory while a document was open.

Don't miss a new lektra release

NewReleases is sending notifications on new releases.