From 1ce19f2ab446b70647ced702db0b83de3cc1ac3c Mon Sep 17 00:00:00 2001 From: Noboru Saito Date: Sat, 17 Feb 2024 13:24:13 +0900 Subject: [PATCH] Fix column delimiter highlighting and update test case --- oviewer/draw.go | 2 +- oviewer/utils_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oviewer/draw.go b/oviewer/draw.go index 4bddfa0b..441b8559 100644 --- a/oviewer/draw.go +++ b/oviewer/draw.go @@ -394,7 +394,7 @@ func (root *Root) columnDelimiterHighlight(line LineC) { switch { case c == 0 && lStart == 0: iStart = lStart - iEnd = indexes[0][1] - 1 + iEnd = indexes[0][1] - len(m.ColumnDelimiter) if iEnd < 0 { iEnd = 0 } diff --git a/oviewer/utils_test.go b/oviewer/utils_test.go index 7aed676e..51aa15bd 100644 --- a/oviewer/utils_test.go +++ b/oviewer/utils_test.go @@ -454,8 +454,8 @@ func Test_allIndex(t *testing.T) { reg: nil, }, want: [][]int{ - {1, 2}, - {5, 6}, + {1, 4}, + {5, 8}, }, }, {