diff --git a/ftplugin/cctree.vim b/ftplugin/cctree.vim index 2d3a1ad..c256657 100644 --- a/ftplugin/cctree.vim +++ b/ftplugin/cctree.vim @@ -16,8 +16,8 @@ " Description: C Call-Tree Explorer Vim Plugin " Maintainer: Hari Rangarajan " URL: http://vim.sourceforge.net/scripts/script.php?script_id=2368 -" Last Change: September 28, 2008 -" Version: 0.4 +" Last Change: October 6, 2008 +" Version: 0.41 " "============================================================================= " @@ -134,6 +134,10 @@ " " History: " +" Version 0.41: October 6, 2008 +" 1. Minor fix: Compressed cscope databases will load +" incorrectly if encoding is not 8-bit +" " Version 0.4: September 28, 2008 " 1. Rewrite of "tree-display" code " 2. New syntax hightlighting @@ -357,9 +361,8 @@ function! s:CCTreeLoadDB(db_name) call filter(symbols, 'v:val =~ "^\t[`#$}]"') if s:dbcompressed == 1 - let compressdict = s:Digraph_DictTable_Init() call s:CCTreeBusyStatusLineUpdate('Uncompressing database') - call map(symbols, 's:Digraph_Uncompress_Fast(v:val, compressdict)') + call s:Digraph_Uncompress(symbols) endif let s:symcount = len(symbols) @@ -941,6 +944,18 @@ function! s:Digraph_Uncompress_Fast (value, dicttable) endfunction +function! s:Digraph_Uncompress (symlist) + let compressdict = s:Digraph_DictTable_Init() + +" The encoding needs to be changed to 8-bit, otherwise we can't swap special +" 8-bit characters; restore after done + let encoding_save=&encoding + let &encoding="latin1" + call map(a:symlist, 's:Digraph_Uncompress_Fast(v:val, compressdict)') + let &encoding=encoding_save +endfunction + + function! s:Digraph_Compress(value, dicttable) let index = 0 let retval = ""