From 9964e468c0209f6b8286e0b08109817c845a3079 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 5 May 2007 17:54:07 +0000 Subject: updated for version 7.1a --- README.txt | 2 +- README_amibin.txt | 2 +- README_dos.txt | 2 +- README_extra.txt | 2 +- README_mac.txt | 2 +- README_ole.txt | 2 +- runtime/autoload/adacomplete.vim | 109 + runtime/autoload/csscomplete.vim | 740 +-- runtime/autoload/decada.vim | 75 + runtime/autoload/getscript.vim | 501 ++ runtime/autoload/netrw.vim | 6973 ++++++++++++--------- runtime/autoload/pythoncomplete.vim | 94 +- runtime/autoload/rubycomplete.vim | 896 ++- runtime/autoload/syntaxcomplete.vim | 117 +- runtime/autoload/xmlcomplete.vim | 24 +- runtime/autoload/zip.vim | 138 +- runtime/colors/blue.vim | 90 +- runtime/colors/torte.vim | 6 +- runtime/doc/change.txt | 20 +- runtime/doc/cmdline.txt | 6 +- runtime/doc/debug.txt | 2 +- runtime/doc/debugger.txt | 2 +- runtime/doc/develop.txt | 4 +- runtime/doc/diff.txt | 17 +- runtime/doc/digraph.txt | 15 +- runtime/doc/editing.txt | 14 +- runtime/doc/fold.txt | 2 +- runtime/doc/gui_w16.txt | 2 +- runtime/doc/gui_w32.txt | 7 +- runtime/doc/gui_x11.txt | 15 +- runtime/doc/hangulin.txt | 2 +- runtime/doc/help.txt | 15 +- runtime/doc/if_cscop.txt | 2 +- runtime/doc/if_mzsch.txt | 9 +- runtime/doc/if_ole.txt | 2 +- runtime/doc/if_perl.txt | 2 +- runtime/doc/if_pyth.txt | 2 +- runtime/doc/if_ruby.txt | 2 +- runtime/doc/if_sniff.txt | 2 +- runtime/doc/insert.txt | 58 +- runtime/doc/mbyte.txt | 5 +- runtime/doc/mlang.txt | 4 +- runtime/doc/motion.txt | 20 +- runtime/doc/os_390.txt | 2 +- runtime/doc/os_beos.txt | 2 +- runtime/doc/os_mac.txt | 2 +- runtime/doc/os_msdos.txt | 2 +- runtime/doc/os_risc.txt | 2 +- runtime/doc/os_unix.txt | 2 +- runtime/doc/pi_getscript.txt | 406 ++ runtime/doc/pi_gzip.txt | 2 +- runtime/doc/pi_netrw.txt | 959 ++- runtime/doc/pi_paren.txt | 4 +- runtime/doc/pi_tar.txt | 34 +- runtime/doc/pi_vimball.txt | 71 +- runtime/doc/pi_zip.txt | 24 +- runtime/doc/print.txt | 4 +- runtime/doc/quickref.txt | 5 +- runtime/doc/recover.txt | 2 +- runtime/doc/rileft.txt | 2 +- runtime/doc/russian.txt | 2 +- runtime/doc/sign.txt | 2 +- runtime/doc/sponsor.txt | 4 +- runtime/doc/tags | 236 +- runtime/doc/term.txt | 4 +- runtime/doc/tips.txt | 6 +- runtime/doc/uganda.txt | 26 +- runtime/doc/undo.txt | 2 +- runtime/doc/usr_02.txt | 64 +- runtime/doc/usr_03.txt | 6 +- runtime/doc/usr_08.txt | 8 +- runtime/doc/usr_09.txt | 2 +- runtime/doc/usr_10.txt | 7 +- runtime/doc/usr_25.txt | 4 +- runtime/doc/usr_26.txt | 2 +- runtime/doc/usr_29.txt | 2 +- runtime/doc/usr_32.txt | 2 +- runtime/doc/usr_42.txt | 2 +- runtime/doc/usr_44.txt | 2 +- runtime/doc/usr_90.txt | 2 +- runtime/doc/usr_toc.txt | 2 +- runtime/doc/version5.txt | 8 +- runtime/doc/version6.txt | 6 +- runtime/doc/vim2html.pl | 1 - runtime/doc/visual.txt | 4 +- runtime/doc/xxd-it.1 | 2 +- runtime/doc/xxd-pl.UTF-8.1 | 2 +- runtime/doc/xxd-ru.UTF-8.1 | 2 +- runtime/ftplugin/ada.vim | 357 +- runtime/ftplugin/bst.vim | 15 + runtime/ftplugin/cobol.vim | 266 + runtime/ftplugin/debchangelog.vim | 27 +- runtime/ftplugin/hamster.vim | 61 + runtime/ftplugin/haskell.vim | 2 +- runtime/ftplugin/mail.vim | 5 +- runtime/ftplugin/make.vim | 4 +- runtime/ftplugin/ocaml.vim | 8 +- runtime/indent/ada.vim | 78 +- runtime/indent/eruby.vim | 51 +- runtime/indent/html.vim | 13 +- runtime/indent/htmldjango.vim | 12 + runtime/indent/jsp.vim | 17 + runtime/indent/ocaml.vim | 2 +- runtime/indent/python.vim | 4 +- runtime/indent/ruby.vim | 14 +- runtime/indent/vhdl.vim | 111 +- runtime/keymap/bulgarian-bds.vim | 127 + runtime/keymap/bulgarian-phonetic.vim | 108 + runtime/keymap/thaana.vim | 3 + runtime/keymap/vietnamese-viqr_utf-8.vim | 160 + runtime/lang/menu_sl_si.cp1250.vim | 294 + runtime/lang/menu_sl_si.latin2.vim | 294 + runtime/lang/menu_slovak_slovak_republic.1250.vim | 2 +- runtime/plugin/README.txt | 20 +- runtime/plugin/vimballPlugin.vim | 30 +- runtime/plugin/zipPlugin.vim | 24 +- runtime/spell/da/main.aap | 2 +- runtime/spell/pl/main.aap | 40 +- runtime/spell/pt/pt_PT.diff | 50 +- runtime/synmenu.vim | 296 +- runtime/syntax/amiga.vim | 6 +- runtime/syntax/aspvbs.vim | 8 +- runtime/syntax/autoit.vim | 1111 ++++ runtime/syntax/automake.vim | 27 +- runtime/syntax/b.vim | 2 +- runtime/syntax/bzr.vim | 51 + runtime/syntax/c.vim | 17 +- runtime/syntax/cmusrc.vim | 309 + runtime/syntax/csh.vim | 16 +- runtime/syntax/dcl.vim | 6 +- runtime/syntax/desc.vim | 4 +- runtime/syntax/elmfilt.vim | 8 +- runtime/syntax/eruby.vim | 8 +- runtime/syntax/foxpro.vim | 45 +- runtime/syntax/fvwm.vim | 906 ++- runtime/syntax/hamster.vim | 382 ++ runtime/syntax/ia64.vim | 3 +- runtime/syntax/ibasic.vim | 176 + runtime/syntax/initng.vim | 91 + runtime/syntax/javascript.vim | 6 +- runtime/syntax/lua.vim | 29 +- runtime/syntax/lynx.vim | 128 +- runtime/syntax/make.vim | 10 +- runtime/syntax/maple.vim | 10 +- runtime/syntax/masm.vim | 366 +- runtime/syntax/muttrc.vim | 163 +- runtime/syntax/named.vim | 44 +- runtime/syntax/netrw.vim | 13 +- runtime/syntax/objc.vim | 4 +- runtime/syntax/ocaml.vim | 20 +- runtime/syntax/php.vim | 734 ++- runtime/syntax/privoxy.vim | 71 + runtime/syntax/remind.vim | 17 +- runtime/syntax/ruby.vim | 149 +- runtime/syntax/sd.vim | 75 + runtime/syntax/sh.vim | 73 +- runtime/syntax/tcsh.vim | 19 +- runtime/syntax/tex.vim | 38 +- runtime/syntax/vim.vim | 59 +- runtime/syntax/xdefaults.vim | 6 +- runtime/tutor/tutor.cs | 812 +++ runtime/tutor/tutor.cs.cp1250 | 812 +++ runtime/tutor/tutor.cs.utf-8 | 812 +++ runtime/tutor/tutor.hu | 823 +++ runtime/tutor/tutor.hu.utf-8 | 823 +++ runtime/tutor/tutor.it | 752 ++- runtime/tutor/tutor.tr.utf-8 | 813 +++ src/GvimExt/GvimExt.reg | 4 +- src/if_xcmdsrv.c | 4 +- src/keymap.h | 2 +- src/move.c | 8 +- src/os_vms.c | 8 +- src/po/README_mvc.txt | 28 +- src/po/de.po | 10 +- src/po/pl.UTF-8.po | 43 +- src/po/pl.cp1250.po | 43 +- src/proto/charset.pro | 108 +- src/proto/diff.pro | 48 +- src/proto/ex_eval.pro | 60 +- src/proto/ex_getln.pro | 108 +- src/proto/fold.pro | 78 +- src/proto/gui.pro | 126 +- src/proto/gui_gtk_x11.pro | 142 +- src/proto/gui_xmdlg.pro | 2 +- src/proto/hashtab.pro | 24 +- src/proto/if_tcl.pro | 16 +- src/proto/main.pro | 48 +- src/proto/mark.pro | 56 +- src/proto/memfile.pro | 32 +- src/proto/message.pro | 138 +- src/proto/netbeans.pro | 46 +- src/proto/normal.pro | 48 +- src/proto/option.pro | 108 +- src/proto/os_riscos.pro | 94 +- src/proto/os_vms.pro | 24 +- src/proto/os_win16.pro | 20 +- src/proto/popupmnu.pro | 12 +- src/proto/regexp.pro | 30 +- src/proto/spell.pro | 48 +- src/proto/syntax.pro | 90 +- src/proto/version.pro | 14 +- src/proto/window.pro | 120 +- src/proto/workshop.pro | 94 +- src/testdir/test55.ok | 4 + src/vim16.def | 2 +- src/vimrun.c | 4 +- 206 files changed, 20003 insertions(+), 7188 deletions(-) create mode 100644 runtime/autoload/adacomplete.vim create mode 100644 runtime/autoload/decada.vim create mode 100644 runtime/autoload/getscript.vim create mode 100644 runtime/doc/pi_getscript.txt create mode 100644 runtime/ftplugin/bst.vim create mode 100644 runtime/ftplugin/cobol.vim create mode 100644 runtime/ftplugin/hamster.vim create mode 100644 runtime/indent/htmldjango.vim create mode 100644 runtime/indent/jsp.vim create mode 100644 runtime/keymap/bulgarian-bds.vim create mode 100644 runtime/keymap/bulgarian-phonetic.vim create mode 100644 runtime/keymap/thaana.vim create mode 100644 runtime/keymap/vietnamese-viqr_utf-8.vim create mode 100644 runtime/lang/menu_sl_si.cp1250.vim create mode 100644 runtime/lang/menu_sl_si.latin2.vim create mode 100644 runtime/syntax/autoit.vim create mode 100644 runtime/syntax/bzr.vim create mode 100644 runtime/syntax/cmusrc.vim create mode 100644 runtime/syntax/hamster.vim create mode 100644 runtime/syntax/ibasic.vim create mode 100644 runtime/syntax/initng.vim create mode 100644 runtime/syntax/privoxy.vim create mode 100644 runtime/syntax/sd.vim create mode 100644 runtime/tutor/tutor.cs create mode 100644 runtime/tutor/tutor.cs.cp1250 create mode 100644 runtime/tutor/tutor.cs.utf-8 create mode 100644 runtime/tutor/tutor.hu create mode 100644 runtime/tutor/tutor.hu.utf-8 create mode 100644 runtime/tutor/tutor.tr.utf-8 diff --git a/README.txt b/README.txt index 3289023d89..5f9d0e9853 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -README.txt for version 7.0 of Vim: Vi IMproved. +README.txt for version 7.1a of Vim: Vi IMproved. WHAT IS VIM diff --git a/README_amibin.txt b/README_amibin.txt index c6bf424ba7..c2df760c9d 100644 --- a/README_amibin.txt +++ b/README_amibin.txt @@ -1,4 +1,4 @@ -README_amibin.txt for version 7.0 of Vim: Vi IMproved. +README_amibin.txt for version 7.1a of Vim: Vi IMproved. See "README.txt" for general information about Vim. See "README_ami.txt" for installation instructions for the Amiga. diff --git a/README_dos.txt b/README_dos.txt index c153e5392b..7cfef57c3d 100644 --- a/README_dos.txt +++ b/README_dos.txt @@ -1,4 +1,4 @@ -README_dos.txt for version 7.0 of Vim: Vi IMproved. +README_dos.txt for version 7.1a of Vim: Vi IMproved. This file explains the installation of Vim on MS-DOS and MS-Windows systems. See "README.txt" for general information about Vim. diff --git a/README_extra.txt b/README_extra.txt index a1de23fb4d..649f62c490 100644 --- a/README_extra.txt +++ b/README_extra.txt @@ -1,4 +1,4 @@ -README_extra.txt for version 7.0 of Vim: Vi IMproved. +README_extra.txt for version 7.1a of Vim: Vi IMproved. The extra archive of Vim is to be used in combination with the source archive (vim-7.0-src.tar.gz). The extra archive is useless without it. diff --git a/README_mac.txt b/README_mac.txt index 39857110a2..50d939ee7c 100644 --- a/README_mac.txt +++ b/README_mac.txt @@ -1,4 +1,4 @@ -README_mac.txt for version 7.0 of Vim: Vi IMproved. +README_mac.txt for version 7.1a of Vim: Vi IMproved. This file explains the installation of Vim on Macintosh systems. See "README.txt" for general information about Vim. diff --git a/README_ole.txt b/README_ole.txt index 4e8ba470d2..d6b20d94b2 100644 --- a/README_ole.txt +++ b/README_ole.txt @@ -1,4 +1,4 @@ -README_ole.txt for version 7.0 of Vim: Vi IMproved. +README_ole.txt for version 7.1a of Vim: Vi IMproved. This archive contains gvim.exe with OLE interface and VisVim. This version of gvim.exe can also load a number of interface dynamically (you diff --git a/runtime/autoload/adacomplete.vim b/runtime/autoload/adacomplete.vim new file mode 100644 index 0000000000..28d68f63dc --- /dev/null +++ b/runtime/autoload/adacomplete.vim @@ -0,0 +1,109 @@ +"------------------------------------------------------------------------------ +" Description: Vim Ada omnicompletion file +" Language: Ada (2005) +" $Id$ +" Maintainer: Martin Krischik +" $Author$ +" $Date$ +" Version: 4.2 +" $Revision$ +" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $ +" History: 24.05.2006 MK Unified Headers +" 26.05.2006 MK improved search for begin of word. +" 16.07.2006 MK Ada-Mode as vim-ball +" 15.10.2006 MK Bram's suggestion for runtime integration +" 05.11.2006 MK Bram suggested not to use include protection for +" autoload +" 05.11.2006 MK Bram suggested agaist using setlocal omnifunc +" 05.11.2006 MK Bram suggested to save on spaces +" Help Page: ft-ada-omni +"------------------------------------------------------------------------------ + +if version < 700 + finish +endif + +" Section: adacomplete#Complete () {{{1 +" +" This function is used for the 'omnifunc' option. +" +function! adacomplete#Complete (findstart, base) + if a:findstart == 1 + return ada#User_Complete (a:findstart, a:base) + else + " + " look up matches + " + if exists ("g:ada_omni_with_keywords") + call ada#User_Complete (a:findstart, a:base) + endif + " + " search tag file for matches + " + let l:Pattern = '^' . a:base . '.*$' + let l:Tag_List = taglist (l:Pattern) + " + " add symbols + " + for Tag_Item in l:Tag_List + if l:Tag_Item['kind'] == '' + " + " Tag created by gnat xref + " + let l:Match_Item = { + \ 'word': l:Tag_Item['name'], + \ 'menu': l:Tag_Item['filename'], + \ 'info': "Symbol from file " . l:Tag_Item['filename'] . " line " . l:Tag_Item['cmd'], + \ 'kind': 's', + \ 'icase': 1} + else + " + " Tag created by ctags + " + let l:Info = 'Symbol : ' . l:Tag_Item['name'] . "\n" + let l:Info .= 'Of type : ' . g:ada#Ctags_Kinds[l:Tag_Item['kind']][1] . "\n" + let l:Info .= 'Defined in File : ' . l:Tag_Item['filename'] . "\n" + + if has_key( l:Tag_Item, 'package') + let l:Info .= 'Package : ' . l:Tag_Item['package'] . "\n" + let l:Menu = l:Tag_Item['package'] + elseif has_key( l:Tag_Item, 'separate') + let l:Info .= 'Separate from Package : ' . l:Tag_Item['separate'] . "\n" + let l:Menu = l:Tag_Item['separate'] + elseif has_key( l:Tag_Item, 'packspec') + let l:Info .= 'Package Specification : ' . l:Tag_Item['packspec'] . "\n" + let l:Menu = l:Tag_Item['packspec'] + elseif has_key( l:Tag_Item, 'type') + let l:Info .= 'Datetype : ' . l:Tag_Item['type'] . "\n" + let l:Menu = l:Tag_Item['type'] + else + let l:Menu = l:Tag_Item['filename'] + endif + + let l:Match_Item = { + \ 'word': l:Tag_Item['name'], + \ 'menu': l:Menu, + \ 'info': l:Info, + \ 'kind': l:Tag_Item['kind'], + \ 'icase': 1} + endif + if complete_add (l:Match_Item) == 0 + return [] + endif + if complete_check () + return [] + endif + endfor + return [] + endif +endfunction adacomplete#Complete + +finish " 1}}} + +"------------------------------------------------------------------------------ +" Copyright (C) 2006 Martin Krischik +" +" Vim is Charityware - see ":help license" or uganda.txt for licence details. +"------------------------------------------------------------------------------ +" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab +" vim: foldmethod=marker diff --git a/runtime/autoload/csscomplete.vim b/runtime/autoload/csscomplete.vim index a6f7041ff3..c9a5997c1a 100644 --- a/runtime/autoload/csscomplete.vim +++ b/runtime/autoload/csscomplete.vim @@ -1,422 +1,407 @@ " Vim completion script " Language: CSS 2.1 " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2006 Apr 30 +" Last Change: 2007 Mar 11 function! csscomplete#CompleteCSS(findstart, base) + if a:findstart " We need whole line to proper checking - let line = getline('.') - let start = col('.') - 1 + let line = getline('.') + let start = col('.') - 1 let compl_begin = col('.') - 2 - while start >= 0 && line[start - 1] =~ '\(\k\|-\)' + while start >= 0 && line[start - 1] =~ '\%(\k\|-\)' let start -= 1 endwhile let b:compl_context = getline('.')[0:compl_begin] return start +endif + +" There are few chars important for context: +" ^ ; : { } /* */ +" Where ^ is start of line and /* */ are comment borders +" Depending on their relative position to cursor we will know what should +" be completed. +" 1. if nearest are ^ or { or ; current word is property +" 2. if : it is value (with exception of pseudo things) +" 3. if } we are outside of css definitions +" 4. for comments ignoring is be the easiest but assume they are the same +" as 1. +" 5. if @ complete at-rule +" 6. if ! complete important +if exists("b:compl_context") + let line = b:compl_context + unlet! b:compl_context else - " There are few chars important for context: - " ^ ; : { } /* */ - " Where ^ is start of line and /* */ are comment borders - " Depending on their relative position to cursor we will now what should - " be completed. - " 1. if nearest are ^ or { or ; current word is property - " 2. if : it is value (with exception of pseudo things) - " 3. if } we are outside of css definitions - " 4. for comments ignoring is be the easiest but assume they are the same - " as 1. - " 5. if @ complete at-rule - " 6. if ! complete important - if exists("b:compl_context") - let line = b:compl_context - unlet! b:compl_context - else - let line = a:base - endif - - let res = [] - let res2 = [] - let borders = {} - - " We need the last occurrence of char so reverse line - let revline = join(reverse(split(line, '.\zs')), '') - - let openbrace = stridx(revline, '{') - let closebrace = stridx(revline, '}') - let colon = stridx(revline, ':') - let semicolon = stridx(revline, ';') - let opencomm = stridx(revline, '*/') " Line was reversed - let closecomm = stridx(revline, '/*') " Line was reversed - let style = stridx(revline, '=\s*elyts') " Line was reversed - let atrule = stridx(revline, '@') - let exclam = stridx(revline, '!') - - if openbrace > -1 - let borders[openbrace] = "openbrace" - endif - if closebrace > -1 - let borders[closebrace] = "closebrace" - endif - if colon > -1 - let borders[colon] = "colon" - endif - if semicolon > -1 - let borders[semicolon] = "semicolon" - endif - if opencomm > -1 - let borders[opencomm] = "opencomm" - endif - if closecomm > -1 - let borders[closecomm] = "closecomm" - endif - if style > -1 - let borders[style] = "style" - endif - if atrule > -1 - let borders[atrule] = "atrule" - endif - if exclam > -1 - let borders[exclam] = "exclam" - endif - - - if len(borders) == 0 || borders[min(keys(borders))] =~ '^\(openbrace\|semicolon\|opencomm\|closecomm\|style\)$' - " Complete properties - - let values = split("azimuth background background-attachment background-color background-image background-position background-repeat border bottom border-collapse border-color border-spacing border-style border-top border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor display direction elevation empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-right margin-left margin-top margin-bottom max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes right richness speak speak-header speak-numeral speak-punctuation speech-rate stress table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility voice-family volume white-space width widows word-spacing z-index") - - let entered_property = matchstr(line, '.\{-}\zs[a-zA-Z-]*$') - - for m in values - if m =~? '^'.entered_property - call add(res, m . ':') - elseif m =~? entered_property - call add(res2, m . ':') - endif - endfor - - return res + res2 - - elseif borders[min(keys(borders))] == 'colon' - " Get name of property - let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$')) - - if prop == 'azimuth' - let values = ["left-side", "far-left", "left", "center-left", "center", "center-right", "right", "far-right", "right-side", "behind", "leftwards", "rightwards"] - elseif prop == 'background-attachment' - let values = ["scroll", "fixed"] - elseif prop == 'background-color' - let values = ["transparent", "rgb(", "#"] - elseif prop == 'background-image' - let values = ["url(", "none"] - elseif prop == 'background-position' - let vals = matchstr(line, '.*:\s*\zs.*') - if vals =~ '^\([a-zA-Z]\+\)\?$' - let values = ["top", "center", "bottom"] - elseif vals =~ '^[a-zA-Z]\+\s\+\([a-zA-Z]\+\)\?$' - let values = ["left", "center", "right"] - else - return [] - endif - elseif prop == 'background-repeat' - let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"] - elseif prop == 'background' - let values = ["url(", "scroll", "fixed", "transparent", "rgb(", "#", "none", "top", "center", "bottom" , "left", "right", "repeat", "repeat-x", "repeat-y", "no-repeat"] - elseif prop == 'border-collapse' - let values = ["collapse", "separate"] - elseif prop == 'border-color' - let values = ["rgb(", "#", "transparent"] - elseif prop == 'border-spacing' + let line = a:base +endif + +let res = [] +let res2 = [] +let borders = {} + +" Check last occurrence of sequence + +let openbrace = strridx(line, '{') +let closebrace = strridx(line, '}') +let colon = strridx(line, ':') +let semicolon = strridx(line, ';') +let opencomm = strridx(line, '/*') +let closecomm = strridx(line, '*/') +let style = strridx(line, 'style\s*=') +let atrule = strridx(line, '@') +let exclam = strridx(line, '!') + +if openbrace > -1 + let borders[openbrace] = "openbrace" +endif +if closebrace > -1 + let borders[closebrace] = "closebrace" +endif +if colon > -1 + let borders[colon] = "colon" +endif +if semicolon > -1 + let borders[semicolon] = "semicolon" +endif +if opencomm > -1 + let borders[opencomm] = "opencomm" +endif +if closecomm > -1 + let borders[closecomm] = "closecomm" +endif +if style > -1 + let borders[style] = "style" +endif +if atrule > -1 + let borders[atrule] = "atrule" +endif +if exclam > -1 + let borders[exclam] = "exclam" +endif + + +if len(borders) == 0 || borders[max(keys(borders))] =~ '^\%(openbrace\|semicolon\|opencomm\|closecomm\|style\)$' + " Complete properties + + let values = split("azimuth background background-attachment background-color background-image background-position background-repeat border bottom border-collapse border-color border-spacing border-style border-top border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor display direction elevation empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-right margin-left margin-top margin-bottom max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes right richness speak speak-header speak-numeral speak-punctuation speech-rate stress table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility voice-family volume white-space width widows word-spacing z-index") + + let entered_property = matchstr(line, '.\{-}\zs[a-zA-Z-]*$') + + for m in values + if m =~? '^'.entered_property + call add(res, m . ':') + elseif m =~? entered_property + call add(res2, m . ':') + endif + endfor + + return res + res2 + +elseif borders[max(keys(borders))] == 'colon' + " Get name of property + let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$')) + + if prop == 'azimuth' + let values = ["left-side", "far-left", "left", "center-left", "center", "center-right", "right", "far-right", "right-side", "behind", "leftwards", "rightwards"] + elseif prop == 'background-attachment' + let values = ["scroll", "fixed"] + elseif prop == 'background-color' + let values = ["transparent", "rgb(", "#"] + elseif prop == 'background-image' + let values = ["url(", "none"] + elseif prop == 'background-position' + let vals = matchstr(line, '.*:\s*\zs.*') + if vals =~ '^\%([a-zA-Z]\+\)\?$' + let values = ["top", "center", "bottom"] + elseif vals =~ '^[a-zA-Z]\+\s\+\%([a-zA-Z]\+\)\?$' + let values = ["left", "center", "right"] + else return [] - elseif prop == 'border-style' + endif + elseif prop == 'background-repeat' + let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"] + elseif prop == 'background' + let values = ["url(", "scroll", "fixed", "transparent", "rgb(", "#", "none", "top", "center", "bottom" , "left", "right", "repeat", "repeat-x", "repeat-y", "no-repeat"] + elseif prop == 'border-collapse' + let values = ["collapse", "separate"] + elseif prop == 'border-color' + let values = ["rgb(", "#", "transparent"] + elseif prop == 'border-spacing' + return [] + elseif prop == 'border-style' + let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] + elseif prop =~ 'border-\%(top\|right\|bottom\|left\)$' + let vals = matchstr(line, '.*:\s*\zs.*') + if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$' + let values = ["thin", "thick", "medium"] + elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$' let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] - elseif prop =~ 'border-\(top\|right\|bottom\|left\)$' - let vals = matchstr(line, '.*:\s*\zs.*') - if vals =~ '^\([a-zA-Z0-9.]\+\)\?$' - let values = ["thin", "thick", "medium"] - elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$' - let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] - elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$' - let values = ["rgb(", "#", "transparent"] - else - return [] - endif - elseif prop =~ 'border-\(top\|right\|bottom\|left\)-color' + elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$' let values = ["rgb(", "#", "transparent"] - elseif prop =~ 'border-\(top\|right\|bottom\|left\)-style' - let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] - elseif prop =~ 'border-\(top\|right\|bottom\|left\)-width' - let values = ["thin", "thick", "medium"] - elseif prop == 'border-width' - let values = ["thin", "thick", "medium"] - elseif prop == 'border' - let vals = matchstr(line, '.*:\s*\zs.*') - if vals =~ '^\([a-zA-Z0-9.]\+\)\?$' - let values = ["thin", "thick", "medium"] - elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$' - let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] - elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$' - let values = ["rgb(", "#", "transparent"] - else - return [] - endif - elseif prop == 'bottom' - let values = ["auto"] - elseif prop == 'caption-side' - let values = ["top", "bottom"] - elseif prop == 'clear' - let values = ["none", "left", "right", "both"] - elseif prop == 'clip' - let values = ["auto", "rect("] - elseif prop == 'color' - let values = ["rgb(", "#"] - elseif prop == 'content' - let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"] - elseif prop =~ 'counter-\(increment\|reset\)$' - let values = ["none"] - elseif prop =~ '^\(cue-after\|cue-before\|cue\)$' - let values = ["url(", "none"] - elseif prop == 'cursor' - let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"] - elseif prop == 'direction' - let values = ["ltr", "rtl"] - elseif prop == 'display' - let values = ["inline", "block", "list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none"] - elseif prop == 'elevation' - let values = ["below", "level", "above", "higher", "lower"] - elseif prop == 'empty-cells' - let values = ["show", "hide"] - elseif prop == 'float' - let values = ["left", "right", "none"] - elseif prop == 'font-family' - let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"] - elseif prop == 'font-size' - let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"] - elseif prop == 'font-style' - let values = ["normal", "italic", "oblique"] - elseif prop == 'font-variant' - let values = ["normal", "small-caps"] - elseif prop == 'font-weight' - let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"] - elseif prop == 'font' - let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"] - elseif prop =~ '^\(height\|width\)$' - let values = ["auto"] - elseif prop =~ '^\(left\|rigth\)$' - let values = ["auto"] - elseif prop == 'letter-spacing' - let values = ["normal"] - elseif prop == 'line-height' - let values = ["normal"] - elseif prop == 'list-style-image' - let values = ["url(", "none"] - elseif prop == 'list-style-position' - let values = ["inside", "outside"] - elseif prop == 'list-style-type' - let values = ["disc", "circle", "square", "decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin", "none"] - elseif prop == 'list-style' + else return [] - elseif prop == 'margin' - let values = ["auto"] - elseif prop =~ 'margin-\(right\|left\|top\|bottom\)$' - let values = ["auto"] - elseif prop == 'max-height' - let values = ["auto"] - elseif prop == 'max-width' - let values = ["none"] - elseif prop == 'min-height' - let values = ["none"] - elseif prop == 'min-width' - let values = ["none"] - elseif prop == 'orphans' + endif + elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-color' + let values = ["rgb(", "#", "transparent"] + elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-style' + let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] + elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-width' + let values = ["thin", "thick", "medium"] + elseif prop == 'border-width' + let values = ["thin", "thick", "medium"] + elseif prop == 'border' + let vals = matchstr(line, '.*:\s*\zs.*') + if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$' + let values = ["thin", "thick", "medium"] + elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$' + let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] + elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$' + let values = ["rgb(", "#", "transparent"] + else return [] - elseif prop == 'outline-color' + endif + elseif prop == 'bottom' + let values = ["auto"] + elseif prop == 'caption-side' + let values = ["top", "bottom"] + elseif prop == 'clear' + let values = ["none", "left", "right", "both"] + elseif prop == 'clip' + let values = ["auto", "rect("] + elseif prop == 'color' + let values = ["rgb(", "#"] + elseif prop == 'content' + let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"] + elseif prop =~ 'counter-\%(increment\|reset\)$' + let values = ["none"] + elseif prop =~ '^\%(cue-after\|cue-before\|cue\)$' + let values = ["url(", "none"] + elseif prop == 'cursor' + let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"] + elseif prop == 'direction' + let values = ["ltr", "rtl"] + elseif prop == 'display' + let values = ["inline", "block", "list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none"] + elseif prop == 'elevation' + let values = ["below", "level", "above", "higher", "lower"] + elseif prop == 'empty-cells' + let values = ["show", "hide"] + elseif prop == 'float' + let values = ["left", "right", "none"] + elseif prop == 'font-family' + let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"] + elseif prop == 'font-size' + let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"] + elseif prop == 'font-style' + let values = ["normal", "italic", "oblique"] + elseif prop == 'font-variant' + let values = ["normal", "small-caps"] + elseif prop == 'font-weight' + let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"] + elseif prop == 'font' + let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"] + elseif prop =~ '^\%(height\|width\)$' + let values = ["auto"] + elseif prop =~ '^\%(left\|rigth\)$' + let values = ["auto"] + elseif prop == 'letter-spacing' + let values = ["normal"] + elseif prop == 'line-height' + let values = ["normal"] + elseif prop == 'list-style-image' + let values = ["url(", "none"] + elseif prop == 'list-style-position' + let values = ["inside", "outside"] + elseif prop == 'list-style-type' + let values = ["disc", "circle", "square", "decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin", "none"] + elseif prop == 'list-style' + return [] + elseif prop == 'margin' + let values = ["auto"] + elseif prop =~ 'margin-\%(right\|left\|top\|bottom\)$' + let values = ["auto"] + elseif prop == 'max-height' + let values = ["auto"] + elseif prop == 'max-width' + let values = ["none"] + elseif prop == 'min-height' + let values = ["none"] + elseif prop == 'min-width' + let values = ["none"] + elseif prop == 'orphans' + return [] + elseif prop == 'outline-color' + let values = ["rgb(", "#"] + elseif prop == 'outline-style' + let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] + elseif prop == 'outline-width' + let values = ["thin", "thick", "medium"] + elseif prop == 'outline' + let vals = matchstr(line, '.*:\s*\zs.*') + if vals =~ '^\%([a-zA-Z0-9,()#]\+\)\?$' let values = ["rgb(", "#"] - elseif prop == 'outline-style' + elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\%([a-zA-Z]\+\)\?$' let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] - elseif prop == 'outline-width' + elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$' let values = ["thin", "thick", "medium"] - elseif prop == 'outline' - let vals = matchstr(line, '.*:\s*\zs.*') - if vals =~ '^\([a-zA-Z0-9,()#]\+\)\?$' - let values = ["rgb(", "#"] - elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\([a-zA-Z]\+\)\?$' - let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"] - elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$' - let values = ["thin", "thick", "medium"] - else - return [] - endif - elseif prop == 'overflow' - let values = ["visible", "hidden", "scroll", "auto"] - elseif prop == 'padding' - return [] - elseif prop =~ 'padding-\(top\|right\|bottom\|left\)$' - return [] - elseif prop =~ 'page-break-\(after\|before\)$' - let values = ["auto", "always", "avoid", "left", "right"] - elseif prop == 'page-break-inside' - let values = ["auto", "avoid"] - elseif prop =~ 'pause-\(after\|before\)$' - return [] - elseif prop == 'pause' - return [] - elseif prop == 'pitch-range' - return [] - elseif prop == 'pitch' - let values = ["x-low", "low", "medium", "high", "x-high"] - elseif prop == 'play-during' - let values = ["url(", "mix", "repeat", "auto", "none"] - elseif prop == 'position' - let values = ["static", "relative", "absolute", "fixed"] - elseif prop == 'quotes' - let values = ["none"] - elseif prop == 'richness' - return [] - elseif prop == 'speak-header' - let values = ["once", "always"] - elseif prop == 'speak-numeral' - let values = ["digits", "continuous"] - elseif prop == 'speak-punctuation' - let values = ["code", "none"] - elseif prop == 'speak' - let values = ["normal", "none", "spell-out"] - elseif prop == 'speech-rate' - let values = ["x-slow", "slow", "medium", "fast", "x-fast", "faster", "slower"] - elseif prop == 'stress' - return [] - elseif prop == 'table-layout' - let values = ["auto", "fixed"] - elseif prop == 'text-align' - let values = ["left", "right", "center", "justify"] - elseif prop == 'text-decoration' - let values = ["none", "underline", "overline", "line-through", "blink"] - elseif prop == 'text-indent' - return [] - elseif prop == 'text-transform' - let values = ["capitalize", "uppercase", "lowercase", "none"] - elseif prop == 'top' - let values = ["auto"] - elseif prop == 'unicode-bidi' - let values = ["normal", "embed", "bidi-override"] - elseif prop == 'vertical-align' - let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"] - elseif prop == 'visibility' - let values = ["visible", "hidden", "collapse"] - elseif prop == 'voice-family' - return [] - elseif prop == 'volume' - let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"] - elseif prop == 'white-space' - let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"] - elseif prop == 'widows' + else return [] - elseif prop == 'word-spacing' - let values = ["normal"] - elseif prop == 'z-index' - let values = ["auto"] + endif + elseif prop == 'overflow' + let values = ["visible", "hidden", "scroll", "auto"] + elseif prop == 'padding' + return [] + elseif prop =~ 'padding-\%(top\|right\|bottom\|left\)$' + return [] + elseif prop =~ 'page-break-\%(after\|before\)$' + let values = ["auto", "always", "avoid", "left", "right"] + elseif prop == 'page-break-inside' + let values = ["auto", "avoid"] + elseif prop =~ 'pause-\%(after\|before\)$' + return [] + elseif prop == 'pause' + return [] + elseif prop == 'pitch-range' + return [] + elseif prop == 'pitch' + let values = ["x-low", "low", "medium", "high", "x-high"] + elseif prop == 'play-during' + let values = ["url(", "mix", "repeat", "auto", "none"] + elseif prop == 'position' + let values = ["static", "relative", "absolute", "fixed"] + elseif prop == 'quotes' + let values = ["none"] + elseif prop == 'richness' + return [] + elseif prop == 'speak-header' + let values = ["once", "always"] + elseif prop == 'speak-numeral' + let values = ["digits", "continuous"] + elseif prop == 'speak-punctuation' + let values = ["code", "none"] + elseif prop == 'speak' + let values = ["normal", "none", "spell-out"] + elseif prop == 'speech-rate' + let values = ["x-slow", "slow", "medium", "fast", "x-fast", "faster", "slower"] + elseif prop == 'stress' + return [] + elseif prop == 'table-layout' + let values = ["auto", "fixed"] + elseif prop == 'text-align' + let values = ["left", "right", "center", "justify"] + elseif prop == 'text-decoration' + let values = ["none", "underline", "overline", "line-through", "blink"] + elseif prop == 'text-indent' + return [] + elseif prop == 'text-transform' + let values = ["capitalize", "uppercase", "lowercase", "none"] + elseif prop == 'top' + let values = ["auto"] + elseif prop == 'unicode-bidi' + let values = ["normal", "embed", "bidi-override"] + elseif prop == 'vertical-align' + let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"] + elseif prop == 'visibility' + let values = ["visible", "hidden", "collapse"] + elseif prop == 'voice-family' + return [] + elseif prop == 'volume' + let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"] + elseif prop == 'white-space' + let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"] + elseif prop == 'widows' + return [] + elseif prop == 'word-spacing' + let values = ["normal"] + elseif prop == 'z-index' + let values = ["auto"] + else + " If no property match it is possible we are outside of {} and + " trying to complete pseudo-(class|element) + let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$')) + if stridx(',a,abbr,acronym,address,area,b,base,bdo,big,blockquote,body,br,button,caption,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,fieldset,form,head,h1,h2,h3,h4,h5,h6,hr,html,i,img,input,ins,kbd,label,legend,li,link,map,meta,noscript,object,ol,optgroup,option,p,param,pre,q,samp,script,select,small,span,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,ul,var,', ','.element.',') > -1 + let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"] else - " If no property match it is possible we are outside of {} and - " trying to complete pseudo-(class|element) - let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$')) - if ",a,abbr,acronym,address,area,b,base,bdo,big,blockquote,body,br,button,caption,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,fieldset,form,head,h1,h2,h3,h4,h5,h6,hr,html,i,img,input,ins,kbd,label,legend,li,link,map,meta,noscript,object,ol,optgroup,option,p,param,pre,q,samp,script,select,small,span,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,ul,var," =~ ','.element.',' - let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"] - else - return [] - endif + return [] endif + endif - " Complete values - let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$') - - for m in values - if m =~? '^'.entered_value - call add(res, m) - elseif m =~? entered_value - call add(res2, m) - endif - endfor - - return res + res2 - - elseif borders[min(keys(borders))] == 'closebrace' + " Complete values + let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$') - return [] + for m in values + if m =~? '^'.entered_value + call add(res, m) + elseif m =~? entered_value + call add(res2, m) + endif + endfor - elseif borders[min(keys(borders))] == 'exclam' + return res + res2 - " Complete values - let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$') +elseif borders[max(keys(borders))] == 'closebrace' - let values = ["important"] + return [] - for m in values - if m =~? '^'.entered_imp - call add(res, m) - endif - endfor +elseif borders[max(keys(borders))] == 'exclam' - return res + " Complete values + let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$') - elseif borders[min(keys(borders))] == 'atrule' + let values = ["important"] - let afterat = matchstr(line, '.*@\zs.*') + for m in values + if m =~? '^'.entered_imp + call add(res, m) + endif + endfor - if afterat =~ '\s' + return res - let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze') +elseif borders[max(keys(borders))] == 'atrule' - if atrulename == 'media' - let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"] + let afterat = matchstr(line, '.*@\zs.*') - let atruleafterbase = matchstr(line, '.*@media\s\+\ze.*$') - let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$') + if afterat =~ '\s' - elseif atrulename == 'import' - let atruleafterbase = matchstr(line, '.*@import\s\+\ze.*$') - let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$') + let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze') - if entered_atruleafter =~ "^[\"']" - let filestart = matchstr(entered_atruleafter, '^.\zs.*') - let files = split(glob(filestart.'*'), '\n') - let values = map(copy(files), '"\"".v:val') + if atrulename == 'media' + let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"] - elseif entered_atruleafter =~ "^url(" - let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*") - let files = split(glob(filestart.'*'), '\n') - let values = map(copy(files), '"url(".v:val') + let atruleafterbase = matchstr(line, '.*@media\s\+\ze.*$') + let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$') - else - let values = ['"', 'url('] + elseif atrulename == 'import' + let atruleafterbase = matchstr(line, '.*@import\s\+\ze.*$') + let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$') - endif + if entered_atruleafter =~ "^[\"']" + let filestart = matchstr(entered_atruleafter, '^.\zs.*') + let files = split(glob(filestart.'*'), '\n') + let values = map(copy(files), '"\"".v:val') + elseif entered_atruleafter =~ "^url(" + let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*") + let files = split(glob(filestart.'*'), '\n') + let values = map(copy(files), '"url(".v:val') + else - return [] + let values = ['"', 'url('] endif - for m in values - if m =~? '^'.entered_atruleafter - call add(res, m) - elseif m =~? entered_atruleafter - call add(res2, m) - endif - endfor - - return res + res2 + else + return [] endif - let values = ["charset", "page", "media", "import", "font-face"] - - let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$') - for m in values - if m =~? '^'.entered_atrule - call add(res, m .' ') - elseif m =~? entered_atrule - call add(res2, m .' ') + if m =~? '^'.entered_atruleafter + call add(res, m) + elseif m =~? entered_atruleafter + call add(res2, m) endif endfor @@ -424,7 +409,22 @@ else endif - return [] + let values = ["charset", "page", "media", "import", "font-face"] + + let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$') + + for m in values + if m =~? '^'.entered_atrule + call add(res, m .' ') + elseif m =~? entered_atrule + call add(res2, m .' ') + endif + endfor + + return res + res2 + +endif + +return [] - endif endfunction diff --git a/runtime/autoload/decada.vim b/runtime/autoload/decada.vim new file mode 100644 index 0000000000..9f8aaf260d --- /dev/null +++ b/runtime/autoload/decada.vim @@ -0,0 +1,75 @@ +"------------------------------------------------------------------------------ +" Description: Vim Ada/Dec Ada compiler file +" Language: Ada (Dec Ada) +" $Id$ +" Copyright: Copyright (C) 2006 Martin Krischik +" Maintainer: Martin Krischik +" $Author$ +" $Date$ +" Version: 4.2 +" $Revision$ +" $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $ +" History: 21.07.2006 MK New Dec Ada +" 15.10.2006 MK Bram's suggestion for runtime integration +" 05.11.2006 MK Bram suggested not to use include protection for +" autoload +" 05.11.2006 MK Bram suggested to save on spaces +" Help Page: compiler-decada +"------------------------------------------------------------------------------ + +if version < 700 + finish +endif + +function decada#Unit_Name () dict " {{{1 + " Convert filename into acs unit: + " 1: remove the file extenstion. + " 2: replace all double '_' or '-' with an dot (which denotes a separate) + " 3: remove a trailing '_' (wich denotes a specification) + return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '') +endfunction decada#Unit_Name " }}}1 + +function decada#Make () dict " {{{1 + let l:make_prg = substitute (g:self.Make_Command, '%<', self.Unit_Name(), '') + let &errorformat = g:self.Error_Format + let &makeprg = l:make_prg + wall + make + copen + set wrap + wincmd W +endfunction decada#Build " }}}1 + +function decada#Set_Session (...) dict " {{{1 + if a:0 > 0 + call ada#Switch_Session (a:1) + elseif argc() == 0 && strlen (v:servername) > 0 + call ada#Switch_Session ( + \ expand('~')[0:-2] . ".vimfiles.session]" . + \ v:servername . ".vim") + endif + return +endfunction decada#Set_Session " }}}1 + +function decada#New () " }}}1 + let Retval = { + \ 'Make' : function ('decada#Make'), + \ 'Unit_Name' : function ('decada#Unit_Name'), + \ 'Set_Session' : function ('decada#Set_Session'), + \ 'Project_Dir' : '', + \ 'Make_Command' : 'ACS COMPILE /Wait /Log /NoPreLoad /Optimize=Development /Debug %<', + \ 'Error_Format' : '%+A%%ADAC-%t-%m,%C %#%m,%Zat line number %l in file %f,' . + \ '%+I%%ada-I-%m,%C %#%m,%Zat line number %l in file %f'} + + return Retval +endfunction decada#New " }}}1 + +finish " 1}}} + +"------------------------------------------------------------------------------ +" Copyright (C) 2006 Martin Krischik +" +" Vim is Charityware - see ":help license" or uganda.txt for licence details. +"------------------------------------------------------------------------------ +" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab +" vim: foldmethod=marker diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim new file mode 100644 index 0000000000..bfe057cc35 --- /dev/null +++ b/runtime/autoload/getscript.vim @@ -0,0 +1,501 @@ +" --------------------------------------------------------------------- +" getscript.vim +" Author: Charles E. Campbell, Jr. +" Date: Nov 27, 2006 +" Version: 23 +" Installing: :help glvs-install +" Usage: :help glvs +" +" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim +" --------------------------------------------------------------------- +" Initialization: {{{1 +" if you're sourcing this file, surely you can't be +" expecting vim to be in its vi-compatible mode +if &cp + echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)" + finish +endif +let s:keepfo = &fo +let s:keepcpo = &cpo +set cpo&vim + +if exists("g:loaded_getscript") + finish +endif +let g:loaded_getscript= "v23" + +" --------------------------------------------------------------------- +" Global Variables: {{{1 +" allow user to change the command for obtaining scripts (does fetch work?) +if !exists("g:GetLatestVimScripts_wget") + if executable("wget") + let g:GetLatestVimScripts_wget= "wget" + elseif executable("curl") + let g:GetLatestVimScripts_wget= "curl" + else + let g:GetLatestVimScripts_wget = 'echo "GetLatestVimScripts needs wget or curl"' + let g:GetLatestVimScripts_options = "" + endif +endif + +" options that wget and curl require: +if !exists("g:GetLatestVimScripts_options") + if g:GetLatestVimScripts_wget == "wget" + let g:GetLatestVimScripts_options= "-q -O" + elseif g:GetLatestVimScripts_wget == "curl" + let g:GetLatestVimScripts_options= "-s -O" + else + let g:GetLatestVimScripts_options= "" + endif +endif + +" by default, allow autoinstall lines to work +if !exists("g:GetLatestVimScripts_allowautoinstall") + let g:GetLatestVimScripts_allowautoinstall= 1 +endif + +"" For debugging: +"let g:GetLatestVimScripts_wget = "echo" +"let g:GetLatestVimScripts_options = "options" + +" --------------------------------------------------------------------- +" Check If AutoInstall Capable: {{{1 +let s:autoinstall= "" +if g:GetLatestVimScripts_allowautoinstall + + if (has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")) && &shell != "bash" + " windows (but not cygwin/bash) + let s:dotvim= "vimfiles" + if !exists("g:GetLatestVimScripts_mv") + let g:GetLatestVimScripts_mv= "ren" + endif + + else + " unix + let s:dotvim= ".vim" + if !exists("g:GetLatestVimScripts_mv") + let g:GetLatestVimScripts_mv= "mv" + endif + endif + + if exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim) + let s:autoinstall= $HOME."/".s:dotvim + endif +" call Decho("s:autoinstall<".s:autoinstall.">") +"else "Decho +" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled") +endif + +" --------------------------------------------------------------------- +" Public Interface: {{{1 +com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts() +com! -nargs=0 GetScript call getscript#GetLatestVimScripts() +silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts() + +" --------------------------------------------------------------------- +" GetOneScript: (Get Latest Vim Script) this function operates {{{1 +" on the current line, interpreting two numbers and text as +" ScriptID, SourceID, and Filename. +" It downloads any scripts that have newer versions from vim.sf.net. +fun! s:GetOneScript(...) +" call Dfunc("GetOneScript()") + + " set options to allow progress to be shown on screen + let t_ti= &t_ti + let t_te= &t_te + let rs = &rs + set t_ti= t_te= nors + + " put current line on top-of-screen and interpret it into + " a script identifer : used to obtain webpage + " source identifier : used to identify current version + " and an associated comment: used to report on what's being considered + if a:0 >= 3 + let scriptid = a:1 + let srcid = a:2 + let fname = a:3 + let cmmnt = "" +" call Decho("scriptid<".scriptid.">") +" call Decho("srcid <".srcid.">") +" call Decho("fname <".fname.">") + else + let curline = getline(".") + if curline =~ '^\s*#' +" call Dret("GetOneScript : skipping a pure comment line") + return + endif + let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$' + try + let scriptid = substitute(curline,parsepat,'\1','e') + catch /^Vim\%((\a\+)\)\=:E486/ + let scriptid= 0 + endtry + try + let srcid = substitute(curline,parsepat,'\2','e') + catch /^Vim\%((\a\+)\)\=:E486/ + let srcid= 0 + endtry + try + let fname= substitute(curline,parsepat,'\3','e') + catch /^Vim\%((\a\+)\)\=:E486/ + let fname= "" + endtry + try + let cmmnt= substitute(curline,parsepat,'\4','e') + catch /^Vim\%((\a\+)\)\=:E486/ + let cmmnt= "" + endtry +" call Decho("curline <".curline.">") +" call Decho("parsepat<".parsepat.">") +" call Decho("scriptid<".scriptid.">") +" call Decho("srcid <".srcid.">") +" call Decho("fname <".fname.">") + endif + + if scriptid == 0 || srcid == 0 + " When looking for :AutoInstall: lines, skip scripts that + " have 0 0 scriptname +" call Dret("GetOneScript : skipping a scriptid==srcid==0 line") + return + endif + + let doautoinstall= 0 + if fname =~ ":AutoInstall:" +" call Decho("fname<".fname."> has :AutoInstall:...") + let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','') +" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall) + if s:autoinstall != "" + let doautoinstall = g:GetLatestVimScripts_allowautoinstall + endif + else + let aicmmnt= fname + endif +" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall) + + exe "norm z\" + redraw! +" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid) + echomsg 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid + + " grab a copy of the plugin's vim.sf.net webpage + let scriptaddr = 'http://vim.sf.net/script.php?script_id='.scriptid + let tmpfile = tempname() + let v:errmsg = "" + + " make three tries at downloading the description + let itry= 1 + while itry <= 3 +" call Decho("try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr) + if has("win32") || has("win16") || has("win95") +" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"') + exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"' + else +" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'") + exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'" + endif + if itry == 1 + exe "silent vsplit ".tmpfile + else + silent! e % + endif + + " find the latest source-id in the plugin's webpage + silent! 1 + let findpkg= search('Click on the package to download','W') + if findpkg > 0 + break + endif + let itry= itry + 1 + endwhile +" call Decho(" --- end downloading tries while loop --- itry=".itry) + + " testing: did finding /Click on the package.../ fail? + if findpkg == 0 || itry >= 4 + silent q! + call delete(tmpfile) + " restore options + let &t_ti = t_ti + let &t_te = t_te + let &rs = rs + let s:downerrors = s:downerrors + 1 +" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">") + echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">" +" call Dret("GetOneScript : srch for /Click on the package/ failed") + return + endif +" call Decho('found "Click on the package to download"') + + let findsrcid= search('src_id=','W') + if findsrcid == 0 + silent q! + call delete(tmpfile) + " restore options + let &t_ti = t_ti + let &t_te = t_te + let &rs = rs + let s:downerrors = s:downerrors + 1 +" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">") + echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">" +" call Dret("GetOneScript : srch for /src_id/ failed") + return + endif +" call Decho('found "src_id=" in description page') + + let srcidpat = '^\s*\([^<]\+\)<.*$' + let latestsrcid= substitute(getline("."),srcidpat,'\1','') + let fname = substitute(getline("."),srcidpat,'\2','') +" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> fname<".fname.">") + silent q! + call delete(tmpfile) + + " convert the strings-of-numbers into numbers + let srcid = srcid + 0 + let latestsrcid = latestsrcid + 0 +" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." fname<".fname.">") + + " has the plugin's most-rece