mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 00:03:39 -05:00
Use Has{Top,Right,Bottom,Left}() where possible
De-duplicate code and reduce the amount of code that has to be changed when new BorderShapes are being added. This also adds and uses the missing HasBottom().
This commit is contained in:
committed by
Junegunn Choi
parent
66dbee10f5
commit
cdf641fa3e
@@ -387,6 +387,14 @@ func (s BorderShape) HasTop() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (s BorderShape) HasBottom() bool {
|
||||
switch s {
|
||||
case BorderNone, BorderLeft, BorderRight, BorderTop, BorderVertical: // No bottom
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type BorderStyle struct {
|
||||
shape BorderShape
|
||||
top rune
|
||||
|
||||
Reference in New Issue
Block a user