diff options
author | Peter Odding <peter@peterodding.com> | 2012-01-15 01:45:56 +0100 |
---|---|---|
committer | Peter Odding <peter@peterodding.com> | 2012-01-15 01:45:56 +0100 |
commit | 467519375d6b462bb28e2e1d490fa634a0bd7c69 (patch) | |
tree | a296d8372423202a8e726ee00e469876d8b8fdde | |
parent | 31d1e15a94dcafc26b9ba98e42acc13fbf4d0b01 (diff) | |
download | vim-easytags-467519375d6b462bb28e2e1d490fa634a0bd7c69.tar.gz |
Bug fix: Sort tags files properly by folding to uppercase (issue #25)
-rw-r--r-- | autoload/xolox/easytags.vim | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim index 7229a1c..7f9f465 100644 --- a/autoload/xolox/easytags.vim +++ b/autoload/xolox/easytags.vim @@ -1,9 +1,9 @@ " Vim script " Author: Peter Odding <peter@peterodding.com> -" Last Change: January 6, 2012 +" Last Change: January 15, 2012 " URL: http://peterodding.com/code/vim/easytags/ -let g:xolox#easytags#version = '2.7.6' +let g:xolox#easytags#version = '2.8' " Public interface through (automatic) commands. {{{1 @@ -489,7 +489,7 @@ function! xolox#easytags#write_tagsfile(tagsfile, headers, entries) " {{{2 if sort_order == 1 call sort(a:entries) else - call sort(a:entries, 1) + call sort(a:entries, function('s:foldcase_compare')) endif let lines = [] if xolox#misc#os#is_win() @@ -512,6 +512,12 @@ function! s:join_entry(value) return type(a:value) == type([]) ? join(a:value, "\t") : a:value endfunction +function! s:foldcase_compare(a, b) + let a = toupper(a:a) + let b = toupper(a:b) + return a == b ? 0 : a ># b ? 1 : -1 +endfunction + function! xolox#easytags#file_has_tags(filename) " {{{2 " Check whether the given source file occurs in one of the tags files known " to Vim. This function might not always give the right answer because of |