mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 05:47:06 +09:00
Merge pull request #357 from boombuler/emptyfiles
don't reuse unsaved file buffers.
This commit is contained in:
@@ -55,10 +55,12 @@ type SerializedBuffer struct {
|
|||||||
|
|
||||||
// NewBuffer creates a new buffer from `txt` with path and name `path`
|
// NewBuffer creates a new buffer from `txt` with path and name `path`
|
||||||
func NewBuffer(txt []byte, path string) *Buffer {
|
func NewBuffer(txt []byte, path string) *Buffer {
|
||||||
for _, tab := range tabs {
|
if path != "" {
|
||||||
for _, view := range tab.views {
|
for _, tab := range tabs {
|
||||||
if view.Buf.Path == path {
|
for _, view := range tab.views {
|
||||||
return view.Buf
|
if view.Buf.Path == path {
|
||||||
|
return view.Buf
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user