Skip to content
Myr

Change default pointer and marker character

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Pointer: '▌' * Marker: '▏' They will still be set to '>' if `--no-unicode` is given. Reasons: * They look okay * They work better with multi-line items (WIP)

authored by Junegunn Choi · committed by Junegunn Choi · parent 04dfb14 · Browse files · 4 files+43 added−19 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+43 added−19 removed

  • tests:+7 added−3 removed
  • other:+36 added−16 removed

4 files+43 added−19 removed

modified:man/man1/fzf.1+2 added-2 removed
436 unmodified lines
437.BI "--prompt=" "STR"438Input prompt (default: '> ')439.TP440.BI "--pointer=" "STR"441Pointer to the current line (default: '>')441Pointer to the current line (default: '▌' or '>' depending on \fB--no-unicode\fR)442.TP443.BI "--marker=" "STR"444Multi-select marker (default: '>')444Multi-select marker (default: '▏' or '>' depending on \fB--no-unicode\fR)445.TP446.BI "--header=" "STR"447The given string will be printed as the sticky header. The lines are displayed448in the given order from top to bottom regardless of \fB--layout\fR option, and
1145 unmodified lines
modified:src/options.go+32 added-12 removed
81 unmodified lines
82 --no-separator Hide info line separator83 --scrollbar[=C1[C2]] Scrollbar character(s) (each for main and preview window)84 --no-scrollbar Hide scrollbar85 --prompt=STR Input prompt (default: '> ')86 --pointer=STR Pointer to the current line (default: '>')87 --marker=STR Multi-select marker (default: '>')86 --pointer=STR Pointer to the current line (default: '▌' or '>')87 --marker=STR Multi-select marker (default: '▏' or '>')88 --header=STR String to print as header89 --header-lines=N The first N lines of the input are treated as header90 --header-first Print header before the prompt line91 --ellipsis=STR Ellipsis to show when line is truncated (default: '..')
327 unmodified lines
419 InfoPrefix string420 Separator *string421 JumpLabels string422 Prompt string423 Pointer string424 Marker string423 Pointer *string424 Marker *string425 Query string426 Select1 bool427 Exit0 bool428 Filter *string
85 unmodified lines
514 InfoStyle: infoDefault,515 Separator: nil,516 JumpLabels: defaultJumpLabels,517 Prompt: "> ",518 Pointer: ">",519 Marker: ">",518 Pointer: nil,519 Marker: nil,520 Query: "",521 Select1: false,522 Exit0: false,523 Filter: nil,
1628 unmodified lines
2152 str, err := nextString(allArgs, &i, "pointer sign string required")2153 if err != nil {2154 return err2155 }2156 opts.Pointer = firstLine(str)2156 str = firstLine(str)2157 opts.Pointer = &str2158 case "--marker":2159 str, err := nextString(allArgs, &i, "selected sign string required")2160 if err != nil {2161 return err2162 }2162 opts.Marker = firstLine(str)2163 str = firstLine(str)2164 opts.Marker = &str2165 case "--sync":2166 opts.Sync = true2167 case "--no-sync", "--async":2168 opts.Sync = false
227 unmodified lines
2396 }2397 } else if match, value := optString(arg, "--prompt="); match {2398 opts.Prompt = value2399 } else if match, value := optString(arg, "--pointer="); match {2398 opts.Pointer = firstLine(value)2400 str := firstLine(value)2401 opts.Pointer = &str2402 } else if match, value := optString(arg, "--marker="); match {2400 opts.Marker = firstLine(value)2403 str := firstLine(value)2404 opts.Marker = &str2405 } else if match, value := optString(arg, "-n", "--nth="); match {2406 if opts.Nth, err = splitNth(value); err != nil {2407 return err2408 }
180 unmodified lines
2589 if opts.BorderShape == tui.BorderUndefined {2590 opts.BorderShape = tui.BorderNone2591 }25922593 if opts.Pointer == nil {2594 defaultPointer := "▌"2595 if !opts.Unicode {2596 defaultPointer = ">"2597 }2598 opts.Pointer = &defaultPointer2599 }26002601 if opts.Marker == nil {2602 defaultMarker := "▏"2603 if !opts.Unicode {2604 defaultMarker = ">"2605 }2606 opts.Marker = &defaultMarker2607 }26082589 if err := validateSign(opts.Pointer, "pointer"); err != nil {2609 if err := validateSign(*opts.Pointer, "pointer"); err != nil {2610 return err2611 }26122593 if err := validateSign(opts.Marker, "marker"); err != nil {2613 if err := validateSign(*opts.Marker, "marker"); err != nil {2614 return err2615 }26162617 if !tui.IsLightRendererSupported() && opts.Height.size > 0 {
151 unmodified lines
modified:src/terminal.go+2 added-2 removed
809 unmodified lines
810 executing: util.NewAtomicBool(false),811 lastAction: actStart,812 lastFocus: minItem.Index()}813 t.prompt, t.promptLen = t.parsePrompt(opts.Prompt)814 t.pointer, t.pointerLen = t.processTabs([]rune(opts.Pointer), 0)815 t.marker, t.markerLen = t.processTabs([]rune(opts.Marker), 0)814 t.pointer, t.pointerLen = t.processTabs([]rune(*opts.Pointer), 0)815 t.marker, t.markerLen = t.processTabs([]rune(*opts.Marker), 0)816 // Pre-calculated empty pointer and marker signs817 t.pointerEmpty = strings.Repeat(" ", t.pointerLen)818 t.markerEmpty = strings.Repeat(" ", t.markerLen)819 t.borderLabel, t.borderLabelLen = t.ansiLabelPrinter(opts.BorderLabel.label, &tui.ColBorderLabel, false)
3599 unmodified lines
modified:test/test_go.rb+7 added-3 removed
22 unmodified lines
2324FILE = File.expand_path(__FILE__)25BASE = File.expand_path('..', __dir__)26Dir.chdir(BASE)27FZF = "FZF_DEFAULT_OPTS=--no-scrollbar FZF_DEFAULT_COMMAND= #{BASE}/bin/fzf"27FZF = "FZF_DEFAULT_OPTS=\"--no-scrollbar --pointer \\> --marker \\>\" FZF_DEFAULT_COMMAND= #{BASE}/bin/fzf"2829def wait30 since = Time.now31 begin
33 unmodified lines
65 end66 end6768 def fish69 "unset #{UNSETS.join(' ')}; FZF_DEFAULT_OPTS=--no-scrollbar fish_history= fish"69 "unset #{UNSETS.join(' ')}; FZF_DEFAULT_OPTS=\"--no-scrollbar --pointer '>' --marker '>'\" fish_history= fish"70 end71 end72end73
3322 unmodified lines
3396 tmux.until { |lines| assert_equal '3rd', lines[-1] }3397 end33983399 def test_ctrl_r_multiline3400 # NOTE: Current bash implementation shows an extra new line if there's3401 # only enty in the history3402 tmux.send_keys ':', :Enter3403 tmux.send_keys 'echo "foo', :Enter, 'bar"', :Enter3404 tmux.until { |lines| assert_equal %w[foo bar], lines[-2..] }3405 tmux.prepare3406 tmux.send_keys 'C-r'3407 tmux.until { |lines| assert_equal '>', lines[-1] }3408 tmux.send_keys 'foo bar'3409 tmux.until { |lines| assert lines[-4]&.match?(/"foo/) } unless shell == :zsh3410 tmux.until { |lines| assert lines[-3]&.match?(/bar"␊?/) }3411 tmux.send_keys :Enter3412 tmux.until { |lines| assert lines[-1]&.match?(/bar"␊?/) }3413 tmux.send_keys :Enter
331 unmodified lines
3745unset <%= UNSETS.join(' ') %>3746unset $(env | sed -n /^_fzf_orig/s/=.*//p)3747unset $(declare -F | sed -n "/_fzf/s/.*-f //p")37483745export FZF_DEFAULT_OPTS=--no-scrollbar3749export FZF_DEFAULT_OPTS="--no-scrollbar --pointer '>' --marker '>'"37503751# Setup fzf3752# ---------3753if [[ ! "$PATH" == *<%= BASE %>/bin* ]]; then
48 unmodified lines