From 46c4fc6877128e88251e4e954526fdbedb3e5e03 Mon Sep 17 00:00:00 2001 From: Felix Angell Date: Sun, 10 Jan 2021 12:56:50 +0000 Subject: [PATCH] added a makefile + let cursor flash in debug mode or when set --- Makefile | 12 ++++++++++++ internal/buff/buffer.go | 3 +-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a8bf800 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +.PHONY: all + +build: + go build cmd/phi/main.go + +exec: + ./main + +run: + go run cmd/phi/main.go + +all: build exec diff --git a/internal/buff/buffer.go b/internal/buff/buffer.go index 2d2e17a..d2cfd84 100644 --- a/internal/buff/buffer.go +++ b/internal/buff/buffer.go @@ -1198,8 +1198,7 @@ func (b *Buffer) processInput(pred func(r int) bool) bool { } } - // FIXME for now this is only enabled in debug mode. - if b.cfg.Cursor.Flash && cfg.DebugMode { + if b.cfg.Cursor.Flash || cfg.DebugMode { if time.Now().Sub(lastCursorDraw) >= time.Duration(b.cfg.Cursor.FlashRate)*time.Millisecond { renderFlashingCursor = !renderFlashingCursor lastCursorDraw = time.Now()