Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Oct 31, 2018
2 parents 70f9f1b + 2ffee7d commit 859b8ff
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# VisiData version history

# v1.4.1 (2018-10-29)

## Bugfixes
- [clipboard] fix broken `gzY` (syscopy-cells)
- [cmdlog] always encode .vd files in utf-8, regardless of options.encoding
- [tsv] major `save_tsv` performance improvement
- [tsv] make short rows missing entries editable
- [shp] reset columns on reload
- [graph] shift rightmost x-axis label to be visible
- [http] allow CLI urls to have `=` in them
- [fixed width] truncate cell edits on fixed width sheets
- [aggregators] ignore unknown aggregators
- `visidata.view(obj)`: obj no longer required to have a `__name__`

## Additions and changes
- [save tsv json] errors are saved as `options.safe_error` (default `#ERR`)
- if empty, error message is saved instead
- [plugins] `~/.visidata` added to sys.path on startup
- put plugin in `~/.visidata/vdfoo.py`
- put `import vdfoo` in `.visidatarc` to activate
- [aggregators] show-aggregate (`z+`) now aggregates selectedRows
- [tsv] add unnamed columns if extra cells in rows
- [diff] now based on display value (more intuitive)
- [mouse] move to column also
- [cosmetic] addcol-new (`za`) input new column name on top of new column
- [cosmetic] include file iteration in progress meter


# v1.4 (2018-09-23)

## Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion visidata/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class Canvas(Plotter):
rowtype = 'plots'
aspectRatio = 0.0
leftMarginPixels = 10*2
rightMarginPixels = 6*2
rightMarginPixels = 4*2
topMarginPixels = 0
bottomMarginPixels = 1*4 # reserve bottom line for x axis

Expand Down
3 changes: 2 additions & 1 deletion visidata/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def add_x_axis_label(self, frac):
attr = colors.color_graph_axis
xmin = self.plotviewBox.xmin + frac*self.plotviewBox.w
if frac == 1.0:
xmin -= min(len(txt), self.rightMarginPixels/2)
# shift rightmost label to be readable
xmin -= max(len(txt)*2 - self.rightMarginPixels+1, 0)

self.plotlabel(xmin, self.plotviewBox.ymax+4, txt, attr)

Expand Down
4 changes: 4 additions & 0 deletions visidata/loaders/tsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def reload_sync(self):
self._rowtype = namedlist(self._rowtype.__name__, list(self._rowtype._fields) + ['_' for c in newcols])
for c in newcols:
self.addColumn(c)
elif len(row) < ncols:
# extend rows that are missing entries
row.extend([None]*(ncols-len(row)))

self.addRow(self._rowtype(row))
prog.addProgress(len(L))

Expand Down
10 changes: 8 additions & 2 deletions visidata/vdtui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,12 @@ def visibleCols(self): # non-hidden cols
'List of `Column` which are not hidden.'
return self.keyCols + [c for c in self.columns if not c.hidden and not c.keycol]

def visibleColAtX(self, x):
for vcolidx, (colx, w) in self.visibleColLayout.items():
if colx <= x <= colx+w:
return vcolidx
error('no visible column at x=%d' % x)

@property
@functools.lru_cache() # cache for perf reasons on wide sheets. cleared in .refresh()
def keyCols(self):
Expand Down Expand Up @@ -1812,7 +1818,7 @@ def editCell(self, vcolidx=None, rowidx=None, **kwargs):
Sheet.addCommand('KEY_END', 'go-bottom', 'sheet.cursorRowIndex = len(rows); sheet.topRowIndex = cursorRowIndex-nVisibleRows'),
Sheet.addCommand('gl', 'go-rightmost', 'sheet.leftVisibleColIndex = len(visibleCols)-1; pageLeft(); sheet.cursorVisibleColIndex = len(visibleCols)-1'),

Sheet.addCommand('BUTTON1_PRESSED', 'go-mouse', 'sheet.cursorRowIndex=topRowIndex+mouseY-1'),
Sheet.addCommand('BUTTON1_PRESSED', 'go-mouse', 'sheet.cursorRowIndex=topRowIndex+mouseY-1; sheet.cursorVisibleColIndex=visibleColAtX(mouseX)'),
Sheet.addCommand('BUTTON1_RELEASED', 'scroll-mouse', 'sheet.topRowIndex=cursorRowIndex-mouseY+1'),
Sheet.addCommand('BUTTON4_PRESSED', 'scroll-up', 'cursorDown(options.scroll_incr); sheet.topRowIndex += options.scroll_incr'),
Sheet.addCommand('REPORT_MOUSE_POSITION', 'scroll-down', 'cursorDown(-options.scroll_incr); sheet.topRowIndex -= options.scroll_incr'),
Expand Down Expand Up @@ -2148,7 +2154,7 @@ def setValueSafe(self, row, value):
try:
return self.setValue(row, value)
except Exception as e:
pass # exceptionCaught(e)
exceptionCaught(e)

def setValues(self, rows, *values):
'Set our column value for given list of rows to `value`.'
Expand Down

0 comments on commit 859b8ff

Please sign in to comment.