From 15666309ee5188d0304f24f401113f6f56b05a32 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 14 Nov 2024 04:28:12 -0600 Subject: [PATCH] fakefile writes to stdout window work Signed-off-by: Jeff Carr --- keybindings.go | 8 ++++++++ structs.go | 3 +++ 2 files changed, 11 insertions(+) diff --git a/keybindings.go b/keybindings.go index e1af3f0..4771642 100644 --- a/keybindings.go +++ b/keybindings.go @@ -143,6 +143,14 @@ func addDebugKeys(g *gocui.Gui) { if tk.v == nil { log.Log(ERROR, "tk.v = nil") } + if me.fakefile == nil { + log.Log(ERROR, "making fakefile") + me.fakefile = NewFakeFile(tk.v) + } else { + log.Log(ERROR, "attempt write to fakefile") + fmt.Fprintf(me.fakefile, "test out fakefile %d\n", ecount) + } + // log.CaptureMode(tk.v) return nil }) diff --git a/structs.go b/structs.go index 4fc2df1..c69971b 100644 --- a/structs.go +++ b/structs.go @@ -99,6 +99,9 @@ type config struct { // used for listWidgets() debugging depth int + + // used to attempt to write to the stdout window + fakefile *FakeFile } // deprecate these