From 0e0b86834294e1befb9e1ce16239230aa40d1add Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 6 Jan 2025 00:44:59 +0900 Subject: [PATCH] Add preview border style 'line' It draws a single line between the preview window and the rest of the interface. i.e. automatically choose between 'left', 'right', 'top', and 'bottom' depending on the position of the preview window. --- CHANGELOG.md | 1 + man/man1/fzf.1 | 11 +++++++++-- src/options.go | 37 +++++++++++++++++++++++++------------ src/terminal.go | 39 ++++++++++++++++++++++++++++++--------- src/tui/tui.go | 9 +++++---- 5 files changed, 70 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e18790b8..e0b8e66e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ CHANGELOG - `change-header-label` - `transform-header-label` - Added `--preview-border[=STYLE]` as short for `--preview-window=border[-STYLE]` +- Added new preview border style `line` which draws a single separator line between the preview window and the rest of the interface - You can specify `border-native` to `--tmux` so that native tmux border is used instead of `--border`. This can be useful if you start a different program from inside the popup. ```sh fzf --tmux border-native --bind 'enter:execute:less {}' diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 index 16421c7b..cc80c1a4 100644 --- a/man/man1/fzf.1 +++ b/man/man1/fzf.1 @@ -775,7 +775,10 @@ e.g. .TP .BI "\-\-preview\-border" [=STYLE] -Short for \fB\-\-preview\-window=border\-STYLE\fR +Short for \fB\-\-preview\-window=border\-STYLE\fR. In addition to the other +styles, \fBline\fR style is also supported for preview border, which draws +a single separator line between the preview window and the rest of the +interface. .TP .BI "\-\-preview\-label" [=LABEL] @@ -812,7 +815,7 @@ default value 0 (or \fBcenter\fR) will put the label at the center of the border line. .TP -.BI "\-\-preview\-window=" "[POSITION][,SIZE[%]][,border\-BORDER_OPT][,[no]wrap][,[no]follow][,[no]cycle][,[no]info][,[no]hidden][,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES][,default][,