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

Add change-ghost and transform-ghost

This commit is contained in:
Junegunn Choi
2025-03-28 23:35:20 +09:00
parent 0dce561ec9
commit ba6d1b8772
6 changed files with 153 additions and 129 deletions

View File

@@ -475,15 +475,19 @@ const (
actBackwardWord
actCancel
actChangeBorderLabel
actChangeListLabel
actChangeInputLabel
actChangeGhost
actChangeHeader
actChangeHeaderLabel
actChangeInputLabel
actChangeListLabel
actChangeMulti
actChangeNth
actChangePointer
actChangePreview
actChangePreviewLabel
actChangePreviewWindow
actChangePrompt
actChangeQuery
actChangeNth
actClearScreen
actClearQuery
actClearSelection
@@ -542,10 +546,11 @@ const (
actTogglePreviewWrap
actTransform
actTransformBorderLabel
actTransformListLabel
actTransformInputLabel
actTransformGhost
actTransformHeader
actTransformHeaderLabel
actTransformInputLabel
actTransformListLabel
actTransformNth
actTransformPointer
actTransformPreviewLabel
@@ -554,9 +559,6 @@ const (
actTransformSearch
actSearch
actPreview
actChangePointer
actChangePreview
actChangePreviewWindow
actPreviewTop
actPreviewBottom
actPreviewUp
@@ -5958,6 +5960,15 @@ func (t *Terminal) Loop() error {
}
}
}
case actChangeGhost, actTransformGhost:
ghost := a.a
if a.t == actTransformGhost {
ghost = t.captureLine(a.a)
}
t.ghost = ghost
if len(t.input) == 0 {
req(reqPrompt)
}
case actChangePointer, actTransformPointer:
pointer := a.a
if a.t == actTransformPointer {