Naheel-Azawy / stpv

Simple Terminal PreViewer
GNU General Public License v3.0
96 stars 12 forks source link

Use vertical preview if window exceeds min width #4

Closed Seirdy closed 4 years ago

Seirdy commented 5 years ago

If the window width is 170 columns wide, then FZF's preview will be 80 columns wide when vertically split; this should be enough to preview most files.

Naheel-Azawy commented 4 years ago

@Seirdy Sorry for the super late response... I saw your pull request and totally forgot to answer... Anyway, why 170 and 80 in particular?

Seirdy commented 4 years ago

80 columns is pretty standard for line-length limits in code, while 72 columns is the standard for prose. For instance, Python's style guide recommends 79-80 columns and 72 columns for docs/comments; plaintext emails without format=flowed are typically hard-wrapped at 72 columns by default.

See this list of style guides grouped by their recommended column count.

The default FZF preview window in vertical mode becomes 80 columns wide when the terminal's column count hits 170; this should be a reasonable point to switch to a vertical preview.

Naheel-Azawy commented 4 years ago

Ok cool thanks!