Add new border style: 'block'

This commit is contained in:
Junegunn Choi
2023-05-16 23:45:31 +09:00
parent 5a39102405
commit 43436e48e0
5 changed files with 69 additions and 33 deletions

View File

@@ -63,7 +63,7 @@ const usage = `usage: fzf [options]
(default: 10)
--layout=LAYOUT Choose layout: [default|reverse|reverse-list]
--border[=STYLE] Draw border around the finder
[rounded|sharp|horizontal|vertical|
[rounded|sharp|bold|block|double|horizontal|vertical|
top|bottom|left|right|none] (default: rounded)
--border-label=LABEL Label to print on the border
--border-label-pos=COL Position of the border label
@@ -544,6 +544,8 @@ func parseBorder(str string, optional bool) tui.BorderShape {
return tui.BorderSharp
case "bold":
return tui.BorderBold
case "block":
return tui.BorderBlock
case "double":
return tui.BorderDouble
case "horizontal":
@@ -564,7 +566,7 @@ func parseBorder(str string, optional bool) tui.BorderShape {
if optional && str == "" {
return tui.DefaultBorderShape
}
errorExit("invalid border style (expected: rounded|sharp|bold|double|horizontal|vertical|top|bottom|left|right|none)")
errorExit("invalid border style (expected: rounded|sharp|bold|block|double|horizontal|vertical|top|bottom|left|right|none)")
}
return tui.BorderNone
}
@@ -1430,6 +1432,8 @@ func parsePreviewWindowImpl(opts *previewOpts, input string, exit func(string))
opts.border = tui.BorderSharp
case "border-bold":
opts.border = tui.BorderBold
case "border-block":
opts.border = tui.BorderBlock
case "border-double":
opts.border = tui.BorderDouble
case "noborder", "border-none":