mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-24 09:47:19 +09:00
Skip save on open or term command if buffer is shared
This commit is contained in:
@@ -620,6 +620,16 @@ func (b *Buffer) WordAt(loc Loc) []byte {
|
||||
return b.Substr(start, end)
|
||||
}
|
||||
|
||||
// Shared returns if there are other buffers with the same file as this buffer
|
||||
func (b *Buffer) Shared() bool {
|
||||
for _, buf := range OpenBuffers {
|
||||
if buf != b && buf.SharedBuffer == b.SharedBuffer {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Modified returns if this buffer has been modified since
|
||||
// being opened
|
||||
func (b *Buffer) Modified() bool {
|
||||
|
||||
Reference in New Issue
Block a user