Added color tags

This commit is contained in:
Eduard Urbach 2023-08-18 17:26:50 +02:00
parent 4a230cb68c
commit f0d559ed64
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -80,6 +80,7 @@ func (e *Editor) newResult() *tview.TextView {
e.Result.SetBackgroundColor(tcell.ColorDefault) e.Result.SetBackgroundColor(tcell.ColorDefault)
e.Result.SetTextStyle(tcell.StyleDefault) e.Result.SetTextStyle(tcell.StyleDefault)
e.Result.SetBorderPadding(0, 0, 1, 1) e.Result.SetBorderPadding(0, 0, 1, 1)
e.Result.SetDynamicColors(true)
e.Result.SetMouseCapture(func(action tview.MouseAction, event *tcell.EventMouse) (tview.MouseAction, *tcell.EventMouse) { e.Result.SetMouseCapture(func(action tview.MouseAction, event *tcell.EventMouse) (tview.MouseAction, *tcell.EventMouse) {
if action == tview.MouseLeftClick { if action == tview.MouseLeftClick {
@ -130,7 +131,7 @@ func (e *Editor) setDirty(dirty bool) {
} }
func (e *Editor) load() { func (e *Editor) load() {
source := "Press Enter to edit.\nPress Esc to preview.\nPress Ctrl + S to save.\n\n{whoami}@{hostname}" source := "Press [lime]Enter[-] to edit.\nPress [lime]Esc[-] to preview.\nPress [lime]Ctrl S[-] to save.\n\n{whoami}@{hostname}"
data, err := os.ReadFile(e.FilePath) data, err := os.ReadFile(e.FilePath)
if err == nil { if err == nil {