don't clone unsaved file buffers.

if I open multiple empty tabs, I don't want the same "new file buffers"
This commit is contained in:
boombuler
2016-09-14 09:37:12 +02:00
parent d0fa467a3c
commit 7d395a29a7

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
}
}
}
}