Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Version 0.41
(Minor fix) Compressed cscope databases will load incorrectly if encoding is not 8-bit
  • Loading branch information
hari-rangarajan authored and vim-scripts committed Feb 20, 2011
1 parent 85f4245 commit e18e910
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions ftplugin/cctree.vim
Expand Up @@ -16,8 +16,8 @@
" Description: C Call-Tree Explorer Vim Plugin
" Maintainer: Hari Rangarajan <hari.rangarajan@gmail.com>
" 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
"
"=============================================================================
"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 = ""
Expand Down

0 comments on commit e18e910

Please sign in to comment.