From bdf4ec3ff860485abff14ca8fc15511ea75f4186 Mon Sep 17 00:00:00 2001 From: Sam Lidder Date: Wed, 19 Oct 2011 22:36:39 -0400 Subject: [PATCH] Added test to only use str2float if compiled with +float --- autoload/indent_guides.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/autoload/indent_guides.vim b/autoload/indent_guides.vim index e048ac0..422a2ee 100644 --- a/autoload/indent_guides.vim +++ b/autoload/indent_guides.vim @@ -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