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.
Some commands, like
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:
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.
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.
- 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.
- Expression can access column attributes
In 2.0, expressions could use attributes on the
vd singleton or the current
sheet object, and had
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
width both refer to the width of the expression column itself, if there are no columns named
select-equal- (bound to
,) matched on the typed value. Now,
select-equal- matches on the displayed value. New commands
-row that match on typed value are bound to
gz, (the display value may be rounded or formatted with less precision, so using the typed value is "more precise".
(Thanks @geekscrapy for noticing)
- 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
This feature obsoletes the older iteration of macro system, and removes the deprecated
z Ctrl+D command.
(Thanks @bob-u for the suggestion)
- Other Additions and Improvements
- 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.)
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).
- Format-specific improvements
[http] auto-paginate by continuing with the given
links.next.url from the response.
[json] 50% speedup for loading (thanks @lxcode).
options.pdf_tables to parse tables from pdf with
[sqlite] Use internal rowid to update and delete rows (
WITHOUT ROWID sqlite tables can no longer be modified).
extract-selected-to commands (bound to
gzx on the ZipSheet).
[fixed] Add fixed-width saver (uses col.width).
[clickhouse] Add plugin for clickhouse loader.