Skip to content

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 05 Nov 12:00
· 61 commits to main since this release

.gtui format 10 (reads v1..v10). Crate 0.11.0.

Changed

  • SVG export draws border glyphs as vector <path> segments and centres every character in its
    cell, on a 9x18 px cell with a 15 px font. Before, the font's advance (8.42 px at 14 px) did not
    match the 8 px cell, so glyphs drifted about 0.4 px per column and box corners broke up.
  • The jump list is global instead of per document: entries remember the tab as well as the cell, so
    Ctrl-o after gf (or any tab switch) goes back to the previous buffer and position, and
    Ctrl-i (Tab) walks forward again. Closing a tab drops its entries and shifts the rest.

Added

  • w / b (jump_next / jump_prev) cast a ray from the cursor along the picture's main axis
    (right when the drawing is wider than it is tall, down when it is taller) and move the cursor to
    the first box or edge the ray reaches — a connector between two boxes counts as a stop. The
    ray stops at the viewport edge, and a direction with nothing in it only prints a message.
    toggle_labels moved from b to B to free the vim keys.
  • i edits the cursor box's text in the box: no prompt line, the frame grows as you type,
    Enter inserts a newline, Esc commits (one undo step) and Ctrl-C drops the draft. The caret
    starts on the character the cursor is on (the end when it is outside the text) and is the only
    cursor on screen — the terminal cursor is moved onto the draft, nothing is painted twice.
    Left/Right/Home/End move by character and line, Alt + arrow by word, Up/Down keep the
    column. On an empty cell i creates the box first and starts editing it (an untouched new box is
    dropped again on Esc). t still edits through the prompt (multi-selection and <|new box|>
    splitting), and a point node keeps the prompt because a one-cell name has no room for a draft.
  • Ctrl+G (edit_text_external) edits the cursor box's text in $VISUAL / $EDITOR and writes
    the result straight into the box when the editor exits, as one undo step; <|new box|> splitting
    applies. The prompt's Ctrl+G also applies its result immediately now instead of leaving the
    text in the prompt for a second Enter.
  • Custom URI schemes are configurable: any scheme://… link is looked up in a new [links]
    section (custom = my-reader) and the raw target is appended as one argument, run blocking
    with the terminal suspended. An unconfigured scheme only says no handler for scheme …. The
    core carries no vendor-specific scheme any more (there is a source audit test for it), and
    --print-config shows an empty [links] example.
  • Link targets are parsed into a handler chain (self -> URL -> custom scheme -> local -> unknown) and
    can end in a position: [x](./src/app.rs:10,4) opens $VISUAL / $EDITOR at line 10,
    column 4 (nvim/vim get +call cursor(10,4), other editors get +10 and a note that the column
    was dropped), [x](self:10,4) jumps the current document's cursor to cell 10,4 and
    [x](./other.gtui:10,4) switches to that tab (opening one if needed) and jumps. URLs never take
    a position, .dot ignores it, custom schemes have no handler by default, and
    every jump is recorded so Ctrl-o goes back across tabs. The terminal suspend/resume for a
    positioned edit is the Ctrl+G path; a true / false / : $EDITOR stub now counts as
    unset.
  • Each edge can pick its own arrowhead glyphs: head is auto|ascii|arrows|triangles in the
    .gtui file (format v10), settable from the right-click menu's arrowhead submenu or
    :head triangles, one undo step, previewed live like every other menu item. auto keeps
    following the global --arrow / [prefs] arrow, a new edge inherits the last chosen one, and
    files from v9 and older load with auto.
  • A link keeps its link inside italics (*[label](target)*); bold already did.
  • Text can carry links: [label](target) renders as the underlined label, the target takes no
    width, and Enter or gf on it opens the target. http(s):// and mailto: go to the opener,
    file:// / ~/ / ./ / ../ / / are resolved to a local path (relative ones against the
    document directory), and a local .gtui / .dot opens as a tab instead of starting another
    graph-tui. The opener is [prefs] opener, then $OPENER, then opener / xdg-open; when it is
    the opener helper it is asked with --which and the edit answer runs with the terminal
    suspended, so nvim can take over. Enter is now open_link (confirm_selection keeps no
    default key and can be rebound).