view release on metacpan or search on metacpan
contrib/vim/taglist.vim view on Meta::CPAN
finish
endif
endif
" Automatically open the taglist window on Vim startup
if !exists('Tlist_Auto_Open')
let Tlist_Auto_Open = 0
endif
" When the taglist window is toggle opened, move the cursor to the
" taglist window
if !exists('Tlist_GainFocus_On_ToggleOpen')
let Tlist_GainFocus_On_ToggleOpen = 0
endif
" Process files even when the taglist window is not open
if !exists('Tlist_Process_File_Always')
let Tlist_Process_File_Always = 0
endif
contrib/vim/taglist.vim view on Meta::CPAN
let s:tlist_def_zsh_settings = 'sh;f:function'
" slang language
let s:tlist_def_slang_settings = 'slang;n:namespace;f:function'
" sml language
let s:tlist_def_sml_settings = 'sml;e:exception;c:functor;s:signature;' .
\ 'r:structure;t:type;v:value;f:function'
" sql language
let s:tlist_def_sql_settings = 'sql;c:cursor;F:field;P:package;r:record;' .
\ 's:subtype;t:table;T:trigger;v:variable;f:function;p:procedure'
" tcl language
let s:tlist_def_tcl_settings = 'tcl;c:class;f:method;m:method;p:procedure'
" vera language
let s:tlist_def_vera_settings = 'vera;c:class;d:macro;e:enumerator;' .
\ 'f:function;g:enum;m:member;p:program;' .
\ 'P:prototype;t:task;T:typedef;v:variable;' .
\ 'x:externvar'
contrib/vim/taglist.vim view on Meta::CPAN
call s:Tlist_Warning_Msg('Taglist: No debug messages')
return
endif
" Open a new window to display the taglist debug messages
new taglist_debug.txt
" Delete all the lines (if the buffer already exists)
silent! %delete _
" Add the messages
silent! put =s:tlist_msg
" Move the cursor to the first line
normal! gg
endfunction
" Tlist_Log_Msg
" Log the supplied debug message along with the time
function! s:Tlist_Log_Msg(msg)
if s:tlist_debug
if s:tlist_debug_file != ''
exe 'redir >> ' . s:tlist_debug_file
silent echon strftime('%H:%M:%S') . ': ' . a:msg . "\n"
contrib/vim/taglist.vim view on Meta::CPAN
setlocal modifiable
exe 'silent! ' . start . ',' . end . 'delete _'
setlocal nomodifiable
" Correct the start and end line offsets for all the files following
" this file, as the tags for this file are removed
call s:Tlist_Window_Update_Line_Offsets(a:fidx + 1, 0, end - start + 1)
endfunction
" Tlist_Remove_File
" Remove the file under the cursor or the specified file index
" user_request - User requested to remove the file from taglist
function! s:Tlist_Remove_File(file_idx, user_request)
let fidx = a:file_idx
if fidx == -1
let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.'))
if fidx == -1
return
endif
endif
contrib/vim/taglist.vim view on Meta::CPAN
if g:Tlist_Use_Horiz_Window
resize
else
vert resize
endif
let s:tlist_win_maximized = 1
endif
endfunction
" Tlist_Ballon_Expr
" When the mouse cursor is over a tag in the taglist window, display the
" tag prototype (balloon)
function! Tlist_Ballon_Expr()
" Get the file index
let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(v:beval_lnum)
if fidx == -1
return ''
endif
" Get the tag output line for the current tag
let tidx = s:Tlist_Window_Get_Tag_Index(fidx, v:beval_lnum)
contrib/vim/taglist.vim view on Meta::CPAN
\ maparg('<leftmouse>', 'n'), '|', '<bar>', 'g'),
\ '\c^<leftmouse>', '', '')
let mapcmd = mapcmd . clickmap
exe mapcmd
endif
endif
" Define the taglist autocommands
augroup TagListAutoCmds
autocmd!
" Display the tag prototype for the tag under the cursor.
autocmd CursorHold __Tag_List__ call s:Tlist_Window_Show_Info()
" Highlight the current tag periodically
autocmd CursorHold * silent call s:Tlist_Window_Highlight_Tag(
\ fnamemodify(bufname('%'), ':p'), line('.'), 1, 0)
" Adjust the Vim window width when taglist window is closed
autocmd BufUnload __Tag_List__ call s:Tlist_Post_Close_Cleanup()
" Close the fold for this buffer when leaving the buffer
if g:Tlist_File_Fold_Auto_Close
autocmd BufEnter * silent
contrib/vim/taglist.vim view on Meta::CPAN
let i = i + 1
endwhile
endif
" If Tlist_File_Fold_Auto_Close option is set, then close all the folds
if g:Tlist_File_Fold_Auto_Close
" Close all the folds
silent! %foldclose
endif
" Move the cursor to the top of the taglist window
normal! gg
endfunction
" Tlist_Post_Close_Cleanup()
" Close the taglist window and adjust the Vim window width
function! s:Tlist_Post_Close_Cleanup()
call s:Tlist_Log_Msg('Tlist_Post_Close_Cleanup()')
" Mark all the files as not visible
let i = 0
while i < s:tlist_file_count
contrib/vim/taglist.vim view on Meta::CPAN
endif
silent! put =ttype_txt
let {fidx_ttype}_offset = ttype_start_lnum - file_start
" create a fold for this tag type
let fold_start = ttype_start_lnum
let fold_end = fold_start + {fidx_ttype}_count
exe fold_start . ',' . fold_end . 'fold'
" Adjust the cursor position
if g:Tlist_Compact_Format == 0
exe ttype_start_lnum + {fidx_ttype}_count
else
exe ttype_start_lnum + {fidx_ttype}_count + 1
endif
if g:Tlist_Compact_Format == 0
" Separate the tag types by a empty line
silent! put =''
endif
contrib/vim/taglist.vim view on Meta::CPAN
return
endif
endif
" Save the current window number
let save_winnr = winnr()
" Goto the taglist window
call s:Tlist_Window_Goto_Window()
" Save the cursor position
let save_line = line('.')
let save_col = col('.')
" Update the taglist window
call s:Tlist_Window_Refresh_File(fname, a:ftype)
" Restore the cursor position
if v:version >= 601
call cursor(save_line, save_col)
else
exe save_line
exe 'normal! ' . save_col . '|'
endif
if winnr() != save_winnr
" Go back to the original window
call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w')
endif
endif
contrib/vim/taglist.vim view on Meta::CPAN
let old_lazyredraw = &lazyredraw
set nolazyredraw
" Save the current window number
let save_winnr = winnr()
" Goto the taglist window
call s:Tlist_Window_Goto_Window()
if !g:Tlist_Auto_Highlight_Tag || !g:Tlist_Highlight_Tag_On_BufEnter
" Save the cursor position
let save_line = line('.')
let save_col = col('.')
endif
" Update the taglist window
call s:Tlist_Window_Refresh_File(filename, ftype)
" Open the fold for the file
exe "silent! " . s:tlist_{fidx}_start . "," .
\ s:tlist_{fidx}_end . "foldopen!"
contrib/vim/taglist.vim view on Meta::CPAN
" window and about to display the tags for a new file,
" then center the current tag line for the new file
let center_tag_line = 1
else
let center_tag_line = 0
endif
" Highlight the current tag
call s:Tlist_Window_Highlight_Tag(filename, cur_lnum, 1, center_tag_line)
else
" Restore the cursor position
if v:version >= 601
call cursor(save_line, save_col)
else
exe save_line
exe 'normal! ' . save_col . '|'
endif
endif
" Jump back to the original window
if save_winnr != winnr()
call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w')
endif
contrib/vim/taglist.vim view on Meta::CPAN
if a:caller == 'cmd'
" Save the current line for later restoration
let curline = '\V\^' . getline('.') . '\$'
call s:Tlist_Window_Refresh_File(s:tlist_{fidx}_filename,
\ s:tlist_{fidx}_filetype)
exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'foldopen!'
" Go back to the cursor line before the tag list is sorted
call search(curline, 'w')
call s:Tlist_Menu_Update_File(1)
else
call s:Tlist_Menu_Remove_File()
call s:Tlist_Refresh()
endif
endfunction
contrib/vim/taglist.vim view on Meta::CPAN
let pat = '/\%' . line('.') . 'l\s\+\zs.*/'
else
let pat = '/\%' . line('.') . 'l.*/'
endif
exe 'match TagListTagName ' . pat
endfunction
" Tlist_Window_Open_File
" Open the specified file in either a new window or an existing window
" and place the cursor at the specified tag pattern
function! s:Tlist_Window_Open_File(win_ctrl, filename, tagpat)
call s:Tlist_Log_Msg('Tlist_Window_Open_File (' . a:filename . ',' .
\ a:win_ctrl . ')')
let prev_Tlist_Skip_Refresh = s:Tlist_Skip_Refresh
let s:Tlist_Skip_Refresh = 1
if s:tlist_app_name == "winmanager"
" Let the winmanager edit the file
call WinManagerFileEdit(a:filename, a:win_ctrl == 'newwin')
else
contrib/vim/taglist.vim view on Meta::CPAN
" If the user asked to jump to the tag in a new window, then split the
" existing window into two.
if a:win_ctrl == 'newwin'
split
endif
endif
endif
" Jump to the tag
if a:tagpat != ''
" Add the current cursor position to the jump list, so that user can
" jump back using the ' and ` marks.
mark '
silent call search(a:tagpat, 'w')
" Bring the line to the middle of the window
normal! z.
" If the line is inside a fold, open the fold
if foldclosed('.') != -1
.foldopen
contrib/vim/taglist.vim view on Meta::CPAN
call s:Tlist_Window_Highlight_Line()
else
" Selected a line which is not a tag name. Just edit the file
let tagpat = ''
endif
call s:Tlist_Window_Open_File(a:win_ctrl, s:tlist_{fidx}_filename, tagpat)
endfunction
" Tlist_Window_Show_Info()
" Display information about the entry under the cursor
function! s:Tlist_Window_Show_Info()
call s:Tlist_Log_Msg('Tlist_Window_Show_Info()')
" Clear the previously displayed line
echo
" Do not process comment lines and empty lines
let curline = getline('.')
if curline =~ '^\s*$' || curline[0] == '"'
return
contrib/vim/taglist.vim view on Meta::CPAN
match none
let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, a:cur_lnum)
if tidx == -1
" Make sure the current tag line is visible in the taglist window.
" Calling the winline() function makes the line visible. Don't know
" of a better way to achieve this.
let lnum = line('.')
if lnum < s:tlist_{fidx}_start || lnum > s:tlist_{fidx}_end
" Move the cursor to the beginning of the file
exe s:tlist_{fidx}_start
endif
if foldclosed('.') != -1
.foldopen
endif
call winline()
if !in_taglist_window
contrib/vim/taglist.vim view on Meta::CPAN
" Get the tag name using the line number
let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, linenr)
if tidx == -1
return ""
endif
return s:tlist_{fidx}_{tidx}_tag_name
endfunction
" Tlist_Window_Move_To_File
" Move the cursor to the beginning of the current file or the next file
" or the previous file in the taglist window
" dir == -1, move to start of current or previous function
" dir == 1, move to start of next function
function! s:Tlist_Window_Move_To_File(dir)
if foldlevel('.') == 0
" Cursor is on a non-folded line (it is not in any of the files)
" Move it to a folded line
if a:dir == -1
normal! zk
else
contrib/vim/taglist.vim view on Meta::CPAN
let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p'))
if fidx == -1
return
endif
let tagpat = s:Tlist_Get_Tag_SearchPat(fidx, a:tidx)
if tagpat == ''
return
endif
" Add the current cursor position to the jump list, so that user can
" jump back using the ' and ` marks.
mark '
silent call search(tagpat, 'w')
" Bring the line to the middle of the window
normal! z.
" If the line is inside a fold, open the fold
if foldclosed('.') != -1