summaryrefslogtreecommitdiff
path: root/runtime/plugin
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-07-11 22:38:52 +0200
committerBram Moolenaar <Bram@vim.org>2010-07-11 22:38:52 +0200
commitb02cbe34686b913e70a64969c0a92998c7872009 (patch)
tree8a929235b33547b020df1b5dd71d7d921a9ca309 /runtime/plugin
parent69f787af848f4c1271d331a2ae541267fa1404fa (diff)
downloadvim-git-b02cbe34686b913e70a64969c0a92998c7872009.tar.gz
When the buffer is in diff mode, have :TOhtml create HTML to show the diff
side-by-side. (Christian Brabandt)
Diffstat (limited to 'runtime/plugin')
-rw-r--r--runtime/plugin/tohtml.vim32
1 files changed, 9 insertions, 23 deletions
diff --git a/runtime/plugin/tohtml.vim b/runtime/plugin/tohtml.vim
index 9914bed6d..a764b2299 100644
--- a/runtime/plugin/tohtml.vim
+++ b/runtime/plugin/tohtml.vim
@@ -1,27 +1,13 @@
" Vim plugin for converting a syntax highlighted file to HTML.
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2003 Apr 06
-
-" Don't do this when:
-" - when 'compatible' is set
-" - this plugin was already loaded
-" - user commands are not available.
+" Last Change: 2010 Jul 11
+"
+" The core of the code is in $VIMRUNTIME/autoload/tohtml.vim
+
+" Define the :TOhtml command when:
+" - 'compatible' is not set
+" - this plugin was not already loaded
+" - user commands are available.
if !&cp && !exists(":TOhtml") && has("user_commands")
- command -range=% TOhtml :call Convert2HTML(<line1>, <line2>)
-
- func Convert2HTML(line1, line2)
- if a:line2 >= a:line1
- let g:html_start_line = a:line1
- let g:html_end_line = a:line2
- else
- let g:html_start_line = a:line2
- let g:html_end_line = a:line1
- endif
-
- runtime syntax/2html.vim
-
- unlet g:html_start_line
- unlet g:html_end_line
- endfunc
-
+ command -range=% TOhtml :call tohtml#Convert2HTML(<line1>, <line2>)
endif