Mercurial > vim-gutentags
changeset 117:df3b0ca48013
Merge pull request #64 from GitHub.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 25 Mar 2016 20:41:38 -0700 |
parents | 563fbba43288 (diff) be8d47e88ab1 (current diff) |
children | 2838af9ff980 a66d90fd758b 8310e4602de9 76a4822aab76 e1f787e8d77c a2b75536fb7d |
files | autoload/gutentags/ctags.vim |
diffstat | 4 files changed, 27 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/autoload/gutentags.vim Thu Feb 25 02:02:03 2016 +0300 +++ b/autoload/gutentags.vim Fri Mar 25 20:41:38 2016 -0700 @@ -262,6 +262,7 @@ for module in g:gutentags_modules call s:update_tags(module, a:bang, 0) endfor + silent doautocmd User GutentagsUpdated endfunction " (Re)Generate the tags file for a buffer that just go saved. @@ -271,6 +272,7 @@ call s:update_tags(module, 0, 2) endfor endif + silent doautocmd User GutentagsUpdated endfunction " Update the tags file for the current buffer's file.
--- a/autoload/gutentags/ctags.vim Thu Feb 25 02:02:03 2016 +0300 +++ b/autoload/gutentags/ctags.vim Fri Mar 25 20:41:38 2016 -0700 @@ -199,13 +199,27 @@ let l:lines = readfile(a:path) let l:outlines = [] for line in l:lines - let l:exarg = matchend(line, '\v^\-\-exclude=') - if l:exarg < 0 + let l:exarg_idx = matchend(line, '\v^\-\-exclude=') + if l:exarg_idx < 0 call add(l:outlines, line) continue endif - let l:fullp = gutentags#normalizepath(l:proj_dir.'/'. - \strpart(line, l:exarg + 1)) + + " Don't convert things that don't look like paths. + let l:exarg = strpart(line, l:exarg_idx + 1) + let l:do_convert = 1 + if l:exarg[0] == '@' " Manifest file path + let l:do_convert = 0 + endif + if stridx(l:exarg, '/') < 0 && stridx(l:exarg, '\\') < 0 " Filename + let l:do_convert = 0 + endif + if l:do_convert == 0 + call add(l:outlines, line) + continue + endif + + let l:fullp = l:proj_dir . gutentags#normalizepath('/'.l:exarg) let l:ol = '--exclude='.l:fullp call add(l:outlines, l:ol) endfor
--- a/plat/unix/update_scopedb.sh Thu Feb 25 02:02:03 2016 +0300 +++ b/plat/unix/update_scopedb.sh Fri Mar 25 20:41:38 2016 -0700 @@ -47,7 +47,7 @@ echo $$ > "$DB_FILE.lock" # Remove lock and temp file if script is stopped unexpectedly. -trap "rm -f \"$DB_FILE.lock\" \"$DB_FILE.temp\"" 0 3 4 15 +trap 'rm -f "$DB_FILE.lock" "$DB_FILE.temp"' INT QUIT TERM EXIT PREVIOUS_DIR=$(pwd) if [ -d "$PROJECT_ROOT" ]; then
--- a/plat/unix/update_tags.sh Thu Feb 25 02:02:03 2016 +0300 +++ b/plat/unix/update_tags.sh Fri Mar 25 20:41:38 2016 -0700 @@ -20,14 +20,14 @@ echo " -p [dir=]: The path to the project root" echo " -s [file=]: The path to the source file that needs updating" echo " -x [pattern=]: A pattern of files to exclude" - echo " -o [options=]: An options file to read additional options from" + echo " -o [options=]: An options file to read additional options from" echo " -c: Ask for confirmation before exiting" echo "" } while getopts "h?e:x:t:p:s:o:c" opt; do - case $opt in + case $opt in h|\?) ShowUsage exit 0 @@ -67,13 +67,13 @@ echo $$ > "$TAGS_FILE.lock" # Remove lock and temp file if script is stopped unexpectedly. -trap "errorcode=$?; rm -f \"$TAGS_FILE.lock\" \"$TAGS_FILE.temp\"; exit $errorcode" INT TERM EXIT +trap 'errorcode=$?; rm -f "$TAGS_FILE.lock" "$TAGS_FILE.temp"; exit $errorcode' INT QUIT TERM EXIT INDEX_WHOLE_PROJECT=1 if [ -f "$TAGS_FILE" ]; then if [ "$UPDATED_SOURCE" != "" ]; then echo "Removing references to: $UPDATED_SOURCE" - echo "grep -v "$UPDATED_SOURCE" \"$TAGS_FILE\" > \"$TAGS_FILE.temp\"" + echo "grep -v \"$UPDATED_SOURCE\" \"$TAGS_FILE\" > \"$TAGS_FILE.temp\"" grep -v "$UPDATED_SOURCE" "$TAGS_FILE" > "$TAGS_FILE.temp" INDEX_WHOLE_PROJECT=0 fi @@ -99,6 +99,6 @@ echo "Done." if [ $PAUSE_BEFORE_EXIT -eq 1 ]; then - read -p "Press ENTER to exit..." + printf "Press ENTER to exit..." + read -r fi -