summary refs log tree commit diff stats
path: root/widgets/compose.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-05-16 12:39:22 -0400
committerDrew DeVault <sir@cmpwn.com>2019-05-16 12:39:22 -0400
commit8be59cae6c133f38fa534df2dc9f79e6c7a810fb (patch)
tree5cda762c19856a2b2ebb65b12468b84c3fede483 /widgets/compose.go
parent475b697bdfd7a5821282174f14f8d904e47aff4d (diff)
downloadaerc-8be59cae6c133f38fa534df2dc9f79e6c7a810fb.tar.gz
Implement :reply -q and :reply -a
Diffstat (limited to 'widgets/compose.go')
-rw-r--r--widgets/compose.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index 02a9d0c..14dfaaa 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -124,6 +124,15 @@ func (c *Composer) Defaults(defaults map[string]string) *Composer {
 	return c
 }
 
+// Note: this does not reload the editor. You must call this before the first
+// Draw() call.
+func (c *Composer) SetContents(reader io.Reader) *Composer {
+	c.email.Seek(0, os.SEEK_SET)
+	io.Copy(c.email, reader)
+	c.email.Seek(0, os.SEEK_SET)
+	return c
+}
+
 func (c *Composer) FocusTerminal() *Composer {
 	c.focusable[c.focused].Focus(false)
 	c.focused = 3