Skip to content
Myr

ADD $FZF_DIRECTION

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

authored by Junegunn Choi · committed by Junegunn Choi · parent e1de29b · Browse files · 4 files+22 added−0 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+22 added−0 removed

  • tests:+1 added−0 removed
  • other:+21 added−0 removed

4 files+22 added−0 removed

modified:man/man1/fzf.1+2 added
1333 unmodified lines
1334.BR FZF_LINES " Number of lines fzf takes up excluding padding and margin"1335.br1336.BR FZF_COLUMNS " Number of columns fzf takes up excluding padding and margin"1337.br1338.BR FZF_DIRECTION " Direction of the list (\fBup\fR or \fBdown\fR)"1339.br1340.BR FZF_TOTAL_COUNT " Total number of items"1341.br1342.BR FZF_MATCH_COUNT " Number of matched items"1343.br
811 unmodified lines
modified:src/terminal.go+5 added
1305 unmodified lines
1306 env = append(env, "FZF_BORDER_LABEL="+t.borderLabelOpts.label)1307 env = append(env, "FZF_LIST_LABEL="+t.listLabelOpts.label)1308 env = append(env, "FZF_INPUT_LABEL="+t.inputLabelOpts.label)1309 env = append(env, "FZF_HEADER_LABEL="+t.headerLabelOpts.label)1310 direction := "down"1311 if t.layout == layoutDefault {1312 direction = "up"1313 }1314 env = append(env, "FZF_DIRECTION="+direction)1315 if len(t.nthCurrent) > 0 {1316 env = append(env, "FZF_NTH="+RangesToString(t.nthCurrent))1317 }1318 if t.raw {
5923 unmodified lines
modified:test/test_core.rb+1 added
1680 unmodified lines
1681 end16821683 tmux.send_keys %(seq 100 | #{FZF} --multi --reverse --preview-window 0 --preview 'env | grep ^FZF_ | sort > #{tempname}' --no-input --bind enter:show-input+refresh-preview,space:disable-search+refresh-preview), :Enter1684 expected = {1685 FZF_DIRECTION: 'down',1686 FZF_TOTAL_COUNT: '100',1687 FZF_MATCH_COUNT: '100',1688 FZF_SELECT_COUNT: '0',1689 FZF_ACTION: 'start',
414 unmodified lines
modified:CHANGELOG.md+14 added
130 unmodified lines
131#### `--gutter-raw CHAR`132133As noted above, the `--gutter-raw CHAR` option was also added for customizing the gutter column in raw mode.134135### Added environment variable136137`$FZF_DIRECTION` is now exported to child processes, indicating the list direction of the current layout.138139- `up` for the default layout140- `down` for `reverse` or `reverse-list`141142This simplifies writing transform actions involving layout-dependent actions143like `{up,down}-match`, `{up,down}-selected`, and `toggle+{up,down}`.144145```sh146fzf --raw --bind 'result:first+transform:[[ $FZF_RAW = 0 ]] && echo $FZF_DIRECTION-match'147```148149### Breaking changes150151#### Hiding the gutter column152
2827 unmodified lines