junegunn / junegunn/fzf

Preview window option : max-char:80 and min-char:10 option ?

Open
#2,277 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
83k
Forks
2.9k
Avg merge
17h 8m
Merged PRs (30d)
10

Description

Hello @junegunn ,

I have a small improvement suggestion with the library, I don't know what you think of it.

I have some cases where for the preview window, using percentages is a bit annoying because all depends on what size of window the fzf window is in.

For example, if I run the following :

fzf --preview 'cat' --preview-window 'right:50%:nohidden'

It is a bit bothering that when the terminal is taking the fullscreen, that the preview-window always takes 50% of the width.
In that case, I would prefer to have a larger filtering view.

I think this could be achieved by adding max-char and min-char to the preview-window.

Something in the line of this :

fzf --preview 'cat' --preview-window 'right:50%:nohidden:max-char:80:min-char:10'

This way, a user could say that they want to not have the preview be too big or too small.

What do you think ?

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names the preview-window option and provides an example command, but no source file or test. Start by locating preview-window option parsing and preview sizing, then determine how min-char and max-char should interact with percentages and nohidden. Done means the command supports bounded preview width without changing existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.