diff --git a/visidata/aggregators.py b/visidata/aggregators.py index 3b424a5ae..ed876cd2c 100644 --- a/visidata/aggregators.py +++ b/visidata/aggregators.py @@ -6,7 +6,7 @@ from copy import copy from visidata import Progress, Sheet, Column, ColumnsSheet, VisiData -from visidata import vd, anytype, vlen, asyncthread, wrapply, AttrDict, date, INPROGRESS +from visidata import vd, anytype, vlen, asyncthread, wrapply, AttrDict, date, INPROGRESS, dispwidth vd.help_aggregators = '''# Choose Aggregators Start typing an aggregator name or description. @@ -264,7 +264,7 @@ def chooseAggregators(vd): prompt = 'choose aggregators: ' def _fmt_aggr_summary(match, row, trigger_key): formatted_aggrname = match.formatted.get('key', row.key) if match else row.key - r = ' '*(len(prompt)-3) + r = ' '*(dispwidth(prompt)-3) r += f'[:keystrokes]{trigger_key}[/] ' r += formatted_aggrname if row.desc: diff --git a/visidata/features/go_col.py b/visidata/features/go_col.py index c559ccea6..8f877a649 100644 --- a/visidata/features/go_col.py +++ b/visidata/features/go_col.py @@ -32,7 +32,7 @@ def nextColName(sheet, show_cells=True): def _fmt_colname(match, row, trigger_key): name = match.formatted.get('name', row.name) if match else row.name - r = ' '*(len(prompt)-3) + r = ' '*(dispwidth(prompt)-3) r += f'[:keystrokes]{trigger_key}[/] ' if show_cells and len(sheet.rows) > 0: # pad the right side with spaces @@ -46,6 +46,7 @@ def _fmt_colname(match, row, trigger_key): else: r += name return r + name = vd.activeSheet.inputPalette(prompt, colnames, value_key='name', diff --git a/visidata/features/join.py b/visidata/features/join.py index 603926eeb..98dd176b5 100644 --- a/visidata/features/join.py +++ b/visidata/features/join.py @@ -3,7 +3,7 @@ import functools from copy import copy -from visidata import vd, VisiData, asyncthread, Sheet, Progress, IndexSheet, Column, CellColorizer, ColumnItem, SubColumnItem, TypedWrapper, ColumnsSheet, AttrDict +from visidata import vd, VisiData, asyncthread, Sheet, Progress, IndexSheet, Column, CellColorizer, ColumnItem, SubColumnItem, TypedWrapper, ColumnsSheet, AttrDict, dispwidth vd.help_join = '# Join Help\nHELPTODO' @@ -367,7 +367,7 @@ def chooseJointype(vd): prompt = 'choose jointype: ' def _fmt_aggr_summary(match, row, trigger_key): formatted_jointype = match.formatted.get('key', row.key) if match else row.key - r = ' '*(len(prompt)-3) + r = ' '*(dispwidth(prompt)-3) r += f'[:keystrokes]{trigger_key}[/] ' r += formatted_jointype if row.desc: