diff --git a/CHANGELOG.md b/CHANGELOG.md index 97ab09f13..cda4af71a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/visidata/canvas.py b/visidata/canvas.py index 272b05e3a..1c5b07b0d 100644 --- a/visidata/canvas.py +++ b/visidata/canvas.py @@ -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 diff --git a/visidata/graph.py b/visidata/graph.py index 43f5aae5c..98c10626b 100644 --- a/visidata/graph.py +++ b/visidata/graph.py @@ -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) diff --git a/visidata/loaders/tsv.py b/visidata/loaders/tsv.py index a547c2e5b..aa0eb5737 100644 --- a/visidata/loaders/tsv.py +++ b/visidata/loaders/tsv.py @@ -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)) diff --git a/visidata/vdtui.py b/visidata/vdtui.py index 83abf4995..8e62dd9b1 100755 --- a/visidata/vdtui.py +++ b/visidata/vdtui.py @@ -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): @@ -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'), @@ -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`.'