m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Add more --border options; default changed to "rounded"

--border option now takes an optional argument that defines the style

  - rounded (new default)
  - sharp
  - horizontal (previous default)
This commit is contained in:
Junegunn Choi
2020-03-05 20:15:15 +09:00
parent 99f1e02766
commit d9b1211191
6 changed files with 150 additions and 90 deletions

View File

@@ -210,7 +210,8 @@ type BorderShape int
const (
BorderNone BorderShape = iota
BorderAround
BorderRounded
BorderSharp
BorderHorizontal
)
@@ -228,14 +229,25 @@ type BorderCharacter int
func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle {
if unicode {
if shape == BorderRounded {
return BorderStyle{
shape: shape,
horizontal: '─',
vertical: '│',
topLeft: '╭',
topRight: '╮',
bottomLeft: '╰',
bottomRight: '╯',
}
}
return BorderStyle{
shape: shape,
horizontal: '─',
vertical: '│',
topLeft: '',
topRight: '',
bottomLeft: '',
bottomRight: '',
topLeft: '',
topRight: '',
bottomLeft: '',
bottomRight: '',
}
}
return BorderStyle{
@@ -251,7 +263,7 @@ func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle {
func MakeTransparentBorder() BorderStyle {
return BorderStyle{
shape: BorderAround,
shape: BorderRounded,
horizontal: ' ',
vertical: ' ',
topLeft: ' ',