From 919a34d10ac05aaffde0d1d2b995182b26e36e2d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 26 Jul 2010 22:21:27 +0200 Subject: [PATCH 01/51] Updated runtime files. --HG-- branch : vim73 --- runtime/doc/mbyte.txt | 4 +-- runtime/doc/message.txt | 13 ++++++-- runtime/doc/todo.txt | 3 +- runtime/filetype.vim | 5 ++- runtime/ftplugin/sass.vim | 13 +++++--- runtime/ftplugin/scss.vim | 12 ++++++++ runtime/indent/scss.vim | 12 ++++++++ runtime/makemenu.vim | 3 +- runtime/synmenu.vim | 2 +- runtime/syntax/haml.vim | 10 +++--- runtime/syntax/sass.vim | 64 +++++++++++++++++++++++++++------------ runtime/syntax/scss.vim | 20 ++++++++++++ 12 files changed, 124 insertions(+), 37 deletions(-) create mode 100644 runtime/ftplugin/scss.vim create mode 100644 runtime/indent/scss.vim create mode 100644 runtime/syntax/scss.vim diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index a72d0f6123..2b53ce3894 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -1,4 +1,4 @@ -*mbyte.txt* For Vim version 7.3c. Last change: 2010 Jul 20 +*mbyte.txt* For Vim version 7.3c. Last change: 2010 Jul 26 VIM REFERENCE MANUAL by Bram Moolenaar et al. @@ -928,7 +928,7 @@ See 'imactivatekey' for the format. {only works Windows GUI and compiled with the |+multi_byte_ime| feature} -To input multibyte characters on Windows, you have to use Input Method Editor +To input multibyte characters on Windows, you can use an Input Method Editor (IME). In process of your editing text, you must switch status (on/off) of IME many many many times. Because IME with status on is hooking all of your key inputs, you cannot input 'j', 'k', or almost all of keys to Vim directly. diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index c4ed18b0d3..d534cab45b 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -1,4 +1,4 @@ -*message.txt* For Vim version 7.3c. Last change: 2010 Jul 20 +*message.txt* For Vim version 7.3c. Last change: 2010 Jul 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -467,7 +467,16 @@ Oh, oh. You must have been doing something complicated, or some other program is consuming your memory. Be careful! Vim is not completely prepared for an out-of-memory situation. First make sure that any changes are saved. Then try to solve the memory shortage. To stay on the safe side, exit Vim and -start again. Also see |msdos-limitations|. +start again. + +Buffers are only partly kept in memory, thus editing a very large file is +unlikely to cause an out-of-memory situation. Undo information is completely +in memory, you can reduce that with these options: +- 'undolevels' Set to a low value, or to -1 to disable undo completely. This + helps for a change that affects all lines. +- 'undoreload' Set to zero to disable. + +Also see |msdos-limitations|. *E339* > Pattern too long diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index e6f5883f61..849fc893d2 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.3c. Last change: 2010 Jul 25 +*todo.txt* For Vim version 7.3c. Last change: 2010 Jul 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -31,6 +31,7 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. -------------------- Known bugs and current work ----------------------- Access to free memory with :redir command. (Dominique Pelle, 2010 Jul 25) +Easier way to reproduce in later message. Patch for :find completion. (Nazri Ramliy) But I prefer to keep term.h and include/term.h Nazri will work on it. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 92dfda2468..369cabcb37 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2010 May 14 +" Last Change: 2010 Jul 26 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -1633,6 +1633,9 @@ au BufNewFile,BufRead *.sa setf sather " Scilab au BufNewFile,BufRead *.sci,*.sce setf scilab +" SCSS +au BufNewFile,BufRead *.scss setf scss + " SD: Streaming Descriptors au BufNewFile,BufRead *.sd setf sd diff --git a/runtime/ftplugin/sass.vim b/runtime/ftplugin/sass.vim index 9a99931731..64232a0894 100644 --- a/runtime/ftplugin/sass.vim +++ b/runtime/ftplugin/sass.vim @@ -1,7 +1,7 @@ " Vim filetype plugin -" Language: Sass -" Maintainer: Tim Pope -" Last Change: 2010 May 21 +" Language: Sass +" Maintainer: Tim Pope +" Last Change: 2010 Jul 26 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -9,11 +9,14 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl cms< inc< ofu<" +let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<" setlocal commentstring=//\ %s +setlocal define=^\\s*\\%(@mixin\\\|=\\) +setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','') setlocal omnifunc=csscomplete#CompleteCSS +setlocal suffixesadd=.sass,.scss,.css -let &l:include = '^\s*@import\s\+\%(url(\)\=' +let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\=' " vim:set sw=2: diff --git a/runtime/ftplugin/scss.vim b/runtime/ftplugin/scss.vim new file mode 100644 index 0000000000..981fb1b881 --- /dev/null +++ b/runtime/ftplugin/scss.vim @@ -0,0 +1,12 @@ +" Vim filetype plugin +" Language: SCSS +" Maintainer: Tim Pope +" Last Change: 2010 Jul 26 + +if exists("b:did_ftplugin") + finish +endif + +runtime! ftplugin/sass.vim + +" vim:set sw=2: diff --git a/runtime/indent/scss.vim b/runtime/indent/scss.vim new file mode 100644 index 0000000000..82bba4920b --- /dev/null +++ b/runtime/indent/scss.vim @@ -0,0 +1,12 @@ +" Vim indent file +" Language: SCSS +" Maintainer: Tim Pope +" Last Change: 2010 Jul 26 + +if exists("b:did_indent") + finish +endif + +runtime! indent/css.vim + +" vim:set sw=2: diff --git a/runtime/makemenu.vim b/runtime/makemenu.vim index d728f77cbf..5b6f6d379f 100644 --- a/runtime/makemenu.vim +++ b/runtime/makemenu.vim @@ -1,6 +1,6 @@ " Script to define the syntax menu in synmenu.vim " Maintainer: Bram Moolenaar -" Last Change: 2008 Jul 13 +" Last Change: 2010 Jul 26 " This is used by "make menu" in the src directory. edit :p:h/synmenu.vim @@ -443,6 +443,7 @@ SynMenu S-Sm.Sather:sather SynMenu S-Sm.Scheme:scheme SynMenu S-Sm.Scilab:scilab SynMenu S-Sm.Screen\ RC:screen +SynMenu S-Sm.SCSS:scss SynMenu S-Sm.SDC\ Synopsys\ Design\ Constraints:sdc SynMenu S-Sm.SDL:sdl SynMenu S-Sm.Sed:sed diff --git a/runtime/synmenu.vim b/runtime/synmenu.vim index cebac66327..e1b0e00a4d 100644 --- a/runtime/synmenu.vim +++ b/runtime/synmenu.vim @@ -2,7 +2,7 @@ " This file is normally sourced from menu.vim. " " Maintainer: Bram Moolenaar -" Last Change: 2006 Apr 27 +" Last Change: 2010 Jul 26 " Define the SetSyn function, used for the Syntax menu entries. " Set 'filetype' and also 'syntax' if it is manually selected. diff --git a/runtime/syntax/haml.vim b/runtime/syntax/haml.vim index bb144bad00..f49eaca986 100644 --- a/runtime/syntax/haml.vim +++ b/runtime/syntax/haml.vim @@ -1,8 +1,8 @@ " Vim syntax file -" Language: Haml -" Maintainer: Tim Pope -" Filenames: *.haml -" Last Change: 2010 May 21 +" Language: Haml +" Maintainer: Tim Pope +" Filenames: *.haml +" Last Change: 2010 Jul 26 if exists("b:current_syntax") finish @@ -30,7 +30,7 @@ syn cluster hamlTop contains=hamlBegin,hamlPlainFilter,hamlRubyFilter,h syn match hamlBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=hamlTag,hamlClassChar,hamlIdChar,hamlRuby,hamlPlainChar,hamlInterpolatable -syn match hamlTag "%\w\+" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent +syn match hamlTag "%\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent syn region hamlAttributes matchgroup=hamlAttributesDelimiter start="(" end=")" contained contains=htmlArg,hamlAttributeString,hamlAttributeVariable,htmlEvent,htmlCssDefinition nextgroup=@hamlComponent syn region hamlAttributesHash matchgroup=hamlAttributesDelimiter start="{" end="}" contained contains=@hamlRubyTop nextgroup=@hamlComponent syn region hamlObject matchgroup=hamlObjectDelimiter start="\[" end="\]" contained contains=@hamlRubyTop nextgroup=@hamlComponent diff --git a/runtime/syntax/sass.vim b/runtime/syntax/sass.vim index 5bee495c04..082ae71bd9 100644 --- a/runtime/syntax/sass.vim +++ b/runtime/syntax/sass.vim @@ -1,8 +1,8 @@ " Vim syntax file -" Language: Sass -" Maintainer: Tim Pope -" Filenames: *.sass -" Last Change: 2010 May 21 +" Language: Sass +" Maintainer: Tim Pope +" Filenames: *.sass +" Last Change: 2010 Jul 26 if exists("b:current_syntax") finish @@ -13,16 +13,36 @@ runtime! syntax/css.vim syn case ignore syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp -syn cluster sassCssAttributes contains=css.*Attr,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp +syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp +syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP + +syn match sassProperty "\%([{};]\s*\|^\)\@<=[[:alnum:]-]\+:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition syn match sassProperty "^\s*\zs\s\%([[:alnum:]-]\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute -syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassScript -syn match sassCssAttribute ".*$" contained contains=@sassCssAttributes,sassConstant -syn match sassScript ".*$" contained contains=@sassCssAttributes,sassConstant -syn match sassConstant "![[:alnum:]_-]\+" -syn match sassConstantAssignment "\%(![[:alnum:]_]\+\s*\)\@<=\%(||\)\==" nextgroup=sassScript skipwhite -syn match sassMixin "^=.*" -syn match sassMixing "^\s\+\zs+.*" +syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute +syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction +syn match sassDefault "!default\>" contained +syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+" +syn match sassVariable "$[[:alnum:]_-]\+" +syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite +syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite + +syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained +syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained +syn match sassFunction "\<\%(alpha\|opacity\|rgba\|opacify\|fade-in\|transparentize\|fade-out\)\>(\@=" contained +syn match sassFunction "\<\%(unquote\|quote\)\>(\@=" contained +syn match sassFunction "\<\%(percentage\|round\|ceil\|floor\|abs\)\>(\@=" contained +syn match sassFunction "\<\%(type-of\|unit\|unitless\|comparable\)\>(\@=" contained + +syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ + +syn match sassMixinName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute +syn match sassMixin "^=" nextgroup=sassMixinName +syn match sassMixin "^\s*\zs@mixin" nextgroup=sassMixinName skipwhite +syn match sassMixing "^\s\+\zs+" nextgroup=sassMixinName +syn match sassMixing "^\s\+\zs@include" nextgroup=sassMixinName skipwhite +syn match sassMixing "\%([{};]\s*\|^\)\@<=@include" nextgroup=sassMixinName skipwhite contained containedin=sassDefinition +syn match sassExtend "^\s\+\zs@extend" syn match sassEscape "^\s*\zs\\" syn match sassIdChar "#[[:alnum:]_-]\@=" nextgroup=sassId @@ -34,28 +54,34 @@ syn match sassAmpersand "&" " TODO: Attribute namespaces " TODO: Arithmetic (including strings and concatenation) -syn region sassInclude start="@import" end=";\|$" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType -syn region sassDebugLine matchgroup=sassDebug start="@debug\>" end="$" contains=@sassCssAttributes,sassConstant -syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="$" contains=sassFor,@sassCssAttributes,sassConstant +syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssURL,cssUnicodeEscape,cssMediaType +syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction +syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction +syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="[{};]\@=\|$" contains=sassFor,@sassCssAttributes,sassVariable,sassFunction syn keyword sassFor from to through contained syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained -syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo -syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo +syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell +syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell hi def link sassCssComment sassComment hi def link sassComment Comment -hi def link sassConstant Identifier +hi def link sassDefault cssImportant +hi def link sassVariable Identifier +hi def link sassFunction Function hi def link sassMixing PreProc hi def link sassMixin PreProc +hi def link sassExtend PreProc hi def link sassTodo Todo hi def link sassInclude Include -hi def link sassDebug Debug +hi def link sassDebug sassControl +hi def link sassWarn sassControl hi def link sassControl PreProc hi def link sassFor PreProc hi def link sassEscape Special hi def link sassIdChar Special hi def link sassClassChar Special +hi def link sassInterpolationDelimiter Delimiter hi def link sassAmpersand Character hi def link sassId Identifier hi def link sassClass Type diff --git a/runtime/syntax/scss.vim b/runtime/syntax/scss.vim new file mode 100644 index 0000000000..6fb9691527 --- /dev/null +++ b/runtime/syntax/scss.vim @@ -0,0 +1,20 @@ +" Vim syntax file +" Language: SCSS +" Maintainer: Tim Pope +" Filenames: *.scss +" Last Change: 2010 Jul 26 + +if exists("b:current_syntax") + finish +endif + +runtime! syntax/sass.vim + +syn match scssComment "//.*" contains=sassTodo,@Spell +syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell + +hi def link scssComment sassComment + +let b:current_syntax = "scss" + +" vim:set sw=2: From 309262c0d96c7d4e6b0f29a166725d4842f8ab72 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 26 Jul 2010 22:51:28 +0200 Subject: [PATCH 02/51] Fix compiler warnings on 64 bit systems. --HG-- branch : vim73 --- src/gui.c | 8 ++++---- src/normal.c | 1 + src/proto/gui.pro | 2 +- src/quickfix.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui.c b/src/gui.c index 49014a532d..20a48d4975 100644 --- a/src/gui.c +++ b/src/gui.c @@ -4467,23 +4467,23 @@ gui_update_horiz_scrollbar(force) */ int gui_do_horiz_scroll(leftcol, compute_longest_lnum) - colnr_T leftcol; + long_u leftcol; int compute_longest_lnum; { /* no wrapping, no scrolling */ if (curwin->w_p_wrap) return FALSE; - if (curwin->w_leftcol == leftcol) + if (curwin->w_leftcol == (colnr_T)leftcol) return FALSE; - curwin->w_leftcol = leftcol; + curwin->w_leftcol = (colnr_T)leftcol; /* When the line of the cursor is too short, move the cursor to the * longest visible line. */ if (vim_strchr(p_go, GO_HORSCROLL) == NULL && !virtual_active() - && leftcol > scroll_line_len(curwin->w_cursor.lnum)) + && (colnr_T)leftcol > scroll_line_len(curwin->w_cursor.lnum)) { if (compute_longest_lnum) { diff --git a/src/normal.c b/src/normal.c index d880ee60dd..9e75afc9eb 100644 --- a/src/normal.c +++ b/src/normal.c @@ -4582,6 +4582,7 @@ nv_mousescroll(cap) if (!curwin->w_p_wrap) { int val, step = 6; + if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)) step = W_WIDTH(curwin); val = curwin->w_leftcol + (cap->arg == MSCR_RIGHT ? -step : +step); diff --git a/src/proto/gui.pro b/src/proto/gui.pro index fa5ce89441..29f87ef65d 100644 --- a/src/proto/gui.pro +++ b/src/proto/gui.pro @@ -46,7 +46,7 @@ void gui_drag_scrollbar __ARGS((scrollbar_T *sb, long value, int still_dragging) void gui_may_update_scrollbars __ARGS((void)); void gui_update_scrollbars __ARGS((int force)); int gui_do_scroll __ARGS((void)); -int gui_do_horiz_scroll __ARGS((colnr_T leftcol, int compute_longest_lnum)); +int gui_do_horiz_scroll __ARGS((long_u leftcol, int compute_longest_lnum)); void gui_check_colors __ARGS((void)); guicolor_T gui_get_color __ARGS((char_u *name)); int gui_get_lightness __ARGS((guicolor_T pixel)); diff --git a/src/quickfix.c b/src/quickfix.c index 883de8c725..3ecc81c724 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -898,7 +898,7 @@ qf_new_list(qi, qf_title) qi->qf_lists[qi->qf_curlist].qf_count = 0; if (qf_title != NULL) { - char_u *p = alloc(STRLEN(qf_title) + 2); + char_u *p = alloc((int)STRLEN(qf_title) + 2); qi->qf_lists[qi->qf_curlist].qf_title = p; if (p != NULL) From 60943f173fb59a18766f0f566b9ad03f2a4ff235 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 26 Jul 2010 22:51:56 +0200 Subject: [PATCH 03/51] Update TeX syntax file. --HG-- branch : vim73 --- runtime/doc/syntax.txt | 12 +- runtime/doc/todo.txt | 7 + runtime/syntax/tex.vim | 343 ++++++++++++++++++++++++++++------------- 3 files changed, 250 insertions(+), 112 deletions(-) diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index b37ceace5a..71afa9f031 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.3c. Last change: 2010 Jul 25 +*syntax.txt* For Vim version 7.3c. Last change: 2010 Jul 26 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2700,6 +2700,16 @@ such use of @ as an error. To solve this: > Putting "let g:tex_stylish=1" into your <.vimrc> will make always accept such use of @. + *tex-cchar* *tex-cole* *tex-conceal* +Taking Advantage of Conceal Mode~ + +If you have |'conceallevel'| set to 1 and if your encoding is utf-8, then a +number of character sequences will be translated (ie. better visualized) using +|syn-cchar|, including various accented characters, Greek characters in +MathZones, and superscripts and subscripts in MathZones. Not all characters +can be made into superscripts or subscripts; the constraint is due to what +utf-8 supports. + TF *tf.vim* *ft-tf-syntax* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 849fc893d2..1759b72ff2 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -33,11 +33,18 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. Access to free memory with :redir command. (Dominique Pelle, 2010 Jul 25) Easier way to reproduce in later message. +Patch for VMS. Zoltan Arpadffy, 2010 Jul 26. + Patch for :find completion. (Nazri Ramliy) But I prefer to keep term.h and include/term.h Nazri will work on it. Move more common code from if_python.c and if_python3.c to if_py_both.h +Problem with concealends in v50 of tex.vim? (Charles Campbell, 2010 Jul 26) + +Add filetype completion to user commands. (Christian Brabandt, 2010 Jul 26) +But call it "filetype" instead of "syntax". + Before release 7.3: - Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23) diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index c6928cffd7..9f27ccefc9 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: TeX " Maintainer: Dr. Charles E. Campbell, Jr. -" Last Change: Jun 24, 2010 -" Version: 48 +" Last Change: Jul 26, 2010 +" Version: 49 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax " " Notes: {{{1 @@ -110,7 +110,7 @@ if !exists("tex_no_math") syn cluster texMatchGroup add=@texMathZones syn cluster texMathDelimGroup contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2 syn cluster texMathMatchGroup contains=@texMathZones,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathMatcher,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone - syn cluster texMathZoneGroup contains=texComment,texDelimiter,texLength,texMathDelim,texMathMatcher,texMathOper,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle + syn cluster texMathZoneGroup contains=texComment,texDelimiter,texLength,texMathDelim,texMathMatcher,texMathOper,texMathSymbol,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle if !exists("g:tex_no_error") syn cluster texMathMatchGroup add=texMathError syn cluster texMathZoneGroup add=texMathError @@ -469,115 +469,236 @@ if !exists("g:tex_no_error") syn region texStyleMatcher matchgroup=Delimiter start="\[" end="]" contains=@texStyleGroup,texError contained endif -" support for +" Conceal mode support (supports set cole=1) {{{1 if has("conceal") && &enc == 'utf-8' - syn match texGreek '\\alpha\>' contained conceal cchar=α - syn match texGreek '\\beta\>' contained conceal cchar=β - syn match texGreek '\\gamma\>' contained conceal cchar=γ - syn match texGreek '\\delta\>' contained conceal cchar=δ - syn match texGreek '\\epsilon\>' contained conceal cchar=ϵ - syn match texGreek '\\varepsilon\>' contained conceal cchar=ε - syn match texGreek '\\zeta\>' contained conceal cchar=ζ - syn match texGreek '\\eta\>' contained conceal cchar=η - syn match texGreek '\\theta\>' contained conceal cchar=θ - syn match texGreek '\\vartheta\>' contained conceal cchar=ϑ - syn match texGreek '\\kappa\>' contained conceal cchar=κ - syn match texGreek '\\lambda\>' contained conceal cchar=λ - syn match texGreek '\\mu\>' contained conceal cchar=μ - syn match texGreek '\\nu\>' contained conceal cchar=ν - syn match texGreek '\\xi\>' contained conceal cchar=ξ - syn match texGreek '\\pi\>' contained conceal cchar=π - syn match texGreek '\\varpi\>' contained conceal cchar=ϖ - syn match texGreek '\\rho\>' contained conceal cchar=ρ - syn match texGreek '\\varrho\>' contained conceal cchar=ϱ - syn match texGreek '\\sigma\>' contained conceal cchar=σ - syn match texGreek '\\varsigma\>' contained conceal cchar=ς - syn match texGreek '\\tau\>' contained conceal cchar=τ - syn match texGreek '\\upsilon\>' contained conceal cchar=υ - syn match texGreek '\\phi\>' contained conceal cchar=φ - syn match texGreek '\\varphi\>' contained conceal cchar=ϕ - syn match texGreek '\\chi\>' contained conceal cchar=χ - syn match texGreek '\\psi\>' contained conceal cchar=ψ - syn match texGreek '\\omega\>' contained conceal cchar=ω - syn match texGreek '\\Gamma\>' contained conceal cchar=Γ - syn match texGreek '\\Delta\>' contained conceal cchar=Δ - syn match texGreek '\\Theta\>' contained conceal cchar=Θ - syn match texGreek '\\Lambda\>' contained conceal cchar=Λ - syn match texGreek '\\Xi\>' contained conceal cchar=Χ - syn match texGreek '\\Pi\>' contained conceal cchar=Π - syn match texGreek '\\Sigma\>' contained conceal cchar=Σ - syn match texGreek '\\Upsilon\>' contained conceal cchar=Υ - syn match texGreek '\\Phi\>' contained conceal cchar=Φ - syn match texGreek '\\Psi\>' contained conceal cchar=Ψ - syn match texGreek '\\Omega\>' contained conceal cchar=Ω - syn match texSuperscript '\^0' contained conceal cchar=⁰ - syn match texSuperscript '\^1' contained conceal cchar=¹ - syn match texSuperscript '\^2' contained conceal cchar=² - syn match texSuperscript '\^3' contained conceal cchar=³ - syn match texSuperscript '\^4' contained conceal cchar=⁴ - syn match texSuperscript '\^5' contained conceal cchar=⁵ - syn match texSuperscript '\^6' contained conceal cchar=⁶ - syn match texSuperscript '\^7' contained conceal cchar=⁷ - syn match texSuperscript '\^8' contained conceal cchar=⁸ - syn match texSuperscript '\^9' contained conceal cchar=⁹ - syn match texSuperscript '\^a' contained conceal cchar=ᵃ - syn match texSuperscript '\^b' contained conceal cchar=ᵇ - syn match texSuperscript '\^c' contained conceal cchar=ᶜ - syn match texSuperscript '\^d' contained conceal cchar=ᵈ - syn match texSuperscript '\^e' contained conceal cchar=ᵉ - syn match texSuperscript '\^f' contained conceal cchar=ᶠ - syn match texSuperscript '\^g' contained conceal cchar=ᵍ - syn match texSuperscript '\^h' contained conceal cchar=ʰ - syn match texSuperscript '\^i' contained conceal cchar=ⁱ - syn match texSuperscript '\^j' contained conceal cchar=ʲ - syn match texSuperscript '\^k' contained conceal cchar=ᵏ - syn match texSuperscript '\^l' contained conceal cchar=ˡ - syn match texSuperscript '\^m' contained conceal cchar=ᵐ - syn match texSuperscript '\^n' contained conceal cchar=ⁿ - syn match texSuperscript '\^o' contained conceal cchar=ᵒ - syn match texSuperscript '\^p' contained conceal cchar=ᵖ - syn match texSuperscript '\^r' contained conceal cchar=ʳ - syn match texSuperscript '\^s' contained conceal cchar=ˢ - syn match texSuperscript '\^t' contained conceal cchar=ᵗ - syn match texSuperscript '\^u' contained conceal cchar=ᵘ - syn match texSuperscript '\^v' contained conceal cchar=ᵛ - syn match texSuperscript '\^w' contained conceal cchar=ʷ - syn match texSuperscript '\^x' contained conceal cchar=ˣ - syn match texSuperscript '\^y' contained conceal cchar=ʸ - syn match texSuperscript '\^z' contained conceal cchar=ᶻ - syn match texSuperscript '\^A' contained conceal cchar=ᴬ - syn match texSuperscript '\^B' contained conceal cchar=ᴮ - syn match texSuperscript '\^D' contained conceal cchar=ᴰ - syn match texSuperscript '\^E' contained conceal cchar=ᴱ - syn match texSuperscript '\^G' contained conceal cchar=ᴳ - syn match texSuperscript '\^H' contained conceal cchar=ᴴ - syn match texSuperscript '\^I' contained conceal cchar=ᴵ - syn match texSuperscript '\^J' contained conceal cchar=ᴶ - syn match texSuperscript '\^K' contained conceal cchar=ᴷ - syn match texSuperscript '\^L' contained conceal cchar=ᴸ - syn match texSuperscript '\^M' contained conceal cchar=ᴹ - syn match texSuperscript '\^N' contained conceal cchar=ᴺ - syn match texSuperscript '\^O' contained conceal cchar=ᴼ - syn match texSuperscript '\^P' contained conceal cchar=ᴾ - syn match texSuperscript '\^R' contained conceal cchar=ᴿ - syn match texSuperscript '\^T' contained conceal cchar=ᵀ - syn match texSuperscript '\^U' contained conceal cchar=ᵁ - syn match texSuperscript '\^W' contained conceal cchar=ᵂ - syn match texSubscript '_0' contained conceal cchar=₀ - syn match texSubscript '_1' contained conceal cchar=₁ - syn match texSubscript '_2' contained conceal cchar=₂ - syn match texSubscript '_3' contained conceal cchar=₃ - syn match texSubscript '_4' contained conceal cchar=₄ - syn match texSubscript '_5' contained conceal cchar=₅ - syn match texSubscript '_6' contained conceal cchar=₆ - syn match texSubscript '_7' contained conceal cchar=₇ - syn match texSubscript '_8' contained conceal cchar=₈ - syn match texSubscript '_9' contained conceal cchar=₉ - syn match texSubscript '_a' contained conceal cchar=ₐ - syn match texSubscript '_e' contained conceal cchar=ₑ - syn match texSubscript '_i' contained conceal cchar=ᵢ - syn match texSubscript '_o' contained conceal cchar=ₒ - syn match texSubscript '_u' contained conceal cchar=ᵤ + + " Math Symbols {{{2 + syn match texMathSymbol '\\left(' contained conceal cchar=( + syn match texMathSymbol '\\right)' contained conceal cchar=) + syn match texMathSymbol '\\left{' contained conceal cchar={ + syn match texMathSymbol '\\right}' contained conceal cchar=} + syn match texMathSymbol '\\cdot\>' contained conceal cchar=· + syn match texMathSymbol '\\leq\>' contained conceal cchar=≤ + syn match texMathSymbol '\\geq\>' contained conceal cchar=≥ + syn match texMathSymbol '\\cdot\>' contained conceal cchar=· + syn match texMathSymbol '\\times\>' contained conceal cchar=× + syn match texMathSymbol '\\div\>' contained conceal cchar=÷ + syn match texMathSymbol '\\pm\>' contained conceal cchar=± + syn match texMathSymbol '\\neq\>' contained conceal cchar=≠ + syn match texMathSymbol '\\cong\>' contained conceal cchar=≅ + + " Greek {{{2 + fun! s:Greek(group,pat,cchar) + exe 'syn match '.a:group." '".a:pat."' contained conceal cchar=".a:cchar + endfun + call s:Greek('texGreek','\\alpha\>' ,'α') + call s:Greek('texGreek','\\beta\>' ,'β') + call s:Greek('texGreek','\\gamma\>' ,'γ') + call s:Greek('texGreek','\\delta\>' ,'δ') + call s:Greek('texGreek','\\epsilon\>' ,'ϵ') + call s:Greek('texGreek','\\varepsilon\>' ,'ε') + call s:Greek('texGreek','\\zeta\>' ,'ζ') + call s:Greek('texGreek','\\eta\>' ,'η') + call s:Greek('texGreek','\\theta\>' ,'θ') + call s:Greek('texGreek','\\vartheta\>' ,'ϑ') + call s:Greek('texGreek','\\kappa\>' ,'κ') + call s:Greek('texGreek','\\lambda\>' ,'λ') + call s:Greek('texGreek','\\mu\>' ,'μ') + call s:Greek('texGreek','\\nu\>' ,'ν') + call s:Greek('texGreek','\\xi\>' ,'ξ') + call s:Greek('texGreek','\\pi\>' ,'π') + call s:Greek('texGreek','\\varpi\>' ,'ϖ') + call s:Greek('texGreek','\\rho\>' ,'ρ') + call s:Greek('texGreek','\\varrho\>' ,'ϱ') + call s:Greek('texGreek','\\sigma\>' ,'σ') + call s:Greek('texGreek','\\varsigma\>' ,'ς') + call s:Greek('texGreek','\\tau\>' ,'τ') + call s:Greek('texGreek','\\upsilon\>' ,'υ') + call s:Greek('texGreek','\\phi\>' ,'φ') + call s:Greek('texGreek','\\varphi\>' ,'ϕ') + call s:Greek('texGreek','\\chi\>' ,'χ') + call s:Greek('texGreek','\\psi\>' ,'ψ') + call s:Greek('texGreek','\\omega\>' ,'ω') + call s:Greek('texGreek','\\Gamma\>' ,'Γ') + call s:Greek('texGreek','\\Delta\>' ,'Δ') + call s:Greek('texGreek','\\Theta\>' ,'Θ') + call s:Greek('texGreek','\\Lambda\>' ,'Λ') + call s:Greek('texGreek','\\Xi\>' ,'Χ') + call s:Greek('texGreek','\\Pi\>' ,'Π') + call s:Greek('texGreek','\\Sigma\>' ,'Σ') + call s:Greek('texGreek','\\Upsilon\>' ,'Υ') + call s:Greek('texGreek','\\Phi\>' ,'Φ') + call s:Greek('texGreek','\\Psi\>' ,'Ψ') + call s:Greek('texGreek','\\Omega\>' ,'Ω') + + " Superscripts/Subscripts {{{2 + syn region texSuperscript start='\^{' end='}' contained contains=texSuperscripts + syn region texSubscript start='_{' end='}' contained contains=texSubscripts + fun! s:SuperSub(group,leader,pat,cchar) + exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar + exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s' + endfun + call s:SuperSub('texSuperscript','\^','0','⁰') + call s:SuperSub('texSuperscript','\^','1','¹') + call s:SuperSub('texSuperscript','\^','2','²') + call s:SuperSub('texSuperscript','\^','3','³') + call s:SuperSub('texSuperscript','\^','4','⁴') + call s:SuperSub('texSuperscript','\^','5','⁵') + call s:SuperSub('texSuperscript','\^','6','⁶') + call s:SuperSub('texSuperscript','\^','7','⁷') + call s:SuperSub('texSuperscript','\^','8','⁸') + call s:SuperSub('texSuperscript','\^','9','⁹') + call s:SuperSub('texSuperscript','\^','a','ᵃ') + call s:SuperSub('texSuperscript','\^','b','ᵇ') + call s:SuperSub('texSuperscript','\^','c','ᶜ') + call s:SuperSub('texSuperscript','\^','d','ᵈ') + call s:SuperSub('texSuperscript','\^','e','ᵉ') + call s:SuperSub('texSuperscript','\^','f','ᶠ') + call s:SuperSub('texSuperscript','\^','g','ᵍ') + call s:SuperSub('texSuperscript','\^','h','ʰ') + call s:SuperSub('texSuperscript','\^','i','ⁱ') + call s:SuperSub('texSuperscript','\^','j','ʲ') + call s:SuperSub('texSuperscript','\^','k','ᵏ') + call s:SuperSub('texSuperscript','\^','l','ˡ') + call s:SuperSub('texSuperscript','\^','m','ᵐ') + call s:SuperSub('texSuperscript','\^','n','ⁿ') + call s:SuperSub('texSuperscript','\^','o','ᵒ') + call s:SuperSub('texSuperscript','\^','p','ᵖ') + call s:SuperSub('texSuperscript','\^','r','ʳ') + call s:SuperSub('texSuperscript','\^','s','ˢ') + call s:SuperSub('texSuperscript','\^','t','ᵗ') + call s:SuperSub('texSuperscript','\^','u','ᵘ') + call s:SuperSub('texSuperscript','\^','v','ᵛ') + call s:SuperSub('texSuperscript','\^','w','ʷ') + call s:SuperSub('texSuperscript','\^','x','ˣ') + call s:SuperSub('texSuperscript','\^','y','ʸ') + call s:SuperSub('texSuperscript','\^','z','ᶻ') + call s:SuperSub('texSuperscript','\^','A','ᴬ') + call s:SuperSub('texSuperscript','\^','B','ᴮ') + call s:SuperSub('texSuperscript','\^','D','ᴰ') + call s:SuperSub('texSuperscript','\^','E','ᴱ') + call s:SuperSub('texSuperscript','\^','G','ᴳ') + call s:SuperSub('texSuperscript','\^','H','ᴴ') + call s:SuperSub('texSuperscript','\^','I','ᴵ') + call s:SuperSub('texSuperscript','\^','J','ᴶ') + call s:SuperSub('texSuperscript','\^','K','ᴷ') + call s:SuperSub('texSuperscript','\^','L','ᴸ') + call s:SuperSub('texSuperscript','\^','M','ᴹ') + call s:SuperSub('texSuperscript','\^','N','ᴺ') + call s:SuperSub('texSuperscript','\^','O','ᴼ') + call s:SuperSub('texSuperscript','\^','P','ᴾ') + call s:SuperSub('texSuperscript','\^','R','ᴿ') + call s:SuperSub('texSuperscript','\^','T','ᵀ') + call s:SuperSub('texSuperscript','\^','U','ᵁ') + call s:SuperSub('texSuperscript','\^','W','ᵂ') + call s:SuperSub('texSuperscript','\^','+','⁺') + call s:SuperSub('texSuperscript','\^','-','⁻') + call s:SuperSub('texSuperscript','\^','<','˂') + call s:SuperSub('texSuperscript','\^','>','˃') + call s:SuperSub('texSuperscript','\^','/','ˊ') + call s:SuperSub('texSuperscript','\^','(','⁽') + call s:SuperSub('texSuperscript','\^',')','⁾') + call s:SuperSub('texSuperscript','\^','\.','˙') + call s:SuperSub('texSuperscript','\^','=','˭') + call s:SuperSub('texSubscript','_','0','₀') + call s:SuperSub('texSubscript','_','1','₁') + call s:SuperSub('texSubscript','_','2','₂') + call s:SuperSub('texSubscript','_','3','₃') + call s:SuperSub('texSubscript','_','4','₄') + call s:SuperSub('texSubscript','_','5','₅') + call s:SuperSub('texSubscript','_','6','₆') + call s:SuperSub('texSubscript','_','7','₇') + call s:SuperSub('texSubscript','_','8','₈') + call s:SuperSub('texSubscript','_','9','₉') + call s:SuperSub('texSubscript','_','a','ₐ') + call s:SuperSub('texSubscript','_','e','ₑ') + call s:SuperSub('texSubscript','_','i','ᵢ') + call s:SuperSub('texSubscript','_','o','ₒ') + call s:SuperSub('texSubscript','_','u','ᵤ') + call s:SuperSub('texSubscript','_','+','₊') + call s:SuperSub('texSubscript','_','-','₋') + call s:SuperSub('texSubscript','_','/','ˏ') + call s:SuperSub('texSubscript','_','(','₍') + call s:SuperSub('texSubscript','_',')','₎') + call s:SuperSub('texSubscript','_','\.','‸') + call s:SuperSub('texSubscript','_','r','ᵣ') + call s:SuperSub('texSubscript','_','v','ᵥ') + call s:SuperSub('texSubscript','_','x','ₓ') + call s:SuperSub('texSubscript','_','\\beta\>' ,'ᵦ') + call s:SuperSub('texSubscript','_','\\delta\>','ᵨ') + call s:SuperSub('texSubscript','_','\\phi\>' ,'ᵩ') + call s:SuperSub('texSubscript','_','\\gamma\>','ᵧ') + call s:SuperSub('texSubscript','_','\\chi\>' ,'ᵪ') + + " Accented characters: {{{2 + if b:tex_stylish + syn match texAccent "\\[bcdvuH][^a-zA-Z@]"me=e-1 + syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1 + else + syn match texAccent '\\`{a}' conceal cchar=à + syn match texAccent '\\\'{a}' conceal cchar=á + syn match texAccent '\\^{a}' conceal cchar=â + syn match texAccent '\\"{a}' conceal cchar=ä + syn match texAccent '\\\~{a}' conceal cchar=ã + syn match texAccent '\\r{a}' conceal cchar=å + syn match texAccent '\\`{A}' conceal cchar=À + syn match texAccent '\\\'{A}' conceal cchar=Á + syn match texAccent '\\^{A}' conceal cchar= + syn match texAccent '\\"{A}' conceal cchar=Ä + syn match texAccent '\\\~{A}' conceal cchar=à + syn match texAccent '\\r{A}' conceal cchar=Å + syn match texAccent '\\c{c}' conceal cchar=ç + syn match texAccent '\\`{e}' conceal cchar=è + syn match texAccent '\\\'{e}' conceal cchar=é + syn match texAccent '\\^{e}' conceal cchar=ê + syn match texAccent '\\"{e}' conceal cchar=ë + syn match texAccent '\\\~{e}' conceal cchar=ẽ + syn match texAccent '\\`{E}' conceal cchar=È + syn match texAccent '\\\'{E}' conceal cchar=É + syn match texAccent '\\^{E}' conceal cchar=Ê + syn match texAccent '\\"{E}' conceal cchar=Ë + syn match texAccent '\\\~{E}' conceal cchar=Ẽ + syn match texAccent '\\`{i}' conceal cchar=ì + syn match texAccent '\\\'{i}' conceal cchar=í + syn match texAccent '\\^{i}' conceal cchar=î + syn match texAccent '\\"{i}' conceal cchar=ï + syn match texAccent '\\\~{i}' conceal cchar=ĩ + syn match texAccent '\\`{I}' conceal cchar=Ì + syn match texAccent '\\\'{I}' conceal cchar=Í + syn match texAccent '\\^{I}' conceal cchar=Î + syn match texAccent '\\"{I}' conceal cchar=Ï + syn match texAccent '\\\~{I}' conceal cchar=Ĩ + syn match texAccent '\\`{o}' conceal cchar=ò + syn match texAccent '\\\'{o}' conceal cchar=ó + syn match texAccent '\\^{o}' conceal cchar=ô + syn match texAccent '\\"{o}' conceal cchar=ö + syn match texAccent '\\\~{o}' conceal cchar=õ + syn match texAccent '\\`{O}' conceal cchar=Ò + syn match texAccent '\\\'{O}' conceal cchar=Ó + syn match texAccent '\\^{O}' conceal cchar=Ô + syn match texAccent '\\"{O}' conceal cchar=Ö + syn match texAccent '\\\~{O}' conceal cchar=Õ + syn match texAccent '\\`{u}' conceal cchar=ù + syn match texAccent '\\\'{u}' conceal cchar=ú + syn match texAccent '\\^{u}' conceal cchar=û + syn match texAccent '\\"{u}' conceal cchar=ü + syn match texAccent '\\\~{u}' conceal cchar=ũ + syn match texAccent '\\`{U}' conceal cchar=Ù + syn match texAccent '\\\'{U}' conceal cchar=Ú + syn match texAccent '\\^{U}' conceal cchar=Û + syn match texAccent '\\"{U}' conceal cchar=Ü + syn match texAccent '\\\~{U}' conceal cchar=Ũ + syn match texAccent '\\`{y}' conceal cchar=ỳ + syn match texAccent '\\\'{y}' conceal cchar=ý + syn match texAccent '\\^{y}' conceal cchar=ŷ + syn match texAccent '\\"{y}' conceal cchar=ÿ + syn match texAccent '\\\~{y}' conceal cchar=ỹ + syn match texAccent '\\`{Y}' conceal cchar=Ỳ + syn match texAccent '\\\'{Y}' conceal cchar=Ý + syn match texAccent '\\^{Y}' conceal cchar=Ŷ + syn match texAccent '\\"{Y}' conceal cchar=Ÿ + syn match texAccent '\\\~{Y}' conceal cchar=Ỹ + endif endif " --------------------------------------------------------------------- From 89a4db0de315cab938868f7137780f133fd30090 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 27 Jul 2010 20:47:25 +0200 Subject: [PATCH 04/51] Fix for "concealends". (Vince Negri) --HG-- branch : vim73 --- src/syntax.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/syntax.c b/src/syntax.c index cb87a02022..4655c77660 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2497,6 +2497,7 @@ push_next_match(cur_si) cur_si->si_end_idx = 0; cur_si->si_flags = HL_MATCH; #ifdef FEAT_CONCEAL + cur_si->si_seqnr = next_seqnr++; cur_si->si_flags |= save_flags; if (cur_si->si_flags & HL_CONCEALENDS) cur_si->si_flags |= HL_CONCEAL; @@ -2546,6 +2547,7 @@ check_state_ends() cur_si->si_h_endpos = cur_si->si_eoe_pos; cur_si->si_flags |= HL_MATCH; #ifdef FEAT_CONCEAL + cur_si->si_seqnr = next_seqnr++; if (cur_si->si_flags & HL_CONCEALENDS) cur_si->si_flags |= HL_CONCEAL; #endif From b6f95fa663f81fe097c1c397a40f7fdfa8a1cad0 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 27 Jul 2010 22:41:43 +0200 Subject: [PATCH 05/51] Fix build warnings and problems for tiny/small Win32 build. (Mike Williams) --HG-- branch : vim73 --- src/eval.c | 2 +- src/ex_cmds2.c | 11 ++++++----- src/feature.h | 3 ++- src/gui_w48.c | 2 ++ src/os_mswin.c | 2 +- src/structs.h | 31 +++++++++++++++++-------------- 6 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/eval.c b/src/eval.c index ac0ad26792..58c89c88d1 100644 --- a/src/eval.c +++ b/src/eval.c @@ -13508,7 +13508,7 @@ find_some_match(argvars, rettv, type) startcol = (colnr_T)(regmatch.startp[0] + (*mb_ptr2len)(regmatch.startp[0]) - str); #else - startcol = regmatch.startp[0] + 1 - str; + startcol = (colnr_T)(regmatch.startp[0] + 1 - str); #endif } } diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index f07bb4ce6e..f7ffb087af 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -3857,6 +3857,7 @@ ex_checktime(eap) #if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ && (defined(FEAT_EVAL) || defined(FEAT_MULTI_LANG)) +# define HAVE_GET_LOCALE_VAL static char *get_locale_val __ARGS((int what)); static char * @@ -3946,7 +3947,7 @@ get_mess_lang() { char_u *p; -# if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) +# ifdef HAVE_GET_LOCALE_VAL # if defined(LC_MESSAGES) p = (char_u *)get_locale_val(LC_MESSAGES); # else @@ -3997,7 +3998,7 @@ get_mess_env() p = mch_getenv((char_u *)"LANG"); if (p != NULL && VIM_ISDIGIT(*p)) p = NULL; /* ignore something like "1043" */ -# if defined(HAVE_LOCALE_H) || defined(X_LOCALE) +# ifdef HAVE_GET_LOCALE_VAL if (p == NULL || *p == NUL) p = (char_u *)get_locale_val(LC_CTYPE); # endif @@ -4018,7 +4019,7 @@ set_lang_var() { char_u *loc; -# if defined(HAVE_LOCALE_H) || defined(X_LOCALE) +# ifdef HAVE_GET_LOCALE_VAL loc = (char_u *)get_locale_val(LC_CTYPE); # else /* setlocale() not supported: use the default value */ @@ -4028,14 +4029,14 @@ set_lang_var() /* When LC_MESSAGES isn't defined use the value from $LC_MESSAGES, fall * back to LC_CTYPE if it's empty. */ -# if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) && defined(LC_MESSAGES) +# if defined(HAVE_GET_LOCALE_VAL) && defined(LC_MESSAGES) loc = (char_u *)get_locale_val(LC_MESSAGES); # else loc = get_mess_env(); # endif set_vim_var_string(VV_LANG, loc, -1); -# if defined(HAVE_LOCALE_H) || defined(X_LOCALE) +# ifdef HAVE_GET_LOCALE_VAL loc = (char_u *)get_locale_val(LC_TIME); # endif set_vim_var_string(VV_LC_TIME, loc, -1); diff --git a/src/feature.h b/src/feature.h index 3f25898a03..ea79758af8 100644 --- a/src/feature.h +++ b/src/feature.h @@ -819,7 +819,8 @@ # endif #endif #if !defined(FEAT_GUI_DIALOG) && (defined(FEAT_GUI_MOTIF) \ - || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK)) + || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) \ + || defined(FEAT_GUI_W32)) /* need a dialog to show error messages when starting from the desktop */ # define FEAT_GUI_DIALOG #endif diff --git a/src/gui_w48.c b/src/gui_w48.c index 00d86fd0d7..80b75ff384 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -3901,7 +3901,9 @@ get_cmd_args(char *prog, char *cmdline, char ***argvp, char **tofree) } } +#ifdef FEAT_MBYTE done: +#endif argv[argc] = NULL; /* NULL-terminated list */ *argvp = argv; return argc; diff --git a/src/os_mswin.c b/src/os_mswin.c index 6b7e896cbb..6ee6379e10 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -2548,7 +2548,7 @@ serverSendEnc(HWND target) data.cbData = (DWORD)STRLEN(p_enc) + 1; data.lpData = p_enc; #else - data.cbData = STRLEN("latin1") + 1; + data.cbData = (DWORD)STRLEN("latin1") + 1; data.lpData = "latin1"; #endif (void)SendMessage(target, WM_COPYDATA, (WPARAM)message_window, diff --git a/src/structs.h b/src/structs.h index 7b8acee790..d959b5c090 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1202,20 +1202,20 @@ typedef struct { int b_syn_folditems; /* number of patterns with the HL_FOLD flag set */ # endif -/* - * b_sst_array[] contains the state stack for a number of lines, for the start - * of that line (col == 0). This avoids having to recompute the syntax state - * too often. - * b_sst_array[] is allocated to hold the state for all displayed lines, and - * states for 1 out of about 20 other lines. - * b_sst_array pointer to an array of synstate_T - * b_sst_len number of entries in b_sst_array[] - * b_sst_first pointer to first used entry in b_sst_array[] or NULL - * b_sst_firstfree pointer to first free entry in b_sst_array[] or NULL - * b_sst_freecount number of free entries in b_sst_array[] - * b_sst_check_lnum entries after this lnum need to be checked for - * validity (MAXLNUM means no check needed) - */ + /* + * b_sst_array[] contains the state stack for a number of lines, for the + * start of that line (col == 0). This avoids having to recompute the + * syntax state too often. + * b_sst_array[] is allocated to hold the state for all displayed lines, + * and states for 1 out of about 20 other lines. + * b_sst_array pointer to an array of synstate_T + * b_sst_len number of entries in b_sst_array[] + * b_sst_first pointer to first used entry in b_sst_array[] or NULL + * b_sst_firstfree pointer to first free entry in b_sst_array[] or NULL + * b_sst_freecount number of free entries in b_sst_array[] + * b_sst_check_lnum entries after this lnum need to be checked for + * validity (MAXLNUM means no check needed) + */ synstate_T *b_sst_array; int b_sst_len; synstate_T *b_sst_first; @@ -1237,6 +1237,9 @@ typedef struct { char_u *b_p_spf; /* 'spellfile' */ char_u *b_p_spl; /* 'spelllang' */ #endif +#if !defined(FEAT_SYN_HL) && !defined(FEAT_SPELL) + int dummy; +#endif } synblock_T; From 58fad7d1eea3f050818552140cf5c4985536c79f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 27 Jul 2010 22:50:36 +0200 Subject: [PATCH 06/51] Updated runtime files. New netrw plugin version. --HG-- branch : vim73 --- runtime/autoload/netrw.vim | 231 +++++++++++++++++---------------- runtime/doc/map.txt | 4 +- runtime/doc/pi_netrw.txt | 55 ++++++-- runtime/doc/todo.txt | 24 +++- runtime/indent/haml.vim | 2 +- runtime/plugin/netrwPlugin.vim | 6 +- 6 files changed, 183 insertions(+), 139 deletions(-) diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 70b146d648..b05f81db8b 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,10 +1,10 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: May 14, 2010 -" Version: 138 +" Date: Jul 27, 2010 +" Version: 139 " Maintainer: Charles E Campbell, Jr " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim -" Copyright: Copyright (C) 1999-2009 Charles E. Campbell, Jr. {{{1 +" Copyright: Copyright (C) 1999-2010 Charles E. Campbell, Jr. {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v138" +let g:loaded_netrw = "v139" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrw needs vim 7.2" @@ -153,6 +153,7 @@ call s:NetrwInit("g:netrw_alto" , &sb) call s:NetrwInit("g:netrw_altv" , &spr) call s:NetrwInit("g:netrw_banner" , 1) call s:NetrwInit("g:netrw_browse_split", 0) +call s:NetrwInit("g:netrw_bufsettings" , "noma nomod nonu nobl nowrap ro") call s:NetrwInit("g:netrw_chgwin" , -1) call s:NetrwInit("g:netrw_compress" , "gzip") call s:NetrwInit("g:netrw_ctags" , "ctags") @@ -163,7 +164,7 @@ if !exists("g:netrw_cursorline") endif " Default values - d-g ---------- {{{3 call s:NetrwInit("g:netrw_dirhist_cnt" , 0) -call s:NetrwInit("g:netrw_decompress" , '{ ".gz" : "gunzip", ".bz2" : "bunzip2", ".zip" : "unzip", ".tar" : "tar -xf"}') +call s:NetrwInit("g:netrw_decompress" , '{ ".gz" : "gunzip", ".bz2" : "bunzip2", ".zip" : "unzip", ".tar" : "tar -xf", ".xz" : "unxz" }') call s:NetrwInit("g:netrw_dirhistmax" , 10) call s:NetrwInit("g:netrw_fastbrowse" , 1) call s:NetrwInit("g:netrw_ftp_browse_reject", '^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$') @@ -325,7 +326,7 @@ fun! s:NetrwOptionSave(vt) " call Dret("s:NetrwOptionSave : options already saved") return endif -" call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")) +" call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")." diff=".&l:diff) " Save current settings and current directory let s:yykeep = @@ @@ -340,6 +341,7 @@ fun! s:NetrwOptionSave(vt) let {a:vt}netrw_cinokeep = &l:cino let {a:vt}netrw_comkeep = &l:com let {a:vt}netrw_cpokeep = &l:cpo + let {a:vt}netrw_diffkeep = &l:diff if g:netrw_keepdir let {a:vt}netrw_dirkeep = getcwd() endif @@ -349,6 +351,7 @@ fun! s:NetrwOptionSave(vt) let {a:vt}netrw_imkeep = &l:im let {a:vt}netrw_magickeep = &l:magic let {a:vt}netrw_repkeep = &l:report + let {a:vt}netrw_selkeep = &l:sel let {a:vt}netrw_spellkeep = &l:spell let {a:vt}netrw_twkeep = &l:tw " textwidth let {a:vt}netrw_wigkeep = &l:wig " wildignore @@ -398,6 +401,7 @@ fun! s:NetrwOptionRestore(vt) if exists("{a:vt}netrw_cinokeep") |let &l:cino = {a:vt}netrw_cinokeep |unlet {a:vt}netrw_cinokeep |endif if exists("{a:vt}netrw_comkeep") |let &l:com = {a:vt}netrw_comkeep |unlet {a:vt}netrw_comkeep |endif if exists("{a:vt}netrw_cpokeep") |let &l:cpo = {a:vt}netrw_cpokeep |unlet {a:vt}netrw_cpokeep |endif + if exists("{a:vt}netrw_diffkeep") |let &l:diff = {a:vt}netrw_diffkeep |unlet {a:vt}netrw_diffkeep |endif if exists("{a:vt}netrw_dirkeep") && isdirectory({a:vt}netrw_dirkeep) && g:netrw_keepdir let dirkeep = substitute({a:vt}netrw_dirkeep,'\\','/','g') if exists("{a:vt}netrw_dirkeep") |exe "keepjumps lcd ".fnameescape(dirkeep)|unlet {a:vt}netrw_dirkeep |endif @@ -408,6 +412,7 @@ fun! s:NetrwOptionRestore(vt) if exists("{a:vt}netrw_imkeep") |let &l:im = {a:vt}netrw_imkeep |unlet {a:vt}netrw_imkeep |endif if exists("{a:vt}netrw_magic") |let &l:magic = {a:vt}netrw_magic |unlet {a:vt}netrw_magic |endif if exists("{a:vt}netrw_repkeep") |let &l:report = {a:vt}netrw_repkeep |unlet {a:vt}netrw_repkeep |endif + if exists("{a:vt}netrw_selkeep") |let &l:sel = {a:vt}netrw_selkeep |unlet {a:vt}netrw_selkeep |endif if exists("{a:vt}netrw_spellkeep")|let &l:spell = {a:vt}netrw_spellkeep |unlet {a:vt}netrw_spellkeep|endif if exists("{a:vt}netrw_twkeep") |let &l:tw = {a:vt}netrw_twkeep |unlet {a:vt}netrw_twkeep |endif if exists("{a:vt}netrw_wigkeep") |let &l:wig = {a:vt}netrw_wigkeep |unlet {a:vt}netrw_wigkeep |endif @@ -433,6 +438,7 @@ fun! s:NetrwOptionRestore(vt) " call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd) " call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")) " call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap) +" call Decho("diff=".&l:diff." win#".winnr()." w:netrw_diffkeep=".(exists("w:netrw_diffkeep")? w:netrw_diffkeep : "doesn't exist")) " call Dret("s:NetrwOptionRestore : win#".winnr()." buf#".bufnr("%")) endfun @@ -450,12 +456,14 @@ fun! s:NetrwSafeOptions() setlocal tw=0 setlocal report=10000 setlocal isk+=@ isk+=* isk+=/ + setlocal sel=inclusive if g:netrw_use_noswf && has("win32") && !has("win95") setlocal noswf endif call s:NetrwCursorline() " allow the user to override safe options +" call Decho("ft<".&ft."> ei=".&ei) if &ft == "netrw" " call Decho("do any netrw FileType autocmds") silent keepalt keepjumps doau FileType netrw @@ -920,7 +928,7 @@ fun! netrw#NetRead(mode,...) unlet b:netrw_method unlet b:netrw_fname endif - if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't' + if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't' && tmpfile !~ '.tar.xz$' && tmpfile !~ '.txz' " call Decho("cleanup by deleting tmpfile<".tmpfile.">") call s:NetrwDelete(tmpfile) endif @@ -1371,8 +1379,8 @@ fun! s:NetrwGetFile(readcmd, tfile, method) else let tfile= a:tfile endif -" call Decho("exe silent! keepalt file ".fnameescape(tfile)) - exe "silent! keepalt file ".fnameescape(tfile) +" call Decho("exe sil! keepalt file ".fnameescape(tfile)) + exe "sil! keepalt file ".fnameescape(tfile) " edit temporary file (ie. read the temporary file in) if rfile =~ '\.zip$' @@ -1381,19 +1389,25 @@ fun! s:NetrwGetFile(readcmd, tfile, method) elseif rfile =~ '\.tar$' " call Decho("handling remote tar file with tar#Browse(tfile<".tfile.">)") call tar#Browse(tfile) - elseif rfile =~ '\.tar\.gz' + elseif rfile =~ '\.tar\.gz$' " call Decho("handling remote gzip-compressed tar file") call tar#Browse(tfile) - elseif rfile =~ '\.tar\.bz2' + elseif rfile =~ '\.tar\.bz2$' " call Decho("handling remote bz2-compressed tar file") call tar#Browse(tfile) + elseif rfile =~ '\.tar\.xz$' +" call Decho("handling remote xz-compressed tar file") + call tar#Browse(tfile) + elseif rfile =~ '\.txz$' +" call Decho("handling remote xz-compressed tar file (.txz)") + call tar#Browse(tfile) else " call Decho("edit temporary file") e! endif " rename buffer back to remote filename -" call Decho("exe silent! keepalt file ".fnameescape(rfile)) +" call Decho("exe sil! keepalt file ".fnameescape(rfile)) exe "sil! keepalt file ".fnameescape(rfile) filetype detect " call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!") @@ -2242,8 +2256,6 @@ fun! s:NetrwBrowse(islocal,dirname) if !exists("s:netrw_initbookhist") call s:NetrwBookHistRead() endif -" call FOTEST(7) -"call Decho("COMBAK#01 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " simplify the dirname (especially for ".."s in dirnames) if a:dirname !~ '^\a\+://' @@ -2251,8 +2263,6 @@ fun! s:NetrwBrowse(islocal,dirname) else let dirname= a:dirname endif -" call FOTEST(8) -"call Decho("COMBAK#02 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") if exists("s:netrw_skipbrowse") unlet s:netrw_skipbrowse @@ -2271,17 +2281,13 @@ fun! s:NetrwBrowse(islocal,dirname) return endif - call s:NetrwOptionSave("w:") -" call FOTEST(9) -"call Decho("COMBAK#03 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") + call s:NetrwOptionSave("w:") " re-instate any marked files if exists("s:netrwmarkfilelist_{bufnr('%')}") " call Decho("clearing marked files") exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/" endif -" call FOTEST(10) -"call Decho("COMBAK#04 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep " call Decho("handle w:netrw_acdkeep:") @@ -2308,11 +2314,11 @@ fun! s:NetrwBrowse(islocal,dirname) setlocal ma noro " call Decho("setlocal ma noro") let b:netrw_curdir= dirname -" call Decho("exe silent! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path)." (bt=".&bt.")") +" call Decho("exe sil! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path)." (bt=".&bt.")") exe "sil! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path) - exe "sil keepalt doau BufReadPre ".fnameescape(s:fname) + exe "sil! keepalt doau BufReadPre ".fnameescape(s:fname) silent call netrw#NetRead(2,s:method."://".s:user.s:machine."/".s:path) - if s:path !~ '.tar.bz2$' && s:path !~ '.tar.gz' + if s:path !~ '.tar.bz2$' && s:path !~ '.tar.gz' && s:path !~ '.tar.xz' && s:path !~ '.txz' " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error exe "sil keepalt doau BufReadPost ".fnameescape(s:fname) endif @@ -2326,8 +2332,6 @@ fun! s:NetrwBrowse(islocal,dirname) " call Dret("s:NetrwBrowse : file<".s:fname.">") return endif -" call FOTEST(11) -"call Decho("COMBAK#05 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " use buffer-oriented WinVars if buffer ones exist but window ones don't {{{3 call s:UseBufWinVars() @@ -2339,8 +2343,6 @@ fun! s:NetrwBrowse(islocal,dirname) " set up menu {{{3 call s:NetrwMenu(1) -" call FOTEST(12) -"call Decho("COMBAK#06 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " set up buffer {{{3 let reusing= s:NetrwGetBuffer(a:islocal,dirname) @@ -2360,12 +2362,10 @@ fun! s:NetrwBrowse(islocal,dirname) " call Dret("s:NetrwBrowse : re-using buffer") return endif -"" call FOTEST(13) " PROBLEM WITH LISTING -"call Decho("COMBAK#07 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " set b:netrw_curdir to the new directory name {{{3 " call Decho("set b:netrw_curdir to the new directory name: (buf#".bufnr("%").")") - let b:netrw_curdir= dirname + let b:netrw_curdir= dirname if b:netrw_curdir =~ '[/\\]$' let b:netrw_curdir= substitute(b:netrw_curdir,'[/\\]$','','e') endif @@ -2383,8 +2383,6 @@ fun! s:NetrwBrowse(islocal,dirname) let b:netrw_curdir= b:netrw_curdir.'/' endif " call Decho("b:netrw_curdir<".b:netrw_curdir.">") -"" call FOTEST(14) " PROBLEM WITH LISTING -"call Decho("COMBAK#08 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " ------------ " (local only) {{{3 @@ -2456,17 +2454,12 @@ fun! s:NetrwBrowse(islocal,dirname) let b:netrw_curdir= dirname " call Decho("b:netrw_curdir<".b:netrw_curdir."> (remote)") endif " (additional remote handling) -"" call FOTEST(15) " PROBLEM WITH LISTING -"call Decho("COMBAK#09 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " ----------------------- " Directory Listing: {{{3 " ----------------------- call s:BrowserMaps(a:islocal) -"" call FOTEST(16) " PROBLEM WITH LISTING call s:PerformListing(a:islocal) -" call FOTEST(17) -"call Decho("COMBAK#10 buf(%)#".bufnr("%")."<".bufname("%")."> win#".winnr()." bufnr(win#1)=".winbufnr(1)."<".bufname(winbufnr(1))." bufnr(win#2)=".winbufnr(2)."<".bufname(winbufnr(2)).">") " The s:LocalBrowseShellCmdRefresh() function is called by an autocmd " installed by s:LocalFastBrowser() when g:netrw_fastbrowse <= 1 (ie. slow, medium speed). @@ -2534,7 +2527,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Decho(" re-use w:netrw_treebufnr=".w:netrw_treebufnr) let eikeep= &ei set ei=all - exe "b ".w:netrw_treebufnr + exe "sil! b ".w:netrw_treebufnr let &ei= eikeep " call Dret("s:NetrwGetBuffer : bufnum#".w:netrw_treebufnr."") return @@ -2614,7 +2607,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) endif " get enew buffer and name it -or- re-use buffer {{{3 - keepj mark ' + sil! keepj mark ' if bufnum < 0 || !bufexists(bufnum) " call Decho("--get enew buffer and name it (bufexists([bufnum=".bufnum."])=".bufexists(bufnum).")") call s:NetrwEnew(dirname) @@ -2629,7 +2622,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) let s:netrw_treelistnum= s:netrw_treelistnum + 1 endif let w:netrw_treebufnr= bufnr("%") -" call Decho(" exe silent! keepalt file NetrwTreeListing ".fnameescape(s:netrw_treelistnum)) +" call Decho(" exe sil! keepalt file NetrwTreeListing ".fnameescape(s:netrw_treelistnum)) exe 'sil! keepalt file NetrwTreeListing\ '.fnameescape(s:netrw_treelistnum) set bt=nofile noswf nnoremap [ :silent call TreeListMove('[') @@ -2641,7 +2634,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) " let v:errmsg= "" " Decho let escdirname= fnameescape(dirname) " call Decho(" errmsg<".v:errmsg."> bufnr(escdirname<".escdirname.">)=".bufnr(escdirname)." bufname()<".bufname(bufnr(escdirname)).">") -" call Decho(' exe silent! keepalt file '.escdirname) +" call Decho(' exe sil! keepalt file '.escdirname) " let v:errmsg= "" " Decho exe 'sil! keepalt file '.escdirname " call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">") @@ -2654,13 +2647,13 @@ fun! s:NetrwGetBuffer(islocal,dirname) set ei=all if getline(2) =~ '^" Netrw Directory Listing' " call Decho(" re-use buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: keepalt b ".bufnum) - exe "keepalt b ".bufnum + exe "sil! keepalt b ".bufnum else " call Decho(" reusing buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: b ".bufnum) - exe "b ".bufnum + exe "sil! b ".bufnum endif if bufname("%") == '.' -" call Decho("exe silent! keepalt file ".fnameescape(getcwd())) +" call Decho("exe sil! keepalt file ".fnameescape(getcwd())) exe "sil! keepalt file ".fnameescape(getcwd()) endif let &ei= eikeep @@ -2689,8 +2682,8 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Decho("--do netrw settings: make this buffer#".bufnr("%")." not-a-file, modifiable, not line-numbered, etc--") let fname= expand("%") call s:NetrwListSettings(a:islocal) -" call Decho("exe keepalt file ".fnameescape(fname)) - exe "keepalt file ".fnameescape(fname) +" call Decho("exe sil! keepalt file ".fnameescape(fname)) + exe "sil! keepalt file ".fnameescape(fname) " delete all lines from buffer {{{3 " call Decho("--delete all lines from buffer--") @@ -2831,8 +2824,8 @@ fun! s:NetrwListSettings(islocal) let fname= bufname("%") " call Decho("setlocal bt=nofile nobl ma nonu nowrap noro") setlocal bt=nofile nobl ma nonu nowrap noro -" call Decho("exe keepalt file ".fnameescape(fname)) - exe "keepalt file ".fnameescape(fname) +" call Decho("exe sil! keepalt file ".fnameescape(fname)) + exe "sil! keepalt file ".fnameescape(fname) if g:netrw_use_noswf setlocal noswf endif @@ -2891,7 +2884,7 @@ fun! s:NetrwListStyle(islocal) " clear buffer - this will cause NetrwBrowse/LocalBrowseCheck to do a refresh " call Decho("clear buffer<".expand("%")."> with :%d") - keepj %d + sil! keepj %d " following prevents tree listing buffer from being marked "modified" setlocal nomod @@ -2903,11 +2896,11 @@ fun! s:NetrwListStyle(islocal) call s:NetrwCursorline() " keep cursor on the filename - sil keepj $ + sil! keepj $ let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc') " call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A')) if result <= 0 && exists("w:netrw_bannercnt") - exe "keepj ".w:netrw_bannercnt + exe "sil! keepj ".w:netrw_bannercnt endif " call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : "")) @@ -3095,6 +3088,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) endif endif endif + " the point where netrw actually edits the (local) file " if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will if a:islocal @@ -3110,9 +3104,12 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " or as a list of function references. It will ignore anything that's not " a function reference. See :help Funcref for information about function references. if exists("g:Netrw_funcref") +" call Decho("handle optional Funcrefs") if type(g:Netrw_funcref) == 2 +" call Decho("handling a g:Netrw_funcref") call g:Netrw_funcref() elseif type(g:Netrw_funcref) == 3 +" call Decho("handling a list of g:Netrw_funcrefs") for Fncref in g:Netrw_funcref if type(FncRef) == 2 call FncRef() @@ -3246,8 +3243,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) call s:NetrwOptionRestore("s:") if dolockout -" call Decho("doing modification lockout settings: ma nomod noro") - setlocal ma nomod noro +" call Decho("filewritable(dirname<".dirname.">)=".filewritable(dirname)) + if filewritable(dirname) +" call Decho("doing modification lockout settings: ma nomod noro") + setlocal ma nomod noro + else +" call Decho("doing modification lockout settings: ma nomod ro") + setlocal ma nomod ro + endif " call Decho("setlocal ma nomod noro") endif @@ -3510,7 +3513,6 @@ fun! netrw#Explore(indx,dosplit,style,...) let curdir = simplify(b:netrw_curdir) let curfiledir = substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e') " call Decho("curdir<".curdir."> curfiledir<".curfiledir.">") -" call FOTEST(1) " save registers sil! let keepregstar = @* @@ -3561,7 +3563,6 @@ fun! netrw#Explore(indx,dosplit,style,...) " call Decho("case a:dosplit=".a:dosplit." AND modified=".&modified." AND a:style=".a:style." is not 6") endif keepj norm! 0 -" call FOTEST(2) if a:0 > 0 " call Decho("case [a:0=".a:0."] > 0: a:1<".a:1.">") @@ -3596,7 +3597,6 @@ fun! netrw#Explore(indx,dosplit,style,...) return endif -" call FOTEST(3) " call Decho("dirname<".dirname.">") if dirname =~ '\.\./\=$' let dirname= simplify(fnamemodify(dirname,':p:h')) @@ -3648,7 +3648,6 @@ fun! netrw#Explore(indx,dosplit,style,...) let starpat= 0 " call Decho("default case: starpat=".starpat) endif -" call FOTEST(4) if starpat == 0 && a:indx >= 0 " [Explore Hexplore Vexplore Sexplore] [dirname] @@ -3875,7 +3874,6 @@ fun! netrw#Explore(indx,dosplit,style,...) call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir)) endif endif -" call FOTEST(5) " visual display of **/ **// */ Exploration files " call Decho("w:netrw_explore_indx=".(exists("w:netrw_explore_indx")? w:netrw_explore_indx : "doesn't exist")) @@ -3920,7 +3918,6 @@ fun! netrw#Explore(indx,dosplit,style,...) echo " " " call Decho("cleared explore match list") endif -" call FOTEST(6) sil! let @* = keepregstar sil! let @+ = keepregstar @@ -4390,7 +4387,7 @@ endfun " using g:netrw_compress_suffix to know which to " do. By default: " g:netrw_compress = "gzip" -" g:netrw_decompress = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf"} +" g:netrw_decompress = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf", ".xz" : "unxz"} fun! s:NetrwMarkFileCompress(islocal) " call Dfunc("s:NetrwMarkFileCompress(islocal=".a:islocal.")") let svpos = netrw#NetrwSavePosn() @@ -4423,6 +4420,7 @@ fun! s:NetrwMarkFileCompress(islocal) endif break endif + unlet sfx endfor if exists("exe") unlet exe @@ -5219,6 +5217,7 @@ fun! s:NetrwMenu(domenu) exe 'sil! menu '.g:NetrwMenuPriority.'.9.4 '.g:NetrwTopLvlMenu.'Browsing\ Control.Refresh\ Listing'." \" exe 'sil! menu '.g:NetrwMenuPriority.'.9.5 '.g:NetrwTopLvlMenu.'Browsing\ Control.Settings/Options:NetrwSettings '.":NetrwSettings\" exe 'sil! menu '.g:NetrwMenuPriority.'.10 '.g:NetrwTopLvlMenu.'Delete\ File/DirectoryD D' + exe 'sil! menu '.g:NetrwMenuPriority.'.11.1 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.Create\ New\ File% %' exe 'sil! menu '.g:NetrwMenuPriority.'.11.1 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Current\ Window '."\" exe 'sil! menu '.g:NetrwMenuPriority.'.11.2 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.Preview\ File/Directoryp p' exe 'sil! menu '.g:NetrwMenuPriority.'.11.3 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Previous\ WindowP P' @@ -5814,7 +5813,7 @@ fun! s:NetrwRefresh(islocal,dirname) setlocal ma noro " call Decho("setlocal ma noro") " call Decho("clear buffer<".expand("%")."> with :%d") - keepj %d + sil! keepj %d if a:islocal call netrw#LocalBrowseCheck(a:dirname) else @@ -6093,7 +6092,7 @@ fun! s:NetrwTreeDir() " call Decho("user attempted to close treeroot") " now force a refresh " call Decho("clear buffer<".expand("%")."> with :%d") - keepj %d + sil! keepj %d " call Dret("NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">") return b:netrw_curdir endif @@ -6174,7 +6173,7 @@ fun! s:NetrwTreeDisplay(dir,depth) call s:NetrwTreeDisplay(direntry.'/',depth) else " call Decho("<".entry."> is not a key in treedict (no subtree)") - keepj call setline(line("$")+1,depth.entry) + sil! keepj call setline(line("$")+1,depth.entry) endif endfor " call Dret("NetrwTreeDisplay") @@ -6206,10 +6205,10 @@ fun! s:NetrwTreeListing(dirname) " update the directory listing for the current directory " call Decho("updating dictionary with ".a:dirname.":[..directory listing..]") " call Decho("bannercnt=".w:netrw_bannercnt." line($)=".line("$")) - exe "silent! keepjumps ".w:netrw_bannercnt.',$g@^\.\.\=/$@d' + exe "sil! keepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d' let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$")) " call Decho("w:treedict[".a:dirname."]= ".string(w:netrw_treedict[a:dirname])) - exe "silent! keepjumps ".w:netrw_bannercnt.",$d" + exe "sil! keepj ".w:netrw_bannercnt.",$d" " if past banner, record word if exists("w:netrw_bannercnt") && line(".") > w:netrw_bannercnt @@ -6263,21 +6262,21 @@ fun! s:NetrwWideListing() let newcolstart = w:netrw_bannercnt + fpc let newcolend = newcolstart + fpc - 1 " call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]") - silent! let keepregstar = @* + sil! let keepregstar = @* while line("$") >= newcolstart if newcolend > line("$") | let newcolend= line("$") | endif let newcolqty= newcolend - newcolstart exe newcolstart if newcolqty == 0 - exe "sil keepj norm! 0\$hx".w:netrw_bannercnt."G$p" + exe "sil! keepj norm! 0\$hx".w:netrw_bannercnt."G$p" else - exe "sil keepj norm! 0\".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p' + exe "sil! keepj norm! 0\".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p' endif - exe "sil keepj ".newcolstart.','.newcolend.'d' - exe 'sil keepj '.w:netrw_bannercnt + exe "sil! keepj ".newcolstart.','.newcolend.'d' + exe 'sil! keepj '.w:netrw_bannercnt endwhile silent! let @*= keepregstar - exe "sil keepj ".w:netrw_bannercnt.',$s/\s\+$//e' + exe "sil! keepj ".w:netrw_bannercnt.',$s/\s\+$//e' call histdel("/",-1) setlocal noma nomod ro " call Dret("NetrwWideListing") @@ -6302,7 +6301,7 @@ fun! s:PerformListing(islocal) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") " force a refresh for tree listings " call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d") - keepj %d + sil! keepj %d endif " save current directory on directory history list @@ -6316,7 +6315,7 @@ fun! s:PerformListing(islocal) keepj put ='\" '.b:netrw_curdir keepj 1d let w:netrw_bannercnt= 3 - exe "keepj ".w:netrw_bannercnt + exe "sil! keepj ".w:netrw_bannercnt else keepj 1 let w:netrw_bannercnt= 1 @@ -6342,7 +6341,7 @@ fun! s:PerformListing(islocal) keepj put ='\" Sorted by '.sortby let w:netrw_bannercnt= w:netrw_bannercnt + 1 endif - exe "keepj ".w:netrw_bannercnt + exe "sil! keepj ".w:netrw_bannercnt endif " show copy/move target, if any @@ -6351,15 +6350,15 @@ fun! s:PerformListing(islocal) " call Decho("show copy/move target<".s:netrwmftgt.">") keepj put ='' if s:netrwmftgt_islocal - keepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)') + sil! keepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)') else - keepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)') + sil! keepj call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)') endif let w:netrw_bannercnt= w:netrw_bannercnt + 1 else " call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt") endif - exe "keepj ".w:netrw_bannercnt + exe "sil! keepj ".w:netrw_bannercnt endif " Hiding... -or- Showing... {{{3 @@ -6382,14 +6381,14 @@ fun! s:PerformListing(islocal) " bannercnt should index the line just after the banner if g:netrw_banner let w:netrw_bannercnt= w:netrw_bannercnt + 1 - exe "keepj ".w:netrw_bannercnt + exe "sil! keepj ".w:netrw_bannercnt " call Decho("bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$")) endif " set up syntax highlighting {{{3 " call Decho("set up syntax highlighting") if has("syntax") - setlocal ft=netrw + setf netrw if !exists("g:syntax_on") || !g:syntax_on setlocal ft= endif @@ -6430,7 +6429,7 @@ fun! s:PerformListing(islocal) endif " remove priority pattern prefix " call Decho("remove priority pattern prefix") - exe 'sil keepj '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e' + exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e' call histdel("/",-1) elseif a:islocal @@ -6438,12 +6437,12 @@ fun! s:PerformListing(islocal) " call Decho("g:netrw_sort_direction=".g:netrw_sort_direction) if g:netrw_sort_direction =~ 'n' " call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort') - exe 'sil keepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options + exe 'sil! keepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options else " call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort!') - exe 'sil keepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options + exe 'sil! keepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options endif - exe 'sil keepj '.w:netrw_bannercnt.',$s/^\d\{-}\///e' + exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\d\{-}\///e' call histdel("/",-1) endif endif @@ -6451,7 +6450,7 @@ fun! s:PerformListing(islocal) elseif g:netrw_sort_direction =~ 'r' " call Decho('reverse the sorted listing') if !g:netrw_banner || w:netrw_bannercnt < line('$') - exe 'sil keepj '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt + exe 'sil! keepj '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt call histdel("/",-1) endif endif @@ -6465,8 +6464,8 @@ fun! s:PerformListing(islocal) if exists("w:netrw_bannercnt") && (line("$") > w:netrw_bannercnt || !g:netrw_banner) " place cursor on the top-left corner of the file listing " call Decho("place cursor on top-left corner of file listing") - exe 'sil keepj '.w:netrw_bannercnt - keepj norm! 0 + exe 'sil! keepj '.w:netrw_bannercnt + sil! keepj norm! 0 endif " record previous current directory @@ -6479,7 +6478,7 @@ fun! s:PerformListing(islocal) " set display to netrw display settings " call Decho("set display to netrw display settings (noma nomod etc)") - setlocal noma nomod nonu nobl nowrap ro + exe "setl ".g:netrw_bufsettings if exists("s:treecurpos") call netrw#NetrwRestorePosn(s:treecurpos) @@ -6586,16 +6585,16 @@ fun! s:NetrwRemoteListing() endif " call Decho("listcmd<".listcmd."> (using g:netrw_ftp_list_cmd)") call s:NetrwRemoteFtpCmd(s:path,listcmd) -" exe "keepj ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))' +" exe "sil! keepalt keepj ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))' if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST " shorten the listing " call Decho("generate short listing") - exe "keepj ".w:netrw_bannercnt + exe "sil! keepalt keepj ".w:netrw_bannercnt " cleanup if g:netrw_ftp_browse_reject != "" - exe "sil! keepj g/".g:netrw_ftp_browse_reject."/keepj d" + exe "sil! keepalt keepj g/".g:netrw_ftp_browse_reject."/keepj d" call histdel("/",-1) endif sil! keepj %s/\r$//e @@ -6603,15 +6602,15 @@ fun! s:NetrwRemoteListing() " if there's no ../ listed, then put ./ and ../ in let line1= line(".") - exe "keepj ".w:netrw_bannercnt + exe "sil! keepj ".w:netrw_bannercnt let line2= search('^\.\.\/\%(\s\|$\)','cnW') if line2 == 0 " call Decho("netrw is putting ./ and ../ into listing") - keepj put='../' - keepj put='./' + sil! keepj put='../' + sil! keepj put='./' endif - exe "keepj ".line1 - keepjumps norm! 0 + exe "sil! keepj ".line1 + sil! keepj norm! 0 " call Decho("line1=".line1." line2=".line2." line(.)=".line(".")) if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup @@ -6636,25 +6635,25 @@ fun! s:NetrwRemoteListing() " call Decho("listcmd<".listcmd."> (using g:netrw_list_cmd)") if g:netrw_scp_cmd =~ '^pscp' " call Decho("1: exe silent r! ".shellescape(listcmd.s:path, 1)) - exe "silent r! ".listcmd.shellescape(s:path, 1) + exe "sil! keepj r! ".listcmd.shellescape(s:path, 1) " remove rubbish and adjust listing format of 'pscp' to 'ssh ls -FLa' like - keepj g/^Listing directory/keepj d - keepj g/^d[-rwx][-rwx][-rwx]/keepj s+$+/+e - sil keepj g/^l[-rwx][-rwx][-rwx]/keepj s+$+@+e + sil! keepj g/^Listing directory/keepj d + sil! keepj g/^d[-rwx][-rwx][-rwx]/keepj s+$+/+e + sil! keepj g/^l[-rwx][-rwx][-rwx]/keepj s+$+@+e call histdel("/",-1) call histdel("/",-1) call histdel("/",-1) if g:netrw_liststyle != s:LONGLIST - keepj g/^[dlsp-][-rwx][-rwx][-rwx]/keepj s/^.*\s\(\S\+\)$/\1/e + sil! keepj g/^[dlsp-][-rwx][-rwx][-rwx]/keepj s/^.*\s\(\S\+\)$/\1/e call histdel("/",-1) endif else if s:path == "" " call Decho("2: exe silent r! ".listcmd) - exe "sil r! ".listcmd + exe "sil! keepalt r! ".listcmd else " call Decho("3: exe silent r! ".listcmd.' '.shellescape(s:path,1)) - exe "sil r! ".listcmd.' '.shellescape(s:path,1) + exe "sil! keepalt r! ".listcmd.' '.shellescape(s:path,1) " call Decho("listcmd<".listcmd."> path<".s:path.">") endif endif @@ -6662,7 +6661,7 @@ fun! s:NetrwRemoteListing() " cleanup if g:netrw_ftp_browse_reject != "" " call Decho("(cleanup) exe silent! g/".g:netrw_ssh_browse_reject."/keepjumps d") - exe "sil! g/".g:netrw_ssh_browse_reject."/keepjumps d" + exe "sil! g/".g:netrw_ssh_browse_reject."/keepj d" call histdel("/",-1) endif endif @@ -6673,23 +6672,23 @@ fun! s:NetrwRemoteListing() if s:method == "ftp" " cleanup - exe "keepj ".w:netrw_bannercnt + exe "sil! keepj ".w:netrw_bannercnt while getline('.') =~ g:netrw_ftp_browse_reject - keepj d + sil! keepj d endwhile " if there's no ../ listed, then put ./ and ../ in let line1= line(".") - keepj 1 - sil keepj call search('^\.\.\/\%(\s\|$\)','W') + sil! keepj 1 + sil! keepj call search('^\.\.\/\%(\s\|$\)','W') let line2= line(".") if line2 == 0 - exe 'keepj '.w:netrw_bannercnt."put='./'" + exe 'sil! keepj '.w:netrw_bannercnt."put='./'" if b:netrw_curdir != '/' - exe 'keepj '.w:netrw_bannercnt."put='../'" + exe 'sil! keepj '.w:netrw_bannercnt."put='../'" endif endif - exe "keepj ".line1 - keepjumps norm! 0 + exe "sil! keepj ".line1 + sil! keepj norm! 0 endif if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup @@ -6796,7 +6795,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all) if path =~ '^\a\+://' let path= substitute(path,'^\a\+://[^/]\+/','','') endif - silent! keepjumps .,$d + sil! keepj .,$d call s:NetrwRemoteFtpCmd(path,"delete ".'"'.a:rmfile.'"') else " call Decho("case ssh: g:netrw_rm_cmd<".g:netrw_rm_cmd.">") @@ -7868,8 +7867,10 @@ fun! s:GetTempfile(fname) if a:fname != "" if a:fname =~ '\.[^./]\+$' " call Decho("using fname<".a:fname.">'s suffix") - if a:fname =~ '.tar.gz' || a:fname =~ '.tar.bz2' + if a:fname =~ '\.tar\.gz$' || a:fname =~ '\.tar\.bz2$' || a:fname =~ '\.tar\.xz$' let suffix = ".tar".substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e') + elseif a:fname =~ '.txz$' + let suffix = ".txz".substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e') else let suffix = substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e') endif @@ -8023,7 +8024,9 @@ fun! s:NetrwEnew(...) call s:NetrwOptionRestore("w:") " call Decho("generate a buffer with keepjumps keepalt enew!") + let netrw_keepdiff= &l:diff keepj keepalt enew! + let &l:diff= netrw_keepdiff " call Decho("bufnr($)=".bufnr("$")) call s:NetrwOptionSave("w:") diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 153cd7fb31..7c4a95442a 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 7.3c. Last change: 2010 Jul 20 +*map.txt* For Vim version 7.3c. Last change: 2010 Jul 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1266,6 +1266,8 @@ the 'path' option: > : return split(globpath(&path, a:A), "\n") :endfun < +This example does not work for file names with spaces! + Range handling *E177* *E178* *:command-range* *:command-count* diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 52df67c8fe..193138bb97 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.3c. Last change: 2010 May 14 +*pi_netrw.txt* For Vim version 7.3c. Last change: 2010 Jul 27 ----------------------------------------------------- NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -318,15 +318,24 @@ settings are described below, in |netrw-browser-options|, and in *b:netrw_lastfile* last file Network-read/written retained on a per-buffer basis (supports plain :Nw ) + *g:netrw_bufsettings* the settings that netrw buffers have + (default) noma nomod nonu nowrap ro nobl + *g:netrw_chgwin* specifies a window number where file edits will take place. (also see |netrw-C|) (default) not defined - *g:Netrw_funcref* specifies a function to be called when netrw edits - a file. The file is first edited, and then the - function reference (|Funcref|) is called. + *g:Netrw_funcref* specifies a function (or functions) to be called when + netrw edits a file. The file is first edited, and + then the function reference (|Funcref|) is called. + This variable may also hold a |List| of Funcrefs. (default) not defined - +> + Example: place in .vimrc; affects all file opening + fun! MyFuncRef() + endfun + let g:Netrw_funcref= function("MyFuncRef") +< *g:netrw_ftp* if it doesn't exist, use default ftp =0 use default ftp (uid password) =1 use alternate ftp method (user uid password) @@ -456,7 +465,7 @@ browsed remote directories, for example. On the other hand, thanks go to Jan M. for pointing out the many vulnerabilities that netrw (and vim itself) had had in handling "crafted" filenames. The |shellescape()| and |fnameescape()| functions were written in -response by Bram Moolenaar to handle this sort of problems, and netrw has +response by Bram Moolenaar to handle these sort of problems, and netrw has been modified to use them. Still, my advice is, if the "filename" looks like a vim command that you aren't comfortable with having executed, don't open it. @@ -589,7 +598,7 @@ password. PASSWORD *netrw-passwd* The script attempts to get passwords for ftp invisibly using |inputsecret()|, -a built-in Vim function. See |NetUserPass()| for how to change the password +a built-in Vim function. See |netrw-uidpass| for how to change the password after one has set it. Unfortunately there doesn't appear to be a way for netrw to feed a password to @@ -778,8 +787,10 @@ variables listed below, and may be modified by the user. The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|) specify the external program to use handle the ftp protocol. They may -include command line options (such as -p for passive mode). +include command line options (such as -p for passive mode). Example: > + let g:netrw_ftp_cmd= "ftp -p" +< Browsing is supported by using the |g:netrw_list_cmd|; the substring "HOSTNAME" will be changed via substitution with whatever the current request is for a hostname. @@ -803,7 +814,7 @@ temporary file: get filename tempfile > --------------------------------------------------------------------- < -The |g:netrw_ftpmode| and g:netrw_extracmd are optional. +The |g:netrw_ftpmode| and |g:netrw_extracmd| are optional. Netrw then executes the lines above by use of a filter: > @@ -2544,13 +2555,13 @@ Associated setting variables: |g:netrw_chgwin| (Vit Gottwald) How to generate public/private key and save public key it on server: > - http://www.tartarus.org/~simon/puttydoc/Chapter8.html#pubkey-gettingready - 8.3 Getting ready for public key authentication + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready + (8.3 Getting ready for public key authentication) < How to use a private key with 'pscp': > - http://www.tartarus.org/~simon/puttydoc/Chapter5.html - 5.2.4 Using public key authentication with PSCP + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html + (5.2.4 Using public key authentication with PSCP) < (Ben Schmidt) I find the ssh included with cwRsync is brilliant, and install cwRsync or cwRsyncServer on most @@ -2695,9 +2706,25 @@ which is loaded automatically at startup (assuming :set nocp). ============================================================================== 12. History *netrw-history* {{{1 + v139: May 14, 2010 * when viewing remote directory listings and + changing listing style, going to tree listing + mode was issuing two rather useless messages + about the buffer name. They have now been + silenced. + * (Jean Johner) with "behave mswin", clicking + on a filename in wide mode opened a new file + with a missing first letter + * (Britton Kerin) wanted netrw listings to be + buflisted; the |g:netrw_bufsettings| option + permits that. + * (John Orr) pointed out that the intended maparg + test for gx was actually testing for g rather + than gx. Fixed. + Jun 18, 2010 * (Jan Steffens) added support for xz compression + Jun 23, 2010 * vimdiff dir1 dir2 now works v138: May 01, 2010 * added the bomb setting to the Save-Set-Restore option handling (for Tony M) - * (Bram Moolenaar) netrw optionally sets cursorline + May 14, 2010 * (Bram Moolenaar) netrw optionally sets cursorline (and sometimes cursorcolumn) for its display. This option setting was leaking through with remote file handling. diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 1759b72ff2..e2d51634c9 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.3c. Last change: 2010 Jul 26 +*todo.txt* For Vim version 7.3c. Last change: 2010 Jul 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,18 +30,30 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- +Problem with concealends in v50 of tex.vim? (Charles Campbell, 2010 Jul 26) +Fixed by patch from Vince? + +Conceal problem: CTRL-L draws differently than individual line. (Benjamin +Fritz, 2010 Jul 27) + Access to free memory with :redir command. (Dominique Pelle, 2010 Jul 25) -Easier way to reproduce in later message. +Easier way to reproduce in later message. (2010 Jul 26) +call get_lval() again in var_redir_stop(). Patch for VMS. Zoltan Arpadffy, 2010 Jul 26. -Patch for :find completion. (Nazri Ramliy) -But I prefer to keep term.h and include/term.h Nazri will work on it. +Patch for :find completion. (Nazri Ramliy, 2010 Jul 27, and leak fix) + +Windows 7: "Open with..." menu starts Vim without a file. + +Windows 7: installing Vim again doesn't find the previously installed Vim. + +ftplugin/mupad.vim should not source AppendMatchGroup.vim, it should use an +autoload function. +Same for indent/GenericIndent.vim Move more common code from if_python.c and if_python3.c to if_py_both.h -Problem with concealends in v50 of tex.vim? (Charles Campbell, 2010 Jul 26) - Add filetype completion to user commands. (Christian Brabandt, 2010 Jul 26) But call it "filetype" instead of "syntax". diff --git a/runtime/indent/haml.vim b/runtime/indent/haml.vim index 079bd0513b..58c0307204 100644 --- a/runtime/indent/haml.vim +++ b/runtime/indent/haml.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Haml " Maintainer: Tim Pope -" Last Change: 2008 Sep 11 +" Last Change: 2010 May 21 if exists("b:did_indent") finish diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index f968964950..25a42629c6 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -1,6 +1,6 @@ " netrwPlugin.vim: Handles file transfer and remote directory listing across a network " PLUGIN SECTION -" Date: Aug 10, 2008 +" Date: Jul 27, 2010 " Maintainer: Charles E Campbell, Jr " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1 @@ -20,7 +20,7 @@ if &cp || exists("g:loaded_netrwPlugin") finish endif -let g:loaded_netrwPlugin = "v138" +let g:loaded_netrwPlugin = "v139" if v:version < 702 echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None finish @@ -81,7 +81,7 @@ com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() com! -bang NetrwClean call netrw#NetrwClean(0) " Maps: -if !exists("g:netrw_nogx") && maparg('g','n') == "" +if !exists("g:netrw_nogx") && maparg('gx','n') == "" if !hasmapto('NetrwBrowseX') nmap gx NetrwBrowseX endif From 8a34e48829807d24c543e23e989b9a8ec119e593 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 12:52:27 +0200 Subject: [PATCH 07/51] Minor runtime file updates. --HG-- branch : vim73 --- runtime/indent/vb.vim | 5 ++++- runtime/syntax/css.vim | 8 ++++---- runtime/syntax/sass.vim | 8 ++++---- runtime/tutor/tutor | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/runtime/indent/vb.vim b/runtime/indent/vb.vim index 85021bd7d9..5f386f7910 100644 --- a/runtime/indent/vb.vim +++ b/runtime/indent/vb.vim @@ -2,6 +2,7 @@ " Language: VisualBasic (ft=vb) / Basic (ft=basic) / SaxBasic (ft=vb) " Author: Johannes Zellner " Last Change: Fri, 18 Jun 2004 07:22:42 CEST +" Small update 2010 Jul 28 by Maxim Kim if exists("b:did_indent") finish @@ -63,7 +64,7 @@ fun! VbGetIndent(lnum) " end select let ind = ind - &sw endif - elseif this_line =~? '^\s*\<\(end\|else\|until\|loop\|next\|wend\)\>' + elseif this_line =~? '^\s*\<\(end\|else\|elseif\|until\|loop\|next\|wend\)\>' let ind = ind - &sw elseif this_line =~? '^\s*\<\(case\|default\)\>' if previous_line !~? '^\s*\' @@ -73,3 +74,5 @@ fun! VbGetIndent(lnum) return ind endfun + +" vim:sw=4 diff --git a/runtime/syntax/css.vim b/runtime/syntax/css.vim index a73836a922..c569213d0f 100644 --- a/runtime/syntax/css.vim +++ b/runtime/syntax/css.vim @@ -2,7 +2,7 @@ " Language: Cascading Style Sheets " Maintainer: Claudio Fleiner " URL: http://www.fleiner.com/vim/syntax/css.vim -" Last Change: 2007 Nov 06 +" Last Change: 2010 Jul 28 " CSS2 by Nikolai Weibull " Full CSS2, HTML4 support by Yeti @@ -87,9 +87,9 @@ syn keyword cssCommonAttr contained auto none inherit syn keyword cssCommonAttr contained top bottom syn keyword cssCommonAttr contained medium normal -syn match cssFontProp contained "\\(-\(family\|style\|variant\|weight\|size\(-adjust\)\=\|stretch\)\>\)\=" +syn match cssFontProp contained "\" syn match cssFontAttr contained "\<\(sans-\)\=\" -syn match cssFontAttr contained "\\(-\(caps\|caption\)\>\)\=" +syn match cssFontAttr contained "\" syn match cssFontAttr contained "\" syn match cssFontAttr contained "\" syn match cssFontAttr contained "\" @@ -102,7 +102,7 @@ syn keyword cssFontAttr contained large smaller larger syn keyword cssFontAttr contained narrower wider syn keyword cssColorProp contained color -syn match cssColorProp contained "\" syn keyword cssColorAttr contained center scroll fixed syn match cssColorAttr contained "\" syn match cssColorAttr contained "\" diff --git a/runtime/syntax/sass.vim b/runtime/syntax/sass.vim index 082ae71bd9..879ff87e85 100644 --- a/runtime/syntax/sass.vim +++ b/runtime/syntax/sass.vim @@ -2,7 +2,7 @@ " Language: Sass " Maintainer: Tim Pope " Filenames: *.sass -" Last Change: 2010 Jul 26 +" Last Change: 2010 Jul 28 if exists("b:current_syntax") finish @@ -17,8 +17,8 @@ syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP -syn match sassProperty "\%([{};]\s*\|^\)\@<=[[:alnum:]-]\+:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition -syn match sassProperty "^\s*\zs\s\%([[:alnum:]-]\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute +syn match sassProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition +syn match sassProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction syn match sassDefault "!default\>" contained @@ -34,7 +34,7 @@ syn match sassFunction "\<\%(unquote\|quote\)\>(\@=" contained syn match sassFunction "\<\%(percentage\|round\|ceil\|floor\|abs\)\>(\@=" contained syn match sassFunction "\<\%(type-of\|unit\|unitless\|comparable\)\>(\@=" contained -syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ +syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ,sassCssAttribute,sassProperty syn match sassMixinName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute syn match sassMixin "^=" nextgroup=sassMixinName diff --git a/runtime/tutor/tutor b/runtime/tutor/tutor index 31ba710725..daf42b6bb2 100644 --- a/runtime/tutor/tutor +++ b/runtime/tutor/tutor @@ -656,7 +656,7 @@ NOTE: If you were to exit Vim and start it again with vim TEST , the file 3. Press the : character. At the bottom of the screen :'<,'> will appear. 4. Type w TEST , where TEST is a filename that does not exist yet. Verify - that you see :'<,'>w TEST before you press Enter. + that you see :'<,'>w TEST before you press . 5. Vim will write the selected lines to the file TEST. Use :!dir or !ls to see it. Do not remove it yet! We will use it in the next lesson. From 608d8d470c928228d5239aa0c419d01e60710ab5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 14:28:48 +0200 Subject: [PATCH 08/51] Updated Italian messages. (Vlad Sandrini) --HG-- branch : vim73 --- src/po/it.po | 176 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 121 insertions(+), 55 deletions(-) diff --git a/src/po/it.po b/src/po/it.po index f152bd7d5a..8bf54e5c21 100644 --- a/src/po/it.po +++ b/src/po/it.po @@ -12,8 +12,9 @@ msgid "" msgstr "" "Project-Id-Version: vim 7.3\n" -"POT-Creation-Date: 2010-06-08 12:54+0200\n" -"PO-Revision-Date: 2010-06-08 16:55+0200\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-07-27 07:35+0200\n" +"PO-Revision-Date: 2010-07-28 06:46+0200\n" "Last-Translator: Vlad Sandrini \n" "Language-Team: Italian" " Antonio Colombo " @@ -22,7 +23,6 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO_8859-1\n" "Content-Transfer-Encoding: 8-bit\n" -"Report-Msgid-Bugs-To: \n" msgid "E831: bf_key_init() called with empty password" msgstr "E831: chiamata a bf_key_init() con password nulla" @@ -39,6 +39,12 @@ msgstr "E818: test sha256 fallito" msgid "E819: Blowfish test failed" msgstr "E819: test Blowfish fallito" +msgid "[Location List]" +msgstr "[Lista Locazioni]" + +msgid "[Quickfix List]" +msgstr "[Lista Quickfix]" + msgid "E82: Cannot allocate any buffer, exiting..." msgstr "E82: Non riesco ad allocare alcun buffer, esco..." @@ -137,12 +143,15 @@ msgstr "[Errori in lettura]" msgid "[readonly]" msgstr "[in sola lettura]" +#, c-format msgid "1 line --%d%%--" msgstr "1 linea --%d%%--" +#, c-format msgid "%ld lines --%d%%--" msgstr "%ld linee --%d%%--" +#, c-format msgid "line %ld of %ld --%d%%-- col " msgstr "linea %ld di %ld --%d%%-- col " @@ -168,6 +177,7 @@ msgstr "Fon" msgid "Top" msgstr "Cim" +#, c-format msgid "" "\n" "# Buffer list:\n" @@ -175,12 +185,6 @@ msgstr "" "\n" "# Lista Buffer:\n" -msgid "[Location List]" -msgstr "[Lista Locazioni]" - -msgid "[Quickfix List]" -msgstr "[Lista Quickfix]" - msgid "[Scratch]" msgstr "[Volatile]" @@ -842,6 +846,7 @@ msgstr "Scrivo file viminfo \"%s\"" msgid "# This viminfo file was generated by Vim %s.\n" msgstr "# Questo file viminfo stato generato da Vim %s.\n" +#, c-format msgid "" "# You may edit it if you're careful!\n" "\n" @@ -849,6 +854,7 @@ msgstr "" "# File modificabile, attento a quel che fai!\n" "\n" +#, c-format msgid "# Value of 'encoding' when this file was written\n" msgstr "# Valore di 'encoding' al momento della scrittura di questo file\n" @@ -960,6 +966,7 @@ msgstr "E148: Manca espressione regolare nel comando 'global'" msgid "Pattern found in every line: %s" msgstr "Espressione trovata su ogni linea: %s" +#, c-format msgid "" "\n" "# Last Substitute String:\n" @@ -1808,6 +1815,7 @@ msgstr "1 carattere" msgid "%lld characters" msgstr "%lld caratteri" +#. Explicit typecast avoids warning on Mac OS X 10.6 #, c-format msgid "%ld characters" msgstr "%ld caratteri" @@ -2053,9 +2061,6 @@ msgstr "Dialogo Vim" msgid "E232: Cannot create BalloonEval with both message and callback" msgstr "E232: Non riesco a creare 'BalloonEval' con sia messaggio che callback" -msgid "Vim dialog..." -msgstr "Dialogo Vim..." - msgid "" "&Yes\n" "&No\n" @@ -2098,12 +2103,15 @@ msgstr "Su" msgid "Down" msgstr "Gi" +#. 'Find Next' button msgid "Find Next" msgstr "Trova il Prossimo" +#. 'Replace' button msgid "Replace" msgstr "Sostituisci" +#. 'Replace All' button msgid "Replace All" msgstr "Sostituisci Tutto" @@ -2122,9 +2130,6 @@ msgstr "Apri linguetta..." msgid "Vim: Main window unexpectedly destroyed\n" msgstr "Vim: Finestra principale distrutta inaspettatamente\n" -msgid "Font Selection" -msgstr "Selezione Font" - msgid "&Filter" msgstr "&Filtro" @@ -2163,7 +2168,7 @@ msgstr "&U Disfa" #, c-format msgid "E610: Can't load Zap font '%s'" -msgstr "E610: Non riesco a caricate il font Zap '%s'" +msgstr "E610: Non riesco a caricare il font Zap '%s'" #, c-format msgid "E611: Can't use font %s" @@ -2302,6 +2307,7 @@ msgstr "Pagina %d" msgid "No text to be printed" msgstr "Manca testo da stampare" +#, c-format msgid "Printing page %d (%d%%)" msgstr "Sto stampando pagina %d (%d%%)" @@ -2537,6 +2543,12 @@ msgstr "nessuna connessione cscope\n" msgid " # pid database name prepend path\n" msgstr " # pid database nome prepend path\n" +msgid "Lua library cannot be loaded." +msgstr "Non riesco a caricare libreria Lua." + +msgid "cannot save undo information" +msgstr "non riesco a salvare informazioni per 'undo'" + msgid "" "E815: Sorry, this command is disabled, the MzScheme libraries could not be " "loaded." @@ -2562,9 +2574,6 @@ msgstr "indice della finestra non nell'intervallo" msgid "couldn't open buffer" msgstr "non sono riuscito ad aprire il buffer" -msgid "cannot save undo information" -msgstr "non riesco a salvare informazioni per 'undo'" - msgid "cannot delete line" msgstr "non posso cancellare la linea" @@ -2595,6 +2604,9 @@ msgstr "numero linea non nell'intervallo" msgid "not allowed in the Vim sandbox" msgstr "non ammesso in ambiente protetto" +msgid "E999: Python: Cannot use :py and :py3 in one session" +msgstr "E999: Python: Impossibile usare :py e :py3 nella stessa sessione" + msgid "" "E263: Sorry, this command is disabled, the Python library could not be " "loaded." @@ -2614,12 +2626,6 @@ msgstr "softspace deve essere un numero intero" msgid "invalid attribute" msgstr "attributo non valido" -msgid "writelines() requires list of strings" -msgstr "writelines() richiede una lista di stringhe" - -msgid "E264: Python: Error initialising I/O objects" -msgstr "E264: Python: Errore inizializzazione oggetti I/O" - msgid "attempt to refer to deleted buffer" msgstr "tentativo di referenza a buffer cancellato" @@ -2823,11 +2829,11 @@ msgstr "" #. This should never happen. Famous last word? msgid "" -"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to " -"vim-dev@vim.org" +"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim." +"org" msgstr "" -"E280: ERRORE FATALE TCL: reflist corrotta!? Si prega notificare a " -"vim-dev@vim.org" +"E280: ERRORE FATALE TCL: reflist corrotta!? Si prega notificare a vim-" +"dev@vim.org" msgid "cannot register callback command: buffer/window reference not found" msgstr "" @@ -2843,8 +2849,8 @@ msgstr "" msgid "" "E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org" msgstr "" -"E281: ERRORE TCL: codice di ritorno non int!? Si prega notificare a " -"vim-dev@vim.org" +"E281: ERRORE TCL: codice di ritorno non int!? Si prega notificare a vim-" +"dev@vim.org" #, c-format msgid "E572: exit code %d" @@ -3330,6 +3336,7 @@ msgstr "" "\n" "modif linea col testo" +#, c-format msgid "" "\n" "# File marks:\n" @@ -3338,6 +3345,7 @@ msgstr "" "# File mark:\n" #. Write the jumplist with -' +#, c-format msgid "" "\n" "# Jumplist (newest first):\n" @@ -3345,6 +3353,7 @@ msgstr "" "\n" "# Jumplist (dai pi recenti):\n" +#, c-format msgid "" "\n" "# History of marks within files (newest to oldest):\n" @@ -3376,16 +3385,6 @@ msgstr "E288: 'input method' non sopporta alcuno stile" msgid "E289: input method doesn't support my preedit type" msgstr "E289: 'input method' non supporta il mio tipo di preedit" -msgid "E290: over-the-spot style requires fontset" -msgstr "E290: stile 'over-the-spot' richiede fontset" - -msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled" -msgstr "" -"E291: Il tuo GTK+ anteriore a versione 1.2.3. Area Status disabilitata" - -msgid "E292: Input Method Server is not running" -msgstr "E292: Server di 'Input Method' non in esecuzione" - msgid "E293: block was not locked" msgstr "E293: il blocco non era riservato" @@ -3472,6 +3471,11 @@ msgstr "" ",\n" "o il file stato danneggiato." +#, c-format +msgid "" +"E833: %s is encrypted and this version of Vim does not support encryption" +msgstr "E833: %s cifrato e questa versione di Vim non supporta la cifratura" + msgid " has been damaged (page size is smaller than minimum value).\n" msgstr "" " stato danneggiato (la dimensione della pagina inferiore al minimo).\n" @@ -3488,6 +3492,38 @@ msgid "E308: Warning: Original file may have been changed" msgstr "" "E308: Attenzione: il file originale pu essere stato modificato nel frattempo" +#, c-format +msgid "Swap file is encrypted: \"%s\"" +msgstr "Il file swap cifrato: \"%s\"" + +msgid "" +"\n" +"If you entered a new crypt key but did not write the text file," +msgstr "" +"\n" +"Se hai immesso una chiave di cifratura senza riscrivere il file di testo," + +msgid "" +"\n" +"enter the new crypt key." +msgstr "" +"\n" +"immetti la nuova chiave di cifratura." + +msgid "" +"\n" +"If you wrote the text file after changing the crypt key press enter" +msgstr "" +"\n" +"Se hai riscritto il file dopo aver cambio chiave di cifr., premi Invio" + +msgid "" +"\n" +"to use the same key for text file and swap file" +msgstr "" +"\n" +"per usare la stessa chiave sia per il testo che per il file swap" + #, c-format msgid "E309: Unable to read block 1 from %s" msgstr "E309: Impossibile leggere blocco 1 da %s" @@ -3545,9 +3581,9 @@ msgid "and run diff with the original file to check for changes)" msgstr "'diff' rispetto al file originale per vedere le differenze)" msgid "Recovery completed. Buffer contents equals file contents." -msgstr "Ripristino effettuato. Il contenuto del buffer coincide con quello del file." +msgstr "" +"Ripristino effettuato. Il contenuto del buffer coincide con quello del file." -#, fuzzy msgid "" "\n" "You may want to delete the .swp file now.\n" @@ -3557,6 +3593,9 @@ msgstr "" " consigliato cancellare il file .swp adesso.\n" "\n" +msgid "Using crypt key from swap file for the text file.\n" +msgstr "Uso la chiave di cifratura del file swap per il file di testo.\n" + #. use msg() to start the scrolling properly msgid "Swap files found:" msgstr "Swap file trovati:" @@ -3980,6 +4019,7 @@ msgstr "Vim: preservo file...\n" msgid "Vim: Finished.\n" msgstr "Vim: Finito.\n" +#, c-format msgid "ERROR: " msgstr "ERRORE: " @@ -4485,6 +4525,7 @@ msgstr "Vim: Segnale doppio, esco\n" msgid "Vim: Caught deadly signal %s\n" msgstr "Vim: Intercettato segnale fatale %s\n" +#, c-format msgid "Vim: Caught deadly signal\n" msgstr "Vim: Intercettato segnale fatale\n" @@ -4628,21 +4669,26 @@ msgstr "" msgid "Vim Warning" msgstr "Avviso da Vim" +#, c-format msgid "E372: Too many %%%c in format string" msgstr "E372: Troppi %%%c nella stringa di 'format'" +#, c-format msgid "E373: Unexpected %%%c in format string" msgstr "E373: %%%c imprevisto nella stringa di 'format'" msgid "E374: Missing ] in format string" msgstr "E374: Manca ] nella stringa di 'format'" +#, c-format msgid "E375: Unsupported %%%c in format string" msgstr "E375: %%%c non supportato nella stringa di 'format'" +#, c-format msgid "E376: Invalid %%%c in format string prefix" msgstr "E376: %%%c non valido nel prefisso della stringa di 'format'" +#, c-format msgid "E377: Invalid %%%c in format string" msgstr "E377: %%%c non valido nella stringa di 'format'" @@ -4675,6 +4721,9 @@ msgstr "lista errori %d di %d; %d errori" msgid "E382: Cannot write, 'buftype' option is set" msgstr "E382: Non posso scrivere, l'opzione 'buftype' impostata" +msgid "Error file" +msgstr "File errori" + msgid "E683: File name missing or invalid pattern" msgstr "E683: Nome file mancante o espressione non valida" @@ -4688,6 +4737,10 @@ msgstr "E681: Buffer non caricato" msgid "E777: String or List expected" msgstr "E777: aspettavo Stringa o Lista" +#, c-format +msgid "E369: invalid item in %s%%[]" +msgstr "E369: elemento non valido in %s%%[]" + msgid "E339: Pattern too long" msgstr "E339: Espressione troppo lunga" @@ -4701,6 +4754,7 @@ msgstr "E51: Troppe %s(" msgid "E52: Unmatched \\z(" msgstr "E52: Senza riscontro: \\z(" +#, c-format msgid "E53: Unmatched %s%%(" msgstr "E53: Senza riscontro: %s%%(" @@ -4747,15 +4801,19 @@ msgstr "E67: \\z1 ecc. non consentiti qui" msgid "E68: Invalid character after \\z" msgstr "E68: Carattere non ammesso dopo \\z" +#, c-format msgid "E69: Missing ] after %s%%[" msgstr "E69: Manca ] dopo %s%%[" +#, c-format msgid "E70: Empty %s%%[]" msgstr "E70: %s%%[] vuoto" +#, c-format msgid "E678: Invalid character after %s%%[dxouU]" msgstr "E678: Carattere non valido dopo %s%%[dxouU]" +#, c-format msgid "E71: Invalid character after %s%%" msgstr "E71: Carattere non ammesso dopo %s%%" @@ -5145,6 +5203,7 @@ msgstr "Flag non riconosciuti in %s linea %d: %s" msgid "Ignored %d words with non-ASCII characters" msgstr "%d parole con caratteri non-ASCII ignorate" +#, c-format msgid "Compressed %d of %d nodes; %d (%d%%) remaining" msgstr "%d di %d nodi compressi; ne restano %d (%d%%)" @@ -5535,6 +5594,10 @@ msgstr "E434: Non riesco a trovare modello tag" msgid "E435: Couldn't find tag, just guessing!" msgstr "E435: Non riesco a trovare tag, sto solo tirando a indovinare!" +#, c-format +msgid "Duplicate field name: %s" +msgstr "Nome di campo duplicato: %s" + msgid "' not known. Available builtin terminals are:" msgstr "' non noto. Terminali disponibili predisposti sono:" @@ -5574,6 +5637,11 @@ msgstr "Vim: Errore leggendo l'input, esco...\n" msgid "Used CUT_BUFFER0 instead of empty selection" msgstr "Uso CUT_BUFFER0 invece che una scelta nulla" +#. This happens when the FileChangedRO autocommand changes the +#. * file in a way it becomes shorter. +msgid "E834: Line count changed unexpectedly" +msgstr "E834: Il conteggio delle righe inaspettatamente cambiato" + #. must display the prompt msgid "No undo possible; continue anyway" msgstr "'undo' non pi possibile; continuo comunque" @@ -5597,14 +5665,14 @@ msgstr "File Undo non sovrascritto, non riesco a leggere: %s" msgid "Will not overwrite, this is not an undo file: %s" msgstr "Non sovrascritto, non un file Undo: %s" -msgid "Skipping undo file write, noting to undo" +msgid "Skipping undo file write, nothing to undo" msgstr "Ometto scrittura del file Undo, non ci sono modifiche" #, c-format msgid "Writing undo file: %s" msgstr "Scrivo file Undo: %s" -#, fuzzy, c-format +#, c-format msgid "E829: write error in undo file: %s" msgstr "E829: errore scrivendo nel file Undo: %s" @@ -5624,7 +5692,7 @@ msgstr "E822: Non posso aprire il file Undo in lettura: %s" msgid "E823: Not an undo file: %s" msgstr "E823: Non un file Undo: %s" -#, fuzzy, c-format +#, c-format msgid "E832: Non-encrypted file has encrypted undo file: %s" msgstr "E832: File non cifrato con file Undo cifrato: %s" @@ -5691,8 +5759,8 @@ msgstr "dopo" msgid "Nothing to undo" msgstr "Nessuna modifica, Undo impossibile" -msgid "number changes time" -msgstr "numero modif. ora" +msgid "number changes time saved" +msgstr "numero modif. ora salv." #, c-format msgid "%ld seconds ago" @@ -5812,7 +5880,6 @@ msgstr "" "\n" "Patch incluse: " -#, fuzzy msgid "" "\n" "Extra patches: " @@ -5874,15 +5941,9 @@ msgstr "senza GUI." msgid "with GTK2-GNOME GUI." msgstr "con GUI GTK2-GNOME." -msgid "with GTK-GNOME GUI." -msgstr "con GUI GTK-GNOME." - msgid "with GTK2 GUI." msgstr "con GUI GTK2." -msgid "with GTK GUI." -msgstr "con GUI GTK." - msgid "with X11-Motif GUI." msgstr "con GUI X11-Motif." @@ -6094,6 +6155,7 @@ msgstr "Differenza con Vim" msgid "Edit with &Vim" msgstr "Apri con &Vim" +#. Now concatenate msgid "Edit with existing Vim - " msgstr "Apri con Vim esistente - " @@ -6451,3 +6513,7 @@ msgstr "raggiunta la CIMA nella ricerca, continuo dal FONDO" msgid "search hit BOTTOM, continuing at TOP" msgstr "raggiunto il FONDO nella ricerca, continuo dalla CIMA" + +#, c-format +msgid "Need encryption key for \"%s\"" +msgstr "Serve una chiave di cifratura per \"%s\"" From 6d69cf05763edc5a0bc01161d1d557324b7c4ef1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 17:02:55 +0200 Subject: [PATCH 09/51] Updated runtime files. --HG-- branch : vim73 --- runtime/doc/eval.txt | 4 +- runtime/doc/evim-it.1 | 8 +-- runtime/doc/todo.txt | 12 ++++- runtime/doc/vim-it.1 | 100 +++++++++++++++++++------------------- runtime/doc/vimdiff-it.1 | 10 ++-- runtime/doc/vimtutor-it.1 | 46 ++++++++++-------- runtime/doc/xxd-it.1 | 62 +++++++++++------------ runtime/indent/perl.vim | 7 +-- 8 files changed, 131 insertions(+), 118 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 33a6c0cfc6..bb62e42d77 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.3c. Last change: 2010 Jul 25 +*eval.txt* For Vim version 7.3c. Last change: 2010 Jul 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5094,7 +5094,7 @@ setreg({regname}, {value} [,{options}]) Set the register {regname} to {value}. If {options} contains "a" or {regname} is upper case, then the value is appended. - {options} can also contains a register type specification: + {options} can also contain a register type specification: "c" or "v" |characterwise| mode "l" or "V" |linewise| mode "b" or "" |blockwise-visual| mode diff --git a/runtime/doc/evim-it.1 b/runtime/doc/evim-it.1 index 48e9a83ce2..1e98a2d3f7 100755 --- a/runtime/doc/evim-it.1 +++ b/runtime/doc/evim-it.1 @@ -17,10 +17,10 @@ e imposta le opzioni per farlo comportare come un editore "modeless". State sempre usando Vim, ma come un editore "posizionati-e-clicca". Simile all'uso di Notepad in MS-Windows. .B evim -richiede la presenza della GUI, per avere a disposizione menu e barra +richiede la presenza della GUI, per avere a disposizione men e barra strumenti. .PP -Da usarsi solo da parte di chi non in grado di lavorare con Vim nella +Da usarsi soltanto se non si in grado di lavorare con Vim nella maniera usuale. La modifica file sar molto meno efficiente. .PP @@ -34,7 +34,7 @@ L'opzione 'insertmode' Sono definite delle mappature che consentono di usare COPIA e INCOLLA con i familiari tasti usati sotto MS-Windows. CTRL-X taglia testo, CTRL-C copia testo e CTRL-V incolla testo. -Usate CTRL-Q per ottenere quello chs si ottierrebbe con CTRL-V in Vim nativo. +Usate CTRL-Q per ottenere quello che si otterrebbe con CTRL-V in Vim nativo. .SH OPZIONI Vedere vim(1). .SH FILE @@ -51,4 +51,4 @@ vim(1) Buona parte di .B Vim stato scritto da Bram Moolenaar, con molto aiuto da altri. -Vedere il Menu "Aiuto/Crediti". +Vedere il men "Aiuto/Crediti". diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index e2d51634c9..b132f56f98 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.3c. Last change: 2010 Jul 27 +*todo.txt* For Vim version 7.3c. Last change: 2010 Jul 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -31,7 +31,10 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. -------------------- Known bugs and current work ----------------------- Problem with concealends in v50 of tex.vim? (Charles Campbell, 2010 Jul 26) -Fixed by patch from Vince? +Fixed by patch from Vince? Try /tmp/tex.vim + +v140 of netrw. +v25 of tar.vim. Conceal problem: CTRL-L draws differently than individual line. (Benjamin Fritz, 2010 Jul 27) @@ -43,6 +46,8 @@ call get_lval() again in var_redir_stop(). Patch for VMS. Zoltan Arpadffy, 2010 Jul 26. Patch for :find completion. (Nazri Ramliy, 2010 Jul 27, and leak fix) +And patch for Windows, Jul 28. +And fix for patch, Jul 28. Windows 7: "Open with..." menu starts Vim without a file. @@ -60,6 +65,9 @@ But call it "filetype" instead of "syntax". Before release 7.3: - Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23) +Insert mode CTRL-R x doesn't paste combining characters. (Tony Mechelynck, +2010 Jul 28) + Cursor positioning wrong with 0x200e character. (John Becket, 2010 May 6) Test 69 breaks on MS-Windows, both 32 and 64 builds. (George Reilly, 2010 Feb diff --git a/runtime/doc/vim-it.1 b/runtime/doc/vim-it.1 index 835fe66147..0ab3eff0d2 100755 --- a/runtime/doc/vim-it.1 +++ b/runtime/doc/vim-it.1 @@ -38,7 +38,7 @@ Particolarmente utile per editare programmi. Ci sono parecchi miglioramenti rispetto a Vi: undo multipli, finestre e buffer multipli, evidenziazione sintattica, possibilit di modificare la linea di comando, completamento nomi file, help -in linea, selezione testi in modalit visuale, etc.. +in linea, selezione testi in Modo Visual, etc.. Vedere ":help vi_diff.txt" per un sommario delle differenze fra .B Vim e Vi. @@ -52,7 +52,7 @@ Quasi sempre .B Vim viene invocato, per modificare un file, col comando .PP - vim file + vim nome_file .PP Pi in generale .B Vim @@ -64,7 +64,7 @@ Se lista_file non Altrimenti, una e una sola delle quattro maniere indicate qui sotto pu essere usata per scegliere uno o pi file da modificare. .TP 12 -file .. +nome_file .. Una lista di nomi di file. Il primo di questi sar il file corrente, e verr letto nel buffer. Il cursore sar posizionato sulla prima linea del buffer. @@ -74,22 +74,22 @@ lista_file. .TP \- Il file da editare letto dallo "stdin" [di solito, ma non -necessriamente, il terminale \- NdT]. I comandi sono letti da "stderr", +necessariamente, il terminale \- NdT]. I comandi sono letti da "stderr", che dovrebbe essere un terminale [tty]. .TP \-t {tag} Il file da editare e la posizione iniziale del cursore dipendono da "tag", una specie di "etichetta" a cui saltare. -{tag} viene cercata nel file tags, ed il file ad essa associato diventa +{tag} viene cercata nel file "tags", ed il file ad essa associato diventa quello corrente, ed il comando ad essa associato viene eseguito. Di solito si usa per programmi C, nel qual caso {tag} potrebbe essere un nome di funzione. L'effetto che il file contenente quella funzione diventa il file corrente e il cursore posizionato all'inizio della funzione. -Vedere ":help tag-commands". +Vedere ":help tag\-commands". .TP \-q [file_errori] -Inizia nella modalit quickFix [correzione veloce]. +Inizia in Modo QuickFix [correzione veloce]. Il file [file_errori] letto e il primo errore visualizzato. Se [file_errori] non indicato, il suo nome ottenuto dal valore dell'opzione 'errorfile' (che, se non specificata, vale "AztecC.Err" @@ -102,35 +102,35 @@ si comporta in modo diverso se invocato con nomi differenti (il programma eseguibile "sottostante" pu essere sempre lo stesso). .TP 10 vim -Modalit "Normal", comportamento normale. +Modo Normal, comportamento normale. .TP ex -Inizia in modalit "Ex". -Si pu passare in modalit "Normal" col comandi ":vi". -Si pu invocare la modalit "Ex" anche con l'argomento "\-e". +Inizia in Modo "Ex". +Si pu passare in Modo Normal col comando ":vi". +Si pu invocare il Modo "Ex" anche con l'argomento "\-e". .TP view -Inizia in modalit "Sola Lettura". Non potete modificare i file. -Si pu invocare la modalit "Sola Lettura" anche con l'argomento "\-R". +Inizia in Modo Read-only (Sola Lettura). Non potete modificare i file. +Si pu invocare il Modo Read-only anche con l'argomento "\-R". .TP gvim gview La versione GUI [Graphical User Interface]. Apre una nuova finestra. -Si pu invocare la modalit "GUI" anche con l'argomento "\-g". +Si pu invocare il Modo GUI anche con l'argomento "\-g". .TP evim eview -La versione GUI in modalit "Facile" (semplificata). +La versione GUI in Modo Easy (semplificata). Apre una nuova finestra. -Si pu invocare la modalit "Facile" anche con l'argomento "\-y". +Si pu invocare il Modo Easy anche con l'argomento "\-y". .TP rvim rview rgvim rgview -Come sopra, ma con restrizioni ai comandi. Non si potrnno eseguire comandi -dello shell o sospendere +Come sopra, ma con restrizioni ai comandi. Non si potranno eseguire comandi +della shell o sospendere .B Vim. -Si pu invocare la modalit "Ristretta" anche con l'argomento "\-Z". +Si pu chiedere la stessa cosa anche con l'argomento "\-Z". .SH OPZIONI Le opzioni possono essere in un ordine qualsiasi, prima o dopo i nomi di -file. Opzioni che non necessitano un argomento possono essere raggruppate +file. Opzioni che non necessitano un argomento possono essere specificate dietro a un solo "\-". .TP 12 +[numero] @@ -140,7 +140,7 @@ Se "numero" manca, il cursore sar +/{espressione} Per il primo file il cursore sar posizionato alla prima occorrenza di {espressione}. -Vedere ":help search-pattern" per come specificare l'espressione. +Vedere ":help search\-pattern" per come specificare l'espressione. .TP +{comando} .TP @@ -149,7 +149,7 @@ Vedere ":help search-pattern" per come specificare l'espressione. primo file stato letto. {comando} interpretato come un comando Ex. Se il {comando} contiene spazi deve essere incluso fra doppi apici -(o altro delimitatore, a seconda dello shell che si sta usando). +(o altro delimitatore, a seconda della shell che si sta usando). Esempio: Vim "+set si" main.c .br Note: Si possono avere fino a 10 comandi "+" o "\-c". @@ -170,16 +170,16 @@ Si possono usare fino a 10 di questi comandi, indipendentemente dai comandi \-A Se .B Vim - stato compilato con supporto ARABIC per editare file con orientamento + stato compilato con supporto Arabic per editare file con orientamento destra-sinistra e tastiera con mappatura Araba, questa opzione inizia .B Vim -in modalit "Arabic", cio impostando 'arabic'. +in Modo Arabic, cio impostando 'arabic'. Altrimenti viene dato un messaggio di errore e .B Vim termina in modo anormale. .TP \-b -Modalit "Binaria". +Modo Binary (binario). Vengono impostate alcune opzioni che permettono di modificare un file binario o un programma eseguibile. .TP @@ -188,11 +188,11 @@ Compatibile. Imposta l'opzione 'compatible'. In questo modo .B Vim ha quasi lo stesso comportamento di Vi, anche in presenza di un file -di configurazione .vimrc [proprio di Vim \- NdT]. +di configurazione .vimrc [proprio di Vim, vi usa .exrc \- Ndt]. .TP \-d -Inizia in modalit "Diff" [differenze]. -Dovrebbero esserci come argomenti due o tre nomi di file. +Inizia in Modo Diff [differenze]. +Dovrebbero esserci come argomenti due o tre o quattro nomi di file. .B Vim aprir tutti i file evidenziando le differenze fra gli stessi. Funziona come vimdiff(1). @@ -204,23 +204,23 @@ Esempio: "\-d con:20/30/600/150". .TP \-D -Debugging. Vim si mette in modalit "debugging" a partire +Debugging. Vim si mette in Modo "debugging" a partire dall'esecuzione del primo comando da uno script. .TP \-e Eseguire .B Vim -in modalit "Ex", come se il programma eseguito sia "ex". +in Modo Ex, come se il programma eseguito sia "ex". .TP \-E Eseguire .B Vim -in modalit "Ex" migliorata, come se il programma eseguito sia "exim". +in Modo Ex migliorato, come se il programma eseguito sia "exim". .TP \-f Direttamente [Foreground]. Per la versione GUI, .B Vim -non crea [fork] una nuova finestra, indipendente dallo shell di invocazione. +non crea [fork] una nuova finestra, indipendente dalla shell di invocazione. Per l'Amiga, .B Vim non fatto ripartire per aprire una nuova finestra. @@ -233,7 +233,7 @@ Sull'Amiga i comandi ":sh" e ":!" non sono disponibili. \-\-nofork Direttamente [Foreground]. Per la versione GUI, .B Vim -non crea [fork] una nuova finestra, indipendente dallo shell di invocazione. +non crea [fork] una nuova finestra, indipendente dalla shell di invocazione. .TP \-F Se @@ -241,7 +241,7 @@ Se stato compilato con supporto FKMAP per editare file con orientamento destra-sinistra e tastiera con mappatura Farsi, questa opzione inizia .B Vim -in modalit "Farsi", cio impostando 'fkmap' e 'rightleft'. +in Modo Farsi, cio impostando 'fkmap' e 'rightleft'. Altrimenti viene dato un messaggio di errore e .B Vim termina in modo anormale. @@ -266,7 +266,7 @@ Se stato compilato col supporto RIGHTLEFT per editare file con orientamento destra-sinistra e tastiera con mappatura Ebraica, questa opzione inizia .B Vim -in modalit "Ebraica", cio impostando 'hkmap' e 'rightleft'. +in Modo Ebraico, cio impostando 'hkmap' e 'rightleft'. Altrimenti viene dato un messaggio di errore e .B Vim termina in modo anormale. @@ -280,13 +280,13 @@ Si pu Equivalente a \-r. .TP \-l -Modalit Lisp. -Imposta le opzini 'lisp' e 'showmatch'. +Modo Lisp. +Imposta le opzioni 'lisp' e 'showmatch'. .TP \-m Inibisce modifica file. Annulla l'opzione 'write'. -E' ancora possibile modificare un buffer [in memoria \- Ndt], ma non scriverlo. + ancora possibile modificare un buffer [in memoria \- Ndt], ma non scriverlo. .TP \-M Modifiche non permesse. Le opzioni 'modifiable' e 'write' sono annullate, @@ -294,7 +294,7 @@ in modo da impedire sia modifiche che riscritture. Da notare che queste opzioni possono essere abilitate in seguito, permettendo cos modifiche. .TP \-N -Modalit "Non-compatibile". Annulla l'opzione 'compatible'. +Modo "Non-compatibile". Annulla l'opzione 'compatible'. Cos .B Vim va un po' meglio, ma meno compatibile con Vi, anche in assenza di un @@ -319,12 +319,12 @@ Apri N finestre, in verticale. Se N manca, apri una finestra per ciascun file. .TP \-R -Modalit "Sola Lettura". +Modo Read-only (Sola Lettura). Imposta l'opzione 'readonly'. Si pu ancora modificare il buffer, ma siete protetti da una riscrittura involontaria. Se volete davvero riscrivere il file, aggiungete un punto esclamativo -al comando "Ex", come in ":w!". +al comando Ex, come in ":w!". L'opzione \-R implica anche l'opzione \-n (vedere sotto). L'opzione 'readonly' pu essere annullata con ":set noro". Vedere ":help 'readonly'". @@ -333,14 +333,14 @@ Vedere ":help 'readonly'". Lista file di swap, assieme a dati utili per un recupero. .TP \-r {file} -Modalit "Recovery". +Modo Recovery (ripristino). Il file di swap usato per recuperare una sessione di edit finita male. Il file di swap un file con lo stesso nome file del file di testo editato, col suffisso ".swp". Vedere ":help recovery". .TP \-s -Modalit silenziosa. Solo quando invocato come "Ex" o quando l'opzione +Modo silenzioso. Solo quando invocato come "Ex" o quando l'opzione "\-e" stata data prima dell'opzione "\-s". .TP \-s {scriptin} @@ -383,7 +383,7 @@ Il valore predefinito \-v Inizia .B Vim -in modalit "Vi", come se il programma eseguibile fosse "vi". Questo ha +in Modo Vi, come se il programma eseguibile fosse "vi". Questo ha effetto solo quando Vim viene invocato con il nome "ex". .TP \-w {scriptout} @@ -408,14 +408,14 @@ ma il titolo della finestra e la clipboard non sono disponibili. \-y Eseguire .B Vim -in modalit "Facile" (semplificata), come se l'eseguibile invocato +in Modo Easy (semplificata), come se l'eseguibile invocato sia "evim" o "eview". Fa s che .B Vim si comporti come un editor che usa solo il mouse e i caratteri. .TP \-Z -Modalit "Ristretta". Vim si comporta come se invocato con un nome +Modo ristretto. Vim si comporta come se invocato con un nome che inizia per "r". .TP \-\- @@ -430,8 +430,8 @@ Solo con GUI GTK: Visualizza Window ID su "stdout". Vim d un messaggio ed esce, come con l'argomento "\-h". .TP \-\-literal -Considera i nomi passati come argomenti letterai, senza espandere -metacaratteri. Non necessario in Unix, lo shell espande i metacaratteri. +Considera i nomi passati come argomenti letterali, senza espandere +metacaratteri. Non necessario in Unix, la shell espande i metacaratteri. .TP \-\-noplugin Non caricare plugin. Implicito se si specifica \-u NONE. @@ -442,7 +442,7 @@ argomenti. Se non si trova un server viene dato un messaggio e i file sono editati nel Vim corrente. .TP \-\-remote\-expr {expr} -Connettersi a un server Vim, valutare ivi {expr} e stampare il risultatoi +Connettersi a un server Vim, valutare ivi {expr} e stampare il risultato su "stdout". .TP \-\-remote\-send {chiavi} @@ -521,7 +521,7 @@ Script Vim usato dal comando ":options", un modo semplice per visualizzare e impostare opzioni. .TP /usr/local/lib/vim/menu.vim -Inzializzazioni del menu gvim a livello di sistema. +Inizializzazioni del men gvim a livello di sistema. .TP /usr/local/lib/vim/bugreport.vim Script Vim per generare una segnalazione di errore. Vedere ":help bugs". diff --git a/runtime/doc/vimdiff-it.1 b/runtime/doc/vimdiff-it.1 index 8d812283d1..2203877acf 100755 --- a/runtime/doc/vimdiff-it.1 +++ b/runtime/doc/vimdiff-it.1 @@ -1,21 +1,21 @@ .TH VIMDIFF 1 "30 marzo 2001" .SH NOME -vimdiff \- modifica due o tre versioni di un file con Vim, visualizzando le -differenze +vimdiff \- modifica due, tre o quattro versioni di un file con Vim, +visualizzando le differenze .SH SINTASSI .br .B vimdiff -[opzioni] file1 file2 [file3] +[opzioni] file1 file2 [file3 [file4]] .PP .B gvimdiff .SH DESCRIZIONE .B Vimdiff inizia .B Vim -per due (o tre) file. +per due (o tre o quattro) file. Ogni file ha una sua finestra. Le differenze fra file sono evidenziate. -E' una maniera elegante per controllare modifiche e portare modifiche + una maniera elegante per controllare modifiche e portare modifiche verso un'altra versione dello stesso file. .PP Vedere vim(1) per dettagli su Vim in generale. diff --git a/runtime/doc/vimtutor-it.1 b/runtime/doc/vimtutor-it.1 index 9adaa722c1..b5c1e61e01 100755 --- a/runtime/doc/vimtutor-it.1 +++ b/runtime/doc/vimtutor-it.1 @@ -1,43 +1,47 @@ -.TH VIMTUTOR 1 "2001 April 2" +.TH VIMTUTOR 1 "2 aprile 2001" .SH NOME -vimtutor \- the Vim tutor +vimtutor \- Un breve corso per imparare Vim .SH SINTASSI .br -.B vimtutor [lingua] +.B vimtutor [\-g] [lingua] .SH DESCRIZIONE .B Vimtutor inizia il .B Vim -tutor. -It copies the tutor file first, so that it can be modified without changing -the original file. +tutor (una breve corso per imparare Vim). +Per prima cosa viene creata una copia del file di lavoro, che pu cos essere +modificato senza alterare il file usato come modello. .PP -The +Il comando .B Vimtutor -is useful for people that want to learn their first + utile a chi voglia imparare i primi comandi .B Vim -commands. +. .PP -The optional [language] argument is the two\-letter name of a language, like -"it" or "es". -If the [language] argument is missing, the language of the current locale will -be used. -If a tutor in this language is available, it will be used. -Otherwise the English version will be used. +L'argomento opzionale \-g inizia vimtutor usando gvim invece che vim, se la +versione GUI di vim disponibile. oppure utilizza vim, se gvim non +disponibile. +.PP +L'arogmento opzionale [lingua] l'abbreviazione di due lettere del nome +di una lingua, per esempio "it" oppure "es". +se L'argomento [lingua] non viene specificato, si utilizza la lingua "locale" +del computer. +Se la versione in quella lingua del "tutor" disponibile, sar usata. +Altrimenti sar usata la versione inglese. .PP .B Vim -is always started in Vi compatible mode. + sempre iniziato in Modo compatibile con vi. .SH FILE .TP 15 /usr/local/lib/vim/tutor/tutor[.language] -The +Il/I file di testo per .B Vimtutor -text file(s). + .TP 15 /usr/local/lib/vim/tutor/tutor.vim -The Vim script used to copy the +Lo script di Vim usato per copiare il file di testo .B Vimtutor -text file. +. .SH AUTORE The .B Vimtutor @@ -46,7 +50,7 @@ Colorado School of Mines, usando idee fornite da Charles Smith, Colorado State University. E\-mail: bware@mines.colorado.edu. .br -E' stato modificato per + stato modificato per .B Vim da Bram Moolenaar. Per i nomi dei traduttori, vedere i file usati nelle rispettive lingue. diff --git a/runtime/doc/xxd-it.1 b/runtime/doc/xxd-it.1 index 41298495a0..3d8dabb950 100755 --- a/runtime/doc/xxd-it.1 +++ b/runtime/doc/xxd-it.1 @@ -24,7 +24,7 @@ Come .BR uuencode (1) e .BR uudecode (1) -permette di trasmettere dati binari in una rapresentazione ASCII "a prova +permette di trasmettere dati binari in una rappresentazione ASCII "a prova di email", ma ha anche il vantaggio di poter decodificare sullo "standard output". Inoltre, pu essere usato per effettuare delle modifiche (patch) a file binari. @@ -61,7 +61,7 @@ sono notazioni equivalenti fra loro. .TP .IR \-a " | " \-autoskip Richiesta di autoskip: Un singolo '*' rimpiazza linee di zeri binari. -Valore predefinito: off. +Valore di default: off. .TP .IR \-b " | " \-bits Richiesta di una immagine binaria (cifre binarie), invece che esadecimale. @@ -74,7 +74,7 @@ linea comando \-r, \-p, \-i non funzionano in questo modo. .IR "\-c colonne " | " \-cols colonne" In ogni linea sono formattate .RI < colonne > -colonne. Valore predefinito 16 (\-i: 12, \-ps: 30, \-b: 6). +colonne. Valore di default 16 (\-i: 12, \-ps: 30, \-b: 6). Valore massimo 256. .TP .IR \-E " | " \-EBCDIC @@ -82,15 +82,15 @@ Cambia la codifica della colonna di destra da ASCII a EBCDIC. Questo non modifica la rappresentazione esadecimale. Non ha senso specificare questa opzione in combinazione con \-r, \-p o \-i. .TP -.IR "\-g bytes " | " \-groupsize bytes" +.IR "\-g numero_byte " | " \-groupsize numero_byte" Inserisci ogni -.RI < bytes > -bytes di output (di due caratteri esadecimali o otto numeri binari ognuno) +.RI < numero_byte > +byte di output (di due caratteri esadecimali o otto numeri binari ognuno) uno spazio bianco. Specificando .I \-g 0 -i bytes di output non sono separati da alcuno spazio. -.RI < Bytes "> ha come valore predefinito " 2 +i byte di output non sono separati da alcuno spazio. +.RI < numero_byte > ha come valore di default " 2 in modalit normale [esadecimale] e \fI1\fP in modalit binaria. Il raggruppamento non si applica agli stili "PostScript" e "include". .TP @@ -103,10 +103,10 @@ L'output definizione completa di un "array" [vettore], dandogli il nome del file di input), tranne che nel caso in cui xxd legga dallo "standard input". .TP -.IR "\-l lunghezza " | " \-len lunghezza" +.IR "\-l numero " | " \-len numero" Il programma esce dopo aver scritto -.RI < lunghezza > -bytes. +.RI < numero > +byte. .TP .IR \-p " | " \-ps " | " \-postscript " | " \-plain L'output nello stile di un dump continuo sotto postscript. @@ -120,7 +120,7 @@ in maniera continua, senza interruzioni. Usare la combinazione .I \-r \-p per leggere dump in stile esadecimale semplice [plain], senza l'informazione di numero di linea e senza un particolare tracciato di colonna. Degli spazi -o delle linee vuote possono essere inserite a piacere [e vengono ingorate]. +o delle linee vuote possono essere inserite a piacere [e vengono ignorate]. .TP .I \-seek distanza Usato con l'opzione @@ -133,17 +133,17 @@ esadecimale. .I \-s [+][\-]seek Inizia a .RI < seek > -bytes assoluti (o relativi) di distanza all'interno di input_file. +byte assoluti (o relativi) di distanza all'interno di input_file. \fI+ \fRindica che il "seek" relativo alla posizione corrente nel file "standard input" (non significativa quando non si legge da "standard input"). \fI\- \fRindica che il "seek" dovrebbe posizionarsi ad quel numero di caratteri dalla fine dell'input (o se in combinazione con \fI+ \fR: prime della posizione corrente nel file "standard input"). -Se non si specifica una opzione \-s option, xxd inizia alla posizione +Se non si specifica una opzione \-s, xxd inizia alla posizione corrente all'interno del file. .TP .I \-u -usa lettere esadecimali maiuscole. Il valore predefinito di usare +usa lettere esadecimali maiuscole. Il valore di default di usare lettere minuscole. .TP .IR \-v " | " \-version @@ -169,7 +169,7 @@ salta il resto della linea, dopo aver letto abbastanza caratteri contenenti dati esadecimali (vedere opzione \-c). Ci implica pure che le modifiche alle colonne di caratteri stampabili ascii (o ebcdic) sono sempre ignorate. La ricostruzione da un file immagine esadecimale in stile semplice -(postscript) con xxd \-r \-p non dipende dal numero corrretto di colonne. +(postscript) con xxd \-r \-p non dipende dal numero corretto di colonne. IN questo caso, qualsiasi cosa assomigli a una coppia di cifre esadecimali interpretata [e utilizzata]. .PP @@ -185,7 +185,7 @@ e pu comportarsi in modo diverso da .IR "xxd \-s seek" , perch lseek(2) usata per tornare indietro nel file di input. Il '+' -fa differenza se il file di input lo "standard input", e se la pozione nel +fa differenza se il file di input lo "standard input", e se la posizione nel file di "standard input" non all'inizio del file quando xxd eseguito, con questo input. I seguenti esempi possono contribuire a chiarire il concetto @@ -204,29 +204,29 @@ si aggiunge a 1k (1024) dove `dd' si era fermato. .PP Immagine esadecimale dalla posizione 0x100 ( = 1024\-768 ) del file in avanti. .br -\fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +-768 > esadecimale' < file +\fI% sh \-c 'dd of=normale bs=1k count=1; xxd \-s +\-768 > esadecimale' < file .PP -Comunque, questo capita raramente, e l'uso del `+' di rado. +Comunque, questo capita raramente, e l'uso del `+' non serve quasi mai. L'autore preferisce monitorare il comportamento di xxd con strace(1) o truss(1), quando si usa l'opzione \-s. .SH ESEMPI .PP .br -Stampa tutto tranne le prime tre linee (0x30 bytes esadecimali) di +Stampa tutto tranne le prime tre linee (0x30 byte esadecimali) di .B file \. .br \fI% xxd \-s 0x30 file .PP .br -Stampa 3 linee (0x30 bytes esadecimali) alla fine di +Stampa 3 linee (0x30 byte esadecimali) alla fine di .B file \. .br \fI% xxd \-s \-0x30 file .PP .br -Stampa 120 bytes come immagine esadecimale continua con 20 bytes per linea. +Stampa 120 byte come immagine esadecimale continua con 20 byte per linea. .br \fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR @@ -245,7 +245,7 @@ Stampa 120 bytes come immagine esadecimale continua con 20 bytes per linea. .br .br -Stampa i primi 120 bytes della pagina di manuale vim.1 a 12 bytes per linea. +Stampa i primi 120 byte della pagina di manuale vim.1 a 12 byte per linea. .br \fI% xxd \-l 120 \-c 12 xxd.1\fR @@ -283,7 +283,7 @@ Copiare .B input_file su .B output_file -premettendogli 100 bytes a 0x00. +premettendogli 100 byte a 0x00. .br \fI% xxd input_file | xxd \-r \-s 100 \> output_file\fR .br @@ -298,7 +298,7 @@ Modificare (patch) la data nel file xxd.1 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996 .PP .br -Creare un file di 65537 tutto a 0x00, +Creare un file di 65537 byte tutto a 0x00, tranne che l'ultimo carattere che una 'A' (esadecimale 0x41). .br \fI% echo '010000: 41' | xxd \-r \> file\fR @@ -316,21 +316,21 @@ Stampa una immagine esadecimale del file di cui sopra con opzione autoskip. .PP Crea un file di 1 byte che contiene il solo carattere 'A'. Il numero dopo '\-r \-s' viene aggiunto a quello trovato nel file; -in pratica, i bytes precedenti non sono stampati. +in pratica, i byte precedenti non sono stampati. .br \fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR .PP -Usare xxd come filtro all'interno di un editor come +Usa xxd come filtro all'interno di un editor come .B vim(1) per ottenere una immagine esadecimale di una parte di file -delimitata dai mark `a' e `z'. +delimitata dai marcatori `a' e `z'. .br \fI:'a,'z!xxd\fR .PP Usare xxd come filtro all'interno di un editor come .B vim(1) per ricostruire un pezzo di file binario da una immagine esadecimale -delimitata dai mark `a' e `z'. +delimitata dai marcatori `a' e `z'. .br \fI:'a,'z!xxd \-r\fR .PP @@ -341,7 +341,7 @@ Portare il cursore sopra la linea e battere: .br \fI!!xxd \-r\fR .PP -Per leggere singoli charatteri da una linea seriale +Per leggere singoli caratteri da una linea seriale .br \fI% xxd \-c1 < /dev/term/b &\fR .br @@ -385,7 +385,7 @@ Questa pagina di manuale documenta la versione 1.7 di xxd. .br (c) 1990-1997 Juergen Weigert .br - + .LP Distribuite liberamente ed attribuitemi il credito, .br diff --git a/runtime/indent/perl.vim b/runtime/indent/perl.vim index b3a9fc0214..0eb95e3afb 100644 --- a/runtime/indent/perl.vim +++ b/runtime/indent/perl.vim @@ -2,11 +2,12 @@ " Language: Perl " Author: Rafael Garcia-Suarez " URL: http://rgarciasuarez.free.fr/vim/indent/perl.vim -" Last Change: 2005 Sep 07 +" Last Change: 2010 Jul 28 " Suggestions and improvements by : " Aaron J. Sherman (use syntax for hints) " Artem Chuprina (play nice with folding) +" Benjamin R. Haskell (fold syntax group fix) " TODO things that are not or not properly indented (yet) : " - Continued statements @@ -133,7 +134,7 @@ function GetPerlIndent() \ || synid == "perlMatchStartEnd" \ || synid == "perlHereDoc" \ || synid =~ "^perlFiledescStatement" - \ || synid =~ '^perl\(Sub\|BEGINEND\|If\)Fold' + \ || synid =~ '^perl\(Sub\|Block\)Fold' let brace = strpart(line, bracepos, 1) if brace == '(' || brace == '{' let ind = ind + &sw @@ -148,7 +149,7 @@ function GetPerlIndent() let synid = synIDattr(synID(v:lnum, bracepos, 0), "name") if synid == "" \ || synid == "perlMatchStartEnd" - \ || synid =~ '^perl\(Sub\|BEGINEND\|If\)Fold' + \ || synid =~ '^perl\(Sub\|Block\)Fold' let ind = ind - &sw endif endif From 98f89366d791d7139fbd00f8344bac008390d162 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 17:25:21 +0200 Subject: [PATCH 10/51] More accented characters in tex.vim syntax. (Charles Campbell) --HG-- branch : vim73 --- runtime/syntax/tex.vim | 140 ++++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 72 deletions(-) diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index 9f27ccefc9..218f9cbfde 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: TeX " Maintainer: Dr. Charles E. Campbell, Jr. -" Last Change: Jul 26, 2010 -" Version: 49 +" Last Change: Jul 28, 2010 +" Version: 51 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax " " Notes: {{{1 @@ -126,8 +126,8 @@ if !exists("tex_no_math") syn cluster texSubSubSectionGroup contains=texParaZone syn cluster texParaGroup contains=texSubParaZone if has("conceal") && &enc == 'utf-8' - syn cluster texMathZoneGroup add=texGreek,texSuperscript,texSubscript - syn cluster texMathMatchGroup add=texGreek,texSuperscript,texSubscript + syn cluster texMathZoneGroup add=texGreek,texSuperscript,texSubscript,texMathSymbol + syn cluster texMathMatchGroup add=texGreek,texSuperscript,texSubscript,texMathSymbol endif endif @@ -341,10 +341,17 @@ if !exists("tex_no_math") call TexNewMathZone("L","xxalignat",0) " Inline Math Zones: {{{2 - syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup - syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup - syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup - syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup + if has("conceal") && &enc == 'utf-8' + syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup + syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend concealends contains=@texMathZoneGroup + syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" concealends contains=@texMathZoneGroup + syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" concealends keepend contains=@texMathZoneGroup + else + syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup + syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup + syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup + syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup + endif syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup syn match texMathOper "[_^=]" contained @@ -530,10 +537,11 @@ if has("conceal") && &enc == 'utf-8' call s:Greek('texGreek','\\Phi\>' ,'Φ') call s:Greek('texGreek','\\Psi\>' ,'Ψ') call s:Greek('texGreek','\\Omega\>' ,'Ω') + delfun s:Greek " Superscripts/Subscripts {{{2 - syn region texSuperscript start='\^{' end='}' contained contains=texSuperscripts - syn region texSubscript start='_{' end='}' contained contains=texSubscripts + syn region texSuperscript matchgroup=Delimiter start='\^{' end='}' contained concealends contains=texSuperscripts + syn region texSubscript matchgroup=Delimiter start='_{' end='}' contained concealends contains=texSubscripts fun! s:SuperSub(group,leader,pat,cchar) exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s' @@ -629,75 +637,63 @@ if has("conceal") && &enc == 'utf-8' call s:SuperSub('texSubscript','_','\\phi\>' ,'ᵩ') call s:SuperSub('texSubscript','_','\\gamma\>','ᵧ') call s:SuperSub('texSubscript','_','\\chi\>' ,'ᵪ') + delfun s:SuperSub " Accented characters: {{{2 if b:tex_stylish syn match texAccent "\\[bcdvuH][^a-zA-Z@]"me=e-1 syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1 else - syn match texAccent '\\`{a}' conceal cchar=à - syn match texAccent '\\\'{a}' conceal cchar=á - syn match texAccent '\\^{a}' conceal cchar=â - syn match texAccent '\\"{a}' conceal cchar=ä - syn match texAccent '\\\~{a}' conceal cchar=ã - syn match texAccent '\\r{a}' conceal cchar=å - syn match texAccent '\\`{A}' conceal cchar=À - syn match texAccent '\\\'{A}' conceal cchar=Á - syn match texAccent '\\^{A}' conceal cchar= - syn match texAccent '\\"{A}' conceal cchar=Ä - syn match texAccent '\\\~{A}' conceal cchar=à - syn match texAccent '\\r{A}' conceal cchar=Å + fun! s:Accents(chr,...) + let i= 1 + for accent in ["`","\\'","^",'"','\~',"r","v"] + if i > a:0 + break + endif + if strlen(a:{i}) == 0 + let i= i + 1 + continue + endif + exe "syn match texAccent '\\\\".accent."{".a:chr."}' conceal cchar=".a:{i} + let i= i + 1 + endfor + endfun + call s:Accents('a','à','á','â','ä','ã','å','ă') + call s:Accents('A','À','Á','Â','Ä','Ã','Å','Ă') + call s:Accents('C',"" ,'Ć','Ĉ',"" ,"" ,"" ,'Ć') + call s:Accents('e','è','é','ê','ë','ẽ',"" ,'ĕ') + call s:Accents('E','È','É','Ê','Ë','Ẽ',"" ,'Ė') + call s:Accents('i','ì','í','î','ï','ĩ',"" ,"ĭ") + call s:Accents('I','Ì','Í','Î','Ï','Ĩ',"" ,'Ĭ') + call s:Accents('o','ò','ó','ô','ö','õ',"" ,'ŏ') + call s:Accents('O','Ò','Ó','Ô','Ö','Õ',"" ,'Ŏ') + call s:Accents('r',"" ,'ŕ',"" ,"" ,"" ,"" ,'ř') + call s:Accents('R',"" ,'Ŕ',"" ,"" ,"" ,"" ,'Ř') + call s:Accents('s',"" ,'ś','ŝ',"" ,"" ,"" ,'š') + call s:Accents('S',"" ,'Ś','Ŝ',"" ,"" ,"" ,'Š') + call s:Accents('u','ù','ú','û','ü','ũ',"" ,'ŭ') + call s:Accents('U','Ù','Ú','Û','Ü','Ũ',"" ,'Ŭ') + call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',"" ,"" ) + call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',"" ,"" ) + delfun s:Accents + syn match texAccent '\\aa\>' conceal cchar=å + syn match texAccent '\\AA\>' conceal cchar=Å + syn match texAccent '\\k{a}' conceal cchar=ą + syn match texAccent '\\k{A}' conceal cchar=Ą + syn match texAccent '\\c{C}' conceal cchar=Ç syn match texAccent '\\c{c}' conceal cchar=ç - syn match texAccent '\\`{e}' conceal cchar=è - syn match texAccent '\\\'{e}' conceal cchar=é - syn match texAccent '\\^{e}' conceal cchar=ê - syn match texAccent '\\"{e}' conceal cchar=ë - syn match texAccent '\\\~{e}' conceal cchar=ẽ - syn match texAccent '\\`{E}' conceal cchar=È - syn match texAccent '\\\'{E}' conceal cchar=É - syn match texAccent '\\^{E}' conceal cchar=Ê - syn match texAccent '\\"{E}' conceal cchar=Ë - syn match texAccent '\\\~{E}' conceal cchar=Ẽ - syn match texAccent '\\`{i}' conceal cchar=ì - syn match texAccent '\\\'{i}' conceal cchar=í - syn match texAccent '\\^{i}' conceal cchar=î - syn match texAccent '\\"{i}' conceal cchar=ï - syn match texAccent '\\\~{i}' conceal cchar=ĩ - syn match texAccent '\\`{I}' conceal cchar=Ì - syn match texAccent '\\\'{I}' conceal cchar=Í - syn match texAccent '\\^{I}' conceal cchar=Î - syn match texAccent '\\"{I}' conceal cchar=Ï - syn match texAccent '\\\~{I}' conceal cchar=Ĩ - syn match texAccent '\\`{o}' conceal cchar=ò - syn match texAccent '\\\'{o}' conceal cchar=ó - syn match texAccent '\\^{o}' conceal cchar=ô - syn match texAccent '\\"{o}' conceal cchar=ö - syn match texAccent '\\\~{o}' conceal cchar=õ - syn match texAccent '\\`{O}' conceal cchar=Ò - syn match texAccent '\\\'{O}' conceal cchar=Ó - syn match texAccent '\\^{O}' conceal cchar=Ô - syn match texAccent '\\"{O}' conceal cchar=Ö - syn match texAccent '\\\~{O}' conceal cchar=Õ - syn match texAccent '\\`{u}' conceal cchar=ù - syn match texAccent '\\\'{u}' conceal cchar=ú - syn match texAccent '\\^{u}' conceal cchar=û - syn match texAccent '\\"{u}' conceal cchar=ü - syn match texAccent '\\\~{u}' conceal cchar=ũ - syn match texAccent '\\`{U}' conceal cchar=Ù - syn match texAccent '\\\'{U}' conceal cchar=Ú - syn match texAccent '\\^{U}' conceal cchar=Û - syn match texAccent '\\"{U}' conceal cchar=Ü - syn match texAccent '\\\~{U}' conceal cchar=Ũ - syn match texAccent '\\`{y}' conceal cchar=ỳ - syn match texAccent '\\\'{y}' conceal cchar=ý - syn match texAccent '\\^{y}' conceal cchar=ŷ - syn match texAccent '\\"{y}' conceal cchar=ÿ - syn match texAccent '\\\~{y}' conceal cchar=ỹ - syn match texAccent '\\`{Y}' conceal cchar=Ỳ - syn match texAccent '\\\'{Y}' conceal cchar=Ý - syn match texAccent '\\^{Y}' conceal cchar=Ŷ - syn match texAccent '\\"{Y}' conceal cchar=Ÿ - syn match texAccent '\\\~{Y}' conceal cchar=Ỹ + syn match texAccent '\\\~{n}' conceal cchar=ñ + syn match texAccent '\\\~{N}' conceal cchar=Ñ + syn match texAccent '\\o\>' conceal cchar=ø + syn match texAccent '\\O\>' conceal cchar=Ø + syn match texAccent '\\H{o}' conceal cchar=ő + syn match texAccent '\\H{O}' conceal cchar=Ő + syn match texAccent '\\c{r}' conceal cchar=ŗ + syn match texLigature '\\AE\>' conceal cchar=Æ + syn match texLigature '\\ae\>' conceal cchar=æ + syn match texLigature '\\oe\>' conceal cchar=œ + syn match texLigature '\\OE\>' conceal cchar=Œ + syn match texLigature '\\ss\>' conceal cchar=ß endif endif From 84142e9d4e72c47c2ab7a81b84ed65da25700420 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 18:14:45 +0200 Subject: [PATCH 11/51] Fix: concealed regions didn't get redrawn correctly when moving the cursor through them. --HG-- branch : vim73 --- src/structs.h | 4 ++++ src/syntax.c | 24 ++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/structs.h b/src/structs.h index d959b5c090..31f71d23e3 100644 --- a/src/structs.h +++ b/src/structs.h @@ -808,6 +808,10 @@ typedef struct buf_state { int bs_idx; /* index of pattern */ int bs_flags; /* flags for pattern */ +#ifdef FEAT_CONCEAL + int bs_seqnr; /* stores si_seqnr */ + int bs_cchar; /* stores si_cchar */ +#endif reg_extmatch_T *bs_extmatch; /* external matches from start pattern */ } bufstate_T; diff --git a/src/syntax.c b/src/syntax.c index 4655c77660..802ebec539 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -145,7 +145,7 @@ typedef struct syn_pattern char sp_syncing; /* this item used for syncing */ int sp_flags; /* see HL_ defines below */ #ifdef FEAT_CONCEAL - int sp_char; /* conceal substitute character */ + int sp_cchar; /* conceal substitute character */ #endif struct sp_syn sp_syn; /* struct passed to in_id_list() */ short sp_syn_match_id; /* highlight group ID of pattern */ @@ -196,8 +196,8 @@ static int current_id = 0; /* ID of current char for syn_get_id() */ static int current_trans_id = 0; /* idem, transparency removed */ #endif #ifdef FEAT_CONCEAL -static int current_seqnr = 0; static int current_flags = 0; +static int current_seqnr = 0; static int current_sub_char = 0; #endif @@ -287,8 +287,8 @@ typedef struct state_item long si_flags; /* HL_HAS_EOL flag in this state, and * HL_SKIP* for si_next_list */ #ifdef FEAT_CONCEAL - int si_char; /* substitution character for conceal */ int si_seqnr; /* sequence number */ + int si_cchar; /* substitution character for conceal */ #endif short *si_cont_list; /* list of contained groups */ short *si_next_list; /* nextgroup IDs after this item ends */ @@ -1495,6 +1495,10 @@ store_current_state() { bp[i].bs_idx = CUR_STATE(i).si_idx; bp[i].bs_flags = CUR_STATE(i).si_flags; +#ifdef FEAT_CONCEAL + bp[i].bs_seqnr = CUR_STATE(i).si_seqnr; + bp[i].bs_cchar = CUR_STATE(i).si_cchar; +#endif bp[i].bs_extmatch = ref_extmatch(CUR_STATE(i).si_extmatch); } sp->sst_next_flags = current_next_flags; @@ -1530,6 +1534,10 @@ load_current_state(from) { CUR_STATE(i).si_idx = bp[i].bs_idx; CUR_STATE(i).si_flags = bp[i].bs_flags; +#ifdef FEAT_CONCEAL + CUR_STATE(i).si_seqnr = bp[i].bs_seqnr; + CUR_STATE(i).si_cchar = bp[i].bs_cchar; +#endif CUR_STATE(i).si_extmatch = ref_extmatch(bp[i].bs_extmatch); if (keepend_level < 0 && (CUR_STATE(i).si_flags & HL_KEEPEND)) keepend_level = i; @@ -1963,7 +1971,7 @@ syn_current_attr(syncing, displaying, can_spell, keep_state) cur_si->si_flags = flags; #ifdef FEAT_CONCEAL cur_si->si_seqnr = next_seqnr++; - cur_si->si_char = cchar; + cur_si->si_cchar = cchar; if (current_state.ga_len > 1) cur_si->si_flags |= CUR_STATE(current_state.ga_len - 2).si_flags @@ -2293,8 +2301,8 @@ syn_current_attr(syncing, displaying, can_spell, keep_state) current_trans_id = sip->si_trans_id; #ifdef FEAT_CONCEAL current_flags = sip->si_flags; - current_sub_char = sip->si_char; current_seqnr = sip->si_seqnr; + current_sub_char = sip->si_cchar; #endif break; } @@ -2449,7 +2457,7 @@ push_next_match(cur_si) cur_si->si_flags = spp->sp_flags; #ifdef FEAT_CONCEAL cur_si->si_seqnr = next_seqnr++; - cur_si->si_char = spp->sp_char; + cur_si->si_cchar = spp->sp_cchar; if (current_state.ga_len > 1) cur_si->si_flags |= CUR_STATE(current_state.ga_len - 2).si_flags & HL_CONCEAL; @@ -4885,7 +4893,7 @@ syn_cmd_match(eap, syncing) SYN_ITEMS(curwin->w_s)[idx].sp_syn.cont_in_list = syn_opt_arg.cont_in_list; #ifdef FEAT_CONCEAL - SYN_ITEMS(curwin->w_s)[idx].sp_char = conceal_char; + SYN_ITEMS(curwin->w_s)[idx].sp_cchar = conceal_char; #endif if (syn_opt_arg.cont_in_list != NULL) curwin->w_s->b_syn_containedin = TRUE; @@ -5129,7 +5137,7 @@ syn_cmd_region(eap, syncing) SYN_ITEMS(curwin->w_s)[idx].sp_syn_match_id = ppp->pp_matchgroup_id; #ifdef FEAT_CONCEAL - SYN_ITEMS(curwin->w_s)[idx].sp_char = conceal_char; + SYN_ITEMS(curwin->w_s)[idx].sp_cchar = conceal_char; #endif if (item == ITEM_START) { From 9c5e157a00fb93b88b37297820ac00974dc1408b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 18:17:41 +0200 Subject: [PATCH 12/51] More runtime file updates. --HG-- branch : vim73 --- runtime/autoload/netrw.vim | 4 ++-- runtime/autoload/tar.vim | 32 +++++++++++++++++++++++--------- runtime/doc/options.txt | 13 ++++++++----- runtime/doc/pi_netrw.txt | 7 ++++--- runtime/doc/pi_tar.txt | 11 ++++++----- runtime/doc/syntax.txt | 17 ++++++++++------- runtime/doc/tags | 6 +++++- runtime/doc/todo.txt | 6 ------ runtime/plugin/netrwPlugin.vim | 5 +++-- runtime/plugin/tarPlugin.vim | 4 +++- 10 files changed, 64 insertions(+), 41 deletions(-) diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index b05f81db8b..6d1c37f488 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION " Date: Jul 27, 2010 -" Version: 139 +" Version: 140 " Maintainer: Charles E Campbell, Jr " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2010 Charles E. Campbell, Jr. {{{1 @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v139" +let g:loaded_netrw = "v140" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrw needs vim 7.2" diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 3e44579ce1..508405341b 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -1,7 +1,7 @@ " tar.vim: Handles browsing tarfiles " AUTOLOAD PORTION -" Date: Dec 28, 2009 -" Version: 24 +" Date: Jul 27, 2010 +" Version: 25 " Maintainer: Charles E Campbell, Jr " License: Vim License (see vim's :help license) " @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_tar") finish endif -let g:loaded_tar= "v24" +let g:loaded_tar= "v25" if v:version < 702 echohl WarningMsg echo "***warning*** this version of tar needs vim 7.2" @@ -164,6 +164,9 @@ fun! tar#Browse(tarfile) elseif tarfile =~# '\.lzma$' " call Decho("3: exe silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + elseif tarfile =~# '\.\(xz\|txz\)$' +" call Decho("3: exe silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") + exe "silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. @@ -265,10 +268,13 @@ fun! tar#Read(fname,mode) elseif fname =~ '\.lzma$' && executable("lzcat") let decmp= "|lzcat" let doro = 1 + elseif fname =~ '\.xz$' && executable("xzcat") + let decmp= "|xzcat" + let doro = 1 else let decmp="" let doro = 0 - if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.zip$\|\.Z$' + if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.xz$\|\.zip$\|\.Z$' setlocal bin endif endif @@ -290,6 +296,9 @@ fun! tar#Read(fname,mode) elseif tarfile =~# '\.lzma$' " call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + elseif tarfile =~# '\.\(xz\|txz\)$' +" call Decho("3: exe silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) + exe "silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. @@ -387,17 +396,22 @@ fun! tar#Write(fname) call system("gzip -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.gz','','e') let compress= "gzip -- ".shellescape(tarfile,0) -" call Decho("compress<".compress.">") - elseif tarfile =~# '\.lzma' - call system("lzma -d -- ".shellescape(tarfile,0)) - let tarfile = substitute(tarfile,'\.lzma','','e') - let compress= "lzma -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") elseif tarfile =~# '\.tgz' call system("gzip -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.tgz','.tar','e') let compress= "gzip -- ".shellescape(tarfile,0) let tgz = 1 +" call Decho("compress<".compress.">") + elseif tarfile =~# '\.xz' + call system("xz -d -- ".shellescape(tarfile,0)) + let tarfile = substitute(tarfile,'\.xz','','e') + let compress= "xz -- ".shellescape(tarfile,0) +" call Decho("compress<".compress.">") + elseif tarfile =~# '\.lzma' + call system("lzma -d -- ".shellescape(tarfile,0)) + let tarfile = substitute(tarfile,'\.lzma','','e') + let compress= "lzma -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") endif " call Decho("tarfile<".tarfile.">") diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index f7b90ca3fd..469d6064c5 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.3c. Last change: 2010 Jul 25 +*options.txt* For Vim version 7.3c. Last change: 2010 Jul 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1741,12 +1741,15 @@ A jump table for the options with a short description can be found at |Q_op|. Value Effect ~ 0 Text is shown normally - 1 Each block of concealed text is replaced with the - character defined in 'listchars' (default is a dash) - and highlighted with the "Conceal" highlight group. + 1 Each block of concealed text is replaced with one + character. If the syntax item does not have a custom + replacement character defined (see |:syn-cchar|) the + character defined in 'listchars' is used (default is a + space). + It is highlighted with the "Conceal" highlight group. 2 Concealed text is completely hidden unless it has a custom replacement character defined (see - |:syn-cchar|. + |:syn-cchar|). 3 Concealed text is completely hidden. Note: in the cursor line concealed text is not hidden, so that you can diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 193138bb97..ec6c139857 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -2706,6 +2706,7 @@ which is loaded automatically at startup (assuming :set nocp). ============================================================================== 12. History *netrw-history* {{{1 + v140: Jul 27, 2010 * (Lech Lorens) unexpected change of window v139: May 14, 2010 * when viewing remote directory listings and changing listing style, going to tree listing mode was issuing two rather useless messages @@ -2717,11 +2718,11 @@ which is loaded automatically at startup (assuming :set nocp). * (Britton Kerin) wanted netrw listings to be buflisted; the |g:netrw_bufsettings| option permits that. - * (John Orr) pointed out that the intended maparg - test for gx was actually testing for g rather - than gx. Fixed. Jun 18, 2010 * (Jan Steffens) added support for xz compression Jun 23, 2010 * vimdiff dir1 dir2 now works + Jul 27, 2010 * (John Orr) pointed out that the intended maparg + test for gx was actually testing for g rather + than gx. Fixed. v138: May 01, 2010 * added the bomb setting to the Save-Set-Restore option handling (for Tony M) May 14, 2010 * (Bram Moolenaar) netrw optionally sets cursorline diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt index d90d7a615b..c14a2a8940 100644 --- a/runtime/doc/pi_tar.txt +++ b/runtime/doc/pi_tar.txt @@ -1,4 +1,4 @@ -*pi_tar.txt* For Vim version 7.3c. Last change: 2009 Dec 28 +*pi_tar.txt* For Vim version 7.3c. Last change: 2010 Jul 27 +====================+ | Tar File Interface | @@ -6,7 +6,7 @@ Author: Charles E. Campbell, Jr. (remove NOSPAM from Campbell's email first) -Copyright 2005-2008: The GPL (gnu public license) applies to *tar-copyright* +Copyright 2005-2010: The GPL (gnu public license) applies to *tar-copyright* tar.vim, tarPlugin.vim, and pi_tar.txt. No warranty, express or implied. Use At-Your-Own-Risk. @@ -26,10 +26,10 @@ Copyright 2005-2008: The GPL (gnu public license) applies to *tar-copyright* also write to the file. Currently, one may not make a new file in tar archives via the plugin. - *:Untarvim* - UNTARVIM~ + *:Vimuntar* + VIMUNTAR~ - :Untarvim [vimhome] + :Vimuntar [vimhome] This command copies, if necessary, the tarball to the .vim or vimfiles directory using the first writable directory in the |'runtimepath'| @@ -83,6 +83,7 @@ Copyright 2005-2008: The GPL (gnu public license) applies to *tar-copyright* 4. History *tar-history* + v25 Jun 19, 2010 * (Jan Steffens) added support for xz compression v24 Apr 07, 2009 * :Untarvim command implemented Sep 28, 2009 * Added lzma support v22 Aug 08, 2008 * security fixes diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 71afa9f031..73e7404053 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.3c. Last change: 2010 Jul 26 +*syntax.txt* For Vim version 7.3c. Last change: 2010 Jul 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2703,12 +2703,15 @@ always accept such use of @. *tex-cchar* *tex-cole* *tex-conceal* Taking Advantage of Conceal Mode~ -If you have |'conceallevel'| set to 1 and if your encoding is utf-8, then a -number of character sequences will be translated (ie. better visualized) using -|syn-cchar|, including various accented characters, Greek characters in -MathZones, and superscripts and subscripts in MathZones. Not all characters -can be made into superscripts or subscripts; the constraint is due to what -utf-8 supports. +If you have |'conceallevel'| set to 2 and if your encoding is utf-8, then a +number of character sequences can be translated into appropriate utf-8 glyphs, +including various accented characters, Greek characters in MathZones, and +superscripts and subscripts in MathZones. Not all characters can be made into +superscripts or subscripts; the constraint is due to what utf-8 supports. +In fact, only a few characters are supported as subscripts. + +One way to use this is to have vertically split windows (see |CTRL-W_v|); one +with |'conceallevel'| at 0 and the other at 2; and both using |'scrollbind'|. TF *tf.vim* *ft-tf-syntax* diff --git a/runtime/doc/tags b/runtime/doc/tags index 004f3ce640..633fa2fb15 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -1819,10 +1819,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :Sexplore pi_netrw.txt /*:Sexplore* :TOhtml syntax.txt /*:TOhtml* :Texplore pi_netrw.txt /*:Texplore* -:Untarvim pi_tar.txt /*:Untarvim* :UseVimball pi_vimball.txt /*:UseVimball* :Vexplore pi_netrw.txt /*:Vexplore* :VimballList pi_vimball.txt /*:VimballList* +:Vimuntar pi_tar.txt /*:Vimuntar* :X editing.txt /*:X* :XMLent insert.txt /*:XMLent* :XMLns insert.txt /*:XMLns* @@ -5732,6 +5732,7 @@ g:netrw_altv pi_netrw.txt /*g:netrw_altv* g:netrw_banner pi_netrw.txt /*g:netrw_banner* g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split* g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer* +g:netrw_bufsettings pi_netrw.txt /*g:netrw_bufsettings* g:netrw_chgperm pi_netrw.txt /*g:netrw_chgperm* g:netrw_chgwin pi_netrw.txt /*g:netrw_chgwin* g:netrw_compress pi_netrw.txt /*g:netrw_compress* @@ -7902,6 +7903,9 @@ terminal-info term.txt /*terminal-info* terminal-options term.txt /*terminal-options* terminfo term.txt /*terminfo* termresponse-variable eval.txt /*termresponse-variable* +tex-cchar syntax.txt /*tex-cchar* +tex-cole syntax.txt /*tex-cole* +tex-conceal syntax.txt /*tex-conceal* tex-error syntax.txt /*tex-error* tex-folding syntax.txt /*tex-folding* tex-math syntax.txt /*tex-math* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index b132f56f98..d539cb0fe2 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -30,12 +30,6 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -Problem with concealends in v50 of tex.vim? (Charles Campbell, 2010 Jul 26) -Fixed by patch from Vince? Try /tmp/tex.vim - -v140 of netrw. -v25 of tar.vim. - Conceal problem: CTRL-L draws differently than individual line. (Benjamin Fritz, 2010 Jul 27) diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index 25a42629c6..3ce710b0ad 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -20,7 +20,7 @@ if &cp || exists("g:loaded_netrwPlugin") finish endif -let g:loaded_netrwPlugin = "v139" +let g:loaded_netrwPlugin = "v140" if v:version < 702 echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None finish @@ -112,8 +112,9 @@ endfun " --------------------------------------------------------------------- " s:VimEnter: {{{2 fun! s:VimEnter(dirname) + let curwin= winnr() windo if a:dirname != expand("%")|call s:LocalBrowse(expand("%:p"))|endif - 1wincmd w + exe curwin."wincmd w" endfun " --------------------------------------------------------------------- diff --git a/runtime/plugin/tarPlugin.vim b/runtime/plugin/tarPlugin.vim index 8232b46d56..42d6f4fc13 100644 --- a/runtime/plugin/tarPlugin.vim +++ b/runtime/plugin/tarPlugin.vim @@ -14,7 +14,7 @@ if &cp || exists("g:loaded_tarPlugin") finish endif -let g:loaded_tarPlugin = "v24" +let g:loaded_tarPlugin = "v25" let s:keepcpo = &cpo set cpo&vim @@ -41,6 +41,8 @@ augroup tar au BufReadCmd *.tar.Z call tar#Browse(expand("")) au BufReadCmd *.tgz call tar#Browse(expand("")) au BufReadCmd *.tar.lzma call tar#Browse(expand("")) + au BufReadCmd *.tar.xz call tar#Browse(expand("")) + au BufReadCmd *.txz call tar#Browse(expand("")) augroup END com! -nargs=? -complete=file Vimuntar call tar#Vimuntar() From 20ae607f71b375bcf7dd566efff35e60149218b5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 18:55:02 +0200 Subject: [PATCH 13/51] Fix: :redir to a dictionary that is changed before ":redir END" causes a memory access error. --HG-- branch : vim73 --- src/eval.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/eval.c b/src/eval.c index 58c89c88d1..f1285ca392 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1056,6 +1056,7 @@ var_redir_start(name, append) FNE_CHECK_START); if (redir_endp == NULL || redir_lval->ll_name == NULL || *redir_endp != NUL) { + clear_lval(redir_lval); if (redir_endp != NULL && *redir_endp != NUL) /* Trailing characters are present after the variable name */ EMSG(_(e_trailing)); @@ -1076,6 +1077,7 @@ var_redir_start(name, append) set_var_lval(redir_lval, redir_endp, &tv, TRUE, (char_u *)"."); else set_var_lval(redir_lval, redir_endp, &tv, TRUE, (char_u *)"="); + clear_lval(redir_lval); err = did_emsg; did_emsg |= save_emsg; if (err) @@ -1084,12 +1086,6 @@ var_redir_start(name, append) var_redir_stop(); return FAIL; } - if (redir_lval->ll_newkey != NULL) - { - /* Dictionary item was created, don't do it again. */ - vim_free(redir_lval->ll_newkey); - redir_lval->ll_newkey = NULL; - } return OK; } @@ -1144,14 +1140,19 @@ var_redir_stop() ga_append(&redir_ga, NUL); /* Append the trailing NUL. */ tv.v_type = VAR_STRING; tv.vval.v_string = redir_ga.ga_data; - set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)"."); + /* Call get_lval() again, if it's inside a Dict or List it may + * have changed. */ + redir_endp = get_lval(redir_varname, NULL, redir_lval, + FALSE, FALSE, FALSE, FNE_CHECK_START); + if (redir_endp != NULL && redir_lval->ll_name != NULL) + set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)"."); + clear_lval(redir_lval); } /* free the collected output */ vim_free(redir_ga.ga_data); redir_ga.ga_data = NULL; - clear_lval(redir_lval); vim_free(redir_lval); redir_lval = NULL; } From ded2e15a0e31fa2c583dce430ac16cf81873bab5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 19:38:16 +0200 Subject: [PATCH 14/51] Changes for VMS. Mostly by Zoltan Arpadffy. --HG-- branch : vim73 --- runtime/doc/os_vms.txt | 18 +++++++++++------- runtime/doc/todo.txt | 9 --------- src/Make_vms.mms | 10 +++++----- src/edit.c | 2 +- src/normal.c | 4 ++-- src/os_vms_conf.h | 3 +++ src/proto/screen.pro | 2 +- src/screen.c | 2 +- src/ui.c | 2 +- 9 files changed, 25 insertions(+), 27 deletions(-) diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt index 6edfbe86ff..320dddaa6b 100644 --- a/runtime/doc/os_vms.txt +++ b/runtime/doc/os_vms.txt @@ -1,4 +1,4 @@ -*os_vms.txt* For Vim version 7.3c. Last change: 2009 Oct 28 +*os_vms.txt* For Vim version 7.3c. Last change: 2010 Jul 28 VIM REFERENCE MANUAL @@ -766,16 +766,20 @@ GNU_TOOLS.ZIP package downloadable from http://www.polarhome.com/vim/ 9. VMS related changes *vms-changes* -Recent changes -- The following plugins are included into VMS runtime: - genutils 2.4, multiselect 2.2, multvals 3.1, selectbuf 4.3, - bufexplorer 7.1.7, taglist 4.5 -- minor changes in vimrc (just in VMS runtime) +Version 7.3 +- CTAGS 5.8 included +- VMS compile warnings fixed - floating-point overflow warning corrected on VAX +- filepath completition corrected - too many chars were escaped in filename + and shell commands +- the following plugins are included into VMS runtime: + genutils 2.4, multiselect 2.2, multvals 3.1, selectbuf 4.3, + bufexplorer 7.1.7, taglist 4.5 +- minor changes in vimrc (just in VMS runtime) - make_vms.mms - HUGE model is the default - [TESTDIR]make_vms.mms include as many tests possible - modify test30 and test54 for VMS - enable FLOAT feature in VMS port -- os_vms.txt updated +- os_vms.txt updated Version 7.2 (2008 Aug 9) - VCF files write corrected diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index d539cb0fe2..469fc4317a 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -30,15 +30,6 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -Conceal problem: CTRL-L draws differently than individual line. (Benjamin -Fritz, 2010 Jul 27) - -Access to free memory with :redir command. (Dominique Pelle, 2010 Jul 25) -Easier way to reproduce in later message. (2010 Jul 26) -call get_lval() again in var_redir_stop(). - -Patch for VMS. Zoltan Arpadffy, 2010 Jul 26. - Patch for :find completion. (Nazri Ramliy, 2010 Jul 27, and leak fix) And patch for Windows, Jul 28. And fix for patch, Jul 28. diff --git a/src/Make_vms.mms b/src/Make_vms.mms index 0519d7b6f9..fce6ab60b2 100644 --- a/src/Make_vms.mms +++ b/src/Make_vms.mms @@ -2,7 +2,7 @@ # Makefile for Vim on OpenVMS # # Maintainer: Zoltan Arpadffy -# Last change: 2008 Aug 16 +# Last change: 2010 Jul 28 # # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64 # with MMS and MMK @@ -295,21 +295,21 @@ ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(VMS_DEF)$(DEBUG_DEF)$(PERL_DEF)$(PYT ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \ $(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(SNIFF_LIB) $(RUBY_LIB) -SRC = buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \ +SRC = blowfish.c buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \ ex_docmd.c ex_eval.c ex_getln.c if_xcmdsrv.c fileio.c fold.c getchar.c \ hardcopy.c hashtab.c main.c mark.c menu.c mbyte.c memfile.c memline.c message.c misc1.c \ - misc2.c move.c normal.c ops.c option.c popupmnu.c quickfix.c regexp.c search.c \ + misc2.c move.c normal.c ops.c option.c popupmnu.c quickfix.c regexp.c search.c sha256.c\ spell.c syntax.c tag.c term.c termlib.c ui.c undo.c version.c screen.c \ window.c os_unix.c os_vms.c pathdef.c \ $(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) $(SNIFF_SRC) \ $(RUBY_SRC) $(HANGULIN_SRC) -OBJ = buffer.obj charset.obj diff.obj digraph.obj edit.obj eval.obj \ +OBJ = blowfish.obj buffer.obj charset.obj diff.obj digraph.obj edit.obj eval.obj \ ex_cmds.obj ex_cmds2.obj ex_docmd.obj ex_eval.obj ex_getln.obj \ if_xcmdsrv.obj fileio.obj fold.obj getchar.obj hardcopy.obj hashtab.obj main.obj mark.obj \ menu.obj memfile.obj memline.obj message.obj misc1.obj misc2.obj \ move.obj mbyte.obj normal.obj ops.obj option.obj popupmnu.obj quickfix.obj \ - regexp.obj search.obj spell.obj syntax.obj tag.obj term.obj termlib.obj \ + regexp.obj search.obj sha256.obj spell.obj syntax.obj tag.obj term.obj termlib.obj \ ui.obj undo.obj screen.obj version.obj window.obj os_unix.obj \ os_vms.obj pathdef.obj \ $(GUI_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \ diff --git a/src/edit.c b/src/edit.c index 4754fd9bde..ed5b79859f 100644 --- a/src/edit.c +++ b/src/edit.c @@ -380,7 +380,7 @@ edit(cmdchar, startln, count) #ifdef FEAT_CONCEAL /* Check if the cursor line needs redrawing before changing State. If * 'concealcursor' is "n" it needs to be redrawn without concealing. */ - conceal_check_cursur_line_redraw(); + conceal_check_cursur_line(); #endif #ifdef FEAT_MOUSE diff --git a/src/normal.c b/src/normal.c index 9e75afc9eb..e17aec3154 100644 --- a/src/normal.c +++ b/src/normal.c @@ -7649,7 +7649,7 @@ n_start_visual_mode(c) { #ifdef FEAT_CONCEAL /* Check for redraw before changing the state. */ - conceal_check_cursur_line_redraw(); + conceal_check_cursur_line(); #endif VIsual_mode = c; @@ -7673,7 +7673,7 @@ n_start_visual_mode(c) #endif #ifdef FEAT_CONCEAL /* Check for redraw after changing the state. */ - conceal_check_cursur_line_redraw(); + conceal_check_cursur_line(); #endif if (p_smd && msg_silent == 0) diff --git a/src/os_vms_conf.h b/src/os_vms_conf.h index d70ab6137c..ade1ea3a49 100644 --- a/src/os_vms_conf.h +++ b/src/os_vms_conf.h @@ -50,6 +50,9 @@ /* Define to `int' if doesn't define. */ /* #undef uid_t */ +/* Define to `unsigned int' or other type that is 32 bit. */ +#define UINT32_T unsigned int + /* Define to `int' if doesn't define. */ /* #undef gid_t */ diff --git a/src/proto/screen.pro b/src/proto/screen.pro index efaf4c6d0e..be791e0c45 100644 --- a/src/proto/screen.pro +++ b/src/proto/screen.pro @@ -9,7 +9,7 @@ void redrawWinline __ARGS((linenr_T lnum, int invalid)); void update_curbuf __ARGS((int type)); void update_screen __ARGS((int type)); int conceal_cursor_line __ARGS((win_T *wp)); -void conceal_check_cursur_line_redraw __ARGS((void)); +void conceal_check_cursur_line __ARGS((void)); void update_single_line __ARGS((win_T *wp, linenr_T lnum)); void update_debug_sign __ARGS((buf_T *buf, linenr_T lnum)); void updateWindow __ARGS((win_T *wp)); diff --git a/src/screen.c b/src/screen.c index ca5827fe32..a53a9419ff 100644 --- a/src/screen.c +++ b/src/screen.c @@ -616,7 +616,7 @@ conceal_cursor_line(wp) * Check if the cursor line needs to be redrawn because of 'concealcursor'. */ void -conceal_check_cursur_line_redraw() +conceal_check_cursur_line() { if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin)) { diff --git a/src/ui.c b/src/ui.c index 1337807b64..fbdc325355 100644 --- a/src/ui.c +++ b/src/ui.c @@ -1914,7 +1914,7 @@ ui_cursor_shape() # endif # ifdef FEAT_CONCEAL - conceal_check_cursur_line_redraw(); + conceal_check_cursur_line(); # endif } #endif From 317c358364c7009534014284cae3576ba9555e7a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 22:29:10 +0200 Subject: [PATCH 15/51] Improvements for ":find" completion. (Nazri Ramliy) --HG-- branch : vim73 --- runtime/doc/editing.txt | 13 +- runtime/doc/todo.txt | 14 +-- src/ex_getln.c | 6 + src/misc1.c | 266 ++++++++++++++++++++++++++++++++++------ 4 files changed, 249 insertions(+), 50 deletions(-) diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 73a8ea49da..6ae67a556f 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 7.3c. Last change: 2010 Jul 21 +*editing.txt* For Vim version 7.3c. Last change: 2010 Jul 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1622,10 +1622,13 @@ There are three different types of searching: In the above example you might want to set path to: > :set path=**,/u/user_x/** -< This searches: > - /u/user_x/work/release/** - /u/user_x/** -< This searches the same directories, but in a different order. +< This searches: + /u/user_x/work/release/** ~ + /u/user_x/** ~ + This searches the same directories, but in a different order. + Note that completion for ":find", ":sfind", and ":tabfind" commands do not + currently work with 'path' items that contain a url or use the double star + (/usr/**2) or upward search (;) notations. > vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 469fc4317a..743eaf7362 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -30,22 +30,20 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -Patch for :find completion. (Nazri Ramliy, 2010 Jul 27, and leak fix) -And patch for Windows, Jul 28. -And fix for patch, Jul 28. +Patch for :filetype completion. (Dominique Pelle, Jul 28) Windows 7: "Open with..." menu starts Vim without a file. Windows 7: installing Vim again doesn't find the previously installed Vim. -ftplugin/mupad.vim should not source AppendMatchGroup.vim, it should use an -autoload function. -Same for indent/GenericIndent.vim - Move more common code from if_python.c and if_python3.c to if_py_both.h Add filetype completion to user commands. (Christian Brabandt, 2010 Jul 26) -But call it "filetype" instead of "syntax". +But call it "filetype" instead of "syntax"? + +ftplugin/mupad.vim should not source AppendMatchGroup.vim, it should use an +autoload function. +Same for indent/GenericIndent.vim Before release 7.3: - Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23) diff --git a/src/ex_getln.c b/src/ex_getln.c index 7b7874ad4f..dfd163dfe0 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -5033,6 +5033,12 @@ globpath(path, file, expand_options) { /* Copy one item of the path to buf[] and concatenate the file name. */ copy_option_part(&path, buf, MAXPATHL, ","); + if (path_with_url(buf)) + continue; + /* + * FIXME: should we proactively skip 'path' with limiter (/usr/ **N) + * and upward search (;) notations, just like we did with url above? + */ if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL) { add_pathsep(buf); diff --git a/src/misc1.c b/src/misc1.c index 9371760a47..c6ac00157b 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -9239,6 +9239,8 @@ unix_expandpath(gap, path, wildoff, flags, didstar) static int find_previous_pathsep __ARGS((char_u *path, char_u **psep)); static int is_unique __ARGS((char_u *maybe_unique, garray_T *gap, int i)); static void remove_duplicates __ARGS((garray_T *gap)); +static void expand_path_option __ARGS((char_u *curdir, garray_T *gap)); +static char_u *get_path_cutoff __ARGS((char_u *fname, garray_T *gap)); static void uniquefy_paths __ARGS((garray_T *gap, char_u *pattern)); static int expand_in_path __ARGS((garray_T *gap, char_u *pattern, int flags)); @@ -9267,8 +9269,8 @@ find_previous_pathsep(path, psep) } /* - * Returns TRUE if maybe_unique is unique wrt other_paths in gap. maybe_unique - * is the end portion of ((char_u **)gap->ga_data)[i]. + * Returns TRUE if "maybe_unique" is unique wrt other_paths in gap. + * "maybe_unique" is the end portion of ((char_u **)gap->ga_data)[i]. */ static int is_unique(maybe_unique, gap, i) @@ -9279,32 +9281,24 @@ is_unique(maybe_unique, gap, i) int j; int candidate_len; int other_path_len; - char_u *rival; - char_u **other_paths; - - other_paths = (gap->ga_data != NULL) ? (char_u **)gap->ga_data - : (char_u **)""; + char_u **other_paths = (char_u **)gap->ga_data; for (j = 0; j < gap->ga_len && !got_int; j++) { ui_breakcheck(); - /* don't compare it with itself */ if (j == i) - continue; + continue; /* don't compare it with itself */ candidate_len = (int)STRLEN(maybe_unique); other_path_len = (int)STRLEN(other_paths[j]); - if (other_path_len < candidate_len) continue; /* it's different */ - rival = other_paths[j] + other_path_len - candidate_len; - - if (fnamecmp(maybe_unique, rival) == 0) - return FALSE; + if (fnamecmp(maybe_unique, gettail(other_paths[j])) == 0) + return FALSE; /* match */ } - return TRUE; + return TRUE; /* no match found */ } /* @@ -9330,6 +9324,101 @@ remove_duplicates(gap) } } +/* + * Split the 'path' option to a an array of strings as garray_T. Relative + * paths are expanded to their equivalent fullpath. This includes the "." + * (relative to current buffer directory) and empty path (relative to current + * directory) notations. + * + * TODO: handle upward search (;) and path limiter (**N) notations by + * expanding each into their equivalent path(s). + */ + static void +expand_path_option(curdir, gap) + char_u *curdir; + garray_T *gap; +{ + char_u *path_option = *curbuf->b_p_path == NUL + ? p_path : curbuf->b_p_path; + char_u *buf; + + ga_init2(gap, (int)sizeof(char_u *), 1); + + if ((buf = alloc((int)(MAXPATHL))) == NULL) + return; + + while (*path_option != NUL) + { + copy_option_part(&path_option, buf, MAXPATHL, " ,"); + + if (STRCMP(buf, ".") == 0) /* relative to current buffer */ + { + if (curbuf->b_ffname == NULL) + continue; + STRCPY(buf, curbuf->b_ffname); + *gettail(buf) = NUL; + } + else if (buf[0] == NUL) /* relative to current directory */ + STRCPY(buf, curdir); + else if (!mch_isFullName(buf)) + { + /* Expand relative path to their full path equivalent */ + int curdir_len = STRLEN(curdir); + int buf_len = STRLEN(buf); + + if (curdir_len + buf_len + 3 > MAXPATHL) + continue; + STRMOVE(buf + curdir_len + 1, buf); + STRCPY(buf, curdir); + add_pathsep(buf); + STRMOVE(buf + curdir_len, buf + curdir_len + 1); + } + + addfile(gap, buf, EW_NOTFOUND|EW_DIR|EW_FILE); + } + + vim_free(buf); +} + +/* + * Returns a pointer to the file or directory name in fname that matches the + * longest path in gap, or NULL if there is no match. For example: + * + * path: /foo/bar/baz + * fname: /foo/bar/baz/quux.txt + * returns: ^this + */ + static char_u * +get_path_cutoff(fname, gap) + char_u *fname; + garray_T *gap; +{ + int i; + int maxlen = 0; + char_u **path_part = (char_u **)gap->ga_data; + char_u *cutoff = NULL; + + for (i = 0; i < gap->ga_len; i++) + { + int j = 0; + + while (fname[j] == path_part[i][j] && fname[j] != NUL + && path_part[i][j] != NUL) + j++; + if (j > maxlen) + { + maxlen = j; + cutoff = &fname[j]; + } + } + + /* Skip to the file or directory name */ + while (cutoff != NULL && vim_ispathsep(*cutoff) && *cutoff != NUL) + mb_ptr_adv(cutoff); + + return cutoff; +} + /* * Sorts, removes duplicates and modifies all the fullpath names in gap so that * they are unique with respect to each other while conserving the part that @@ -9342,13 +9431,14 @@ uniquefy_paths(gap, pattern) { int i; int len; - char_u *pathsep_p; - char_u *path; - char_u **fnames = (char_u **) gap->ga_data; + char_u **fnames = (char_u **)gap->ga_data; int sort_again = 0; char_u *pat; char_u *file_pattern; + char_u *curdir = NULL; + int len_curdir = 0; regmatch_T regmatch; + garray_T path_ga; sort_strings(fnames, gap->ga_len); remove_duplicates(gap); @@ -9360,8 +9450,10 @@ uniquefy_paths(gap, pattern) */ len = (int)STRLEN(pattern); file_pattern = alloc(len + 2); + if (file_pattern == NULL) + return; file_pattern[0] = '*'; - file_pattern[1] = '\0'; + file_pattern[1] = NUL; STRCAT(file_pattern, pattern); pat = file_pat_to_reg_pat(file_pattern, NULL, NULL, TRUE); vim_free(file_pattern); @@ -9374,25 +9466,95 @@ uniquefy_paths(gap, pattern) if (regmatch.regprog == NULL) return; + if ((curdir = alloc((int)(MAXPATHL))) == NULL) + return; + mch_dirname(curdir, MAXPATHL); + len_curdir = STRLEN(curdir); + + expand_path_option(curdir, &path_ga); + for (i = 0; i < gap->ga_len; i++) { - path = fnames[i]; + char_u *path = fnames[i]; + int is_in_curdir; + char_u *dir_end = gettail(path); + len = (int)STRLEN(path); + while (dir_end > path && !vim_ispathsep(*dir_end)) + mb_ptr_back(path, dir_end); + is_in_curdir = STRNCMP(curdir, path, dir_end - path) == 0 + && curdir[dir_end - path] == NUL; - /* we start at the end of the path */ - pathsep_p = path + len - 1; + /* + * If the file is in the current directory, + * and it is not unique, + * reduce it to ./{filename} + * FIXME ^ Is this portable? + */ + if (is_in_curdir) + { + char_u *rel_path; + char_u *short_name = shorten_fname(path, curdir); - while (find_previous_pathsep(path, &pathsep_p)) - if (vim_regexec(®match, pathsep_p + 1, (colnr_T)0) - && is_unique(pathsep_p, gap, i)) + if (short_name == NULL) + short_name = path; + if (is_unique(short_name, gap, i)) { - sort_again = 1; - mch_memmove(path, pathsep_p + 1, STRLEN(pathsep_p)); - break; + STRMOVE(path, short_name); + continue; } + + rel_path = alloc((int)(STRLEN(short_name) + + STRLEN(PATHSEPSTR) + 2)); + if (rel_path == NULL) + goto theend; + + /* FIXME Is "." a portable way of denoting the current directory? */ + STRCPY(rel_path, "."); + add_pathsep(rel_path); + STRCAT(rel_path, short_name); + + if (len < (int)STRLEN(rel_path)) + { + vim_free(fnames[i]); + fnames[i] = alloc((int)(STRLEN(rel_path) + 1)); + if (fnames[i] == NULL) + { + vim_free(rel_path); + goto theend; + } + } + + STRCPY(fnames[i], rel_path); + vim_free(rel_path); + sort_again = 1; + } + else + { + /* Shorten the filename while maintaining its uniqueness */ + char_u *pathsep_p; + char_u *path_cutoff = get_path_cutoff(path, &path_ga); + + /* we start at the end of the path */ + pathsep_p = path + len - 1; + + while (find_previous_pathsep(path, &pathsep_p)) + if (vim_regexec(®match, pathsep_p + 1, (colnr_T)0) + && is_unique(pathsep_p + 1, gap, i) + && path_cutoff != NULL && pathsep_p + 1 >= path_cutoff) + { + sort_again = 1; + mch_memmove(path, pathsep_p + 1, STRLEN(pathsep_p)); + break; + } + } } +theend: + vim_free(curdir); + ga_clear_strings(&path_ga); vim_free(regmatch.regprog); + if (sort_again) { sort_strings(fnames, gap->ga_len); @@ -9412,23 +9574,53 @@ expand_in_path(gap, pattern, flags) int flags; /* EW_* flags */ { int c = 0; - char_u *path_option = *curbuf->b_p_path == NUL - ? p_path : curbuf->b_p_path; - char_u *files; + char_u *files = NULL; char_u *s; /* start */ char_u *e; /* end */ + char_u *paths = NULL; + char_u **path_list; + char_u *curdir; + garray_T path_ga; + int i; + + if ((curdir = alloc((int)(MAXPATHL))) == NULL) + return 0; + mch_dirname(curdir, MAXPATHL); + + expand_path_option(curdir, &path_ga); + vim_free(curdir); + path_list = (char_u **)(path_ga.ga_data); + for (i = 0; i < path_ga.ga_len; i++) + { + if (paths == NULL) + { + if ((paths = alloc((int)(STRLEN(path_list[i]) + 1))) == NULL) + return 0; + STRCPY(paths, path_list[i]); + } + else + { + if ((paths = realloc(paths, (int)(STRLEN(paths) + + STRLEN(path_list[i]) + 2))) == NULL) + return 0; + STRCAT(paths, ","); + STRCAT(paths, path_list[i]); + } + } + + files = globpath(paths, pattern, 0); + vim_free(paths); - files = globpath(path_option, pattern, 0); if (files == NULL) return 0; /* Copy each path in files into gap */ s = e = files; - while (*s != '\0') + while (*s != NUL) { - while (*e != '\n' && *e != '\0') + while (*e != '\n' && *e != NUL) e++; - if (*e == '\0') + if (*e == NUL) { addfile(gap, s, flags); break; @@ -9436,7 +9628,7 @@ expand_in_path(gap, pattern, flags) else { /* *e is '\n' */ - *e = '\0'; + *e = NUL; addfile(gap, s, flags); e++; s = e; @@ -9817,7 +10009,7 @@ get_cmd_output(cmd, infile, flags) buffer = NULL; } else - buffer[len] = '\0'; /* make sure the buffer is terminated */ + buffer[len] = NUL; /* make sure the buffer is terminated */ done: vim_free(tempname); From b379ad862b54f9259a1fa32a287e0b4b7df93d12 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 22:30:00 +0200 Subject: [PATCH 16/51] Remove Mupad indent and ftplugin files, they are not useful. --HG-- branch : vim73 --- runtime/ftplugin/AppendMatchGroup.vim | 125 ---------- runtime/ftplugin/mupad.vim | 30 --- runtime/indent/GenericIndent.vim | 322 -------------------------- runtime/indent/mupad.vim | 35 --- 4 files changed, 512 deletions(-) delete mode 100644 runtime/ftplugin/AppendMatchGroup.vim delete mode 100644 runtime/ftplugin/mupad.vim delete mode 100644 runtime/indent/GenericIndent.vim delete mode 100644 runtime/indent/mupad.vim diff --git a/runtime/ftplugin/AppendMatchGroup.vim b/runtime/ftplugin/AppendMatchGroup.vim deleted file mode 100644 index 34e80b5f83..0000000000 --- a/runtime/ftplugin/AppendMatchGroup.vim +++ /dev/null @@ -1,125 +0,0 @@ -" Vim filetype plugin file utility -" Language: * (various) -" Maintainer: Dave Silvia -" Date: 6/30/2004 - -" The start of match (b:SOM) default is: -" '\<' -" The end of match (b:EOM) default is: -" '\>' -" -" If you want to use some other start/end of match, just assign the -" value to the b:SOM|EOM variable in your filetype script. -" -" SEE: :h pattern.txt -" :h pattern-searches -" :h regular-expression -" :h matchit - -let s:myName=expand(":t") - -" matchit.vim not loaded -- don't do anyting -if !exists("loaded_matchit") - echomsg s:myName.": matchit.vim not loaded -- finishing without loading" - finish -endif - -" already been here -- don't redefine -if exists("*AppendMatchGroup") - finish -endif - -" Function To Build b:match_words -" The following function, 'AppendMatchGroup', helps to increase -" readability of your filetype script if you choose to use matchit. -" It also precludes many construction errors, reducing the -" construction to simply invoking the function with the match words. -" As an example, let's take the ubiquitous if/then/else/endif type -" of construct. This is how the entry in your filetype script would look. -" -" " source the AppendMatchGroup function file -" runtime ftplugin/AppendMatchGroup.vim -" -" " fill b:match_words -" call AppendMatchGroup('if,then,else,endif') -" -" And the b:match_words constructed would look like: -" -" \:\:\:\ -" -" Use of AppendMatchGroup makes your filetype script is a little -" less busy and a lot more readable. Additionally, it -" checks three critical things: -" -" 1) Do you have at least 2 entries in your match group. -" -" 2) Does the buffer variable 'b:match_words' exist? if not, create it. -" -" 3) If the buffer variable 'b:match_words' does exist, is the last -" character a ','? If not, add it before appending. -" -" You should now be able to match 'if/then/else/endif' in succession -" in your source file, in just about any construction you may have -" chosen for them. -" -" To add another group, simply call 'AppendMatchGroup again. E.G.: -" -" call AppendMatchGroup('while,do,endwhile') - -function AppendMatchGroup(mwordList) - let List=a:mwordList - let Comma=match(List,',') - if Comma == -1 || Comma == strlen(List)-1 - echoerr "Must supply a comma separated list of at least 2 entries." - echoerr "Supplied list: <".List.">" - return - endif - let listEntryBegin=0 - let listEntryEnd=Comma - let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin) - let List=strpart(List,Comma+1) - let Comma=match(List,',') - " if listEntry is all spaces || List is empty || List is all spaces - if (match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1) - \ || List == '' || (match(List,'\s\+') == 0 && match(List,'\S\+') == -1) - echoerr "Can't use all spaces for an entry <".listEntry.">" - echoerr "Remaining supplied list: <".List.">" - return - endif - - if !exists("b:SOM") - let b:SOM='\<' - endif - if !exists("b:EOM") - let b:EOM='\>' - endif - if !exists("b:match_words") - let b:match_words='' - endif - if b:match_words != '' && match(b:match_words,',$') == -1 - let b:match_words=b:match_words.',' - endif - " okay, all set add first entry in this list - let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':' - while Comma != -1 - let listEntryEnd=Comma - let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin) - let List=strpart(List,Comma+1) - let Comma=match(List,',') - " if listEntry is all spaces - if match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1 - echoerr "Can't use all spaces for an entry <".listEntry."> - skipping" - echoerr "Remaining supplied list: <".List.">" - continue - endif - let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':' - endwhile - let listEntry=List - let b:match_words=b:match_words.b:SOM.listEntry.b:EOM -endfunction - -" TODO: Write a wrapper to handle multiple groups in one function call. -" Don't see a lot of utility in this as it would undoubtedly warrant -" continuation lines in the filetype script and it would be a toss -" up as to which is more readable: individual calls one to a line or -" a single call with continuation lines. I vote for the former. diff --git a/runtime/ftplugin/mupad.vim b/runtime/ftplugin/mupad.vim deleted file mode 100644 index ef3a4fe28f..0000000000 --- a/runtime/ftplugin/mupad.vim +++ /dev/null @@ -1,30 +0,0 @@ -" Vim filetype plugin file -" Language: MuPAD source files -" Maintainer: Dave Silvia -" Filenames: *.mu -" Date: 6/30/2004 - -if exists("b:did_ftplugin") | finish | endif -let b:did_ftplugin = 1 - -" Change the :browse e filter to primarily show MuPAD source files. -if has("gui_win32") - let b:browsefilter= - \ "MuPAD source (*.mu)\t*.mu\n" . - \ "All Files (*.*)\t*.*\n" -endif - -" matchit.vim not loaded -- don't do anyting below -if !exists("loaded_matchit") - " echomsg "matchit.vim not loaded -- finishing" - finish -endif - -" source the AppendMatchGroup function file -runtime ftplugin/AppendMatchGroup.vim - -" fill b:match_words for MuPAD -call AppendMatchGroup('domain,end_domain') -call AppendMatchGroup('proc,begin,end_proc') -call AppendMatchGroup('if,then,elif,else,end_if') -call AppendMatchGroup('\%(for\|while\|repeat\|case\),of,do,break,next,until,\%(end_for\|end_while\|end_repeat\|end_case\)') diff --git a/runtime/indent/GenericIndent.vim b/runtime/indent/GenericIndent.vim deleted file mode 100644 index 67afd70ce3..0000000000 --- a/runtime/indent/GenericIndent.vim +++ /dev/null @@ -1,322 +0,0 @@ -" Vim indent file generic utility functions -" Language: * (various) -" Maintainer: Dave Silvia -" Date: 6/30/2004 - -" SUMMARY: To use GenericIndent, indent/.vim would have the -" following general format: -" -" if exists("b:did_indent") | finish | endif -" let b:did_indent = 1 -" runtime indent/GenericIndent.vim -" let b:indentStmts='' -" let b:dedentStmts='' -" let b:allStmts='' -" setlocal indentexpr=GenericIndent() -" setlocal indentkeys= -" call GenericIndentStmts() -" call GenericDedentStmts() -" call GenericAllStmts() -" -" END SUMMARY: - -" NOTE: b:indentStmts, b:dedentStmts, and b:allStmts need to be initialized -" to '' before callin the functions because 'indent.vim' explicitly -" 'unlet's b:did_indent. This means that the lists will compound if -" you change back and forth between buffers. This is true as of -" version 6.3, 6/23/2004. -" -" NOTE: By default, GenericIndent is case sensitive. -" let b:case_insensitive=1 if you want to ignore case, e.g. DOS batch files - -" The function 'GenericIndent' is data driven and handles most all cases of -" indent checking if you first set up the data. To use this function follow -" the example below (taken from the file indent/MuPAD_source.vim) -" -" Before you start, source this file in indent/.vim to have it -" define functions for your use. -" -"runtime indent/GenericIndent.vim -" -" The data is in 5 sets: -" -" First, set the data set 'indentexpr' to GenericIndent(). -" -"setlocal indentexpr=GenericIndent() -" -" Second, set the data set 'indentkeys' to the keywords/expressions that need -" to be checked for 'indenting' _as_ they typed. -" -"setlocal indentkeys==end_proc,=else,=then,=elif,=end_if,=end_case,=until,=end_repeat,=end_domain,=end_for,=end_while,=end,o,O -" -" NOTE: 'o,O' at the end of the previous line says you wish to be called -" whenever a newline is placed in the buffer. This allows the previous line -" to be checked for indentation parameters. -" -" Third, set the data set 'b:indentStmts' to the keywords/expressions that, when -" they are on a line _when_ you _press_ the __ key, -" you wish to have the next line indented. -" -"call GenericIndentStmts('begin,if,then,else,elif,case,repeat,until,domain,do') -" -" Fourth, set the data set 'b:dedentStmts' to the keywords/expressions that, when -" they are on a line you are currently typing, you wish to have that line -" 'dedented' (having already been indented because of the previous line's -" indentation). -" -"call GenericDedentStmts('end_proc,then,else,elif,end_if,end_case,until,end_repeat,end_domain,end_for,end_while,end') -" -" Fifth, set the data set 'b:allStmts' to the concatenation of the third and -" fourth data sets, used for checking when more than one keyword/expression -" is on a line. -" -"call GenericAllStmts() -" -" NOTE: GenericIndentStmts uses two variables: 'b:indentStmtOpen' and -" 'b:indentStmtClose' which default to '\<' and '\>' respectively. You can -" set (let) these to any value you wish before calling GenericIndentStmts with -" your list. Similarly, GenericDedentStmts uses 'b:dedentStmtOpen' and -" 'b:dedentStmtClose'. -" -" NOTE: Patterns may be used in the lists passed to Generic[In|De]dentStmts -" since each element in the list is copied verbatim. -" -" Optionally, you can set the DEBUGGING flag within your script to have the -" debugging messages output. See below for description. This can also be set -" (let) from the command line within your editing buffer. -" -"let b:DEBUGGING=1 -" -" See: -" :h runtime -" :set runtimepath ? -" to familiarize yourself with how this works and where you should have this -" file and your file(s) installed. -" -" For help with setting 'indentkeys' see: -" :h indentkeys -" Also, for some good examples see 'indent/sh.vim' and 'indent/vim.vim' as -" well as files for other languages you may be familiar with. -" -" -" Alternatively, if you'd rather specify yourself, you can enter -" 'b:indentStmts', 'b:dedentStmts', and 'b:allStmts' 'literally': -" -"let b:indentStmts='\\|\\|\\|\\|\\|\\|\\|\\|\\|\' -"let b:dedentStmts='\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\' -"let b:allStmts=b:indentStmts.'\|'.b:dedentStmts -" -" This is only useful if you have particularly different parameters for -" matching each statement. - -" RECAP: From indent/MuPAD_source.vim -" -"if exists("b:did_indent") | finish | endif -" -"let b:did_indent = 1 -" -"runtime indent/GenericIndent.vim -" -"setlocal indentexpr=GenericIndent() -"setlocal indentkeys==end_proc,=then,=else,=elif,=end_if,=end_case,=until,=end_repeat,=end_domain,=end_for,=end_while,=end,o,O -"call GenericIndentStmts('begin,if,then,else,elif,case,repeat,until,domain,do') -"call GenericDedentStmts('end_proc,then,else,elif,end_if,end_case,until,end_repeat,end_domain,end_for,end_while,end') -"call GenericAllStmts() -" -" END RECAP: - -let s:hit=0 -let s:lastVlnum=0 -let s:myScriptName=expand(":t") - -if exists("*GenericIndent") - finish -endif - -function GenericAllStmts() - let b:allStmts=b:indentStmts.'\|'.b:dedentStmts - call DebugGenericIndent(expand("").": "."b:indentStmts: ".b:indentStmts.", b:dedentStmts: ".b:dedentStmts.", b:allStmts: ".b:allStmts) -endfunction - -function GenericIndentStmts(stmts) - let Stmts=a:stmts - let Comma=match(Stmts,',') - if Comma == -1 || Comma == strlen(Stmts)-1 - echoerr "Must supply a comma separated list of at least 2 entries." - echoerr "Supplied list: <".Stmts.">" - return - endif - - if !exists("b:indentStmtOpen") - let b:indentStmtOpen='\<' - endif - if !exists("b:indentStmtClose") - let b:indentStmtClose='\>' - endif - if !exists("b:indentStmts") - let b:indentStmts='' - endif - if b:indentStmts != '' - let b:indentStmts=b:indentStmts.'\|' - endif - call DebugGenericIndent(expand("").": "."b:indentStmtOpen: ".b:indentStmtOpen.", b:indentStmtClose: ".b:indentStmtClose.", b:indentStmts: ".b:indentStmts.", Stmts: ".Stmts) - let stmtEntryBegin=0 - let stmtEntryEnd=Comma - let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin) - let Stmts=strpart(Stmts,Comma+1) - let Comma=match(Stmts,',') - let b:indentStmts=b:indentStmts.b:indentStmtOpen.stmtEntry.b:indentStmtClose - while Comma != -1 - let stmtEntryEnd=Comma - let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin) - let Stmts=strpart(Stmts,Comma+1) - let Comma=match(Stmts,',') - let b:indentStmts=b:indentStmts.'\|'.b:indentStmtOpen.stmtEntry.b:indentStmtClose - endwhile - let stmtEntry=Stmts - let b:indentStmts=b:indentStmts.'\|'.b:indentStmtOpen.stmtEntry.b:indentStmtClose -endfunction - -function GenericDedentStmts(stmts) - let Stmts=a:stmts - let Comma=match(Stmts,',') - if Comma == -1 || Comma == strlen(Stmts)-1 - echoerr "Must supply a comma separated list of at least 2 entries." - echoerr "Supplied list: <".Stmts.">" - return - endif - - if !exists("b:dedentStmtOpen") - let b:dedentStmtOpen='\<' - endif - if !exists("b:dedentStmtClose") - let b:dedentStmtClose='\>' - endif - if !exists("b:dedentStmts") - let b:dedentStmts='' - endif - if b:dedentStmts != '' - let b:dedentStmts=b:dedentStmts.'\|' - endif - call DebugGenericIndent(expand("").": "."b:dedentStmtOpen: ".b:dedentStmtOpen.", b:dedentStmtClose: ".b:dedentStmtClose.", b:dedentStmts: ".b:dedentStmts.", Stmts: ".Stmts) - let stmtEntryBegin=0 - let stmtEntryEnd=Comma - let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin) - let Stmts=strpart(Stmts,Comma+1) - let Comma=match(Stmts,',') - let b:dedentStmts=b:dedentStmts.b:dedentStmtOpen.stmtEntry.b:dedentStmtClose - while Comma != -1 - let stmtEntryEnd=Comma - let stmtEntry=strpart(Stmts,stmtEntryBegin,stmtEntryEnd-stmtEntryBegin) - let Stmts=strpart(Stmts,Comma+1) - let Comma=match(Stmts,',') - let b:dedentStmts=b:dedentStmts.'\|'.b:dedentStmtOpen.stmtEntry.b:dedentStmtClose - endwhile - let stmtEntry=Stmts - let b:dedentStmts=b:dedentStmts.'\|'.b:dedentStmtOpen.stmtEntry.b:dedentStmtClose -endfunction - -" Debugging function. Displays messages in the command area which can be -" reviewed using ':messages'. To turn it on use ':let b:DEBUGGING=1'. Once -" on, turn off by using ':let b:DEBUGGING=0. If you don't want it at all and -" feel it's slowing down your editing (you must have an _awfully_ slow -" machine!;-> ), you can just comment out the calls to it from 'GenericIndent' -" below. No need to remove the function or the calls, tho', as you never can -" tell when they might come in handy!;-) -function DebugGenericIndent(msg) - if exists("b:DEBUGGING") && b:DEBUGGING - echomsg '['.s:hit.']'.s:myScriptName."::".a:msg - endif -endfunction - -function GenericIndent() - " save ignore case option. Have to set noignorecase for the match - " functions to do their job the way we want them to! - " NOTE: if you add a return to this function be sure you do - " if IgnoreCase | set ignorecase | endif - " before returning. You can just cut and paste from here. - let IgnoreCase=&ignorecase - " let b:case_insensitive=1 if you want to ignore case, e.g. DOS batch files - if !exists("b:case_insensitive") - set noignorecase - endif - " this is used to let DebugGenericIndent display which invocation of the - " function goes with which messages. - let s:hit=s:hit+1 - let lnum=v:lnum - let cline=getline(lnum) - let lnum=prevnonblank(lnum) - if lnum==0 | if IgnoreCase | set ignorecase | endif | return 0 | endif - let pline=getline(lnum) - let ndnt=indent(lnum) - if !exists("b:allStmts") - call GenericAllStmts() - endif - - call DebugGenericIndent(expand("").": "."cline=<".cline.">, pline=<".pline.">, lnum=".lnum.", v:lnum=".v:lnum.", ndnt=".ndnt) - if lnum==v:lnum - " current line, only check dedent - " - " just dedented this line, don't need to do it again. - " another dedentStmts was added or an end%[_*] was completed. - if s:lastVlnum==v:lnum - if IgnoreCase | set ignorecase | endif - return ndnt - endif - let s:lastVlnum=v:lnum - call DebugGenericIndent(expand("").": "."Checking dedent") - let srcStr=cline - let dedentKeyBegin=match(srcStr,b:dedentStmts) - if dedentKeyBegin != -1 - let dedentKeyEnd=matchend(srcStr,b:dedentStmts) - let dedentKeyStr=strpart(srcStr,dedentKeyBegin,dedentKeyEnd-dedentKeyBegin) - "only dedent if it's the beginning of the line - if match(srcStr,'^\s*\<'.dedentKeyStr.'\>') != -1 - call DebugGenericIndent(expand("").": "."It's the beginning of the line, dedent") - let ndnt=ndnt-&shiftwidth - endif - endif - call DebugGenericIndent(expand("").": "."dedent - returning ndnt=".ndnt) - else - " previous line, only check indent - call DebugGenericIndent(expand("").": "."Checking indent") - let srcStr=pline - let indentKeyBegin=match(srcStr,b:indentStmts) - if indentKeyBegin != -1 - " only indent if it's the last indentStmts in the line - let allKeyBegin=match(srcStr,b:allStmts) - let allKeyEnd=matchend(srcStr,b:allStmts) - let allKeyStr=strpart(srcStr,allKeyBegin,allKeyEnd-allKeyBegin) - let srcStr=strpart(srcStr,allKeyEnd) - let allKeyBegin=match(srcStr,b:allStmts) - if allKeyBegin != -1 - " not the end of the line, check what is and only indent if - " it's an indentStmts - call DebugGenericIndent(expand("").": "."Multiple words in line, checking if last is indent") - while allKeyBegin != -1 - let allKeyEnd=matchend(srcStr,b:allStmts) - let allKeyStr=strpart(srcStr,allKeyBegin,allKeyEnd-allKeyBegin) - let srcStr=strpart(srcStr,allKeyEnd) - let allKeyBegin=match(srcStr,b:allStmts) - endwhile - if match(b:indentStmts,allKeyStr) != -1 - call DebugGenericIndent(expand("").": "."Last word in line is indent") - let ndnt=ndnt+&shiftwidth - endif - else - " it's the last indentStmts in the line, go ahead and indent - let ndnt=ndnt+&shiftwidth - endif - endif - call DebugGenericIndent(expand("").": "."indent - returning ndnt=".ndnt) - endif - if IgnoreCase | set ignorecase | endif - return ndnt -endfunction - - -" TODO: I'm open! -" -" BUGS: You tell me! Probably. I just haven't found one yet or haven't been -" told about one. -" diff --git a/runtime/indent/mupad.vim b/runtime/indent/mupad.vim deleted file mode 100644 index 307aaf047f..0000000000 --- a/runtime/indent/mupad.vim +++ /dev/null @@ -1,35 +0,0 @@ -" Vim indent file -" Language: MuPAD source files -" Maintainer: Dave Silvia -" Filenames: *.mu -" Date: 6/30/2004 - -if exists("b:did_indent") - finish -endif - -let b:did_indent = 1 - -runtime indent/GenericIndent.vim - -let b:indentStmts='' -let b:dedentStmts='' -let b:allStmts='' -" NOTE: b:indentStmts, b:dedentStmts, and b:allStmts need to be initialized -" to '' before callin the functions because 'indent.vim' explicitly -" 'unlet's b:did_indent. This means that the lists will compound if -" you change back and forth between buffers. This is true as of -" version 6.3, 6/23/2004. -setlocal indentexpr=GenericIndent() -setlocal indentkeys==end_proc,=then,=else,=elif,=end_if,=end_case,=until,=end_repeat,=end_domain,=end_for,=end_while,=end,o,O - -call GenericIndentStmts('begin,if,then,else,elif,case,repeat,until,domain,do') -call GenericDedentStmts('end_proc,then,else,elif,end_if,end_case,until,end_repeat,end_domain,end_for,end_while,end') -call GenericAllStmts() - - -" TODO: More comprehensive indentstmt, dedentstmt, and indentkeys values. -" -" BUGS: You tell me! Probably. I just haven't found one yet or haven't been -" told about one. -" From a5672c1daf9ec2562a299572771b6ee4ca2c03b5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Jul 2010 22:46:08 +0200 Subject: [PATCH 17/51] Update for Lua interface. (Luis Carvalho) --HG-- branch : vim73 --- src/if_lua.c | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/src/if_lua.c b/src/if_lua.c index 4c3f9b715f..21f66e9bf2 100644 --- a/src/if_lua.c +++ b/src/if_lua.c @@ -109,9 +109,11 @@ static const char LUAVIM_FREE[] = "luaV_free"; #define luaopen_table dll_luaopen_table #define luaopen_string dll_luaopen_string #define luaopen_math dll_luaopen_math +#define luaopen_io dll_luaopen_io #define luaopen_os dll_luaopen_os #define luaopen_package dll_luaopen_package #define luaopen_debug dll_luaopen_debug +#define luaL_openlibs dll_luaL_openlibs /* lauxlib */ void (*dll_luaL_register) (lua_State *L, const char *libname, const luaL_Reg *l); @@ -168,9 +170,11 @@ int (*dll_luaopen_base) (lua_State *L); int (*dll_luaopen_table) (lua_State *L); int (*dll_luaopen_string) (lua_State *L); int (*dll_luaopen_math) (lua_State *L); +int (*dll_luaopen_io) (lua_State *L); int (*dll_luaopen_os) (lua_State *L); int (*dll_luaopen_package) (lua_State *L); int (*dll_luaopen_debug) (lua_State *L); +void (*dll_luaL_openlibs) (lua_State *L); typedef void **luaV_function; typedef struct { @@ -234,9 +238,11 @@ static const luaV_Reg luaV_dll[] = { {"luaopen_table", (luaV_function) &dll_luaopen_table}, {"luaopen_string", (luaV_function) &dll_luaopen_string}, {"luaopen_math", (luaV_function) &dll_luaopen_math}, + {"luaopen_io", (luaV_function) &dll_luaopen_io}, {"luaopen_os", (luaV_function) &dll_luaopen_os}, {"luaopen_package", (luaV_function) &dll_luaopen_package}, {"luaopen_debug", (luaV_function) &dll_luaopen_debug}, + {"luaL_openlibs", (luaV_function) &dll_luaL_openlibs}, {NULL, NULL} }; @@ -1094,40 +1100,8 @@ luaopen_vim(lua_State *L) luaV_newstate(void) { lua_State *L = luaL_newstate(); - const luaL_Reg luaV_core_libs[] = { - {"", luaopen_base}, - {LUA_TABLIBNAME, luaopen_table}, - {LUA_STRLIBNAME, luaopen_string}, - {LUA_MATHLIBNAME, luaopen_math}, - {LUA_OSLIBNAME, luaopen_os}, /* restricted */ - {LUA_LOADLIBNAME, luaopen_package}, - {LUA_DBLIBNAME, luaopen_debug}, - {NULL, NULL} - }; - const char *os_funcs[] = { - "date", "clock", "time", "difftime", "getenv", NULL - }; - const luaL_Reg *reg = luaV_core_libs; - const char **s = os_funcs; - /* core libs */ - for ( ; reg->func; reg++) - { - lua_pushcfunction(L, reg->func); - lua_pushstring(L, reg->name); - lua_call(L, 1, 0); - } - /* restricted os lib */ - lua_getglobal(L, LUA_OSLIBNAME); - lua_newtable(L); - for ( ; *s; s++) - { - lua_getfield(L, -2, *s); - lua_setfield(L, -2, *s); - } - lua_setglobal(L, LUA_OSLIBNAME); - lua_pop(L, 1); /* os table */ - /* vim */ - lua_pushcfunction(L, luaopen_vim); + luaL_openlibs(L); /* core libs */ + lua_pushcfunction(L, luaopen_vim); /* vim */ lua_call(L, 0, 0); return L; } From b33a4e633d4b37a13bc7f0b00419486736ff6496 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 29 Jul 2010 20:43:36 +0200 Subject: [PATCH 18/51] Updated runtime files. :TOhtml improvements by Benjamin Fritz. --HG-- branch : vim73 --- runtime/autoload/tohtml.vim | 44 +++++++++++++++-- runtime/doc/pi_netrw.txt | 96 ++++++++++++++++++------------------- runtime/doc/syntax.txt | 2 +- runtime/doc/todo.txt | 1 + runtime/indent/vb.vim | 2 +- runtime/plugin/tohtml.vim | 12 ++++- runtime/syntax/2html.vim | 96 +++++++++++++++++++++++++------------ 7 files changed, 165 insertions(+), 88 deletions(-) diff --git a/runtime/autoload/tohtml.vim b/runtime/autoload/tohtml.vim index 620c9c3502..55399a788e 100644 --- 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 July 24 +" Last Change: 2010 Jul 29 " " Additional contributors: " @@ -39,7 +39,6 @@ func! tohtml#Convert2HTML(line1, line2) let g:html_diff_win_num += 1 runtime syntax/2html.vim call add(buf_list, bufnr('%')) - "exec '%s#'] + let body_line = '' + let html = [] call add(html, '') @@ -69,6 +70,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) " validate without warnings about encoding call add(html, '') + let body_line_num = len(html) call add(html, '') call add(html, '') @@ -78,6 +80,9 @@ func! tohtml#Diff2HTML(win_list, buf_list) endfor call add(html, '') + let diff_style_start = 0 + let insert_index = 0 + for buf in a:buf_list let temp = [] exe bufwinnr(buf) . 'wincmd w' @@ -86,13 +91,40 @@ func! tohtml#Diff2HTML(win_list, buf_list) " to act on everything in a fold by mistake. setlocal nofoldenable + " When not using CSS or when using xhtml, the line can be important. + " Assume it will be the same for all buffers and grab it from the first + " buffer. Similarly, need to grab the body end line as well. + if body_line == '' + 1 + call search('', 'b') + let s:body_end_line = getline('.') + endif + " Grab the style information. Some of this will be duplicated... 1 let style_start = search('^') if style_start > 0 && style_end > 0 - let style += getline(style_start + 1, style_end - 1) + let buf_styles = getline(style_start + 1, style_end - 1) + for a_style in buf_styles + if index(style, a_style) == -1 + if diff_style_start == 0 + if a_style =~ '\') call add(html, '
') - call add(html, '') + call add(html, s:body_end_line) call add(html, '') let i = 1 diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index ec6c139857..ec3404f5fc 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.3c. Last change: 2010 Jul 27 +*pi_netrw.txt* For Vim version 7.3c. Last change: 2010 Jul 28 ----------------------------------------------------- NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -316,20 +316,20 @@ settings are described below, in |netrw-browser-options|, and in |netrw-externapp|: *b:netrw_lastfile* last file Network-read/written retained on a - per-buffer basis (supports plain :Nw ) + per-buffer basis (supports plain :Nw ) *g:netrw_bufsettings* the settings that netrw buffers have - (default) noma nomod nonu nowrap ro nobl + (default) noma nomod nonu nowrap ro nobl *g:netrw_chgwin* specifies a window number where file edits will take - place. (also see |netrw-C|) - (default) not defined + place. (also see |netrw-C|) + (default) not defined *g:Netrw_funcref* specifies a function (or functions) to be called when - netrw edits a file. The file is first edited, and - then the function reference (|Funcref|) is called. - This variable may also hold a |List| of Funcrefs. - (default) not defined + netrw edits a file. The file is first edited, and + then the function reference (|Funcref|) is called. + This variable may also hold a |List| of Funcrefs. + (default) not defined > Example: place in .vimrc; affects all file opening fun! MyFuncRef() @@ -337,74 +337,74 @@ settings are described below, in |netrw-browser-options|, and in let g:Netrw_funcref= function("MyFuncRef") < *g:netrw_ftp* if it doesn't exist, use default ftp - =0 use default ftp (uid password) - =1 use alternate ftp method (user uid password) - If you're having trouble with ftp, try changing the - value of this variable to see if the alternate ftp - method works for your setup. + =0 use default ftp (uid password) + =1 use alternate ftp method (user uid password) + If you're having trouble with ftp, try changing the + value of this variable to see if the alternate ftp + method works for your setup. *g:netrw_ftpextracmd* default: doesn't exist - If this variable exists, then any string it contains - will be placed into the commands set to your ftp - client. As an example: - ="passive" + If this variable exists, then any string it contains + will be placed into the commands set to your ftp + client. As an example: + ="passive" *g:netrw_ftpmode* ="binary" (default) - ="ascii" + ="ascii" *g:netrw_ignorenetrc* =0 (default for linux, cygwin) - =1 If you have a <.netrc> file but it doesn't work and - you want it ignored, then set this variable as - shown. (default for Windows + cmd.exe) + =1 If you have a <.netrc> file but it doesn't work and + you want it ignored, then set this variable as + shown. (default for Windows + cmd.exe) *g:netrw_menu* =0 disable netrw's menu - =1 (default) netrw's menu enabled + =1 (default) netrw's menu enabled *g:netrw_nogx* if this variable exists, then the "gx" map will not - be available (see |netrw-gx|) + be available (see |netrw-gx|) *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis *g:netrw_preview* =0 (default) preview window shown in a horizontally - split window - =1 preview window shown in a vertically split window. - Also affects the "previous window" (see |netrw-P|) in - the same way. + split window + =1 preview window shown in a vertically split window. + Also affects the "previous window" (see |netrw-P|) in + the same way. *g:netrw_scpport* = "-P" : option to use to set port for scp *g:netrw_sshport* = "-p" : option to use to set port for ssh *g:netrw_sepchr* =\0xff - =\0x01 for enc == euc-jp (and perhaps it should be for + =\0x01 for enc == euc-jp (and perhaps it should be for others, too, please let me know) - Separates priority codes from filenames internally. - See |netrw-p12|. + Separates priority codes from filenames internally. + See |netrw-p12|. *g:netrw_silent* =0 : transfers done normally - =1 : transfers done silently + =1 : transfers done silently *g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one - line window. This window provides reliable - delivery of messages. (default) - =0 : messages from netrw will use echoerr ; - messages don't always seem to show up this - way, but one doesn't have to quit the window. + line window. This window provides reliable + delivery of messages. (default) + =0 : messages from netrw will use echoerr ; + messages don't always seem to show up this + way, but one doesn't have to quit the window. *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank - lines that o/s's ftp "provides" on transfers - =0 force normal ftp behavior (no trailing line removal) + lines that o/s's ftp "provides" on transfers + =0 force normal ftp behavior (no trailing line removal) *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also - permits network browsing to use ls with time and - size sorting (default if windows) - =0 assume Windows' scp accepts windows-style paths - Network browsing uses dir instead of ls - This option is ignored if you're using unix + permits network browsing to use ls with time and + size sorting (default if windows) + =0 assume Windows' scp accepts windows-style paths + Network browsing uses dir instead of ls + This option is ignored if you're using unix *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP - =1 use WinNT's rcp in binary mode (default) + =1 use WinNT's rcp in binary mode (default) PATHS *netrw-path* {{{2 @@ -598,7 +598,7 @@ password. PASSWORD *netrw-passwd* The script attempts to get passwords for ftp invisibly using |inputsecret()|, -a built-in Vim function. See |netrw-uidpass| for how to change the password +a built-in Vim function. See |netrw-userpass| for how to change the password after one has set it. Unfortunately there doesn't appear to be a way for netrw to feed a password to @@ -809,12 +809,12 @@ temporary file: open machine [port] open machine [port] user userid password userid password [g:netrw_ftpmode] password - [g:netrw_extracmd] [g:netrw_ftpmode] + [g:netrw_ftpextracmd] [g:netrw_ftpmode] get filename tempfile [g:netrw_extracmd] get filename tempfile > --------------------------------------------------------------------- < -The |g:netrw_ftpmode| and |g:netrw_extracmd| are optional. +The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional. Netrw then executes the lines above by use of a filter: > diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 73e7404053..399eed3eba 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -431,7 +431,7 @@ shorter and valid HTML 4 file), use: > Concealed text is removed from the HTML and replaced with the appropriate character from |:syn-cchar| or 'listchars' depending on the current value of 'conceallevel'. If you always want to display all text in your document, -either set 'conceallevel' to before invoking 2html, or use: > +either set 'conceallevel' to zero before invoking 2html, or use: > :let g:html_ignore_conceal = 1 Similarly, closed folds are put in the HTML as they are displayed. If you diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 743eaf7362..66bbf5dc43 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -33,6 +33,7 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. Patch for :filetype completion. (Dominique Pelle, Jul 28) Windows 7: "Open with..." menu starts Vim without a file. +Need to use other registry methods in if_ole.cpp? Windows 7: installing Vim again doesn't find the previously installed Vim. diff --git a/runtime/indent/vb.vim b/runtime/indent/vb.vim index 5f386f7910..55a8ea302a 100644 --- a/runtime/indent/vb.vim +++ b/runtime/indent/vb.vim @@ -48,7 +48,7 @@ fun! VbGetIndent(lnum) let ind = indent(lnum) " Add - if previous_line =~? '^\s*\<\(begin\|\%(\%(private\|public\|friend\)\s\+\)\=\%(function\|sub\|property\)\|select\|case\|default\|if\>.\{-}\\s*$\|else\|elseif\|do\|for\|while\|enum\|with\)\>' + if previous_line =~? '^\s*\<\(begin\|\%(\%(private\|public\|friend\)\s\+\)\=\%(function\|sub\|property\)\|select\|case\|default\|if\|else\|elseif\|do\|for\|while\|enum\|with\)\>' let ind = ind + &sw endif diff --git a/runtime/plugin/tohtml.vim b/runtime/plugin/tohtml.vim index 867b85d40d..5ef59ca5ad 100644 --- a/runtime/plugin/tohtml.vim +++ b/runtime/plugin/tohtml.vim @@ -1,14 +1,22 @@ " Vim plugin for converting a syntax highlighted file to HTML. " Maintainer: Ben Fritz -" Last Change: 2010 July 24 +" Last Change: 2010 Jul 28 " " The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and " $VIMRUNTIME/syntax/2html.vim +" +" TODO: +" * Diff mode with xhtml gives invalid markup +" * Diff mode does not determine encoding +" * Line number column has one character too few on empty lines +" without CSS. +" * Add extra meta info (generation time, etc.) +" * TODO comments for code cleanup scattered throughout if exists('g:loaded_2html_plugin') finish endif -let g:loaded_2html_plugin = 'vim7.3_v1' +let g:loaded_2html_plugin = 'vim7.3_v2' " Define the :TOhtml command when: " - 'compatible' is not set diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim index 5094433cd6..cf4620e9e0 100644 --- a/runtime/syntax/2html.vim +++ b/runtime/syntax/2html.vim @@ -1,6 +1,6 @@ " Vim syntax support file " Maintainer: Ben Fritz -" Last Change: 2010 July 24 +" Last Change: 2010 Jul 28 " " Additional contributors: " @@ -129,10 +129,14 @@ endif " Return HTML valid characters enclosed in a span of class style_name with " unprintable characters expanded and double spaces replaced as necessary. -function! s:HtmlFormat(text, style_name) +function! s:HtmlFormat(text, style_name, diff_style_name) " Replace unprintable characters let formatted = strtrans(a:text) + " separate the two classes by a space to apply them both if there is a diff + " style name + let l:style_name = a:style_name . (a:diff_style_name == '' ? '' : ' ') . a:diff_style_name + " Replace the reserved html characters let formatted = substitute(substitute(substitute(substitute(substitute(formatted, '&', '\&', 'g'), '<', '\<', 'g'), '>', '\>', 'g'), '"', '\"', 'g'), "\x0c", '
', 'g') @@ -143,12 +147,26 @@ function! s:HtmlFormat(text, style_name) endif " Enclose in a span of class style_name - let formatted = '' . formatted . '' + let formatted = '' . formatted . '' - " Add the class to class list if it's not there yet + " Add the class to class list if it's not there yet. + " Add normal groups to the beginning so diff groups can override them. let s:id = hlID(a:style_name) - if stridx(s:idlist, "," . s:id . ",") == -1 - let s:idlist = s:idlist . s:id . "," + if index(s:idlist, s:id ) == -1 + if a:style_name =~ 'Diff\%(Add\|Change\|Delete\|Text\)' + call add(s:idlist, s:id) + else + call insert(s:idlist, s:id) + endif + endif + + " Add the diff highlight class to class list if used and it's not there yet. + " Add diff groups to the end so they override the other highlighting. + if a:diff_style_name != "" + let s:diff_id = hlID(a:diff_style_name) + if index(s:idlist, s:diff_id) == -1 + call add(s:idlist, s:diff_id) + endif endif return formatted @@ -437,7 +455,7 @@ endif exe s:orgwin . "wincmd w" " List of all id's -let s:idlist = "," +let s:idlist = [] " set up progress bar in the status line if !s:html_no_progress && has("statusline") @@ -702,7 +720,7 @@ while s:lnum <= s:end let s:new = s:new . repeat(s:difffillchar, 3) endif - let s:new = s:HtmlFormat(s:new, "DiffDelete") + let s:new = s:HtmlFormat(s:new, "DiffDelete", "") if s:numblines " Indent if line numbering is on; must be after escaping. let s:new = repeat(s:LeadingSpace, s:margin) . s:new @@ -734,7 +752,7 @@ while s:lnum <= s:end let s:new = s:new . repeat(s:foldfillchar, &columns - strlen(s:new)) endif - let s:new = s:HtmlFormat(s:new, "Folded") + let s:new = s:HtmlFormat(s:new, "Folded", "") " Skip to the end of the fold let s:new_lnum = foldclosedend(s:lnum) @@ -807,7 +825,7 @@ while s:lnum <= s:end " add fold text, moving the span ending to the next line so collapsing " of folds works correctly - let s:new = s:new . substitute(s:HtmlFormat(s:numcol . foldtextresult(s:lnum), "Folded"), '
', s:HtmlEndline.'\n\0', '') + let s:new = s:new . substitute(s:HtmlFormat(s:numcol . foldtextresult(s:lnum), "Folded", ""), '', s:HtmlEndline.'\n\0', '') let s:new = s:new . "" " open the fold now that we have the fold text to allow retrieval of @@ -827,7 +845,7 @@ while s:lnum <= s:end " add the empty foldcolumn for unfolded lines if there is a fold " column at all if s:foldcolumn > 0 - let s:new = s:new . s:HtmlFormat(repeat(' ', s:foldcolumn), "FoldColumn") + let s:new = s:new . s:HtmlFormat(repeat(' ', s:foldcolumn), "FoldColumn", "") endif else " add the fold column for folds not on the opening line @@ -842,7 +860,8 @@ while s:lnum <= s:end " Now continue with the unfolded line text if s:numblines - let s:new = s:new . s:HtmlFormat(s:numcol, "lnr") + " TODO: why not use the real highlight name here? + let s:new = s:new . s:HtmlFormat(s:numcol, "lnr", "") endif " Get the diff attribute, if any. @@ -853,6 +872,11 @@ while s:lnum <= s:end " Loop over each character in the line let s:col = 1 + + " most of the time we won't use the diff_id, initialize to zero + let s:diff_id = 0 + let s:diff_id_name = "" + while s:col <= s:len || (s:col == 1 && s:diffattr) let s:startcol = s:col " The start column for processing text if !exists('g:html_ignore_conceal') && has('conceal') @@ -866,13 +890,18 @@ while s:lnum <= s:end " characters. while s:col <= s:len && s:concealinfo == synconcealed(s:lnum, s:col) | let s:col = s:col + 1 | endwhile elseif s:diffattr - let s:id = diff_hlID(s:lnum, s:col) + let s:diff_id = diff_hlID(s:lnum, s:col) + let s:id = synID(s:lnum, s:col, 1) let s:col = s:col + 1 " Speed loop (it's small - that's the trick) " Go along till we find a change in hlID - while s:col <= s:len && s:id == diff_hlID(s:lnum, s:col) | let s:col = s:col + 1 | endwhile + while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) + \ && s:diff_id == diff_hlID(s:lnum, s:col) | + \ let s:col = s:col + 1 | + \ endwhile if s:len < &columns && !exists("g:html_no_pre") - " Add spaces at the end to mark the changed line. + " Add spaces at the end of the raw text line to extend the changed + " line to the full width. let s:line = s:line . repeat(' ', &columns - virtcol([s:lnum, s:len]) - s:margin) let s:len = &columns endif @@ -913,6 +942,9 @@ while s:lnum <= s:end " get the highlight group name to use let s:id = synIDtrans(s:id) let s:id_name = synIDattr(s:id, "name", s:whatterm) + if s:diff_id + let s:diff_id_name = synIDattr(s:diff_id, "name", s:whatterm) + endif else " use Conceal highlighting for concealed text let s:id_name = 'Conceal' @@ -920,9 +952,9 @@ while s:lnum <= s:end endif " Output the text with the same synID, with class set to {s:id_name}, - " unless it has been concealed completely. Always output empty lines. + " unless it has been concealed completely. if strlen(s:expandedtab) > 0 - let s:new = s:new . s:HtmlFormat(s:expandedtab, s:id_name) + let s:new = s:new . s:HtmlFormat(s:expandedtab, s:id_name, s:diff_id_name) endif endwhile endif @@ -948,18 +980,18 @@ if exists("g:html_dynamic_folds") " add fold column to the style list if not already there let s:id = hlID('FoldColumn') - if stridx(s:idlist, "," . s:id . ",") == -1 - let s:idlist = s:idlist . s:id . "," + if index(s:idlist, s:id) == -1 + call insert(s:idlist, s:id) endif endif -" Close off the font tag that encapsulates the whole -if !exists("g:html_use_css") - let s:lines[-1].="" -endif - if exists("g:html_no_pre") - call extend(s:lines, ["", ""]) + if !exists("g:html_use_css") + " Close off the font tag that encapsulates the whole + call extend(s:lines, ["", ""]) + else + call extend(s:lines, ["", ""]) + endif else call extend(s:lines, ["", "", ""]) endif @@ -1009,9 +1041,6 @@ if s:numblines endif " Gather attributes for all other classes -let s:idlist_str = s:idlist -unlet s:idlist -let s:idlist = split(s:idlist_str, ',') if !s:html_no_progress && !empty(s:idlist) let s:pgb = s:ProgressBar("Processing classes:", len(s:idlist),s:newwin) endif @@ -1027,12 +1056,18 @@ while !empty(s:idlist) if exists("g:html_use_css") execute "normal! A\n." . s:id_name . " { " . s:attr . "}" else - execute '%s+\([^<]*\)+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g' + " replace spans of just this class name with non-CSS style markup + execute '%s+\([^<]*\)+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+ge' + " Replace spans of this class name AND a diff class with non-CSS style + " markup surrounding a span of just the diff class. The diff class will + " be handled later because we know that information is at the end. + execute '%s+\([^<]*\)+' . s:HtmlOpening(s:id) . '\2' . s:HtmlClosing(s:id) . '+ge' endif else execute '%s+\([^<]*\)+\1+ge' + execute '%s+\([^<]*\)+\2+ge' if exists("g:html_use_css") - 1;/