Skip to content

Commit

Permalink
Bug fix: Sort tags files properly by folding to uppercase (issue #25)
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Jan 15, 2012
1 parent 31d1e15 commit 4675193
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions 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

Expand Down Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 4675193

Please sign in to comment.