1
0
forked from aniani/vim

Update runtime files.

This commit is contained in:
Bram Moolenaar
2018-11-16 16:13:44 +01:00
parent 0c27cbcacf
commit f0d58efc9d
23 changed files with 812 additions and 706 deletions

View File

@@ -1,6 +1,6 @@
" Vim autoload file for the tohtml plugin.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2013 Sep 03
" Last Change: 2018 Nov 11
"
" Additional contributors:
"
@@ -544,12 +544,16 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
" add required javascript in reverse order so we can just call append again
" and again without adjusting {{{
" insert script closing tag
call append(style_start, [
\ '',
\ s:settings.use_xhtml ? '//]]>' : '-->',
\ "</script>"
\ ])
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids || !empty(s:settings.prevent_copy)
" insert script closing tag if needed
if s:uses_script
call append(style_start, [
\ '',
\ s:settings.use_xhtml ? '//]]>' : '-->',
\ "</script>"
\ ])
endif
" insert script which corrects the size of small input elements in
" prevent_copy mode. See 2html.vim for details on why this is needed and how
@@ -575,55 +579,61 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
\ '}'
\ ])
endif
"
" insert javascript to get IDs from line numbers, and to open a fold before
" jumping to any lines contained therein
call append(style_start, [
\ " /* Always jump to new location even if the line was hidden inside a fold, or",
\ " * we corrected the raw number to a line ID.",
\ " */",
\ " if (lineElem) {",
\ " lineElem.scrollIntoView(true);",
\ " }",
\ " return true;",
\ "}",
\ "if ('onhashchange' in window) {",
\ " window.onhashchange = JumpToLine;",
\ "}"
\ ])
if s:settings.dynamic_folds
if s:settings.line_ids
call append(style_start, [
\ " /* Always jump to new location even if the line was hidden inside a fold, or",
\ " * we corrected the raw number to a line ID.",
\ " */",
\ " if (lineElem) {",
\ " lineElem.scrollIntoView(true);",
\ " }",
\ " return true;",
\ "}",
\ "if ('onhashchange' in window) {",
\ " window.onhashchange = JumpToLine;",
\ "}"
\ ])
if s:settings.dynamic_folds
call append(style_start, [
\ "",
\ " /* navigate upwards in the DOM tree to open all folds containing the line */",
\ " var node = lineElem;",
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
\ " {",
\ " if (node.className == 'closed-fold')",
\ " {",
\ " /* toggle open the fold ID (remove window ID) */",
\ " toggleFold(node.id.substr(4));",
\ " }",
\ " node = node.parentNode;",
\ " }",
\ ])
endif
endif
if s:settings.line_ids
call append(style_start, [
\ "",
\ " /* navigate upwards in the DOM tree to open all folds containing the line */",
\ " var node = lineElem;",
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
\ " {",
\ " if (node.className == 'closed-fold')",
\ " {",
\ " /* toggle open the fold ID (remove window ID) */",
\ " toggleFold(node.id.substr(4));",
\ " }",
\ " node = node.parentNode;",
\ "/* function to open any folds containing a jumped-to line before jumping to it */",
\ "function JumpToLine()",
\ "{",
\ " var lineNum;",
\ " lineNum = window.location.hash;",
\ " lineNum = lineNum.substr(1); /* strip off '#' */",
\ "",
\ " if (lineNum.indexOf('L') == -1) {",
\ " lineNum = 'L'+lineNum;",
\ " }",
\ " if (lineNum.indexOf('W') == -1) {",
\ " lineNum = 'W1'+lineNum;",
\ " }",
\ " var lineElem = document.getElementById(lineNum);"
\ ])
endif
call append(style_start, [
\ "",
\ "/* function to open any folds containing a jumped-to line before jumping to it */",
\ "function JumpToLine()",
\ "{",
\ " var lineNum;",
\ " lineNum = window.location.hash;",
\ " lineNum = lineNum.substr(1); /* strip off '#' */",
\ "",
\ " if (lineNum.indexOf('L') == -1) {",
\ " lineNum = 'L'+lineNum;",
\ " }",
\ " if (lineNum.indexOf('W') == -1) {",
\ " lineNum = 'W1'+lineNum;",
\ " }",
\ " lineElem = document.getElementById(lineNum);"
\ ])
" Insert javascript to toggle matching folds open and closed in all windows,
" if dynamic folding is active.
@@ -648,11 +658,13 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{
\ ])
endif
" insert script tag; javascript is always needed for the line number
" normalization for URL hashes
call append(style_start, [
\ "<script type='text/javascript'>",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
if s:uses_script
" insert script tag; javascript is always needed for the line number
" normalization for URL hashes
call append(style_start, [
\ "<script type='text/javascript'>",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
endif
" Insert styles from all the generated html documents and additional styles
" for the table-based layout of the side-by-side diff. The diff should take
@@ -767,7 +779,7 @@ func! tohtml#GetUserSettings() "{{{
if user_settings.no_pre == 0
call tohtml#GetOption(user_settings,
\ 'expand_tabs',
\ &expandtab || &ts != 8 || user_settings.number_lines ||
\ &expandtab || &ts != 8 || &vts != '' || user_settings.number_lines ||
\ (user_settings.dynamic_folds && !user_settings.no_foldcolumn))
else
let user_settings.expand_tabs = 1

View File

@@ -2026,7 +2026,7 @@ append({lnum}, {text}) Number append {text} below line {lnum}
appendbufline({expr}, {lnum}, {text})
Number append {text} below line {lnum}
in buffer {expr}
argc( [{winid}]) Number number of files in the argument list
argc([{winid}]) Number number of files in the argument list
argidx() Number current index in the argument list
arglistid([{winnr} [, {tabnr}]]) Number argument list id
argv({nr} [, {winid}]) String {nr} entry of the argument list
@@ -2386,7 +2386,7 @@ sha256({string}) String SHA256 checksum of {string}
shellescape({string} [, {special}])
String escape {string} for use as shell
command argument
shiftwidth() Number effective value of 'shiftwidth'
shiftwidth([{list}]) Number effective value of 'shiftwidth'
simplify({filename}) String simplify filename as much as possible
sin({expr}) Float sine of {expr}
sinh({expr}) Float hyperbolic sine of {expr}
@@ -7639,12 +7639,20 @@ shellescape({string} [, {special}]) *shellescape()*
< See also |::S|.
shiftwidth() *shiftwidth()*
shiftwidth([{list}]) *shiftwidth()*
Returns the effective value of 'shiftwidth'. This is the
'shiftwidth' value unless it is zero, in which case it is the
'tabstop' value. This function was introduced with patch
7.3.694 in 2012, everybody should have it by now.
When there is one argument {list} this is used as position
|List| for which to return the 'shiftwidth' value (actually
only the column number is relevant). This matters for the
'vartabstop' feature. For the {list} arguments see |cursor()|
function. If the 'vartabstop' setting is enabled and no
{list} argument is given, the current cursor position is
taken into account.
simplify({filename}) *simplify()*
Simplify the file name as much as possible without changing

View File

@@ -878,7 +878,7 @@ be used to complete the name of the menu item.
't': |:tlmenu| Terminal mode
'i': |:imenu| Insert mode
'c': |:cmenu| Cmdline mode
If the console-mode vim has been compiled with WANT_MENU defined, you can
use :emenu to access useful menu items you may have got used to from GUI

View File

@@ -45,8 +45,8 @@ The Perl patches for Vim were made by:
Matt Gerassimof
Perl for MS-Windows (and other platforms) can be found at:
http://www.perl.org/ The ActiveState one should work, Strawberry Perl is a
good alternative.
http://www.perl.org/
The ActiveState one should work, Strawberry Perl is a good alternative.
==============================================================================
3. Using the Perl interface *perl-using*

View File

@@ -603,14 +603,14 @@ the use of square and curly brackets, and otherwise by community convention.
These conventions are not universally followed, so the Clojure indent script
offers a few configurable options, listed below.
If the current vim does not include searchpairpos(), the indent script falls
If the current vim does not include |searchpairpos()|, the indent script falls
back to normal 'lisp' indenting, and the following options are ignored.
*g:clojure_maxlines*
Set maximum scan distance of searchpairpos(). Larger values trade performance
for correctness when dealing with very long forms. A value of 0 will scan
without limits.
Set maximum scan distance of |searchpairpos()|. Larger values trade
performance for correctness when dealing with very long forms. A value of 0
will scan without limits.
>
" Default
let g:clojure_maxlines = 100
@@ -936,14 +936,14 @@ given are the defaults. Note that the variables are set to an expression, so
that you can change the value of 'shiftwidth' later.
Indent after an open paren: >
let g:pyindent_open_paren = '&sw * 2'
let g:pyindent_open_paren = 'shiftwidth() * 2'
Indent after a nested paren: >
let g:pyindent_nested_paren = '&sw'
let g:pyindent_nested_paren = 'shiftwidth()'
Indent for a continuation line: >
let g:pyindent_continue = '&sw * 2'
let g:pyindent_continue = 'shiftwidth() * 2'
The method uses searchpair() to look back for unclosed parenthesis. This can
sometimes be slow, thus it timeouts after 150 msec. If you notice the
The method uses |searchpair()| to look back for unclosed parenthesis. This
can sometimes be slow, thus it timeouts after 150 msec. If you notice the
indenting isn't correct, you can set a larger timeout in msec: >
let g:pyindent_searchpair_timeout = 500
@@ -1039,7 +1039,7 @@ Furthermore, setting the variable b:verilog_indent_width to change the
indenting width (default is 'shiftwidth'): >
let b:verilog_indent_width = 4
let b:verilog_indent_width = &sw * 2
let b:verilog_indent_width = shiftwidth() * 2
In addition, you can turn the verbose mode for debug issue: >
@@ -1162,7 +1162,7 @@ VIM *ft-vim-indent*
For indenting Vim scripts there is one variable that specifies the amount of
indent for a continuation line, a line that starts with a backslash: >
:let g:vim_indent_cont = &sw * 3
:let g:vim_indent_cont = shiftwidth() * 3
Three times shiftwidth is the default value.

View File

@@ -1025,7 +1025,7 @@ remembered. You can return to that position with the "''" and "``" command,
unless the line containing that position was changed or deleted. The
following commands are "jump" commands: "'", "`", "G", "/", "?", "n", "N",
"%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and the
commands that start editing a new file.
commands that start editing a new file.
*CTRL-O*
CTRL-O Go to [count] Older cursor position in jump list

View File

@@ -1057,9 +1057,9 @@ A jump table for the options with a short description can be found at |Q_op|.
- To include a comma in a directory name precede it with a backslash.
- A directory name may end in an '/'.
- For Unix and Win32, if a directory ends in two path separators "//",
the swap file name will be built from the complete path to the file
with all path separators changed to percent '%' signs. This will
ensure file name uniqueness in the backup directory.
the backup file name will be built from the complete path to the
file with all path separators changed to percent '%' signs. This
will ensure file name uniqueness in the backup directory.
On Win32, it is also possible to end with "\\". However, When a
separating comma is following, you must use "//", since "\\" will
include the comma in the file name. Therefore it is recommended to
@@ -2686,11 +2686,11 @@ A jump table for the options with a short description can be found at |Q_op|.
option to see when this happens.
indent-heuristic
Use the indent heuristic for the internal
diff library.
Use the indent heuristic for the internal
diff library.
algorithm:{text} Use the specified diff algorithm with the
internal diff engine. Currently supported
internal diff engine. Currently supported
algorithms are:
myers the default algorithm
minimal spend extra time to generate the
@@ -8120,13 +8120,14 @@ A jump table for the options with a short description can be found at |Q_op|.
global or local to buffer |global-local|
{not in Vi}
List of file names, separated by commas, that are used to lookup words
for thesaurus completion commands |i_CTRL-X_CTRL-T|. Each line in
the file should contain words with similar meaning, separated by
non-keyword characters (white space is preferred). Maximum line
length is 510 bytes.
To obtain a file to be used here, check out this ftp site:
ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/ First get the README
file.
for thesaurus completion commands |i_CTRL-X_CTRL-T|.
Each line in the file should contain words with similar meaning,
separated by non-keyword characters (white space is preferred).
Maximum line length is 510 bytes.
Unfortunately we currently cannot recommend a file to be used here.
To include a comma in a file name precede it with a backslash. Spaces
after a comma are ignored, otherwise spaces are included in the file
name. See |option-backslash| about using backslashes.

View File

@@ -295,7 +295,7 @@ the "*" is under your right hand middle finger (search to the right and down).
*E956*
In very rare cases a regular expression is used recursively. This can happen
when executing a pattern takes a long time and when checkig for messages on
when executing a pattern takes a long time and when checking for messages on
channels a callback is invoked that also uses a pattern or an autocommand is
triggered. In most cases this should be fine, but if a pattern is in use when
it's used again it fails. Usually this means there is something wrong with

View File

@@ -515,7 +515,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
--clean Similar to "-u DEFAULTS -U NONE -i NONE":
- initializations from files and environment variables is
skipped
-'runtimepath'and 'packpath' are set to exclude home
- 'runtimepath' and 'packpath' are set to exclude home
directory entries (does not happen with -u DEFAULTS).
- the |defaults.vim| script is loaded, which implies
'nocompatible': use Vim defaults

View File

@@ -671,12 +671,12 @@ the rendered page generated by 2html.vim.
:let g:html_no_pre = 1
<
*g:html_expand_tabs*
Default: 1 if 'tabstop' is 8, 'expandtab' is 0, and no fold column or line
numbers occur in the generated HTML;
0 otherwise.
When 0, <Tab> characters in the buffer text are replaced with an appropriate
Default: 0 if 'tabstop' is 8, 'expandtab' is 0, 'vartabstop' is not in use,
and no fold column or line numbers occur in the generated HTML;
1 otherwise.
When 1, <Tab> characters in the buffer text are replaced with an appropriate
number of space characters, or &nbsp; references if |g:html_no_pre| is 1.
When 1, if |g:html_no_pre| is 0 or unset, <Tab> characters in the buffer text
When 0, if |g:html_no_pre| is 0 or unset, <Tab> characters in the buffer text
are included as-is in the generated HTML. This is useful for when you want to
allow copy and paste from a browser without losing the actual whitespace in
the source document. Note that this can easily break text alignment and
@@ -774,6 +774,8 @@ When 1, generate XHTML 1.0 instead (XML compliant HTML).
:let g:html_use_xhtml = 1
<
vim:tw=78:sw=4:ts=8:sts=4:ft=help:norl:ai:noet:
ABEL *abel.vim* *ft-abel-syntax*
ABEL highlighting provides some user-defined options. To enable them, assign

View File

@@ -4652,6 +4652,7 @@ E958 eval.txt /*E958*
E96 diff.txt /*E96*
E960 options.txt /*E960*
E961 cmdline.txt /*E961*
E962 eval.txt /*E962*
E97 diff.txt /*E97*
E98 diff.txt /*E98*
E99 diff.txt /*E99*
@@ -6692,6 +6693,7 @@ getscript-start pi_getscript.txt /*getscript-start*
gettabinfo() eval.txt /*gettabinfo()*
gettabvar() eval.txt /*gettabvar()*
gettabwinvar() eval.txt /*gettabwinvar()*
gettagstack() eval.txt /*gettagstack()*
getwininfo() eval.txt /*getwininfo()*
getwinpos() eval.txt /*getwinpos()*
getwinposx() eval.txt /*getwinposx()*
@@ -8435,6 +8437,7 @@ setqflist-examples quickfix.txt /*setqflist-examples*
setreg() eval.txt /*setreg()*
settabvar() eval.txt /*settabvar()*
settabwinvar() eval.txt /*settabwinvar()*
settagstack() eval.txt /*settagstack()*
setting-guifont gui.txt /*setting-guifont*
setting-guitablabel tabpage.txt /*setting-guitablabel*
setting-tabline tabpage.txt /*setting-tabline*

View File

@@ -179,8 +179,8 @@ commands explained above the tag stack will look like this:
1 1 main 1 harddisk2:text/vim/test
2 1 FuncB 59 harddisk2:text/vim/src/main.c
The gettagstack() function returns the tag stack of a specified window. The
settagstack() function modifies the tag stack of a window.
The |gettagstack()| function returns the tag stack of a specified window. The
|settagstack()| function modifies the tag stack of a window.
*E73*
When you try to use the tag stack while it doesn't contain anything you will

View File

@@ -38,6 +38,8 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
runtest: for flaky test, try more often if error message changes (5 times)
'incsearch' with :s: (#3321)
- :s/foo using CTRL-G moves to another line, should not happen, or use the
correct line (it uses the last but one line) (Lifepillar, Aug 18, #3345)
@@ -92,6 +94,19 @@ Terminal emulator window:
- When 'encoding' is not utf-8, or the job is using another encoding, setup
conversions.
Users get used to "function!" because they reload a script file. How about
recognizing the script is re-sourced and not giving an error for the first
function that overwrites. Then one can leave out the exclamation mark and
catch actual errors, overwriting a function from another script.
Update for German spell files: https://github.com/chrisbra/vim/compare/5e021c990f8817a50d3264782a5...3b27c92f297540761ebbd92d04fb3
(Christian Brabandt, 2018 Nov 4)
Patch for comparing quickfix and location stacks. (Yegappan, 2018 Nov 15)
Patch to fix visual block problem. (Tom M, tommm, 2018 Nov 14)
Also will write a test.
Key mapping times out when using a timer in Gvim. (Michael Henry, 2018 Sep 9,
#3417)
@@ -115,6 +130,9 @@ Include part of #3242?
When a terminal exit_cb closes the window, a following typed key is lost, if
it's in a mapping. (2018 Oct 6, #2302, #3522)
Patch for dos installer to use logic instead of $HOME. (Ken Takata, Nov 5,
#3564)
Completion mixes results from the current buffer with tags and other files.
Happens when typing CTRL-N while still search for results. E.g., type "b_" in
terminal.c and then CTRL-N twice.
@@ -126,6 +144,9 @@ Williams, 2018 Oct 30)
Problem with :tlmenu: Detach item added with all modes? Issue #3563.
Patch to avoid that increment or decrement gets interrupted by updating folds.
(Christian Brabandt, 2018 Nov 6, #3599)
C syntax: {} inside () causes following {} to be highlighted as error.
(Michalis Giannakidis, 2006 Jun 1)
@@ -220,6 +241,9 @@ Set g:actual_curbuf when evaluating 'statusline', not just with an expression.
ml_get error. (Dominique Pelle, 2018 Sep 14, #3434)
Patch to use forward slash for completion even when 'shellslash' is set.
Adds 'completepathslash'. (Yasuhiro Matsumoto, 2018 Nov 15, #3612)
Only output t_Cs when t_Ce is also set. do not use Cs and Ce termcap entries. (Daniel Hahler, 2018 Sep 25)
Add t_cS and t_cR for cursor color select and reset. Use Cs and Cr terminfo
values.
@@ -311,6 +335,7 @@ balloonexpr() on MS-Windows GUI doesn't handle accented chars? (nivaemail,
Add v:motion_force. (Kana Natsuno, 2008 Dec 6)
Maybe call it v:motiontype. Update in #3490.
Alternative: add the force flag to mode(), after "no".
Patch ready to include?
Try out background make plugin:
https://github.com/AndrewVos/vim-make-background
@@ -369,7 +394,6 @@ Jun 10, #2998)
Improve the installer for MS-Windows. There are a few alternatives:
- mui2 installer improved by Ken Takata (2018 Sep 29)
- Add silent install option. (Shane Lee, #751)
- Installer from Cream (Steve Hall).
- Modern UI 2.0 for the Nsis installer. (Guopeng Wen)
https://github.com/gpwen/vim-installer-mui2

View File

@@ -2,9 +2,9 @@
"
" Menu Translations: Japanese (EUC-JP)
" Last Translator: MURAOKA Taro <koron.kaoriya@gmail.com>
" Last Change: 28-Jan-2016.
" Last Change: 18-Jul-2018.
"
" Copyright (C) 2001-2016 MURAOKA Taro <koron.kaoriya@gmail.com>,
" Copyright (C) 2001-2018 MURAOKA Taro <koron.kaoriya@gmail.com>,
" vim-jp <http://vim-jp.org/>
"
" THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.

View File

@@ -2,9 +2,9 @@
"
" Menu Translations: Japanese (UTF-8)
" Last Translator: MURAOKA Taro <koron.kaoriya@gmail.com>
" Last Change: 28-Jan-2016.
" Last Change: 18-Jul-2018.
"
" Copyright (C) 2001-2016 MURAOKA Taro <koron.kaoriya@gmail.com>,
" Copyright (C) 2001-2018 MURAOKA Taro <koron.kaoriya@gmail.com>,
" vim-jp <http://vim-jp.org/>
"
" THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.

View File

@@ -2,9 +2,9 @@
"
" Menu Translations: Japanese (CP932)
" Last Translator: MURAOKA Taro <koron.kaoriya@gmail.com>
" Last Change: 28-Jan-2016.
" Last Change: 18-Jul-2018.
"
" Copyright (C) 2001-2016 MURAOKA Taro <koron.kaoriya@gmail.com>,
" Copyright (C) 2001-2018 MURAOKA Taro <koron.kaoriya@gmail.com>,
" vim-jp <http://vim-jp.org/>
"
" THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.

View File

@@ -1,82 +1,33 @@
" Vim plugin for converting a syntax highlighted file to HTML.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2015 Sep 08
" Last Change: 2018 Nov 11
"
" The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and
" $VIMRUNTIME/syntax/2html.vim
"
" TODO: {{{
" * Options for generating the CSS in external style sheets. New :TOcss
" command to convert the current color scheme into a (mostly) generic CSS
" stylesheet which can be re-used. Alternate stylesheet support? Good start
" by Erik Falor
" ( https://groups.google.com/d/topic/vim_use/7XTmC4D22dU/discussion ).
" * Add optional argument to :TOhtml command to specify mode (gui, cterm,
" term) to use for the styling. Suggestion by "nacitar".
" * Add way to override or specify which RGB colors map to the color numbers
" in cterm. Get better defaults than just guessing? Suggestion by "nacitar".
" * Disable filetype detection until after all processing is done.
" * Add option for not generating the hyperlink on stuff that looks like a
" URL? Or just color the link to fit with the colorscheme (and only special
" when hovering)?
" * Bug: Opera does not allow printing more than one page if uncopyable
" regions is turned on. Possible solution: Add normal text line numbers with
" display:none, set to display:inline for print style sheets, and hide
" <input> elements for print, to allow Opera printing multiple pages (and
" other uncopyable areas?). May need to make the new text invisible to IE
" with conditional comments to prevent copying it, IE for some reason likes
" to copy hidden text. Other browsers too?
" * Bug: still a 1px gap throughout the fold column when html_prevent_copy is
" "fn" in some browsers. Specifically, in Chromium on Ubuntu (but not Chrome
" on Windows). Perhaps it is font related?
" * Bug: still some gaps in the fold column when html_prevent_copy contains
" 'd' and showing the whole diff (observed in multiple browsers). Only gaps
" on diff lines though.
" * Undercurl support via CSS3, with fallback to dotted or something:
" https://groups.google.com/d/topic/vim_use/BzXA6He1pHg/discussion
" * Redo updates for modified default foldtext (v11) when/if the patch is
" accepted to modify it.
" * Test case +diff_one_file-dynamic_folds+expand_tabs-hover_unfold
" +ignore_conceal-ignore_folding+no_foldcolumn+no_pre+no_progress
" +number_lines-pre_wrap-use_css+use_xhtml+whole_filler.xhtml
" does not show the whole diff filler as it is supposed to?
" * Bug: when 'isprint' is wrong for the current encoding, will generate
" invalid content. Can/should anything be done about this? Maybe a separate
" plugin to correct 'isprint' based on encoding?
" * Check to see if the windows-125\d encodings actually work in Unix without
" the 8bit- prefix. Add prefix to autoload dictionaries for Unix if not.
" * Font auto-detection similar to
" http://www.vim.org/scripts/script.php?script_id=2384 but for a variety of
" platforms.
" * Error thrown when sourcing 2html.vim directly when plugins are not loaded.
" * Pull in code from http://www.vim.org/scripts/script.php?script_id=3113 :
" - listchars support
" - full-line background highlight
" - other?
" * Make it so deleted lines in a diff don't create side-scrolling (get it
" free with full-line background highlight above).
" * Restore open/closed folds and cursor position after processing each file
" with option not to restore for speed increase.
" * Add extra meta info (generation time, etc.)?
" * Tidy up so we can use strict doctype in even more situations
" * Implementation detail: add threshold for writing the lines to the html
" buffer before we're done (5000 or so lines should do it)
" * TODO comments for code cleanup scattered throughout
"}}}
if exists('g:loaded_2html_plugin')
finish
endif
let g:loaded_2html_plugin = 'vim7.4_v2'
let g:loaded_2html_plugin = 'vim8.1_v1'
"
" Changelog: {{{
" 7.4_v2 (this version): Fix error raised when converting a diff containing
" 8.1_v1 (this version): Fix Bitbucket issue #6: Don't generate empty script
" tag.
" Fix Bitbucket issue #5: javascript should
" declare variables with "var".
" Fix Bitbucket issue #13: errors thrown sourcing
" 2html.vim directly when plugins not loaded.
" Fix Bitbucket issue #16: support 'vartabstop'.
"
" 7.4 updates: {{{
" 7.4_v2 (Vim 7.4.0899): Fix error raised when converting a diff containing
" an empty buffer. Jan Stocker: allow g:html_font to
" take a list so it is easier to specfiy fallback
" fonts in the generated CSS.
" 7.4_v1 (Vim 7.4.0000): Fix modeline mangling for new "Vim:" format, and
" also for version-specific modelines like "vim>703:".
"}}}
"
" 7.3 updates: {{{
" 7.3_v14 (Vim 7.3.1246): Allow suppressing line number anchors using
@@ -170,9 +121,69 @@ let g:loaded_2html_plugin = 'vim7.4_v2'
"}}}
"}}}
" TODO: {{{
" * Check the issue tracker:
" https://bitbucket.org/fritzophrenic/vim-tohtml/issues?status=new&status=open
" * Options for generating the CSS in external style sheets. New :TOcss
" command to convert the current color scheme into a (mostly) generic CSS
" stylesheet which can be re-used. Alternate stylesheet support? Good start
" by Erik Falor
" ( https://groups.google.com/d/topic/vim_use/7XTmC4D22dU/discussion ).
" * Add optional argument to :TOhtml command to specify mode (gui, cterm,
" term) to use for the styling. Suggestion by "nacitar".
" * Add way to override or specify which RGB colors map to the color numbers
" in cterm. Get better defaults than just guessing? Suggestion by "nacitar".
" * Disable filetype detection until after all processing is done.
" * Add option for not generating the hyperlink on stuff that looks like a
" URL? Or just color the link to fit with the colorscheme (and only special
" when hovering)?
" * Bug: Opera does not allow printing more than one page if uncopyable
" regions is turned on. Possible solution: Add normal text line numbers with
" display:none, set to display:inline for print style sheets, and hide
" <input> elements for print, to allow Opera printing multiple pages (and
" other uncopyable areas?). May need to make the new text invisible to IE
" with conditional comments to prevent copying it, IE for some reason likes
" to copy hidden text. Other browsers too?
" * Bug: still a 1px gap throughout the fold column when html_prevent_copy is
" "fn" in some browsers. Specifically, in Chromium on Ubuntu (but not Chrome
" on Windows). Perhaps it is font related?
" * Bug: still some gaps in the fold column when html_prevent_copy contains
" 'd' and showing the whole diff (observed in multiple browsers). Only gaps
" on diff lines though.
" * Undercurl support via CSS3, with fallback to dotted or something:
" https://groups.google.com/d/topic/vim_use/BzXA6He1pHg/discussion
" * Redo updates for modified default foldtext (v11) when/if the patch is
" accepted to modify it.
" * Test case +diff_one_file-dynamic_folds+expand_tabs-hover_unfold
" +ignore_conceal-ignore_folding+no_foldcolumn+no_pre+no_progress
" +number_lines-pre_wrap-use_css+use_xhtml+whole_filler.xhtml
" does not show the whole diff filler as it is supposed to?
" * Bug: when 'isprint' is wrong for the current encoding, will generate
" invalid content. Can/should anything be done about this? Maybe a separate
" plugin to correct 'isprint' based on encoding?
" * Check to see if the windows-125\d encodings actually work in Unix without
" the 8bit- prefix. Add prefix to autoload dictionaries for Unix if not.
" * Font auto-detection similar to
" http://www.vim.org/scripts/script.php?script_id=2384 but for a variety of
" platforms.
" * Pull in code from http://www.vim.org/scripts/script.php?script_id=3113 :
" - listchars support
" - full-line background highlight
" - other?
" * Make it so deleted lines in a diff don't create side-scrolling (get it
" free with full-line background highlight above).
" * Restore open/closed folds and cursor position after processing each file
" with option not to restore for speed increase.
" * Add extra meta info (generation time, etc.)?
" * Tidy up so we can use strict doctype in even more situations
" * Implementation detail: add threshold for writing the lines to the html
" buffer before we're done (5000 or so lines should do it)
" * TODO comments for code cleanup scattered throughout
"}}}
" Define the :TOhtml command when:
" - 'compatible' is not set
" - this plugin was not already loaded
" - this plugin or user override was not already loaded
" - user commands are available. {{{
if !&cp && !exists(":TOhtml") && has("user_commands")
command -range=% -bar TOhtml :call tohtml#Convert2HTML(<line1>, <line2>)

View File

@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2015 Sep 08
" Last Change: 2018 Nov 11
"
" Additional contributors:
"
@@ -633,6 +633,45 @@ if s:current_syntax == ''
let s:current_syntax = 'none'
endif
" If the user is sourcing this script directly then the plugin version isn't
" known because the main plugin script didn't load. In the usual case where the
" user still has the full Vim runtime installed, or has this full plugin
" installed in a package or something, then we can extract the version from the
" main plugin file at it's usual spot relative to this file. Otherwise the user
" is assembling their runtime piecemeal and we have no idea what versions of
" other files may be present so don't even try to make a guess or assume the
" presence of other specific files with specific meaning.
"
" We don't want to actually source the main plugin file here because the user
" may have a good reason not to (e.g. they define their own TOhtml command or
" something).
"
" If this seems way too complicated and convoluted, it is. Probably I should
" have put the version information in the autoload file from the start. But the
" version has been in the global variable for so long that changing it could
" break a lot of user scripts.
if exists("g:loaded_2html_plugin")
let s:pluginversion = g:loaded_2html_plugin
else
if !exists("g:unloaded_tohtml_plugin")
let s:main_plugin_path = expand("<sfile>:p:h:h")."/plugin/tohtml.vim"
if filereadable(s:main_plugin_path)
let s:lines = readfile(s:main_plugin_path, "", 20)
call filter(s:lines, 'v:val =~ "loaded_2html_plugin = "')
if empty(s:lines)
let g:unloaded_tohtml_plugin = "unknown"
else
let g:unloaded_tohtml_plugin = substitute(s:lines[0], '.*loaded_2html_plugin = \([''"]\)\(\%(\1\@!.\)\+\)\1', '\2', '')
endif
unlet s:lines
else
let g:unloaded_tohtml_plugin = "unknown"
endif
unlet s:main_plugin_path
endif
let s:pluginversion = g:unloaded_tohtml_plugin
endif
" Split window to create a buffer with the HTML file.
let s:orgbufnr = winbufnr(0)
let s:origwin_stl = &l:stl
@@ -721,7 +760,7 @@ endif
call extend(s:lines, [
\ ("<title>".expand("%:p:~")."</title>"),
\ ("<meta name=\"Generator\" content=\"Vim/".v:version/100.".".v:version%100.'"'.s:tag_close),
\ ("<meta name=\"plugin-version\" content=\"".g:loaded_2html_plugin.'"'.s:tag_close)
\ ("<meta name=\"plugin-version\" content=\"".s:pluginversion.'"'.s:tag_close)
\ ])
call add(s:lines, '<meta name="syntax" content="'.s:current_syntax.'"'.s:tag_close)
call add(s:lines, '<meta name="settings" content="'.
@@ -807,12 +846,15 @@ if s:settings.use_css
endif
endif
" insert script tag; javascript is always needed for the line number
" normalization for URL hashes
call extend(s:lines, [
\ "",
\ "<script type='text/javascript'>",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids || !empty(s:settings.prevent_copy)
" insert script tag if needed
if s:uses_script
call extend(s:lines, [
\ "",
\ "<script type='text/javascript'>",
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
endif
" insert javascript to toggle folds open and closed
if s:settings.dynamic_folds
@@ -849,8 +891,9 @@ if s:settings.line_ids
\ " if (lineNum.indexOf('L') == -1) {",
\ " lineNum = 'L'+lineNum;",
\ " }",
\ " lineElem = document.getElementById(lineNum);"
\ " var lineElem = document.getElementById(lineNum);"
\ ])
if s:settings.dynamic_folds
call extend(s:lines, [
\ "",
@@ -940,12 +983,14 @@ if !empty(s:settings.prevent_copy)
\ ])
endif
" insert script closing tag
call extend(s:lines, [
\ '',
\ s:settings.use_xhtml ? '//]]>' : '-->',
\ "</script>"
\ ])
" insert script closing tag if needed
if s:uses_script
call extend(s:lines, [
\ '',
\ s:settings.use_xhtml ? '//]]>' : '-->',
\ "</script>"
\ ])
endif
call extend(s:lines, ["</head>"])
if !empty(s:settings.prevent_copy)
@@ -1525,10 +1570,22 @@ while s:lnum <= s:end
if s:settings.expand_tabs
let s:offset = 0
let s:idx = stridx(s:expandedtab, "\t")
let s:tablist = split(&vts,',')
if empty(s:tablist)
let s:tablist = [ &ts ]
endif
let s:tabidx = 0
let s:tabwidth = 0
while s:idx >= 0
while s:startcol+s:idx > s:tabwidth + s:tablist[s:tabidx]
let s:tabwidth += s:tablist[s:tabidx]
if s:tabidx < len(s:tablist)-1
let s:tabidx = s:tabidx+1
endif
endwhile
if has("multi_byte_encoding")
if s:startcol + s:idx == 1
let s:i = &ts
let s:i = s:tablist[s:tabidx]
else
if s:idx == 0
let s:prevc = matchstr(s:line, '.\%' . (s:startcol + s:idx + s:offset) . 'c')
@@ -1536,11 +1593,11 @@ while s:lnum <= s:end
let s:prevc = matchstr(s:expandedtab, '.\%' . (s:idx + 1) . 'c')
endif
let s:vcol = virtcol([s:lnum, s:startcol + s:idx + s:offset - len(s:prevc)])
let s:i = &ts - (s:vcol % &ts)
let s:i = s:tablist[s:tabidx] - (s:vcol - s:tabwidth)
endif
let s:offset -= s:i - 1
else
let s:i = &ts - ((s:idx + s:startcol - 1) % &ts)
let s:i = s:tablist[s:tabidx] - ((s:idx + s:startcol - 1) - s:tabwidth)
endif
let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', s:i), '')
let s:idx = stridx(s:expandedtab, "\t")

View File

@@ -1,5 +1,5 @@
===============================================================================
= Ласкаво простимо в уроки VIM =
= Ласкаво просимо в уроки VIM =
===============================================================================
Vim дуже потужний редактор, що має багато команд. Всі команди неможливо