mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-14 22:33:47 -05:00
@@ -2485,6 +2485,10 @@ func (t *Terminal) printInfoImpl() {
|
|||||||
outputPrinter, outputLen = t.ansiLabelPrinter(output, &tui.ColInfo, false)
|
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 {
|
switch t.infoStyle {
|
||||||
case infoDefault:
|
case infoDefault:
|
||||||
if !move(line+1, 0, t.separatorLen == 0) {
|
if !move(line+1, 0, t.separatorLen == 0) {
|
||||||
@@ -2498,9 +2502,9 @@ func (t *Terminal) printInfoImpl() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
case infoInlineRight:
|
case infoInlineRight:
|
||||||
pos = t.promptLen + t.queryLen[0] + t.queryLen[1] + 1
|
pos = t.promptLen + shiftLen
|
||||||
case infoInline:
|
case infoInline:
|
||||||
pos = t.promptLen + t.queryLen[0] + t.queryLen[1] + 1
|
pos = t.promptLen + shiftLen
|
||||||
printInfoPrefix()
|
printInfoPrefix()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1831,4 +1831,19 @@ class TestCore < TestInteractive
|
|||||||
assert_includes lines, 'X Type in query ...'
|
assert_includes lines, 'X Type in query ...'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_ghost_inline
|
||||||
|
tmux.send_keys %(seq 100 | #{FZF} --info 'inline: Y' --no-separator --prompt 'X ' --ghost 'Type in query ...'), :Enter
|
||||||
|
tmux.until do |lines|
|
||||||
|
assert_includes lines, 'X Type in query ... Y100/100'
|
||||||
|
end
|
||||||
|
tmux.send_keys '100'
|
||||||
|
tmux.until do |lines|
|
||||||
|
assert_includes lines, 'X 100 Y1/100'
|
||||||
|
end
|
||||||
|
tmux.send_keys 'C-u'
|
||||||
|
tmux.until do |lines|
|
||||||
|
assert_includes lines, 'X Type in query ... Y100/100'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user