# HG changeset patch # User Bram Moolenaar # Date 1281038040 -7200 # Node ID a29075150aee2d64d2139d8f7b8ae0afcea79488 # Parent a847363bf06ef9c3aa54dbc853640537103dd75b Improve handling of user settings in :TOhtml. Default to generating CSS. (Benjamin Fritz) diff --git a/runtime/autoload/tohtml.vim b/runtime/autoload/tohtml.vim --- a/runtime/autoload/tohtml.vim +++ b/runtime/autoload/tohtml.vim @@ -1,6 +1,6 @@ " Vim autoload file for the tohtml plugin. " Maintainer: Ben Fritz -" Last Change: 2010 Jul 29 +" Last Change: 2010 Aug 02 " " Additional contributors: " @@ -14,9 +14,9 @@ let s:cpo_sav = &cpo set cpo-=C func! tohtml#Convert2HTML(line1, line2) - let old_vals = tohtml#OverrideUserSettings() + let s:settings = tohtml#GetUserSettings() - if !&diff || exists("g:html_diff_one_file") + if !&diff || s:settings.diff_one_file if a:line2 >= a:line1 let g:html_start_line = a:line1 let g:html_end_line = a:line2 @@ -29,8 +29,7 @@ func! tohtml#Convert2HTML(line1, line2) let win_list = [] let buf_list = [] windo | if &diff | call add(win_list, winbufnr(0)) | endif - let save_hwf = exists("g:html_whole_filler") - let g:html_whole_filler = 1 + let s:settings.whole_filler = 1 let g:html_diff_win_num = 0 for window in win_list exe ":" . bufwinnr(window) . "wincmd w" @@ -41,16 +40,12 @@ func! tohtml#Convert2HTML(line1, line2) call add(buf_list, bufnr('%')) endfor unlet g:html_diff_win_num - if !save_hwf - unlet g:html_whole_filler - endif call tohtml#Diff2HTML(win_list, buf_list) endif - call tohtml#RestoreUserSettings(old_vals) - unlet g:html_start_line unlet g:html_end_line + unlet s:settings endfunc func! tohtml#Diff2HTML(win_list, buf_list) @@ -175,7 +170,7 @@ func! tohtml#Diff2HTML(win_list, buf_lis " Insert javascript to toggle matching folds open and closed in all windows, " if dynamic folding is active. - if exists("g:html_dynamic_folds") + if s:settings.dynamic_folds call append(style_start, [ \ "