# HG changeset patch # User Ludovic Chabant # Date 1428638545 25200 # Node ID c0f56e4d52bd897bb4e70b2b76d03de1bf1e484d # Parent 64de69ca71950cb30fef88fe817a7eff08854fcc Make a bunch of advanced commands opt-in only. diff -r 64de69ca7195 -r c0f56e4d52bd autoload/gutentags.vim --- a/autoload/gutentags.vim Mon Mar 16 07:04:03 2015 -0700 +++ b/autoload/gutentags.vim Thu Apr 09 21:02:25 2015 -0700 @@ -277,6 +277,14 @@ endif endfunction +function! gutentags#delete_lock_files() abort + if exists('b:gutentags_files') + for tagfile in values(b:gutentags_files) + silent call delete(tagfile.'.lock') + endfor + endif +endfunction + function! gutentags#toggletrace(...) let g:gutentags_trace = !g:gutentags_trace if a:0 > 0 diff -r 64de69ca7195 -r c0f56e4d52bd doc/gutentags.txt --- a/doc/gutentags.txt Mon Mar 16 07:04:03 2015 -0700 +++ b/doc/gutentags.txt Thu Apr 09 21:02:25 2015 -0700 @@ -134,7 +134,8 @@ current buffer. -Some debugging/troubleshooting commands are also available. +Some debugging/troubleshooting commands are also available if the +|gutentags_define_advanced_commands| global setting is set to 1. *:GutentagsToggleEnabled* :GutentagsToggleEnabled @@ -307,5 +308,10 @@ project. This is handy to keep tags files from polluting many directories all across your computer. + *gutentags_define_advanced_commands* +g:gutentags_define_advanced_commands + Defines some advanced commands like + |GutentagsToggleEnabled| and |GutentagsUnlock|. + vim:tw=78:et:ft=help:norl: diff -r 64de69ca7195 -r c0f56e4d52bd plugin/gutentags.vim --- a/plugin/gutentags.vim Mon Mar 16 07:04:03 2015 -0700 +++ b/plugin/gutentags.vim Thu Apr 09 21:02:25 2015 -0700 @@ -67,6 +67,10 @@ let g:gutentags_cache_dir = fnamemodify(g:gutentags_cache_dir, ':s?[/\\]$??') endif +if !exists('g:gutentags_define_advanced_commands') + let g:gutentags_define_advanced_commands = 0 +endif + if g:gutentags_cache_dir != '' && !isdirectory(g:gutentags_cache_dir) call mkdir(g:gutentags_cache_dir, 'p') endif @@ -93,15 +97,12 @@ " Toggles and Miscellaneous Commands {{{ -function! s:delete_lock_files() abort - for tagfile in values(b:gutentags_files) - silent call delete(tagfile.'.lock') - endfor -endfunction +command! GutentagsUnlock :call gutentags#delete_lock_files() -command! GutentagsToggleEnabled :let g:gutentags_enabled=!g:gutentags_enabled -command! GutentagsToggleTrace :call gutentags#trace() -command! GutentagsUnlock :call s:delete_lock_files() +if g:gutentags_define_advanced_commands + command! GutentagsToggleEnabled :let g:gutentags_enabled=!g:gutentags_enabled + command! GutentagsToggleTrace :call gutentags#trace() +endif if g:gutentags_debug command! GutentagsToggleFake :call gutentags#fake()