Merge pull request #357 from boombuler/emptyfiles

don't reuse unsaved file buffers.
This commit is contained in:
Zachary Yedidia
2016-09-14 07:28:52 -04:00
committed by GitHub

View File

@@ -55,10 +55,12 @@ type SerializedBuffer struct {
// NewBuffer creates a new buffer from `txt` with path and name `path`
func NewBuffer(txt []byte, path string) *Buffer {
for _, tab := range tabs {
for _, view := range tab.views {
if view.Buf.Path == path {
return view.Buf
if path != "" {
for _, tab := range tabs {
for _, view := range tab.views {
if view.Buf.Path == path {
return view.Buf
}
}
}
}