display bookmarks without the surrounding [ ]

This commit is contained in:
Martin Grenfell
2008-08-31 20:57:37 +12:00
parent 4f0a39159a
commit 927aebfa8b

View File

@@ -339,7 +339,7 @@ endfunction
" Function: oBookmark.Str() {{{3 " Function: oBookmark.Str() {{{3
" Get the string that should be rendered in the view for this bookmark " Get the string that should be rendered in the view for this bookmark
function! s:oBookmark.Str() dict function! s:oBookmark.Str() dict
let pathStrMaxLen = winwidth(s:GetTreeWinNum()) - 5 - len(self.name) let pathStrMaxLen = winwidth(s:GetTreeWinNum()) - 4 - len(self.name)
if &nu if &nu
let pathStrMaxLen = pathStrMaxLen - &numberwidth let pathStrMaxLen = pathStrMaxLen - &numberwidth
endif endif
@@ -348,7 +348,7 @@ function! s:oBookmark.Str() dict
if len(pathStr) > pathStrMaxLen if len(pathStr) > pathStrMaxLen
let pathStr = '<' . strpart(pathStr, len(pathStr) - pathStrMaxLen) let pathStr = '<' . strpart(pathStr, len(pathStr) - pathStrMaxLen)
endif endif
return '>' . self.name . ' [' . pathStr . ']' return '>' . self.name . ' ' . pathStr
endfunction endfunction
" Function: oBookmark.Write() {{{3 " Function: oBookmark.Write() {{{3
" Class method to write all bookmarks to the bookmarks file " Class method to write all bookmarks to the bookmarks file
@@ -2199,7 +2199,7 @@ endfunction
"nodes parent "nodes parent
function! s:GetSelectedBookmark() function! s:GetSelectedBookmark()
let line = getline(".") let line = getline(".")
let name = substitute(line, '^>\(.\{-}\) \[.*\]$', '\1', '') let name = substitute(line, '^>\(.\{-}\) .\+$', '\1', '')
if name != line if name != line
try try
return s:oBookmark.BookmarkFor(name) return s:oBookmark.BookmarkFor(name)