Skip to content

Commit

Permalink
[options] rename options.note_* to options.disp_note_* #2381
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed May 19, 2024
1 parent e8db0ae commit c744cde
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions visidata/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def getCell(self, row):
dispval = options.disp_error_val
return DisplayWrapper(cellval.val, error=exc.stacktrace,
text=dispval,
note=options.note_getter_exc,
note=options.disp_note_getexc,
notecolor='color_error')
elif typedval.val is None: # early out for strict None
return DisplayWrapper(None, text='', # force empty display for None
Expand All @@ -377,18 +377,18 @@ def getCell(self, row):
elif isinstance(typedval, TypedExceptionWrapper): # calc succeeded, type failed
return DisplayWrapper(typedval.val, text=str(cellval),
error=typedval.stacktrace,
note=options.note_type_exc,
note=options.disp_note_typeexc,
notecolor='color_warning')
else:
return DisplayWrapper(typedval.val, text=str(typedval.val),
error=['unknown'],
note=options.note_type_exc,
note=options.disp_note_typeexc,
notecolor='color_warning')

elif isinstance(typedval, threading.Thread):
return DisplayWrapper(None,
text=options.disp_pending,
note=options.note_pending,
note=options.disp_note_pending,
notecolor='color_note_pending')

dw = DisplayWrapper(cellval)
Expand All @@ -411,7 +411,7 @@ def getCell(self, row):
dw.text = str(cellval)
except Exception as e:
dw.text = str(e)
dw.note = options.note_format_exc
dw.note = options.disp_note_fmtexc
dw.notecolor = 'color_warning'

# dw.display = self.display(dw) # set during draw() when colwidth is known
Expand Down
2 changes: 1 addition & 1 deletion visidata/guides/ErrorsSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ If a Python Exception like [:error]RuntimeError[/] appears in the sidebar:
- {help.commands.error_recent}
- {help.commands.errors_all}

If [:note_type]{vd.options.note_format_exc}[/] or [:error]{vd.options.note_getter_exc}[/] appear inside a cell, it indicates an error happened during calculation, type-conversion, or formatting. When the cursor is on an error cell:
If [:note_type]{vd.options.disp_note_fmtexc}[/] or [:error]{vd.options.disp_note_getexc}[/] appear inside a cell, it indicates an error happened during calculation, type-conversion, or formatting. When the cursor is on an error cell:

- {help.commands.error_cell}
8 changes: 4 additions & 4 deletions visidata/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
vd.theme_option('disp_ambig_width', 1, 'width to use for unicode chars marked ambiguous')

vd.theme_option('disp_pending', '', 'string to display in pending cells')
vd.theme_option('note_pending', '⌛', 'note to display for pending cells')
vd.theme_option('note_format_exc', '?', 'cell note for an exception during formatting')
vd.theme_option('note_getter_exc', '!', 'cell note for an exception during computation')
vd.theme_option('note_type_exc', '!', 'cell note for an exception during type conversion')
vd.theme_option('disp_note_pending', '⌛', 'note to display for pending cells')
vd.theme_option('disp_note_fmtexc', '?', 'cell note for an exception during formatting')
vd.theme_option('disp_note_getexc', '!', 'cell note for an exception during computation')
vd.theme_option('disp_note_typeexc', '!', 'cell note for an exception during type conversion')

vd.theme_option('color_note_pending', 'bold magenta', 'color of note in pending cells')
vd.theme_option('color_note_type', '226 yellow', 'color of cell note for non-str types in anytype columns')
Expand Down
8 changes: 4 additions & 4 deletions visidata/themes/ascii8.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
disp_ambig_width=1,

disp_pending='',
note_pending=':',
note_format_exc='?',
note_getter_exc='!',
note_type_exc='!',
disp_note_pending=':',
disp_note_fmtexc='?',
disp_note_getexc='!',
disp_note_typeexc='!',

color_note_pending='bold magenta',
color_note_type='yellow',
Expand Down
8 changes: 4 additions & 4 deletions visidata/themes/asciimono.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
disp_ambig_width=1,

disp_pending='',
note_pending=':',
note_format_exc='?',
note_getter_exc='!',
note_type_exc='!',
disp_note_pending=':',
disp_note_fmtexc='?',
disp_note_getexc='!',
disp_note_typeexc='!',

color_note_pending='bold',
color_note_type='',
Expand Down

0 comments on commit c744cde

Please sign in to comment.