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

Add more --border options; default changed to "rounded"

--border option now takes an optional argument that defines the style

  - rounded (new default)
  - sharp
  - horizontal (previous default)
This commit is contained in:
Junegunn Choi
2020-03-05 20:15:15 +09:00
parent 99f1e02766
commit d9b1211191
6 changed files with 150 additions and 90 deletions

View File

@@ -28,6 +28,7 @@ type Attr tcell.Style
type TcellWindow struct {
color bool
preview bool
top int
left int
width int
@@ -418,6 +419,7 @@ func (r *FullscreenRenderer) NewWindow(top int, left int, width int, height int,
}
return &TcellWindow{
color: r.theme != nil,
preview: preview,
top: top,
left: left,
width: width,
@@ -591,7 +593,7 @@ func (w *TcellWindow) drawBorder() {
var style tcell.Style
if w.color {
if w.borderStyle.shape == BorderAround {
if w.preview {
style = ColPreviewBorder.style()
} else {
style = ColBorder.style()
@@ -605,7 +607,7 @@ func (w *TcellWindow) drawBorder() {
_screen.SetContent(x, bot-1, w.borderStyle.horizontal, nil, style)
}
if w.borderStyle.shape == BorderAround {
if w.borderStyle.shape != BorderHorizontal {
for y := top; y < bot; y++ {
_screen.SetContent(left, y, w.borderStyle.vertical, nil, style)
_screen.SetContent(right-1, y, w.borderStyle.vertical, nil, style)