Skip to content

v0.12.0

Choose a tag to compare

@unixsuperhero unixsuperhero released this 27 Oct 03:10
· 387 commits to main since this release

Tables are cell-based: a current column, per-column widths, and V for rows.

Tables are cell-based, like o-csv's grid: a current column, column widths, and a visual row selection.

Tables

  • A list with columns has a current column (List.Column, SetColumn; column in its state). On the list noun in normal mode, on a cell-mode table only: h/l/left/right move by column (counts), 0/^/home and $/end go to the first and last, N| to column N, g c chooses one from a chooser of the titles (list.column, list.choose-column, motions); j/k keep the column. Every frame scrolls the column offset as little as shows the current column; z l/z h carry it along. $, ^ and 0 no longer run list.scroll-columns; list.column scrolls a row-select table the same way. Stories tables/cell-motion, tables/column-count.
  • The current cell is drawn reverse and underlined inside the row's highlight, the header underlines the current column's title, and an unfocused table fades both. Story tables/unfocused-cell-dimmed.
  • y and Y copy the current cell, or the row's cells joined by tabs, into the registers (list.yank {what, register}).
  • z >/z < widen or narrow the current column by ColumnWidthStep (2) cells, never below 3; z = makes every column automatic (list.resize-column, list.reset-columns; List.SetColumnWidth, ColumnWidths, ResetColumnWidths). The widths and the current column are remembered per table id in the state directory's tables.json (Runtime.TableState, SetTableState). Story tables/column-resize.
  • V starts a visual row selection drawn into the marks: j/k extend it (they clamp), a row's application verb runs for every selected row through list.apply, esc or V ends it and the marks go back (list.visual, List.Visual, StartVisual, EndVisual). Story tables/visual-apply.
  • list.apply takes args for every row's request, and a verb with a confirm asks once for all the rows.
  • RowSelect() keeps a table on row selection: trees' lists (h/l expand and collapse), the ? help modal and the Settings page use it.
  • y, Y, V and the width keys are hidden from the footer; ? help lists them.
  • cli: the groups rail's h/left back rows take the new guard list-first-column, so in a table h moves left and goes back to the rail from the first column. Story catalog/groups-table-h.

grid

  • Per-column widths: z >/z </z = on the grid noun (grid.resize-column, grid.reset-columns; Grid.SetColumnWidth, ColumnWidth, ColumnWidths, ResetColumnWidths). A given width replaces MaxCellWidth for its column and is remembered under the grid's id.

o-story

  • Goldens read C| (c| dimmed) for a highlighted row that holds a table's current cell; the expect field cell names the current cell's text.