m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-14 14:23:47 -05:00

Fix ghost text with inline info

Fix #4312
This commit is contained in:
Junegunn Choi
2025-03-15 18:42:08 +09:00
parent 4298c0b1eb
commit 87f7f436e8
2 changed files with 21 additions and 2 deletions

View File

@@ -2485,6 +2485,10 @@ func (t *Terminal) printInfoImpl() {
outputPrinter, outputLen = t.ansiLabelPrinter(output, &tui.ColInfo, false)
}
shiftLen := t.queryLen[0] + t.queryLen[1] + 1
if shiftLen == 1 && len(t.ghost) > 0 {
shiftLen = util.StringWidth(t.ghost)
}
switch t.infoStyle {
case infoDefault:
if !move(line+1, 0, t.separatorLen == 0) {
@@ -2498,9 +2502,9 @@ func (t *Terminal) printInfoImpl() {
return
}
case infoInlineRight:
pos = t.promptLen + t.queryLen[0] + t.queryLen[1] + 1
pos = t.promptLen + shiftLen
case infoInline:
pos = t.promptLen + t.queryLen[0] + t.queryLen[1] + 1
pos = t.promptLen + shiftLen
printInfoPrefix()
}