m/fzf
1
0
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:
Julian Prein
2024-11-09 18:12:17 +01:00
committed by Junegunn Choi
parent 66dbee10f5
commit cdf641fa3e
2 changed files with 39 additions and 65 deletions

View File

@@ -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