Skip to content

v2.1

By Saul Pwanson

v2.1 (2020-12-06)

This release fixes several bugs in 2.0 and fills in some of the gaps. Please see the CHANGELOG for the complete list of changes and bugfixes.

  1. options.some_selected_rows

Some commands, like setcol-expr (g=) operate on the selected rows. Before 2.0, if no rows were selected, these commands would fall back to operating over all rows. This is intuitive and helpful, but can cause problems with non-interactive script replay: sometimes there are legitimately no selected rows, and so the command should not do anything (but also not fail). So the behavior was changed in 2.0 to have reliable and deterministic results. It's reasonably easy to work around: select all rows with gs, repeat the command, and maybe unselect them all with gu. But this turned out to be ultimately disappointing for interactive use.

So, in 2.1, there is now an option some_selected_rows, which if True, causes these commands to operate on all rows, if none are selected:

`setcol-expr` (`g=`)
`setcol-iter` (`gz=`)
`setcol-subst` (`g*`)
`setcol-subst-all` (`gz*`)

This option applies only to interactive mode, and not to batch mode. In batch mode, commands that operate on selected rows will always use the list of selected rows, even if there are none (and so it won't do anything). Be careful about saving .vd scripts from sessions in which this option was set; the results when replaying in batch mode may not be as expected.

  1. options.numeric_binning

For 2.0, ranged binning of numeric columns was implemented, and allowed to be disabled by setting options.numeric_binning to False. (By default it was set to True.)

In 2.1, this option is now disabled by default, and must be enabled (whether globally or per-sheet) by setting it to True.

  1. [input] Shift+Arrow within edit-cell to move cursor and re-enter edit mode

By popular demand, pressing Shift+Arrow when editing a cell, will save the current value, move the cursor one row or column in the given direction, and re-enter edit mode. This makes it easier to enter data, either row-wise or column-wise.

This feature obsoletes options.cmd_after_edit, which was always a terrible hack. It has no effect now.

  1. Expression can access column attributes

In 2.0, expressions could use attributes on the vd singleton or the current sheet object, and had sheet and row special variables to refer to the sheet and row objects themselves.

In 2.1, expressions can also use attributes of the expression column, and col can be used to refer to the column object directly. (So col.width and width both refer to the width of the expression column itself, if there are no columns named width.)

  1. Differentiate select-equal- and select-exact-.

Previously, select-equal- (bound to ,) matched on the typed value. Now, select-equal- matches on the displayed value. New commands select-exact-cell/-row that match on typed value are bound to z, and gz, (the display value may be rounded or formatted with less precision, so using the typed value is "more precise".

(Thanks @geekscrapy for noticing)

  1. New macro system

A new command macro-record (bound to m) starts recording commands for use in a macro. The same command stops recording and prompts for a keystroke to bind the macro to. When the given keystroke is pressed, the macro will be executed. All macros run their commands on the current (row, column, sheet), regardless of the cursor position when the macro was recorded.

The new command macro-sheet (bound to gm) opens an index of all current macros. A macro on this sheet can be viewed with Enter and then modified, saving changes with Ctrl+S

This feature obsoletes the older iteration of macro system, and removes the deprecated z Ctrl+D command.

(Thanks @bob-u for the suggestion)

  1. Other Additions and Improvements
  • Add mode and stdev aggregators.
  • Add sort-order indicator in column header.
  • Unset options with d on options sheet (also add options.unset() API function).
  • .vdj scripts are now hashbangable. Put #!vd -p at the start of the .vdj file and watch it go! (Note: extension must still be .vdj for now.)
  • The floatsi type (z%) can now parse SI strings like "2.3M" (thanks @anjakefala for sponsoring).
  • Regex capture (;) will use capture names as column names, if available (thanks @tsibley).
  1. Format-specific improvements
  • [http] auto-paginate by continuing with the given links.next.url from the response.

  • [json] 50% speedup for loading (thanks @lxcode).

  • [pdf] options.pdf_tables to parse tables from pdf with tabular.

  • [sqlite] Use internal rowid to update and delete rows (WITHOUT ROWID sqlite tables can no longer be modified).

  • [zip] Add extract-file, extract-selected, extract-file-to, extract-selected-to commands (bound to x, gx, zx, and gzx on the ZipSheet).

  • [fixed] Add fixed-width saver (uses col.width).

  • [clickhouse] Add plugin for clickhouse loader.

Sponsored in part by