|
1 | 1 | " File: taglist.vim
|
2 | 2 | " Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
|
3 |
| -" Version: 4.3 |
4 |
| -" Last Modified: February 18, 2007 |
5 |
| -" Copyright: Copyright (C) 2002-2006 Yegappan Lakshmanan |
| 3 | +" Version: 4.4 |
| 4 | +" Last Modified: May 24, 2007 |
| 5 | +" Copyright: Copyright (C) 2002-2007 Yegappan Lakshmanan |
6 | 6 | " Permission is hereby granted to use and distribute this code,
|
7 | 7 | " with or without modifications, provided that this copyright
|
8 | 8 | " notice is copied with it. Like anything else that's free,
|
@@ -1662,7 +1662,7 @@ function! s:Tlist_Window_Init()
|
1662 | 1662 | " Close the fold for this buffer when leaving the buffer
|
1663 | 1663 | if g:Tlist_File_Fold_Auto_Close
|
1664 | 1664 | autocmd BufEnter * silent
|
1665 |
| - \ call s:Tlist_Window_Open_File_Fold(expand('<afile>')) |
| 1665 | + \ call s:Tlist_Window_Open_File_Fold(expand('<abuf>')) |
1666 | 1666 | endif
|
1667 | 1667 | " Exit Vim itself if only the taglist window is present (optional)
|
1668 | 1668 | if g:Tlist_Exit_OnlyWindow
|
@@ -4012,8 +4012,8 @@ autocmd BufDelete * silent call s:Tlist_Buffer_Removed(expand('<afile>:p'))
|
4012 | 4012 | " Tlist_Window_Open_File_Fold
|
4013 | 4013 | " Open the fold for the specified file and close the fold for all the
|
4014 | 4014 | " other files
|
4015 |
| -function! s:Tlist_Window_Open_File_Fold(acmd_file) |
4016 |
| - call s:Tlist_Log_Msg('Tlist_Window_Open_File_Fold (' . a:acmd_file . ')') |
| 4015 | +function! s:Tlist_Window_Open_File_Fold(acmd_bufnr) |
| 4016 | + call s:Tlist_Log_Msg('Tlist_Window_Open_File_Fold (' . a:acmd_bufnr . ')') |
4017 | 4017 |
|
4018 | 4018 | " Make sure the taglist window is present
|
4019 | 4019 | let winnum = bufwinnr(g:TagList_title)
|
@@ -4044,7 +4044,7 @@ function! s:Tlist_Window_Open_File_Fold(acmd_file)
|
4044 | 4044 | silent! %foldclose
|
4045 | 4045 |
|
4046 | 4046 | " Get tag list index of the specified file
|
4047 |
| - let fname = fnamemodify(a:acmd_file, ":p") |
| 4047 | + let fname = fnamemodify(bufname(a:acmd_bufnr + 0), ':p') |
4048 | 4048 | if filereadable(fname)
|
4049 | 4049 | let fidx = s:Tlist_Get_File_Index(fname)
|
4050 | 4050 | if fidx != -1
|
@@ -4251,12 +4251,6 @@ function! s:Tlist_Menu_Update_File(clear_menu)
|
4251 | 4251 |
|
4252 | 4252 | endif
|
4253 | 4253 |
|
4254 |
| - let fname = escape(fnamemodify(bufname('%'), ':t'), '.') |
4255 |
| - if fname != '' |
4256 |
| - exe 'anoremenu T&ags.' . fname . ' <Nop>' |
4257 |
| - anoremenu T&ags.-SEP2- : |
4258 |
| - endif |
4259 |
| - |
4260 | 4254 | " Skip buffers with 'buftype' set to nofile, nowrite, quickfix or help
|
4261 | 4255 | if &buftype != ''
|
4262 | 4256 | return
|
@@ -4285,6 +4279,12 @@ function! s:Tlist_Menu_Update_File(clear_menu)
|
4285 | 4279 | endif
|
4286 | 4280 | endif
|
4287 | 4281 |
|
| 4282 | + let fname = escape(fnamemodify(bufname('%'), ':t'), '.') |
| 4283 | + if fname != '' |
| 4284 | + exe 'anoremenu T&ags.' . fname . ' <Nop>' |
| 4285 | + anoremenu T&ags.-SEP2- : |
| 4286 | + endif |
| 4287 | + |
4288 | 4288 | if !s:tlist_{fidx}_tag_count
|
4289 | 4289 | return
|
4290 | 4290 | endif
|
|
0 commit comments