Skip to content

Commit

Permalink
[format-] pass through *args and **kwargs for format_enum
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Jul 21, 2022
1 parent 4815576 commit d665f5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion visidata/sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ def _async_deepcopy(newlist, oldlist):

@Column.api
def format_enum(col, fmtdict):
return lambda val, fmtdict=fmtdict: fmtdict.__getitem__(val)
return lambda val, fmtdict=fmtdict,*args,**kwargs: fmtdict.__getitem__(val)

Sheet.addCommand('', 'setcol-formatter', 'cursorCol.formatter=input("set formatter to: ", value=cursorCol.formatter or "generic")', 'set formatter for current column (generic, json, python)')
Sheet.addCommand('', 'setcol-format-enum', 'cursorCol.fmtstr=input("format replacements (k=v): ", value=f"{cursorDisplay}=", i=len(cursorDisplay)+1); cursorCol.formatter="enum"', 'add secondary type translator to current column from input enum (space-separated)')

0 comments on commit d665f5a

Please sign in to comment.