From 0ab50969d385ea4c65f6849f725d1cdec78ac388 Mon Sep 17 00:00:00 2001 From: midichef <67946319+midichef@users.noreply.github.com> Date: Tue, 11 Jul 2023 16:43:20 -0700 Subject: [PATCH] [graph] fix legend display of full-width characters --- visidata/canvas.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/visidata/canvas.py b/visidata/canvas.py index d34a7f39a..44ef2a915 100644 --- a/visidata/canvas.py +++ b/visidata/canvas.py @@ -305,7 +305,7 @@ def _overlaps(a, b): for o, fldraw in line: if fldraw: char_x, char_y, txt, attr, row = o - clipdraw(scr, char_y, char_x, txt, attr, len(txt)) + clipdraw(scr, char_y, char_x, txt, attr, dispwidth(txt)) # - has a cursor, of arbitrary position and width/height (not restricted to current zoom) @@ -359,7 +359,7 @@ def plotColor(self, k): del self.legends[lastlegend] legend = '[other]' - self.legendwidth = max(self.legendwidth, len(legend)) + self.legendwidth = max(self.legendwidth, dispwidth(legend)) self.legends[legend] = attr self.plotAttrs[k] = attr self.plotlegends()