From 31445645f70cafdb9f6ab24d88c205038c6f90ef Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sat, 28 Jun 2008 21:35:22 +1200 Subject: [PATCH] truncate the bookmark path if its too long --- plugin/NERD_tree.vim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 71fd65d..311eb18 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -2290,12 +2290,20 @@ endfunction "FUNCTION: s:RenderBookmarks {{{2 function! s:RenderBookmarks() - call setline(line(".")+1, ">---------Bookmarks---------") + call setline(line(".")+1, ">----------Bookmarks----------") call cursor(line(".")+1, col(".")) let bookmarks = s:GetBookmarks() for i in keys(bookmarks) - call setline(line(".")+1,'>' . i . ' [' . bookmarks[i].StrForOS(0) . ']') + + let pathStrMaxLen = 26 - len(i) + let pathStr = bookmarks[i].StrForOS(0) + if len(pathStr) > pathStrMaxLen + let pathStr = '<' . strpart(pathStr, len(pathStr) - pathStrMaxLen) + endif + + "call setline(line(".")+1,'>' . i . ' [' . bookmarks[i].StrForOS(0) . ']') + call setline(line(".")+1,'>' . i . ' [' . pathStr . ']') call cursor(line(".")+1, col(".")) endfor