From 6ce8fe3ce120bace6426900bea9b651cf917918d Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Mon, 29 Aug 2016 09:01:54 -0400 Subject: [PATCH] Open an empty buffer if user opened a directory Fixes #216 --- cmd/micro/micro.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index 1a1fbda3..aa301e72 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -93,7 +93,8 @@ func LoadInput() []*Buffer { input, err = ioutil.ReadFile(filename) if err != nil { TermMessage(err) - continue + input = []byte{} + filename = "" } } // If the file didn't exist, input will be empty, and we'll open an empty buffer