From cbc9a92fdd9c4d5e5359f2abab4cfa9d4b718fc0 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 4 Jan 2025 12:10:52 +0900 Subject: [PATCH] Put 1-column margin on the sides when native border is used For more consistent look --- src/tmux.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tmux.go b/src/tmux.go index ff24e81eb0e..e459000a265 100644 --- a/src/tmux.go +++ b/src/tmux.go @@ -9,13 +9,16 @@ import ( func runTmux(args []string, opts *Options) (int, error) { // Prepare arguments - fzf := args[0] - args = append([]string{"--bind=ctrl-z:ignore"}, args[1:]...) - if opts.BorderShape == tui.BorderUndefined && !opts.Tmux.border { + fzf, rest := args[0], args[1:] + args = []string{"--bind=ctrl-z:ignore"} + if !opts.Tmux.border && opts.BorderShape == tui.BorderUndefined { args = append(args, "--border") } + if opts.Tmux.border && opts.Margin == defaultMargin() { + args = append(args, "--margin=0,1") + } argStr := escapeSingleQuote(fzf) - for _, arg := range args { + for _, arg := range append(args, rest...) { argStr += " " + escapeSingleQuote(arg) } argStr += ` --no-tmux --no-height`