mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-17 14:30:32 +00:00
Fix bug with opening empty files
This commit is contained in:
parent
370e667e91
commit
6fbff048f0
1 changed files with 5 additions and 1 deletions
|
|
@ -104,7 +104,11 @@ func LoadInput() []*Buffer {
|
|||
}
|
||||
}
|
||||
// If the file didn't exist, input will be empty, and we'll open an empty buffer
|
||||
buffers = append(buffers, NewBuffer(input, filename))
|
||||
if input != nil {
|
||||
buffers = append(buffers, NewBuffer(input, filename))
|
||||
} else {
|
||||
buffers = append(buffers, NewBuffer(strings.NewReader(""), filename))
|
||||
}
|
||||
}
|
||||
} else if !isatty.IsTerminal(os.Stdin.Fd()) {
|
||||
// Option 2
|
||||
|
|
|
|||
Loading…
Reference in a new issue