From 467519375d6b462bb28e2e1d490fa634a0bd7c69 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Sun, 15 Jan 2012 01:45:56 +0100 Subject: Bug fix: Sort tags files properly by folding to uppercase (issue #25) --- autoload/xolox/easytags.vim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'autoload') 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 -" 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 -- cgit v1.2.3