Fix buffer name problem

Fixes #458
This commit is contained in:
Zachary Yedidia
2016-11-19 19:07:51 -05:00
parent c692570212
commit 0fbae7610c
7 changed files with 15 additions and 11 deletions

View File

@@ -30,7 +30,7 @@ type Buffer struct {
// Absolute path to the file on disk
AbsPath string
// Name of the buffer on the status line
Name string
name string
// Whether or not the buffer has been modified since it was opened
IsModified bool
@@ -164,6 +164,13 @@ func NewBuffer(txt []byte, path string) *Buffer {
return b
}
func (b *Buffer) GetName() string {
if b.name == "" {
return b.Path
}
return b.name
}
// UpdateRules updates the syntax rules and filetype for this buffer
// This is called when the colorscheme changes
func (b *Buffer) UpdateRules() {