summaryrefslogtreecommitdiffstats
path: root/src/tui/tcell.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/tui/tcell.go')
-rw-r--r--src/tui/tcell.go24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/tui/tcell.go b/src/tui/tcell.go
index af0902cb..16ce452d 100644
--- a/src/tui/tcell.go
+++ b/src/tui/tcell.go
@@ -7,7 +7,6 @@ import (
"time"
"github.com/gdamore/tcell/v2"
- "github.com/gdamore/tcell/v2/encoding"
"github.com/junegunn/fzf/src/util"
"github.com/rivo/uniseg"
@@ -146,13 +145,13 @@ var (
_initialResize bool = true
)
-func (r *FullscreenRenderer) initScreen() {
+func (r *FullscreenRenderer) initScreen() error {
s, e := tcell.NewScreen()
if e != nil {
- errorExit(e.Error())
+ return e
}
if e = s.Init(); e != nil {
- errorExit(e.Error())
+ return e
}
if r.mouse {
s.EnableMouse()
@@ -160,16 +159,21 @@ func (r *FullscreenRenderer) initScreen() {
s.DisableMouse()
}
_screen = s
+
+ return nil
}
-func (r *FullscreenRenderer) Init() {
+func (r *FullscreenRenderer) Init() error {
if os.Getenv("TERM") == "cygwin" {
os.Setenv("TERM", "")
}
- encoding.Register()
- r.initScreen()
+ if err := r.initScreen(); err != nil {
+ return err
+ }
initTheme(r.theme, r.defaultTheme(), r.forceBlack)
+
+ return nil
}
func (r *FullscreenRenderer) Top() int {
@@ -561,7 +565,11 @@ func fill(x, y, w, h int, n ColorPair, r rune) {
}
func (w *TcellWindow) Erase() {
- fill(w.left-1, w.top, w.width+1, w.height-1, w.normal, ' ')
+ if w.borderStyle.shape.HasLeft() {
+ fill(w.left-1, w.top, w.width, w.height-1, w.normal, ' ')
+ } else {
+ fill(w.left, w.top, w.width-1, w.height-1, w.normal, ' ')
+ }
w.drawBorder(false)
}