diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-02-22 19:05:30 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-02-22 19:05:30 +0900 |
| commit | d79902ae595db726fa644fd441f9bc5d2a733285 (patch) | |
| tree | 6bb824ff7b1012b88162e76b1493057e3dc8cadf /src/terminal.go | |
| parent | 77568e114ff531f4fe14cfaeab6febd53a99b1bc (diff) | |
| download | fzf-d79902ae595db726fa644fd441f9bc5d2a733285.tar.gz | |
Fix 'jump' when pointer is empty
Fix #4270
Diffstat (limited to 'src/terminal.go')
| -rw-r--r-- | src/terminal.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/terminal.go b/src/terminal.go index e4fdd394..bf74b77b 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -2755,11 +2755,15 @@ func (t *Terminal) printItem(result Result, line int, maxLine int, index int, cu item := result.item _, selected := t.selected[item.Index()] label := "" + extraWidth := 0 if t.jumping != jumpDisabled { if index < len(t.jumpLabels) { // Striped current = index%2 == 0 - label = t.jumpLabels[index:index+1] + strings.Repeat(" ", t.pointerLen-1) + label = t.jumpLabels[index:index+1] + strings.Repeat(" ", util.Max(0, t.pointerLen-1)) + if t.pointerLen == 0 { + extraWidth = 1 + } } } else if current { label = t.pointer @@ -2788,6 +2792,7 @@ func (t *Terminal) printItem(result Result, line int, maxLine int, index int, cu maxWidth := t.window.Width() - (t.pointerLen + t.markerLen + 1) postTask := func(lineNum int, width int, wrapped bool, forceRedraw bool) { + width += extraWidth if (current || selected) && t.highlightLine { color := tui.ColSelected if current { |
