summaryrefslogtreecommitdiff
path: root/src/options.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-03-14 16:46:23 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-03-14 16:46:23 +0900
commit4298c0b1eb31b7563eb608e3fbf4069488ada08d (patch)
treeabca5dae422106c0ccc59e0070a9383995330777 /src/options.go
parent6c104d771e382f499025a35b10f39d997ce83b7d (diff)
downloadfzf-4298c0b1eb31b7563eb608e3fbf4069488ada08d.tar.gz
Add `--ghost=TEXT` to display a ghost text when the input is empty
Diffstat (limited to 'src/options.go')
-rw-r--r--src/options.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/options.go b/src/options.go
index 8a9e33ff..1f431c45 100644
--- a/src/options.go
+++ b/src/options.go
@@ -136,6 +136,7 @@ Usage: fzf [options]
--separator=STR Draw horizontal separator on info line using the string
(default: '─' or '-')
--no-separator Hide info line separator
+ --ghost=TEXT Ghost text to display when the input is empty
--filepath-word Make word-wise movements respect path separators
--input-border[=STYLE] Draw border around the input section
[rounded|sharp|bold|block|thinblock|double|horizontal|vertical|
@@ -574,6 +575,7 @@ type Options struct {
InfoStyle infoStyle
InfoPrefix string
InfoCommand string
+ Ghost string
Separator *string
JumpLabels string
Prompt string
@@ -689,6 +691,7 @@ func defaultOptions() *Options {
ScrollOff: 3,
FileWord: false,
InfoStyle: infoDefault,
+ Ghost: "",
Separator: nil,
JumpLabels: defaultJumpLabels,
Prompt: "> ",
@@ -2597,6 +2600,10 @@ func parseOptions(index *int, opts *Options, allArgs []string) error {
case "--no-separator":
nosep := ""
opts.Separator = &nosep
+ case "--ghost":
+ if opts.Ghost, err = nextString("ghost text required"); err != nil {
+ return err
+ }
case "--scrollbar":
given, bar := optionalNextString()
if given {