mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
@@ -97,11 +97,16 @@ func LoadInput() []*Buffer {
|
|||||||
if _, e := os.Stat(filename); e == nil {
|
if _, e := os.Stat(filename); e == nil {
|
||||||
// If it exists we load it into a buffer
|
// If it exists we load it into a buffer
|
||||||
input, err = os.Open(filename)
|
input, err = os.Open(filename)
|
||||||
|
stat, _ := input.Stat()
|
||||||
defer input.Close()
|
defer input.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
TermMessage(err)
|
TermMessage(err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if stat.IsDir() {
|
||||||
|
TermMessage("Cannot read", filename, "because it is a directory")
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// If the file didn't exist, input will be empty, and we'll open an empty buffer
|
// If the file didn't exist, input will be empty, and we'll open an empty buffer
|
||||||
if input != nil {
|
if input != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user