diff options
| author | Julian Prein <julian@druckdev.xyz> | 2024-11-09 18:12:17 +0100 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-12-12 13:53:08 +0900 |
| commit | cdf641fa3ef266fee7217bf01513e5f942adb340 (patch) | |
| tree | bf73a6b330f2d81baa735b7c48dbb84d009bfafe /src/tui | |
| parent | 66dbee10f56ba3d776ad176b603eee9f30f0e940 (diff) | |
| download | fzf-cdf641fa3ef266fee7217bf01513e5f942adb340.tar.gz | |
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().
Diffstat (limited to 'src/tui')
| -rw-r--r-- | src/tui/tui.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tui/tui.go b/src/tui/tui.go index 240f7ce7..e7d3e42f 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -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 |
