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

Add --no-unicode option to draw borders in ASCII characters

Close ##1533
This commit is contained in:
Junegunn Choi
2019-03-29 02:11:03 +09:00
parent e7d60aac9c
commit 75972d59a8
6 changed files with 87 additions and 38 deletions

View File

@@ -201,14 +201,47 @@ type MouseEvent struct {
Mod bool
}
type BorderStyle int
type BorderShape int
const (
BorderNone BorderStyle = iota
BorderNone BorderShape = iota
BorderAround
BorderHorizontal
)
type BorderStyle struct {
shape BorderShape
horizontal rune
vertical rune
topLeft rune
topRight rune
bottomLeft rune
bottomRight rune
}
func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle {
if unicode {
return BorderStyle{
shape: shape,
horizontal: '─',
vertical: '│',
topLeft: '┌',
topRight: '┐',
bottomLeft: '└',
bottomRight: '┘',
}
}
return BorderStyle{
shape: shape,
horizontal: '-',
vertical: '|',
topLeft: '+',
topRight: '+',
bottomLeft: '+',
bottomRight: '+',
}
}
type Renderer interface {
Init()
Pause(clear bool)