Permalink
Browse files

[vdtui] Change '~' back to str, add 'z~' for anytype

- testdiff.sh only diffs changed output file
- updated vd.1
  • Loading branch information...
saulpw committed Nov 27, 2017
1 parent ce7f08d commit 83faa256e14c517c72cf2e8b017bb2e3b329be6d
Showing with 26 additions and 15 deletions.
  1. +3 −5 testdiff.sh
  2. +11 −5 visidata/man/vd.1
  3. +6 −2 visidata/man/vd.inc
  4. +4 −2 visidata/metasheets.py
  5. +2 −1 visidata/vdtui.py
View
@@ -1,10 +1,8 @@
#!/bin/bash
for fn in tests/*.vd ; do
if [ "${fn%-notest.vd}-notest" != "${fn%.vd}" ]
for fn in `git diff --name-only -- *.tsv` ; do
if [ "${fn%-notest.tsv}-notest" != "${fn%.tsv}" ]
then
fna=${fn##tests/}
tsvfn=tests/golden/${fna%.vd}.tsv
git show HEAD^:$tsvfn | bin/vd --diff $tsvfn
git show HEAD^:$fn | bin/vd --diff $fn
fi
done
View
@@ -59,7 +59,7 @@ replays in batch mode (with no interface)
.Bl -tag -width XXXXXXXXXXXXXXXXXXX -compact -offset XXX
.It Sy ^U
pauses/resumes replay
.It Sy Space
.It Sy Tab
executes next row in replaying sheet
.It Sy ^K
cancels current replay
@@ -154,7 +154,7 @@ pins current column on the left as a key column
.It Ic ^
edits name of current column
.It Ic "~ # % $ @"
sets type of current column to str/int/float/currency/date
sets type of current column to untyped/int/float/currency/date
.Pp
.It Ic " =" Ar expr
.No creates new column from Python Ar expr Ns , with column names as variables
@@ -421,9 +421,13 @@ adjusts widths of selected columns on source sheet
.It Ic "g-" No (hyphen)
hides selected columns on source sheet
.It Ic " ~ # % $ @"
sets type of current column to str/int/float/currency/date
sets type of current column on source sheet to str/int/float/currency/date
.It Ic "g~ g# g% g$ g@"
sets type of selected columns to str/int/float/currency/date
sets type of selected columns on source sheet to str/int/float/currency/date
.It Ic "z~"
sets type of current column on source sheet to anytype
.It Ic "gz~"
sets type of selected columns on source sheet to anytype
.It Ic " Enter"
.No opens a Sy Frequency Table No sheet grouped on column referenced in current row
.El
@@ -746,7 +750,9 @@ These are the supported sources:
.Bl -inset -compact -offset xxx
.It Sy csv No (comma-separated value)
.Bl -inset -compact -offset xxx
.It .csv files are a scourge upon the earth, and still regrettably common. See the Sy --csv-dialect Ns , Sy --csv-delimiter Ns , Sy --csv-quotechar Ns , and Sy --csv-skipinitialspace No options. Accepted dialects are Ic excel-tab Ns , Ic unix Ns , and Ic excel Ns .
.It .csv files are a scourge upon the earth, and still regrettably common.
.It See the Sy --csv-dialect Ns , Sy --csv-delimiter Ns , Sy --csv-quotechar Ns , and Sy --csv-skipinitialspace No options.
.It Accepted dialects are Ic excel-tab Ns , Ic unix Ns , and Ic excel Ns .
.El
.El
.Pp
View
@@ -421,9 +421,13 @@ adjusts widths of selected columns on source sheet
.It Ic "g-" No (hyphen)
hides selected columns on source sheet
.It Ic " ~ # % $ @"
sets type of current column to untyped/int/float/currency/date
sets type of current column on source sheet to str/int/float/currency/date
.It Ic "g~ g# g% g$ g@"
sets type of selected columns to untyped/int/float/currency/date
sets type of selected columns on source sheet to str/int/float/currency/date
.It Ic "z~"
sets type of current column on source sheet to anytype
.It Ic "gz~"
sets type of selected columns on source sheet to anytype
.It Ic " Enter"
.No opens a Sy Frequency Table No sheet grouped on column referenced in current row
.El
View
@@ -31,7 +31,8 @@ def createJoinedSheet(sheets, jointype=''):
Command('#', 'cursorRow.type = int', 'set type of source column to int'),
Command('@', 'cursorRow.type = date', 'set type of source column to date'),
Command('$', 'cursorRow.type = currency', 'set type of source column to currency'),
Command('~', 'cursorRow.type = anytype', 'unset type of current column'),
Command('~', 'cursorRow.type = str', 'set type of current column to str'),
Command('z~', 'cursorRow.type = anytype', 'set type of current column to anytype'),
Command('g!', 'for c in selectedRows or [cursorRow]: source.toggleKeyColumn(source.columns.index(c))', 'toggle selected columns as keys on source sheet'),
Command('g-', 'for c in selectedRows or source.nonKeyVisibleCols: c.width = 0', 'hide selected source columns on source sheet'),
@@ -40,7 +41,8 @@ def createJoinedSheet(sheets, jointype=''):
Command('g#', 'for c in selectedRows or source.nonKeyVisibleCols: c.type = int', 'set type of selected source columns to int'),
Command('g@', 'for c in selectedRows or source.nonKeyVisibleCols: c.type = date', 'set type of selected source columns to date'),
Command('g$', 'for c in selectedRows or source.nonKeyVisibleCols: c.type = currency', 'set type of selected columns to currency'),
Command('g~', 'for c in selectedRows or source.nonKeyVisibleCols: c.type = anytype', 'unset type of selected columns'),
Command('g~', 'for c in selectedRows or source.nonKeyVisibleCols: c.type = str', 'set type of selected columns to str'),
Command('gz~', 'for c in selectedRows or source.nonKeyVisibleCols: c.type = anytype', 'set type of selected columns to anytype'),
]
ColumnsSheet.commands += columnCommands + [
View
@@ -216,7 +216,8 @@ def __setitem__(self, k, v): # options[k] = v
globalCommand('-', 'cursorCol.width = 0', 'hide current column', 'width-curcol-zero')
globalCommand('z-', 'cursorCol.width = cursorCol.width//2', 'reduce column width by half', 'width-curcol-half')
globalCommand('!', 'toggleKeyColumn(cursorColIndex); cursorRight(+1)', 'pin current column on the left as a key column', 'toggle-curcol-key')
globalCommand('~', 'cursorCol.type = anytype', 'unset type of current column', 'type-curcol-any')
globalCommand('z~', 'cursorCol.type = anytype', 'set type of current column to anytype', 'type-curcol-any')
globalCommand('~', 'cursorCol.type = str', 'set type of current column to str', 'type-curcol-str')
globalCommand('@', 'cursorCol.type = date', 'set type of current column to date', 'type-curcol-date')
globalCommand('#', 'cursorCol.type = int', 'set type of current column to int', 'type-curcol-int')
globalCommand('$', 'cursorCol.type = currency', 'set type of current column to currency', 'type-curcol-currency')

0 comments on commit 83faa25

Please sign in to comment.