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

Border around the header section

Close #4159
This commit is contained in:
Junegunn Choi
2025-01-05 23:02:52 +09:00
parent 45fc7b903d
commit a5beb08ed7
9 changed files with 757 additions and 292 deletions

View File

@@ -557,6 +557,8 @@ func (r *FullscreenRenderer) NewWindow(top int, left int, width int, height int,
switch windowType {
case WindowList:
normal = ColListBorder
case WindowHeader:
normal = ColHeaderBorder
case WindowInput:
normal = ColInputBorder
case WindowPreview:
@@ -593,9 +595,16 @@ func (w *TcellWindow) EraseMaybe() bool {
return true
}
func (w *TcellWindow) EncloseX(x int) bool {
return x >= w.left && x < (w.left+w.width)
}
func (w *TcellWindow) EncloseY(y int) bool {
return y >= w.top && y < (w.top+w.height)
}
func (w *TcellWindow) Enclose(y int, x int) bool {
return x >= w.left && x < (w.left+w.width) &&
y >= w.top && y < (w.top+w.height)
return w.EncloseX(x) && w.EncloseY(y)
}
func (w *TcellWindow) Move(y int, x int) {
@@ -792,6 +801,8 @@ func (w *TcellWindow) drawBorder(onlyHorizontal bool) {
style = ColBorder.style()
case WindowList:
style = ColListBorder.style()
case WindowHeader:
style = ColHeaderBorder.style()
case WindowInput:
style = ColInputBorder.style()
case WindowPreview: