diff options
Diffstat (limited to 'editor/buffer.go')
-rw-r--r-- | editor/buffer.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/editor/buffer.go b/editor/buffer.go index 503cf02..9b7444a 100644 --- a/editor/buffer.go +++ b/editor/buffer.go @@ -110,6 +110,11 @@ func (b *Buffer) ReadFile() error { return nil } +// IsDir returns true if the type of the this buffer is a directory listing. +func (b *Buffer) IsDir() bool { + return b.what == BufferDir +} + // SaveFile writes content of buffer to its filename. func (b *Buffer) SaveFile() (int, error) { b.initBuffer() @@ -176,9 +181,6 @@ func (b *Buffer) Name() string { return "" } s, _ := filepath.Abs(b.file.name) - if b.what == BufferDir { - s += string(filepath.Separator) - } return s } |