summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-03-15 18:42:08 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-03-15 18:42:08 +0900
commit87f7f436e8e6de98336eb26d695bec93cc5b6b07 (patch)
tree92e7093fc4672dff06cf9a884a13976a0c7e30b0 /src
parent4298c0b1eb31b7563eb608e3fbf4069488ada08d (diff)
downloadfzf-87f7f436e8e6de98336eb26d695bec93cc5b6b07.tar.gz
Fix ghost text with inline info
Fix #4312
Diffstat (limited to 'src')
-rw-r--r--src/terminal.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/terminal.go b/src/terminal.go
index 8f8b800a..1d89d235 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -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()
}