Merge branch 'bug-endless-reload-prompt' of https://github.com/jawahars16/micro into jawahars16-bug-endless-reload-prompt

This commit is contained in:
Zachary Yedidia
2020-02-12 13:56:00 -05:00
2 changed files with 14 additions and 2 deletions

View File

@@ -75,6 +75,10 @@ type SharedBuffer struct {
// Type of the buffer (e.g. help, raw, scratch etc..)
Type BufType
// ReloadDisabled allows the user to disable reloads if they
// are viewing a file that is constantly changing
ReloadDisabled bool
isModified bool
// Whether or not suggestions can be autocompleted must be shared because
// it changes based on how the buffer has changed
@@ -103,6 +107,11 @@ func (b *SharedBuffer) remove(start, end Loc) []byte {
return b.LineArray.remove(start, end)
}
// DisableReload disables future reloads of this sharedbuffer
func (b *SharedBuffer) DisableReload() {
b.ReloadDisabled = true
}
const (
DSUnchanged = 0
DSAdded = 1