Commit Graph

352 Commits (f7447aece12f9b95133b803d5c4f71815bee8ca6)

Author SHA1 Message Date
Junegunn Choi f7447aece1
Code cleanup 1 year ago
Junegunn Choi aa2b9ec476
Add 'show-preview' and 'hide-preview'
For cases where 'toggle-preview' is not enough
1 year ago
Junegunn Choi 3ee00f8bc2
toggle-preview should not show empty preview window 1 year ago
Junegunn Choi fccab60a5c
`--preview-window 0,hidden` should not execute the preview command
Until `toggle-preview` action is triggered

Fix #3149
1 year ago
Junegunn Choi 95a7661bb1
Sanitize input strings that should be a single line 1 year ago
Junegunn Choi 618d317803
Support custom separator of inline info
Close #2030
Close #3084
1 year ago
Junegunn Choi 284d77fe2e
Add 'focus' event
Can we find a better name? I have considered the followings.

* 'point', because "the pointer" points to the current item.
* 'shift', 'switch', 'move', etc. These are not technically correct
  because the current item can change without cursor movement (--tac,
  reload, search update)
* 'change' is already taken. 'change-current' feels a bit wordy and
  sounds wrong, 'current-changed' is wordy and doesn't go well with the
  other event names
* 'target', not straightforward

Close #3053
1 year ago
Junegunn Choi 826178f1e2
Do not restore terminal state while running an external command 1 year ago
Junegunn Choi d51980a3f5 Add 'transform-border-label' and 'transform-preview-label' 1 year ago
jpcrs c3d73e7ecb Add change-border-label and change-preview-label actions, update man 1 year ago
Junegunn Choi 8b299a29c7
Fix rendering of double-column borders 1 year ago
Junegunn Choi 0c5956c43c
Better support for Windows terminals
* Default border style on Windows is changed to `sharp` because some
  Windows terminals are not capable of displaying `rounded` border
  characters correctly.
* If your terminal emulator renders each box-drawing character with
  2 columns, set `RUNEWIDTH_EASTASIAN` environment variable to `1`.
1 year ago
Junegunn Choi e97e925efb
Resume preview following if the user scrolls the window to the bottom 1 year ago
Junegunn Choi e0f0984da7
Allow re-enabling preview follow on change-preview-window 1 year ago
Junegunn Choi 4d22b5aaef
Disable preview follow after dragging the scrollbar
TBD: Should we re-enable follow once the offset reaches the bottom?
1 year ago
Junegunn Choi 80b8846318
Run preview command when preview window appears after resize (#3113)
# Start fzf in a small screen so that the preview window is hidden
  fzf --bind 'ctrl-p:toggle-preview' --preview 'stat {}' --preview-window='right,50%,<100(down,50%,hidden)'

  # Enlarge the screen until the preview window appears. It should not be empty.
1 year ago
Junegunn Choi 23d8b78ce1
Allow toggling of alternative preview window layout that is hidden
Fix #3113
1 year ago
Junegunn Choi 3b2244077d
Add scrollbar to the preview window 1 year ago
Junegunn Choi ee5cdb9713
Reduce flickering of the scroll info panel on the preview window 1 year ago
Junegunn Choi 03d02d67f7
Fix cyclic scrolling with non-zero preview header lines
e.g. fzf --preview-window 'cycle,~2' --preview 'echo foo; echo bar; seq 100'
1 year ago
Junegunn Choi c1cd0c09a2
Allow dragging of the preview window 1 year ago
Junegunn Choi 3761dc0433
Avoid superfluous update of scrollbar 1 year ago
Junegunn Choi aa71a07fbe
Fix scrollbar rendering (#3096) 1 year ago
Junegunn Choi 7c660aa86e
Allow dragging of scrollbar 1 year ago
Junegunn Choi 435d8fa0a2
Colors for 'separator' and 'scrollbar' will default to that for 'border' 1 year ago
Junegunn Choi 5cd6f1d064
Add scrollbar
Close #3096
1 year ago
Junegunn Choi 62c7f59b94
Add transform-prompt(...) action 1 year ago
Junegunn Choi d649f5d826
Always execute preview command if {q} is in the template
Even when {q} is empty. Because, why not?

While this can be seen as a breaking change, there is an easy workaround
to keep the old behavior.

    # This will show // even when the query is empty
    : | fzf --preview 'echo /{q}/'

    # But if you don't want it,
    : | fzf --preview '[ -n {q} ] || exit; echo /{q}/'

Close #2759
1 year ago
Junegunn Choi 6c37177cf5
Add reload-sync action
Close #2816
1 year ago
Junegunn Choi 14775aa975
Add 'load' event that is triggered when the input stream is complete
and the first search (with or without query) is complete
1 year ago
Junegunn Choi 44b6336372
Make server channel buffered
Not to block an action that calls the API

  fzf --listen 6266 --bind 'space:execute-silent:curl localhost:6266 -d up'
1 year ago
Junegunn Choi 36d2bb332b
Add transform-query(...) action
Test case authored by @SpicyLemon

Close #1930
Close #2465
Close #2559
Close #2509 (e.g. fzf --bind 'space:transform-query:printf %s%s {q} {}')
1 year ago
Junegunn Choi 4dbe45640a
Remove $FZF_LISTEN_PORT
It is not worth the added complexity.
1 year ago
Junegunn Choi 4b3f0b9f08
Allow put action with an argument i.e. put(...) 1 year ago
Junegunn Choi 12af069dca
Add pos(...) action to move the cursor to the numeric position
# Put the cursor on the 10th item
  seq 100 | fzf --sync --bind 'start:pos(10)'

  # Put the cursor on the 10th to last item
  seq 100 | fzf --sync --bind 'start:pos(-10)'

Close #3069
Close #395
1 year ago
Junegunn Choi b7bb973118
Revert "Add GET endpoints for getting the state of the finder"
This reverts commit 750b2a6313.

This can cause a deadlock if the endpoints are accessed in the core event
loop via execute action.

  fzf --listen 6266 --bind 'space:execute:curl localhost:6266'

Technically, there's no reason to use the API because the information is
already available via `{}` and `{q}`, but I'd like to completely remove
the risk of misuse.
1 year ago
Junegunn Choi 750b2a6313
Add GET endpoints for getting the state of the finder
* GET / (or GET /current)
* GET /query
1 year ago
Junegunn Choi fd1f7665a7
Abort fzf if --listen port is unavailable 1 year ago
Junegunn Choi a7a771b92b Break out of jump mode when any action is submitted to the server 1 year ago
Junegunn Choi 4b055bf260 Rewrite HTTP server without net/http
This cuts down the binary size from 5.7MB to 3.3MB.
1 year ago
Junegunn Choi 1ba7484d60 Add --listen=HTTP_PORT option to receive actions
Supersedes #2019

See also:
* #1728
* https://github.com/junegunn/fzf.vim/pull/1044
1 year ago
Junegunn Choi 51c518da1e
Add change-query(...) action 1 year ago
Junegunn Choi 18e3b38c69
Add 'next-selected' and 'prev-selected' actions
Close #2749
1 year ago
Junegunn Choi 0ad30063ff
Rename previous-history to prev-history
previous-history is still supported for backward compatibility
1 year ago
Junegunn Choi 3d2376ab52
Add color name 'preview-label' (#3053) 1 year ago
Junegunn Choi 8f4c89f50e
Make 'double-click' behave the same as 'enter' by default
Close #3061
1 year ago
Junegunn Choi 2ba68d24f2
Do not erase info separator before redrawing it 1 year ago
Zhizhen He 2a54e3d770
Fix typos in the source code (#3048) 2 years ago
Junegunn Choi 8868d7d188
Add --separator to customize the info separator 2 years ago
Junegunn Choi 01ae621f11
Add --border=[bold|double] and --preview-window=border-[bold|double] 2 years ago