Added test to only use str2float if compiled with +float

This commit is contained in:
Sam Lidder 2011-10-19 22:36:39 -04:00
parent 6854275667
commit bdf4ec3ff8

View File

@ -182,12 +182,18 @@ function! indent_guides#init_script_vars()
let s:debug = g:indent_guides_debug
let s:indent_levels = g:indent_guides_indent_levels
let s:auto_colors = g:indent_guides_auto_colors
let s:change_percent = g:indent_guides_color_change_percent / str2float("100.0")
let s:color_hex_pat = g:indent_guides_color_hex_pattern
let s:color_hex_bg_pat = g:indent_guides_color_hex_guibg_pattern
let s:color_name_bg_pat = g:indent_guides_color_name_guibg_pattern
let s:start_level = g:indent_guides_start_level
" str2float not available in vim versions <= 7.1
if has('float')
let s:change_percent = g:indent_guides_color_change_percent / str2float('100.0')
else
let s:change_percent = g:indent_guides_color_change_percent / 100.0
endif
if s:debug
echo 's:indent_size = ' . s:indent_size
echo 's:guide_size = ' . s:guide_size