"io/ioutil"
"log"
"os"
+ "path"
"path/filepath"
"strconv"
"strings"
// GetName returns the name that should be displayed in the statusline
// for this buffer
func (b *Buffer) GetName() string {
- if b.name == "" {
+ name := b.name
+ if name == "" {
if b.Path == "" {
return "No name"
}
- return b.Path
+ name = b.Path
}
- return b.name
+ if b.Settings["basename"].(bool) {
+ return path.Base(name)
+ }
+ return name
}
//SetName changes the name for this buffer
import (
"bytes"
"fmt"
- "path"
"regexp"
"strconv"
"strings"
var statusInfo = map[string]func(*buffer.Buffer) string{
"filename": func(b *buffer.Buffer) string {
- if b.Settings["basename"].(bool) {
- return path.Base(b.GetName())
- }
return b.GetName()
},
"line": func(b *buffer.Buffer) string {
default value: `true`
-* `basename`: in the infobar, show only the basename of the file being edited
- rather than the full path.
+* `basename`: in the infobar and tabbar, show only the basename of the file
+ being edited rather than the full path.
default value: `false`