diff --git a/.hgtags b/.hgtags index fce339f253..d66e05e1cb 100644 --- a/.hgtags +++ b/.hgtags @@ -2049,3 +2049,45 @@ fb7dec372910b61478abdd7f79871724153ebfdd v7-3-709 906eb5c0ef129b6876fa9c6c5a13e44807f7a503 v7-3-710 2a7b2943be22c27edb3c0334423c1b17275f18fb v7-3-711 557ef119999ea687ccb84eddca295755c24989da v7-3-712 +f15769bce0b811fc840fd455035270288e8d744d v7-3-713 +9ea14f097855e0929f86c86d405725717efb044d v7-3-714 +4f0ddf4137eeb08753f2593a32b42a1dcb1e6f4c v7-3-715 +eb268db98f321b93f5e7552920b6389f9dddfd3f v7-3-716 +6a76846b84eb0fe1220f8cfa19b1161145932d4d v7-3-717 +18e95db59826aa9379e6e3ada5d3540cbae1e596 v7-3-718 +e6d8b44065bc05741effbc0635c21506032d97b4 v7-3-719 +9e119e0ade5d804f174a3b67ad5e0d0e7449739f v7-3-720 +b23f583e132e88ec98f2b449b7216642ba64a8a8 v7-3-721 +de6968039340db04ec65164a3450a40773488e00 v7-3-722 +ee138f29259e02f62fe8181073e7a063523e50b8 v7-3-723 +6e5acfdf7a5a2b3fa27a529881af77c1e1b1c0f7 v7-3-724 +f4aa43d952f5bacc752951c80495fd20c72ba90c v7-3-725 +5049eacbff0e9688af99eb67a408cae5919ff52c v7-3-726 +d3c291efdb0b9f5cd286013b789eb1c91ae868ca v7-3-727 +233666f859339f425684af70dd008354776259af v7-3-728 +d08f05285dd102d8f071ee42869416d25dd4e72d v7-3-729 +37a4cacd20511ead4cf1a8ecb235276bc448fddf v7-3-730 +778ff2e87806133faa8fcfefbd41cad2b601bdb6 v7-3-731 +fa8bf69d3866eaf31e6c8fed74862feea11a40b0 v7-3-732 +509e55bd4a3feeb651ea173cefcbd933f723d8b6 v7-3-733 +fc8b4a06af9db05af800b1304599afd3e1229980 v7-3-734 +d3158bf4dee9270477defcde85949ce58fa350e5 v7-3-735 +b1536bbbda104edb11b0f5772e433d2b5388905e v7-3-736 +1773d5aa6437b0f88029a192cdde2c510faf517d v7-3-737 +eccae034465b9a44aa2389039ba06b25dc6ae7dc v7-3-738 +e2d36f345a7f1131e085336e7b471f718fad6c9d v7-3-739 +2c12cd5c1381dd9691af5e7d3e1fe1f54c929ee1 v7-3-740 +6e1fe64cf4404d899232a880552cf52998934656 v7-3-741 +4d1753f3e85c7fb6d9cde1a8aa9ded8d11cdcd01 v7-3-742 +67e3b2753a6ef97a94084b85f87873c309fea3d6 v7-3-743 +26c8b3b49f743ca163a63463da08cc3822322bc2 v7-3-744 +aab4b29520e79134e33f2c641f1d960de2dcdc1e v7-3-745 +4934eb2e22dc0bc03fd5d4f95706a69a1ddffb94 v7-3-746 +cd59ba19985a3b3bd66dffdcf59b00427f844818 v7-3-747 +56bb88c68f985365b0545a0370be59fcd97a4178 v7-3-748 +3e22fe67fa6935d1156738a34e50bffdf62006c9 v7-3-749 +5c36fe9f19a529fb6064b37b8e47e82cdeeb7ca8 v7-3-750 +d149f18b289fdf19363214e7805a0637307bd264 v7-3-751 +ed936effb1f374004db15f092b8c8ab87631fdd4 v7-3-752 +c83cd3d01128204d6926550cbe1064daaf8dee8c v7-3-753 +beceb0a18c79b5b1bda4822b34cb2d62b2967d27 v7-3-754 diff --git a/README.txt b/README.txt index cf462db1ca..c29d32f3af 100644 --- a/README.txt +++ b/README.txt @@ -97,10 +97,12 @@ The latest news about Vim can be found on the Vim home page: If you have problems, have a look at the Vim FAQ: http://vimdoc.sf.net/vimfaq.html -Send bug reports to: - Bram Moolenaar +If you still have problems or any other questions, use one of the mailing +lists to discuss them with Vim users and developers: + http://www.vim.org/maillist.php -There are several mailing lists for Vim, see http://www.vim.org/maillist.php. +If nothing else works, report bugs directly: + Bram Moolenaar MAIN AUTHOR diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 2700a8c825..3e9bd34b19 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: Apr 05, 2012 -" Version: 145 +" Date: Oct 25, 2012 +" Version: 146 " Maintainer: Charles E Campbell, Jr " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim -" Copyright: Copyright (C) 1999-2010 Charles E. Campbell, Jr. {{{1 +" Copyright: Copyright (C) 1999-2012 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 = "v145" +let g:loaded_netrw = "v146" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrw needs vim 7.2" @@ -55,12 +55,12 @@ set cpo&vim " 0=note = s:NOTE " 1=warning = s:WARNING " 2=error = s:ERROR -" Apr 05, 2012 : max errnum currently is 88 +" Oct 24, 2012 : max errnum currently is 91 fun! netrw#ErrorMsg(level,msg,errnum) " call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow) if a:level < g:netrw_errorlvl - call Dret("netrw#ErrorMsg : suppressing level=".a:level." since g;netrw_errorlvl=".g:netrw_errorlvl) +" call Dret("netrw#ErrorMsg : suppressing level=".a:level." since g;netrw_errorlvl=".g:netrw_errorlvl) return endif @@ -225,7 +225,7 @@ endif " Cygwin Detection ------- {{{3 if !exists("g:netrw_cygwin") if has("win32") || has("win95") || has("win64") || has("win16") - if &shell =~ '\%(\\|\\)\%(\.exe\)\=$' + if has("win32unix") && &shell =~ '\%(\\|\\)\%(\.exe\)\=$' let g:netrw_cygwin= 1 else let g:netrw_cygwin= 0 @@ -300,30 +300,27 @@ if exists("g:netrw_local_copycmd") let g:netrw_localcopycmd= g:netrw_local_copycmd" call netrw#ErrorMsg(s:NOTE,"g:netrw_local_copycmd is deprecated in favor of g:netrw_localcopycmd",84) endif +if !exists("g:netrw_localcmdshell") + let g:netrw_localcmdshell= "" +endif if !exists("g:netrw_localcopycmd") if has("win32") || has("win95") || has("win64") || has("win16") if g:netrw_cygwin let g:netrw_localcopycmd= "cp" else - let g:netrw_localcopycmd= "copy" + let g:netrw_localcopycmd= "cmd /c copy" endif elseif has("unix") || has("macunix") let g:netrw_localcopycmd= "cp" else let g:netrw_localcopycmd= "" endif - if !executable(g:netrw_localcopycmd) - call netrw#ErrorMsg(s:NOTE,"consider setting g:netrw_localcopycmd<".g:netrw_localcopycmd."> to something that works",80) - endif endif if exists("g:netrw_local_mkdir") - let g:netrw_localmkdir= g:netrw_local_mkdir" + let g:netrw_localmkdir= g:netrw_local_mkdir call netrw#ErrorMsg(s:NOTE,"g:netrw_local_mkdir is deprecated in favor of g:netrw_localmkdir",87) endif call s:NetrwInit("g:netrw_localmkdir","mkdir") -if !executable(g:netrw_localmkdir) - call netrw#ErrorMsg(s:NOTE,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80) -endif call s:NetrwInit("g:netrw_remote_mkdir","mkdir") if exists("g:netrw_local_movecmd") let g:netrw_localmovecmd= g:netrw_local_movecmd" @@ -334,25 +331,19 @@ if !exists("g:netrw_localmovecmd") if g:netrw_cygwin let g:netrw_localmovecmd= "mv" else - let g:netrw_localmovecmd= "move" + let g:netrw_localmovecmd= "cmd /c move" endif elseif has("unix") || has("macunix") let g:netrw_localmovecmd= "mv" else let g:netrw_localmovecmd= "" endif - if !executable(g:netrw_localmkdir) - call netrw#ErrorMsg(s:NOTE,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",81) - endif endif call s:NetrwInit("g:netrw_localrmdir", "rmdir") if exists("g:netrw_local_rmdir") let g:netrw_localrmdir= g:netrw_local_rmdir" call netrw#ErrorMsg(s:NOTE,"g:netrw_local_rmdir is deprecated in favor of g:netrw_localrmdir",86) endif -if !executable(g:netrw_localrmdir) - call netrw#ErrorMsg(s:NOTE,"consider setting g:netrw_localrmdir<".g:netrw_localrmdir."> to something that works",82) -endif call s:NetrwInit("g:netrw_liststyle" , s:THINLIST) " sanity checks if g:netrw_liststyle < 0 || g:netrw_liststyle >= s:MAXLIST @@ -607,7 +598,8 @@ fun! s:NetrwOptionRestore(vt) if exists("{a:vt}netrw_rokeep") |let &l:ro = {a:vt}netrw_rokeep |unlet {a:vt}netrw_rokeep |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_tskeep") |let &l:ts = {a:vt}netrw_tskeep |unlet {a:vt}netrw_tskeep |endif + " Problem: start with liststyle=0; press : result, following line resets l:ts. +" if exists("{a:vt}netrw_tskeep") |let &l:ts = {a:vt}netrw_tskeep |unlet {a:vt}netrw_tskeep |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 if exists("{a:vt}netrw_wrapkeep") |let &l:wrap = {a:vt}netrw_wrapkeep |unlet {a:vt}netrw_wrapkeep |endif @@ -647,6 +639,7 @@ fun! s:NetrwOptionRestore(vt) " call Decho("(NetrwOptionRestore) fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist")) " call Decho("(NetrwOptionRestore) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") " call Decho("(NetrwOptionRestore) diff=".&l:diff." win#".winnr()." w:netrw_diffkeep=".(exists("w:netrw_diffkeep")? w:netrw_diffkeep : "doesn't exist")) +" call Decho("(NetrwOptionRestore) ts=".&l:ts) " call Dret("s:NetrwOptionRestore : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) endfun @@ -956,7 +949,7 @@ fun! netrw#NetRead(mode,...) " call Decho("filter input: ".getline('.')) endif - if exists("g:netrw_uid" && g:netrw_uid != "" + if exists("g:netrw_uid") && g:netrw_uid != "" if exists("g:netrw_ftp") && g:netrw_ftp == 1 keepj put =g:netrw_uid " call Decho("filter input: ".getline('.')) @@ -1487,7 +1480,7 @@ fun! netrw#NetWrite(...) range "......................................... " NetWrite: (sftp) NetWrite Method #9 {{{3 elseif b:netrw_method == 9 -" call Decho("read via sftp (method #9)") +" call Decho("write via sftp (method #9)") let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if exists("g:netrw_uid") && ( g:netrw_uid != "" ) let uid_machine = g:netrw_uid .'@'. g:netrw_machine @@ -1505,7 +1498,8 @@ fun! netrw#NetWrite(...) range call setline(1,'put "'.escape(tmpfile,'\').'" '.netrw_fname) " call Decho("filter input: ".getline('.')) " call Decho("executing: %!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1)) - exe s:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1) + let sftpcmd= substitute(g:netrw_sftp_cmd,"%TEMPFILE%",escape(tmpfile,'\'),"g") + exe s:netrw_silentxfer."%!".sftpcmd.' '.shellescape(uid_machine,1) let filtbuf= bufnr("%") exe curbuf."b!" let &l:bh = bhkeep @@ -1647,14 +1641,14 @@ fun! s:NetrwGetFile(readcmd, tfile, method) " call Decho("exe sil! keepalt file ".fnameescape(rfile)) exe "sil! keepj keepalt file ".fnameescape(rfile) - " detect filetype of local version of remote file + " Detect filetype of local version of remote file. " Note that isk must not include a "/" for scripts.vim " to process this detection correctly. " call Decho("detect filetype of local version of remote file") - let iskkeep= &isk - set isk-=/ + let iskkeep= &l:isk + setl isk-=/ filetype detect - let &isk= iskkeep + let &l:isk= iskkeep " call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!") let line1 = 1 let line2 = line("$") @@ -2013,11 +2007,17 @@ fun! NetUserPass(...) endif if a:0 == 0 + " case: no input arguments + + " change host and username if not previously entered; get new password + if !exists("g:netrw_machine") + let g:netrw_machine= input('Enter hostname: ') + endif if !exists("g:netrw_uid") || g:netrw_uid == "" - " get uid via prompt + " get username (user-id) via prompt let g:netrw_uid= input('Enter username: ') endif - " get password via prompt + " get password via prompting let s:netrw_passwd= inputsecret("Enter Password: ") " set up hup database @@ -2029,8 +2029,10 @@ fun! NetUserPass(...) let s:netrw_hup[host].passwd = s:netrw_passwd elseif a:0 == 1 + " case: one input argument if a:1 =~ '^ftp:' + " get host from ftp:... url " access userid and password from hup (host-user-passwd) dictionary let host = substitute(a:1,'^ftp:','','') let host = substitute(host,'\..*','','') @@ -2043,14 +2045,22 @@ fun! NetUserPass(...) let g:netrw_uid = input("Enter UserId: ") let s:netrw_passwd = inputsecret("Enter Password: ") endif + else - " set userid, prompt for password -" call Decho("set g:netrw_uid= <".a:1.">") + " case: one input argument, not an url. Using it as a new user-id. if exists("g:netrw_machine") let host= substitute(g:netrw_machine,'\..*$','','') + else + let g:netrw_machine= input('Enter hostname: ') + endif + let g:netrw_uid = a:1 +" call Decho("set g:netrw_uid= <".g:netrw_uid.">") + if exists("g:netrw_passwd") + " ask for password if one not previously entered + let s:netrw_passwd= g:netrw_passwd + else + let s:netrw_passwd = inputsecret("Enter Password: ") endif - let g:netrw_uid = a:1 - let s:netrw_passwd = inputsecret("Enter Password: ") endif " call Decho("host<".host.">") @@ -2161,6 +2171,7 @@ fun! s:NetrwMaps(islocal) nnoremap U :call NetrwBookHistHandler(5,expand("%")) nnoremap v :call NetrwSplit(5) nnoremap x :call netrw#NetrwBrowseX(NetrwBrowseChgDir(1,NetrwGetWord(),0),0)" + nnoremap X :call NetrwLocalExecute(expand(""))" " local insert-mode maps inoremap a :call NetrwHide(1) inoremap c :exe "keepjumps lcd ".fnameescape(b:netrw_curdir) @@ -2283,7 +2294,7 @@ fun! s:NetrwMaps(islocal) nnoremap mx :call NetrwMarkFileExe(0) nnoremap mX :call NetrwMarkFileVimCmd(0) nnoremap mz :call NetrwMarkFileCompress(0) - nnoremap gb :call NetrwBookHistHandler(1,b:netrw_cur) + nnoremap gb :call NetrwBookHistHandler(1,b:netrw_curdir) nnoremap gd :call NetrwForceChgDir(0,NetrwGetWord()) nnoremap gf :call NetrwForceFile(0,NetrwGetWord()) nnoremap gh :call NetrwHidden(0) @@ -2330,7 +2341,7 @@ fun! s:NetrwMaps(islocal) inoremap mx :call NetrwMarkFileExe(0) inoremap mX :call NetrwMarkFileVimCmd(0) inoremap mz :call NetrwMarkFileCompress(0) - inoremap gb :call NetrwBookHistHandler(1,b:netrw_cur) + inoremap gb :call NetrwBookHistHandler(1,b:netrw_curdir) inoremap gh :call NetrwHidden(0) inoremap gp :call NetrwChgPerm(0,b:netrw_curdir) inoremap C :let g:netrw_chgwin= winnr() @@ -2431,6 +2442,7 @@ endfun fun! s:NetrwBookHistHandler(chg,curdir) " call Dfunc("s:NetrwBookHistHandler(chg=".a:chg." curdir<".a:curdir.">) cnt=".v:count." histcnt=".g:netrw_dirhist_cnt." histmax=".g:netrw_dirhistmax) + let ykeep= @@ if a:chg == 0 " bookmark the current directory " call Decho("(user: ) bookmark the current directory") @@ -2579,6 +2591,7 @@ fun! s:NetrwBookHistHandler(chg,curdir) keepj call remove(g:netrw_bookmarklist,v:count-1) endif call s:NetrwBookmarkMenu() + let @@= ykeep " call Dret("s:NetrwBookHistHandler") endfun @@ -2587,6 +2600,7 @@ endfun " Sister function: s:NetrwBookHistSave() fun! s:NetrwBookHistRead() " call Dfunc("s:NetrwBookHistRead()") + let ykeep= @@ if !exists("s:netrw_initbookhist") let home = s:NetrwHome() let savefile= home."/.netrwbook" @@ -2604,6 +2618,7 @@ fun! s:NetrwBookHistRead() au VimLeave * call s:NetrwBookHistSave() endif endif + let @@= ykeep " call Dret("s:NetrwBookHistRead") endfun @@ -2678,11 +2693,12 @@ fun! s:NetrwBrowse(islocal,dirname) " call Dfunc("s:NetrwBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%")."> win#".winnr()) " call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) " call Dredir("ls!") + " s:NetrwBrowse: initialize history {{{3 if !exists("s:netrw_initbookhist") keepj call s:NetrwBookHistRead() endif - " simplify the dirname (especially for ".."s in dirnames) + " s:NetrwBrowse: simplify the dirname (especially for ".."s in dirnames) {{{3 if a:dirname !~ '^\a\+://' let dirname= simplify(a:dirname) else @@ -2695,6 +2711,8 @@ fun! s:NetrwBrowse(islocal,dirname) " call Dret("s:NetrwBrowse : s:netrw_skipbrowse=".s:netrw_skipbrowse) return endif + + " s:NetrwBrowse: sanity checks: {{{3 if !exists("*shellescape") keepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing shellescape()",69) " call Dret("s:NetrwBrowse : missing shellescape()") @@ -2706,15 +2724,17 @@ fun! s:NetrwBrowse(islocal,dirname) return endif + " s:NetrwBrowse: save options: {{{3 call s:NetrwOptionSave("w:") - " re-instate any marked files + " s:NetrwBrowse: re-instate any marked files {{{3 if exists("s:netrwmarkfilelist_{bufnr('%')}") " call Decho("clearing marked files") exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/" endif if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep + " s:NetrwBrowse: set up "safe" options for local directory/file {{{3 " call Decho("handle w:netrw_acdkeep:") " call Decho("keepjumps lcd ".fnameescape(dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")") exe 'keepj lcd '.fnameescape(dirname) @@ -2722,17 +2742,17 @@ fun! s:NetrwBrowse(islocal,dirname) " call Decho("getcwd<".getcwd().">") elseif !a:islocal && dirname !~ '[\/]$' && dirname !~ '^"' - " looks like a regular file, attempt transfer + " s:NetrwBrowse: looks like a remote regular file, attempt transfer {{{3 " call Decho("attempt transfer as regular file<".dirname.">") - " remove any filetype indicator from end of dirname, except for the {{{3 + " remove any filetype indicator from end of dirname, except for the " "this is a directory" indicator (/). " There shouldn't be one of those here, anyway. let path= substitute(dirname,'[*=@|]\r\=$','','e') " call Decho("new path<".path.">") call s:RemotePathAnalysis(dirname) - " remote-read the requested file into current buffer {{{3 + " s:NetrwBrowse: remote-read the requested file into current buffer {{{3 keepj mark ' call s:NetrwEnew(dirname) call s:NetrwSafeOptions() @@ -2749,7 +2769,7 @@ fun! s:NetrwBrowse(islocal,dirname) exe "sil keepj keepalt doau BufReadPost ".fnameescape(s:fname) endif - " save certain window-oriented variables into buffer-oriented variables {{{3 + " s:NetrwBrowse: save certain window-oriented variables into buffer-oriented variables {{{3 call s:SetBufWinVars() call s:NetrwOptionRestore("w:") " call Decho("setl ma nomod") @@ -2771,7 +2791,7 @@ fun! s:NetrwBrowse(islocal,dirname) " set up menu {{{3 keepj call s:NetrwMenu(1) - " set up buffer {{{3 + " get/set-up buffer {{{3 let reusing= s:NetrwGetBuffer(a:islocal,dirname) " maintain markfile highlighting if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != "" @@ -2852,11 +2872,11 @@ fun! s:NetrwBrowse(islocal,dirname) else " call Decho("remote only:") - " analyze dirname and g:netrw_list_cmd {{{4 + " analyze dirname and g:netrw_list_cmd {{{3 " call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist")."> dirname<".dirname.">") if dirname =~ "^NetrwTreeListing\>" let dirname= b:netrw_curdir -" call Decho("(dirname was ".dirname.") dirname<".dirname.">") +" call Decho("(dirname was ) dirname<".dirname.">") elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir") let dirname= substitute(b:netrw_curdir,'\\','/','g') if dirname !~ '/$' @@ -2914,6 +2934,7 @@ endfun " s:NetrwFileInfo: supports qf (query for file information) {{{2 fun! s:NetrwFileInfo(islocal,fname) " call Dfunc("s:NetrwFileInfo(islocal=".a:islocal." fname<".a:fname.">)") + let ykeep= @@ if a:islocal if (has("unix") || has("macunix")) && executable("/bin/ls") if exists("b:netrw_curdir") @@ -2943,6 +2964,7 @@ fun! s:NetrwFileInfo(islocal,fname) else echo "sorry, \"qf\" not supported yet for remote files" endif + let @@= ykeep " call Dret("s:NetrwFileInfo") endfun @@ -2958,22 +2980,22 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Decho("--re-use a buffer if possible--") if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST " find NetrwTreeList buffer if there is one -" call Decho("find NetrwTreeList buffer if there is one") +" call Decho("case liststyle=treelist: find NetrwTreeList buffer if there is one") if exists("w:netrw_treebufnr") && w:netrw_treebufnr > 0 " call Decho(" re-use w:netrw_treebufnr=".w:netrw_treebufnr) let eikeep= &ei set ei=all exe "sil! b ".w:netrw_treebufnr let &ei= eikeep -" call Dret("s:NetrwGetBuffer : bufnum#".w:netrw_treebufnr."") - return +" call Dret("s:NetrwGetBuffer 1 : bufnum#".w:netrw_treebufnr."") + return 1 endif let bufnum= -1 " call Decho(" liststyle=TREE but w:netrw_treebufnr doesn't exist") else " find buffer number of buffer named precisely the same as dirname {{{3 -" call Decho("--find buffer numnber of buffer named precisely the same as dirname--") +" call Decho("case listtyle not treelist: find buffer numnber of buffer named precisely the same as dirname--") " call Dredir("ls!") " get dirname and associated buffer number @@ -3003,7 +3025,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) " note: !~ was used just below, but that means using ../ to go back would match (ie. abc/def/ and abc/ matches) if bufnum > 0 && bufname(bufnum) != dirname && bufname(bufnum) != '.' " handle approximate matches -" call Decho(" handling approx match: bufnum#".bufnum."<".bufname(bufnum)."> approx-dirname<".dirname.">") +" call Decho(" handling approx match: bufnum#".bufnum.">0 AND bufname<".bufname(bufnum).">!=dirname<".dirname."> AND bufname(".bufnum.")!='.'") let ibuf = 1 let buflast = bufnr("$") " call Decho(" findbuf2: buflast=bufnr($)=".buflast) @@ -3043,9 +3065,10 @@ fun! s:NetrwGetBuffer(islocal,dirname) endif " get enew buffer and name it -or- re-use buffer {{{3 +" call Decho(" get enew buffer and name it OR re-use buffer") sil! keepj mark ' if bufnum < 0 || !bufexists(bufnum) -" call Decho("--get enew buffer and name it (bufexists([bufnum=".bufnum."])=".bufexists(bufnum).")") +" call Decho("--get enew buffer and name it (bufnum#".bufnum."<0 OR bufexists(".bufnum.")=".bufexists(bufnum)."==0)") call s:NetrwEnew(dirname) " call Decho(" got enew buffer#".bufnr("%")." (altbuf<".expand("#").">)") " name the buffer @@ -3078,14 +3101,14 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Decho(" named enew buffer#".bufnr("%")."<".bufname("%").">") else " Re-use the buffer -" call Decho("--re-use buffer#".bufnum." (bufexists([bufnum=".bufnum."])=".bufexists(bufnum).")") +" call Decho("--re-use buffer#".bufnum." (bufnum#".bufnum.">=0 AND bufexists(".bufnum.")=".bufexists(bufnum)."!=0)") let eikeep= &ei set ei=all if getline(2) =~ '^" Netrw Directory Listing' -" call Decho(" re-use buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: keepalt b ".bufnum) +" call Decho(" getline(2)<".getline(2).'> matches "Netrw Directory Listing" : using keepalt b '.bufnum) exe "sil! keepalt b ".bufnum else -" call Decho(" reusing buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: b ".bufnum) +" call Decho(" getline(2)<".getline(2).'> does not match "Netrw Directory Listing" : using b '.bufnum) exe "sil! b ".bufnum endif if bufname("%") == '.' @@ -3095,17 +3118,22 @@ fun! s:NetrwGetBuffer(islocal,dirname) let &ei= eikeep if line("$") <= 1 keepj call s:NetrwListSettings(a:islocal) -" call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but its empty, so refresh it") +" call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but its empty, so refresh it") + return 0 + elseif g:netrw_fastbrowse == 0 || (a:islocal && g:netrw_fastbrowse == 1) + keepj call s:NetrwListSettings(a:islocal) + sil keepj %d +" call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but refreshing due to g:netrw_fastbrowse=".g:netrw_fastbrowse) return 0 elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST " call Decho("--re-use tree listing--") " call Decho(" clear buffer<".expand("%")."> with :%d") sil keepj %d keepj call s:NetrwListSettings(a:islocal) -" call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but treelist mode always needs a refresh") +" call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but treelist mode always needs a refresh") return 0 else -" call Dret("s:NetrwGetBuffer 1 : buf#".bufnr("%")) +" call Dret("s:NetrwGetBuffer 1 : buf#".bufnr("%")) return 1 endif endif @@ -3126,7 +3154,7 @@ fun! s:NetrwGetBuffer(islocal,dirname) " call Decho(" clear buffer<".expand("%")."> with :%d") sil! keepalt keepj %d -" call Dret("s:NetrwGetBuffer 0 : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) +" call Dret("s:NetrwGetBuffer 0 : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) return 0 endfun @@ -3266,8 +3294,8 @@ fun! s:NetrwListSettings(islocal) setlocal noswf endif " call Dredir("ls!") -" call Decho("exe setlocal ts=".g:netrw_maxfilenamelen) - exe "setlocal ts=".g:netrw_maxfilenamelen +" call Decho("(LocalListing) exe setl ts=".(g:netrw_maxfilenamelen+1)) + exe "setl ts=".(g:netrw_maxfilenamelen+1) setlocal isk+=.,~,- if g:netrw_fastbrowse > a:islocal setlocal bh=hide @@ -3283,6 +3311,7 @@ endfun " =1: local browsing fun! s:NetrwListStyle(islocal) " call Dfunc("NetrwListStyle(islocal=".a:islocal.") w:netrw_liststyle=".w:netrw_liststyle) + let ykeep = @@ let fname = s:NetrwGetWord() if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif let w:netrw_liststyle = (w:netrw_liststyle + 1) % s:MAXLIST @@ -3340,6 +3369,7 @@ fun! s:NetrwListStyle(islocal) if result <= 0 && exists("w:netrw_bannercnt") exe "sil! keepj ".w:netrw_bannercnt endif + let @@= ykeep " call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : "")) endfun @@ -3349,6 +3379,7 @@ endfun fun! s:NetrwBannerCtrl(islocal) " call Dfunc("s:NetrwBannerCtrl(islocal=".a:islocal.") g:netrw_banner=".g:netrw_banner) + let ykeep= @@ " toggle the banner (enable/suppress) let g:netrw_banner= !g:netrw_banner @@ -3364,6 +3395,7 @@ fun! s:NetrwBannerCtrl(islocal) if result <= 0 && exists("w:netrw_bannercnt") exe "keepj ".w:netrw_bannercnt endif + let @@= ykeep " call Dret("s:NetrwBannerCtrl : g:netrw_banner=".g:netrw_banner) endfun @@ -3439,9 +3471,11 @@ endfun fun! s:NetrwBrowseChgDir(islocal,newdir,...) " call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">") + let ykeep= @@ if !exists("b:netrw_curdir") " Don't try to change-directory: this can happen, for example, when netrw#ErrorMsg has been called " and the current window is the NetrwMessage window. + let @@= ykeep " call Decho("(NetrwBrowseChgDir) b:netrw_curdir doesn't exist!") " call Decho("(NetrwBrowseChgDir) getcwd<".getcwd().">") " call Dredir("ls!") @@ -3449,6 +3483,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) return endif + " NetrwBrowseChgDir: save options and initialize {{{3 keepj call s:NetrwOptionSave("s:") keepj call s:NetrwSafeOptions() let nbcd_curpos = netrw#NetrwSavePosn() @@ -3478,15 +3513,15 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) endif if newdir !~ dirpat - " ------------ - " edit a file: - " ------------ + " ------------------------------ + " NetrwBrowseChgDir: edit a file {{{3 + " ------------------------------ " call Decho('(NetrwBrowseChgDir) case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">") - " save position for benefit of Rexplore - let s:rexposn_{bufnr("%")}= netrw#NetrwSavePosn() + " save position for benefit of Rexplore + let s:rexposn_{bufnr("%")}= netrw#NetrwSavePosn() -" call Decho("(NetrwBrowseChgDir) setting s:rexposn_".bufnr("%")." to SavePosn") +" call Decho("(NetrwBrowseChgDir) setting s:rexposn_".bufnr("%")." to SavePosn") if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") && newdir !~ '^\(/\|\a:\)' let dirname= s:NetrwTreeDir() if dirname =~ '/$' @@ -3507,20 +3542,26 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " call Decho("(NetrwBrowseChgDir) set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist")) keepj call s:NetrwOptionRestore("s:") if !exists("s:didsplit") +" call Decho("s:didsplit does not exist; g:netrw_browse_split=".g:netrw_browse_split." win#".winnr()) if g:netrw_browse_split == 1 + " horizontally splitting the window first new if !&ea wincmd _ endif elseif g:netrw_browse_split == 2 + " vertically splitting the window first rightb vert new if !&ea wincmd | endif elseif g:netrw_browse_split == 3 + " open file in new tab tabnew elseif g:netrw_browse_split == 4 + " act like "P" (ie. open previous window) if s:NetrwPrevWinOpen(2) == 3 + let @@= ykeep " call Dret("s:NetrwBrowseChgDir") return endif @@ -3540,6 +3581,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) if a:islocal " call Decho("(NetrwBrowseChgDir) edit local file: exe e! ".fnameescape(dirname)) exe "e! ".fnameescape(dirname) + call s:NetrwCursor() else " call Decho("(NetrwBrowseChgDir) remote file: NetrwBrowse will edit it") endif @@ -3566,25 +3608,25 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) endif elseif newdir =~ '^/' - " --------------------------------- - " just go to the new directory spec - " --------------------------------- + " ---------------------------------------------------- + " NetrwBrowseChgDir: just go to the new directory spec {{{3 + " ---------------------------------------------------- " call Decho('(NetrwBrowseChgDir) case "just go to new directory spec": newdir<'.newdir.'>') - let dirname= newdir + let dirname = newdir keepj call s:SetRexDir(a:islocal,dirname) keepj call s:NetrwOptionRestore("s:") elseif newdir == './' - " -------------------------- - " refresh the directory list - " -------------------------- + " --------------------------------------------- + " NetrwBrowseChgDir: refresh the directory list {{{3 + " --------------------------------------------- " call Decho('(NetrwBrowseChgDir) case "refresh directory listing": newdir == "./"') keepj call s:SetRexDir(a:islocal,dirname) elseif newdir == '../' - " ------------------- - " go up one directory - " ------------------- + " -------------------------------------- + " NetrwBrowseChgDir: go up one directory {{{3 + " -------------------------------------- " call Decho('(NetrwBrowseChgDir) case "go up one directory": newdir == "../"') if w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") @@ -3622,6 +3664,9 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) keepj call s:SetRexDir(a:islocal,dirname) elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") + " -------------------------------------- + " NetrwBrowseChgDir: Handle Tree Listing {{{3 + " -------------------------------------- " call Decho('(NetrwBrowseChgDir) case liststyle is TREELIST and w:netrw_treedict exists') " force a refresh (for TREELIST, wait for NetrwTreeDir() to force the refresh) " call Decho("(NetrwBrowseChgDir) setl noro ma") @@ -3681,12 +3726,17 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) let s:treeforceredraw = 1 else - " go down one directory - let dirname= s:ComposePath(dirname,newdir) + " ---------------------------------------- + " NetrwBrowseChgDir: Go down one directory {{{3 + " ---------------------------------------- + let dirname = s:ComposePath(dirname,newdir) " call Decho("(NetrwBrowseChgDir) go down one dir: dirname<".dirname."> newdir<".newdir.">") keepj call s:SetRexDir(a:islocal,dirname) endif + " -------------------------------------- + " NetrwBrowseChgDir: Restore and Cleanup {{{3 + " -------------------------------------- keepj call s:NetrwOptionRestore("s:") if dolockout " call Decho("(NetrwBrowseChgDir) filewritable(dirname<".dirname.">)=".filewritable(dirname)) @@ -3702,6 +3752,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " call Decho("(NetrwBrowseChgDir) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") endif endif + let @@= ykeep " call Dret("s:NetrwBrowseChgDir <".dirname."> : curpos<".string(getpos(".")).">") return dirname @@ -3714,6 +3765,9 @@ endfun fun! netrw#NetrwBrowseX(fname,remote) " call Dfunc("NetrwBrowseX(fname<".a:fname."> remote=".a:remote.")") + let ykeep = @@ + let screenposn = netrw#NetrwSavePosn() + " special core dump handler if a:fname =~ '/core\(\.\d\+\)\=$' if exists("g:Netrw_corehandler") @@ -3730,6 +3784,8 @@ fun! netrw#NetrwBrowseX(fname,remote) endif endfor endif + call netrw#NetrwRestorePosn(screenposn) + let @@= ykeep " call Dret("NetrwBrowseX : coredump handler invoked") return endif @@ -3747,7 +3803,7 @@ fun! netrw#NetrwBrowseX(fname,remote) " gnome-open's subsidiary display tools are largely absent. Kde systems " usually have "kdeinit" running, though... (tnx Mikolaj Machowski) if !exists("s:haskdeinit") - if has("unix") + if has("unix") && executable("ps") && !has("win32unix") let s:haskdeinit= system("ps -e") =~ 'kdeinit' if v:shell_error let s:haskdeinit = 0 @@ -3760,12 +3816,12 @@ fun! netrw#NetrwBrowseX(fname,remote) if a:remote == 1 " create a local copy -" call Decho("a:remote=".a:remote.": create a local copy of <".a:fname.">") +" call Decho("(remote) a:remote=".a:remote.": create a local copy of <".a:fname.">") setlocal bh=delete call netrw#NetRead(3,a:fname) " attempt to rename tempfile let basename= substitute(a:fname,'^\(.*\)/\(.*\)\.\([^.]*\)$','\2','') - let newname= substitute(s:netrw_tmpfile,'^\(.*\)/\(.*\)\.\([^.]*\)$','\1/'.basename.'.\3','') + let newname = substitute(s:netrw_tmpfile,'^\(.*\)/\(.*\)\.\([^.]*\)$','\1/'.basename.'.\3','') " call Decho("basename<".basename.">") " call Decho("newname <".newname.">") if rename(s:netrw_tmpfile,newname) == 0 @@ -3776,6 +3832,7 @@ fun! netrw#NetrwBrowseX(fname,remote) let fname= s:netrw_tmpfile endif else +" call Decho("(local) a:remote=".a:remote.": handling local copy of <".a:fname.">") let fname= a:fname " special ~ handler for local if fname =~ '^\~' && expand("$HOME") != "" @@ -3798,9 +3855,10 @@ fun! netrw#NetrwBrowseX(fname,remote) else let redir= &srr . "/dev/null" endif -" call Decho("redir{".redir."} srr{".&srr."}") +" call Decho("set up redirection: redir{".redir."} srr{".&srr."}") " extract any viewing options. Assumes that they're set apart by quotes. +" call Decho("extract any viewing options") if exists("g:netrw_browsex_viewer") " call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">") if g:netrw_browsex_viewer =~ '\s' @@ -3823,6 +3881,7 @@ fun! netrw#NetrwBrowseX(fname,remote) endif " execute the file handler +" call Decho("execute the file handler (if any)") if exists("g:netrw_browsex_viewer") && g:netrw_browsex_viewer == '-' " call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">") let ret= netrwFileHandlers#Invoke(exten,fname) @@ -3834,6 +3893,7 @@ fun! netrw#NetrwBrowseX(fname,remote) let ret= v:shell_error elseif has("win32") || has("win64") +" call Decho("windows") if executable("start") " call Decho('exe sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)) exe 'sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1) @@ -3846,17 +3906,35 @@ fun! netrw#NetrwBrowseX(fname,remote) call inputsave()|call input("Press to continue")|call inputrestore() let ret= v:shell_error - elseif has("unix") && executable("gnome-open") && !s:haskdeinit -" call Decho("exe sil !gnome-open ".shellescape(fname,1)." ".redir) - exe "sil !gnome-open ".shellescape(fname,1).redir + elseif has("win32unix") + let winfname= 'c:\cygwin'.substitute(fname,'/','\\','g') +" call Decho("cygwin: winfname<".shellescape(winfname,1).">") + if executable("start") +" call Decho('exe sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1)) + exe 'sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1) + elseif executable("rundll32") +" call Decho('exe sil !rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1)) + exe 'sil !rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1) + else + call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74) + endif + call inputsave()|call input("Press to continue")|call inputrestore() + let ret= v:shell_error + + elseif has("unix") && executable("xdg-open") && !s:haskdeinit +" call Decho("unix and xdg-open") +" call Decho("exe sil !xdg-open ".shellescape(fname,1)." ".redir) + exe "sil !xdg-open ".shellescape(fname,1).redir let ret= v:shell_error elseif has("unix") && executable("kfmclient") && s:haskdeinit +" call Decho("unix and kfmclient") " call Decho("exe sil !kfmclient exec ".shellescape(fname,1)." ".redir) exe "sil !kfmclient exec ".shellescape(fname,1)." ".redir let ret= v:shell_error elseif has("macunix") && executable("open") +" call Decho("macunix and open") " call Decho("exe sil !open ".shellescape(fname,1)." ".redir) exe "sil !open ".shellescape(fname,1)." ".redir let ret= v:shell_error @@ -3880,7 +3958,7 @@ fun! netrw#NetrwBrowseX(fname,remote) " Feb 12, 2008: had to de-activiate removal of " temporary file because it wasn't getting seen. " if a:remote == 1 && fname != a:fname -" call Decho("deleting temporary file<".fname.">") +"" call Decho("deleting temporary file<".fname.">") " call s:NetrwDelete(fname) " endif @@ -3892,6 +3970,8 @@ fun! netrw#NetrwBrowseX(fname,remote) exe "sil! keepj norm! \" " redraw! endif + call netrw#NetrwRestorePosn(screenposn) + let @@= ykeep " call Dret("NetrwBrowseX") endfun @@ -3900,6 +3980,7 @@ endfun " s:NetrwChgPerm: (implements "gp") change file permission {{{2 fun! s:NetrwChgPerm(islocal,curdir) " call Dfunc("s:NetrwChgPerm(islocal=".a:islocal." curdir<".a:curdir.">)") + let ykeep = @@ call inputsave() let newperm= input("Enter new permission: ") call inputrestore() @@ -3913,6 +3994,7 @@ fun! s:NetrwChgPerm(islocal,curdir) if a:islocal keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) endif + let @@= ykeep " call Dret("s:NetrwChgPerm") endfun @@ -4405,6 +4487,7 @@ endfun " s:NetrwForceChgDir: (gd support) Force treatment as a directory {{{2 fun! s:NetrwForceChgDir(islocal,newdir) " call Dfunc("s:NetrwForceChgDir(islocal=".a:islocal." newdir<".a:newdir.">)") + let ykeep= @@ if a:newdir !~ '/$' " ok, looks like force is needed to get directory-style treatment if a:newdir =~ '@$' @@ -4419,8 +4502,9 @@ fun! s:NetrwForceChgDir(islocal,newdir) " should already be getting treatment as a directory let newdir= a:newdir endif - call s:NetrwBrowseChgDir(a:islocal,newdir) + let newdir= s:NetrwBrowseChgDir(a:islocal,newdir) call s:NetrwBrowse(a:islocal,newdir) + let @@= ykeep " call Dret("s:NetrwForceChgDir") endfun @@ -4446,6 +4530,7 @@ endfun " 2: show hidden files only fun! s:NetrwHide(islocal) " call Dfunc("NetrwHide(islocal=".a:islocal.") g:netrw_hide=".g:netrw_hide) + let ykeep= @@ let svpos= netrw#NetrwSavePosn() if exists("s:netrwmarkfilelist_{bufnr('%')}") @@ -4481,6 +4566,7 @@ fun! s:NetrwHide(islocal) exe "keepj norm! 0" if g:netrw_hide && g:netrw_list_hide == "" keepj call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49) + let @@= ykeep " call Dret("NetrwHide") return endif @@ -4488,6 +4574,7 @@ fun! s:NetrwHide(islocal) keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) keepj call netrw#NetrwRestorePosn(svpos) + let @@= ykeep " call Dret("NetrwHide") endfun @@ -4495,6 +4582,7 @@ endfun " s:NetrwHidden: invoked by "gh" {{{2 fun! s:NetrwHidden(islocal) " call Dfunc("s:NetrwHidden()") + let ykeep= @@ " save current position let svpos= netrw#NetrwSavePosn() @@ -4510,6 +4598,7 @@ fun! s:NetrwHidden(islocal) " refresh screen and return to saved position keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) keepj call netrw#NetrwRestorePosn(svpos) + let @@= ykeep " call Dret("s:NetrwHidden") endfun @@ -4553,6 +4642,7 @@ endfun fun! s:NetrwLeftmouse(islocal) " call Dfunc("s:NetrwLeftmouse(islocal=".a:islocal.")") + let ykeep= @@ " check if the status bar was clicked on instead of a file/directory name while getchar(0) != 0 "clear the input stream @@ -4566,10 +4656,12 @@ fun! s:NetrwLeftmouse(islocal) " call Decho("v:mouse_col =".v:mouse_col." col=".col(".")." wincol =".wincol()." winwidth =".winwidth(0)) if mouse_lnum >= wlastline + 1 || v:mouse_win != winnr() " appears to be a status bar leftmouse click + let @@= ykeep " call Dret("s:NetrwLeftmouse : detected a status bar leftmouse click") return endif if v:mouse_col != col('.') + let @@= ykeep " call Dret("s:NetrwLeftmouse : detected a vertical separator bar leftmouse click") return endif @@ -4583,6 +4675,7 @@ fun! s:NetrwLeftmouse(islocal) keepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) endif endif + let @@= ykeep " call Dret("s:NetrwLeftmouse") endfun @@ -4591,6 +4684,7 @@ endfun " separated patterns given in g:netrw_list_hide fun! s:NetrwListHide() " call Dfunc("NetrwListHide() g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">") + let ykeep= @@ " find a character not in the "hide" string to use as a separator for :g and :v commands " How-it-works: take the hiding command, convert it into a range. Duplicate @@ -4612,21 +4706,22 @@ fun! s:NetrwListHide() " Prune the list by hiding any files which match if g:netrw_hide == 1 " call Decho("hiding<".hide."> listhide<".listhide.">") - exe 'sil keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d' + exe 'sil! keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d' elseif g:netrw_hide == 2 " call Decho("showing<".hide."> listhide<".listhide.">") - exe 'sil keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @' + exe 'sil! keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @' endif endwhile if g:netrw_hide == 2 - exe 'sil keepj '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d' - exe 'sil keepj '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e' + exe 'sil! keepj '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d' + exe 'sil! keepj '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e' endif " remove any blank lines that have somehow remained. " This seems to happen under Windows. exe 'sil! keepj 1,$g@^\s*$@d' + let @@= ykeep " call Dret("NetrwListHide") endfun @@ -4635,6 +4730,7 @@ endfun fun! s:NetrwHideEdit(islocal) " call Dfunc("NetrwHideEdit(islocal=".a:islocal.")") + let ykeep= @@ " save current cursor position let svpos= netrw#NetrwSavePosn() @@ -4650,6 +4746,7 @@ fun! s:NetrwHideEdit(islocal) " restore cursor position call netrw#NetrwRestorePosn(svpos) + let @@= ykeep " call Dret("NetrwHideEdit") endfun @@ -4659,6 +4756,7 @@ endfun fun! s:NetSortSequence(islocal) " call Dfunc("NetSortSequence(islocal=".a:islocal.")") + let ykeep= @@ let svpos= netrw#NetrwSavePosn() call inputsave() let newsortseq= input("Edit Sorting Sequence: ",g:netrw_sort_sequence) @@ -4668,6 +4766,7 @@ fun! s:NetSortSequence(islocal) let g:netrw_sort_sequence= newsortseq keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) keepj call netrw#NetrwRestorePosn(svpos) + let @@= ykeep " call Dret("NetSortSequence") endfun @@ -4677,6 +4776,7 @@ endfun fun! s:NetrwMakeDir(usrhost) " call Dfunc("NetrwMakeDir(usrhost<".a:usrhost.">)") + let ykeep= @@ " get name of new directory from user. A bare will skip. " if its currently a directory, also request will be skipped, but with " a message. @@ -4686,6 +4786,7 @@ fun! s:NetrwMakeDir(usrhost) " call Decho("newdirname<".newdirname.">") if newdirname == "" + let @@= ykeep " call Dret("NetrwMakeDir : user aborted with bare ") return endif @@ -4701,6 +4802,7 @@ fun! s:NetrwMakeDir(usrhost) if !exists("g:netrw_quiet") keepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24) endif + let @@= ykeep " call Dret("NetrwMakeDir : directory<".newdirname."> exists previously") return endif @@ -4708,6 +4810,7 @@ fun! s:NetrwMakeDir(usrhost) if !exists("g:netrw_quiet") keepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a file!",25) endif + let @@= ykeep " call Dret("NetrwMakeDir : file<".newdirname."> exists previously") return endif @@ -4722,6 +4825,12 @@ fun! s:NetrwMakeDir(usrhost) " call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">") " call Decho("exe sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1)) exe "sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1) + if v:shell_error != 0 + let @@= ykeep + call netrw#ErrorMsg(s:ERROR,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80) +" call Dret("NetrwMakeDir : failed: sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1)) + return + endif if !g:netrw_keepdir exe 'keepj lcd '.fnameescape(netrw_origdir) " call Decho("netrw_keepdir=".g:netrw_keepdir.": keepjumps lcd ".fnameescape(netrw_origdir)." getcwd<".getcwd().">") @@ -4768,6 +4877,7 @@ fun! s:NetrwMakeDir(usrhost) keepj call netrw#NetrwRestorePosn(svpos) endif + let @@= ykeep " call Dret("NetrwMakeDir") endfun @@ -4790,9 +4900,10 @@ endfun " b:netrw_islocal fun! s:NetrwMarkFile(islocal,fname) " call Dfunc("s:NetrwMarkFile(islocal=".a:islocal." fname<".a:fname.">)") + let ykeep = @@ let curbufnr= bufnr("%") let curdir = b:netrw_curdir - let trailer = '[@=|\/\*]\=\>' + let trailer = '[@=|\/\*]\=\ze\%( \|\t\|$\)' if exists("s:netrwmarkfilelist_{curbufnr}") " markfile list pre-exists @@ -4881,6 +4992,7 @@ fun! s:NetrwMarkFile(islocal,fname) " call Decho("2match none") 2match none endif + let @@= ykeep " call Dret("s:NetrwMarkFile : s:netrwmarkfilelist_".curbufnr."<".(exists("s:netrwmarkfilelist_{curbufnr}")? string(s:netrwmarkfilelist_{curbufnr}) : " doesn't exist").">") endfun @@ -4972,9 +5084,19 @@ fun! s:NetrwMarkFileCopy(islocal) if a:islocal && s:netrwmftgt_islocal " Copy marked files, local directory to local directory " call Decho("copy from local to local") + if !executable(g:netrw_localcopycmd) && g:netrw_localcopycmd !~ '^cmd ' + call netrw#ErrorMsg(s:ERROR,"g:netrw_localcopycmd<".g:netrw_localcopycmd."> not executable on your system, aborting",91) +" call Dfunc("s:NetrwMarkFileMove : g:netrw_localcopycmd<".g:netrw_localcopycmd."> n/a!") + return + endif let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"shellescape(b:netrw_curdir.\"/\".v:val)")) " call Decho("system(".g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt).")") call system(netrw#WinPath(g:netrw_localcopycmd)." ".args." ".shellescape(s:netrwmftgt)) + if v:shell_error != 0 + call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localcopycmd<".g:netrw_localcopycmd."> to something that works",80) +" call Dret("s:NetrwMarkFileCopy 0 : failed: system(".g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt)) + return 0 + endif elseif a:islocal && !s:netrwmftgt_islocal " Copy marked files, local directory to remote directory @@ -4996,6 +5118,11 @@ fun! s:NetrwMarkFileCopy(islocal) call mkdir(tmpdir) else exe "sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1) + if v:shell_error != 0 + call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80) +" call Dret("s:NetrwMarkFileCopy : failed: sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1) ) + return + endif endif if isdirectory(tmpdir) exe "keepj lcd ".fnameescape(tmpdir) @@ -5008,6 +5135,11 @@ fun! s:NetrwMarkFileCopy(islocal) endfor exe "keepj lcd ".fnameescape(curdir) exe "sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1) + if v:shell_error != 0 + call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localrmdir<".g:netrw_localrmdir."> to something that works",80) +" call Dret("s:NetrwMarkFileCopy : failed: sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1) ) + return + endif else exe "keepj lcd ".fnameescape(curdir) endif @@ -5348,9 +5480,9 @@ fun! s:NetrwMarkFileGrep(islocal) try exe "keepj noautocmd vimgrep".pat." ".netrwmarkfilelist catch /^Vim\%((\a\+)\)\=:E480/ - keepj call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pattern.">",76) -" call Dret("s:NetrwMarkFileGrep : unable to find pattern<".pattern.">") - return + keepj call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pattern.">",76) +" call Dret("s:NetrwMarkFileGrep : unable to find pattern<".pattern.">") + return endtry 2match none @@ -5388,18 +5520,19 @@ fun! s:NetrwMarkFileMove(islocal) " move: local -> local " call Decho("move from local to local") " call Decho("(s:NetrwMarkFileMove) local to local move") - if executable(g:netrw_localmovecmd) - for fname in s:netrwmarkfilelist_{bufnr("%")} -" call Decho("system(".g:netrw_localmovecmd." ".shellescape(fname)." ".shellescape(s:netrwmftgt).")") - let ret= system(g:netrw_localmovecmd." ".shellescape(fname)." ".shellescape(s:netrwmftgt)) - if v:shell_error < 0 - call netrw#ErrorMsg(s:ERROR,"command<".g:netrw_localmovecmd."> failed, aborting",54) - break - endif - endfor - else - keepj call netrw#ErrorMsg(s:ERROR,"command<".g:netrw_localmovecmd."> is not executable!",57) + if !executable(g:netrw_localmovecmd) && g:netrw_localmovecmd !~ '^cmd ' + call netrw#ErrorMsg(s:ERROR,"g:netrw_localmovecmd<".g:netrw_localmovecmd."> not executable on your system, aborting",90) +" call Dfunc("s:NetrwMarkFileMove : g:netrw_localmovecmd<".g:netrw_localmovecmd."> n/a!") + return endif + for fname in s:netrwmarkfilelist_{bufnr("%")} +" call Decho("system(".g:netrw_localmovecmd." ".shellescape(fname)." ".shellescape(s:netrwmftgt).")") + let ret= system(g:netrw_localmovecmd." ".shellescape(fname)." ".shellescape(s:netrwmftgt)) + if v:shell_error < 0 + call netrw#ErrorMsg(s:ERROR,"command<".g:netrw_localmovecmd."> failed, aborting",54) + break + endif + endfor elseif a:islocal && !s:netrwmftgt_islocal " move: local -> remote @@ -5703,6 +5836,7 @@ endfun " s:NetrwOpenFile: query user for a filename and open it {{{2 fun! s:NetrwOpenFile(islocal) " call Dfunc("s:NetrwOpenFile(islocal=".a:islocal.")") + let ykeep= @@ call inputsave() let fname= input("Enter filename: ") call inputrestore() @@ -5726,6 +5860,7 @@ fun! s:NetrwOpenFile(islocal) else exe "e ".fnameescape(fname) endif + let @@= ykeep " call Dret("s:NetrwOpenFile") endfun @@ -5899,6 +6034,7 @@ endfun fun! s:NetrwObtain(islocal) " call Dfunc("NetrwObtain(islocal=".a:islocal.")") + let ykeep= @@ if exists("s:netrwmarkfilelist_{bufnr('%')}") let islocal= s:netrwmarkfilelist_{bufnr('%')}[1] !~ '^\a\+://' call netrw#NetrwObtain(islocal,s:netrwmarkfilelist_{bufnr('%')}) @@ -5906,6 +6042,7 @@ fun! s:NetrwObtain(islocal) else call netrw#NetrwObtain(a:islocal,expand("")) endif + let @@= ykeep " call Dret("NetrwObtain") endfun @@ -5949,6 +6086,10 @@ fun! netrw#NetrwObtain(islocal,fname,...) for fname in fnamelist " call Decho("system(".g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath).")") call system(g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath)) + if v:shell_error != 0 + call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localcopycmd<".g:netrw_localcopycmd."> to something that works",80) +" call Dret("s:NetrwObtain 0 : failed: ".g:netrw_localcopycmd." ".shellescape(fname)." ".shellescape(topath)) + return endfor else " transfer files with one command @@ -5956,6 +6097,10 @@ fun! netrw#NetrwObtain(islocal,fname,...) let filelist= join(map(deepcopy(fnamelist),"shellescape(v:val)")) " call Decho("system(".g:netrw_localcopycmd." ".filelist." ".shellescape(topath).")") call system(g:netrw_localcopycmd." ".filelist." ".shellescape(topath)) + if v:shell_error != 0 + call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localcopycmd<".g:netrw_localcopycmd."> to something that works",80) +" call Dret("s:NetrwObtain 0 : failed: ".g:netrw_localcopycmd." ".filelist." ".shellescape(topath)) + return endif elseif !exists("b:netrw_curdir") call netrw#ErrorMsg(s:ERROR,"local browsing directory doesn't exist!",36) @@ -6129,6 +6274,7 @@ endfun fun! s:NetrwPrevWinOpen(islocal) " call Dfunc("NetrwPrevWinOpen(islocal=".a:islocal.")") + let ykeep= @@ " grab a copy of the b:netrw_curdir to pass it along to newly split windows let curdir = b:netrw_curdir @@ -6187,6 +6333,7 @@ fun! s:NetrwPrevWinOpen(islocal) else wincmd p endif + let @@= ykeep " call Dret("NetrwPrevWinOpen ".choice." : unable to write <".bufname.">") return choice endif @@ -6206,6 +6353,7 @@ fun! s:NetrwPrevWinOpen(islocal) else wincmd p endif + let @@= ykeep " call Dret("NetrwPrevWinOpen ".choice." : cancelled") return choice endif @@ -6222,6 +6370,7 @@ fun! s:NetrwPrevWinOpen(islocal) call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,curword)) endif endif + let @@= ykeep " call Dret("NetrwPrevWinOpen ".choice) return choice endfun @@ -6415,6 +6564,7 @@ endfun " s:NetrwPreview: {{{2 fun! s:NetrwPreview(path) range " call Dfunc("NetrwPreview(path<".a:path.">)") + let ykeep= @@ keepj call s:NetrwOptionSave("s:") keepj call s:NetrwSafeOptions() if has("quickfix") @@ -6435,6 +6585,7 @@ fun! s:NetrwPreview(path) range keepj call netrw#ErrorMsg(s:WARNING,"sorry, to preview your vim needs the quickfix feature compiled in",39) endif keepj call s:NetrwOptionRestore("s:") + let @@= ykeep " call Dret("NetrwPreview") endfun @@ -6443,18 +6594,20 @@ endfun fun! s:NetrwRefresh(islocal,dirname) " call Dfunc("NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction) " at the current time (Mar 19, 2007) all calls to NetrwRefresh() call NetrwBrowseChgDir() first. - " NetrwBrowseChgDir() may clear the display; hence a NetrwSavePosn() may not work if its placed here. - " Also, NetrwBrowseChgDir() now does a NetrwSavePosn() itself. + " (defunct) NetrwBrowseChgDir() may clear the display; hence a NetrwSavePosn() may not work if its placed here. + " (defunct) Also, NetrwBrowseChgDir() now does a NetrwSavePosn() itself. setlocal ma noro " call Decho("setlocal ma noro") " call Decho("clear buffer<".expand("%")."> with :%d") + let ykeep = @@ + let screenposn = netrw#NetrwSavePosn() sil! keepj %d if a:islocal keepj call netrw#LocalBrowseCheck(a:dirname) else keepj call s:NetrwBrowse(a:islocal,a:dirname) endif - keepj call netrw#NetrwRestorePosn() + keepj call netrw#NetrwRestorePosn(screenposn) " restore file marks if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != "" @@ -6465,7 +6618,8 @@ fun! s:NetrwRefresh(islocal,dirname) 2match none endif -" redraw! +" restore + let @@= ykeep " call Dret("NetrwRefresh") endfun @@ -6474,7 +6628,7 @@ endfun " Called by NetrwMarkFileCopy() " Interfaces to s:NetrwRefresh() and s:LocalBrowseShellCmdRefresh() fun! s:NetrwRefreshDir(islocal,dirname) -" call Dfunc("s:NetrwRefreshDir(islocal=".a:islocal." dirname<".a:dirname.">) fastbrowse=".g:netrw_fastbrowse) +" call Dfunc("s:NetrwRefreshDir(islocal=".a:islocal." dirname<".a:dirname.">) g:netrw_fastbrowse=".g:netrw_fastbrowse) if g:netrw_fastbrowse == 0 " slowest mode (keep buffers refreshed, local or remote) " call Decho("slowest mode: keep buffers refreshed, local or remote") @@ -6510,6 +6664,7 @@ endfun " front. An "*" pattern handles the default priority. fun! s:NetrwSetSort() " call Dfunc("SetSort() bannercnt=".w:netrw_bannercnt) + let ykeep= @@ if w:netrw_liststyle == s:LONGLIST let seqlist = substitute(g:netrw_sort_sequence,'\$','\\%(\t\\|\$\\)','ge') else @@ -6570,6 +6725,7 @@ fun! s:NetrwSetSort() " be just digits themselves. exe 'sil keepj '.w:netrw_bannercnt.',$s/^\(\d\{3}'.g:netrw_sepchr.'\)\%(\d\{3}'.g:netrw_sepchr.'\)\+\ze./\1/e' keepj call histdel("/",-1) + let @@= ykeep " call Dret("SetSort") endfun @@ -6600,6 +6756,7 @@ endfun fun! s:NetrwSplit(mode) " call Dfunc("s:NetrwSplit(mode=".a:mode.") alto=".g:netrw_alto." altv=".g:netrw_altv) + let ykeep= @@ call s:SaveWinVars() if a:mode == 0 @@ -6668,6 +6825,7 @@ fun! s:NetrwSplit(mode) keepj call netrw#ErrorMsg(s:ERROR,"(NetrwSplit) unsupported mode=".a:mode,45) endif + let @@= ykeep " call Dret("s:NetrwSplit") endfun @@ -7126,6 +7284,10 @@ fun! s:PerformListing(islocal) " set display to netrw display settings " call Decho("set display to netrw display settings (noma nomod etc)") exe "setl ".g:netrw_bufsettings + if g:netrw_liststyle == s:LONGLIST +" call Decho("(LocalListing) exe setl ts=".(g:netrw_maxfilenamelen+1)) + exe "setl ts=".(g:netrw_maxfilenamelen+1) + endif if exists("s:treecurpos") keepj call netrw#NetrwRestorePosn(s:treecurpos) @@ -7250,7 +7412,8 @@ fun! s:NetrwRemoteListing() " if there's no ../ listed, then put ./ and ../ in let line1= line(".") exe "sil! keepj ".w:netrw_bannercnt - let line2= search('^\.\.\/\%(\s\|$\)','cnW') + let line2= search('\.\.\/\%(\s\|$\)','cnW') +" call Decho("search(".'\.\.\/\%(\s\|$\)'."','cnW')=".line2." w:netrw_bannercnt=".w:netrw_bannercnt) if line2 == 0 " call Decho("netrw is putting ./ and ../ into listing") sil! keepj put='../' @@ -7720,6 +7883,55 @@ endfun " Local Directory Browsing Support: {{{1 " ========================================== +" --------------------------------------------------------------------- +" netrw#FileUrlRead: handles reading file://* files {{{2 +" Should accept: file://localhost/etc/fstab +" file:///etc/fstab +" file:///c:/WINDOWS/clock.avi +" file:///c|/WINDOWS/clock.avi +" file://localhost/c:/WINDOWS/clock.avi +" file://localhost/c|/WINDOWS/clock.avi +" file://c:/foo.txt +" file:///c:/foo.txt +" and %XX (where X is [0-9a-fA-F] is converted into a character with the given hexadecimal value +fun! netrw#FileUrlRead(fname) +" call Dfunc("netrw#FileUrlRead(fname<".a:fname.">)") + let fname = a:fname + if fname =~ '^file://localhost/' +" call Decho('converting file://localhost/ -to- file:///') + let fname= substitute(fname,'^file://localhost/','file:///','') +" call Decho("fname<".fname.">") + endif + if (has("win32") || has("win95") || has("win64") || has("win16")) + if fname =~ '^file:///\=\a[|:]/' +" call Decho('converting file:///\a|/ -to- file://\a:/') + let fname = substitute(fname,'^file:///\=\(\a\)[|:]/','file://\1:/','') +" call Decho("fname<".fname.">") + endif + endif + let fname2396 = netrw#RFC2396(fname) + let fname2396e= fnameescape(fname2396) + let plainfname= substitute(fname2396,'file://\(.*\)','\1',"") + if (has("win32") || has("win95") || has("win64") || has("win16")) +" call Decho("windows exception for plainfname") + if plainfname =~ '^/\+\a:' +" call Decho('removing leading "/"s') + let plainfname= substitute(plainfname,'^/\+\(\a:\)','\1','') + endif + endif +" call Decho("fname2396<".fname2396.">") +" call Decho("plainfname<".plainfname.">") + exe "sil doau BufReadPre ".fname2396e + exe 'keepj r '.plainfname + exe 'file! '.plainfname + keepj 1d +" call Decho("(FileUrlRead) setl nomod") + setl nomod +" call Decho("(FileUrlRead) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") +" call Dret("netrw#FileUrlRead") + exe "sil doau BufReadPost ".fname2396e +endfun + " --------------------------------------------------------------------- " netrw#LocalBrowseCheck: {{{2 fun! netrw#LocalBrowseCheck(dirname) @@ -7732,17 +7944,36 @@ fun! netrw#LocalBrowseCheck(dirname) " refreshes (and would do so in the middle of NetrwSaveOptions(), too) " call Decho("netrw#LocalBrowseCheck: isdir<".a:dirname.">=".isdirectory(a:dirname).((exists("s:treeforceredraw")? " treeforceredraw" : ""))) " call Dredir("LocalBrowseCheck","ls!")|redraw!|sleep 3 + let ykeep= @@ if isdirectory(a:dirname) -" call Decho(" ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")) - if &ft != "netrw" || (exists("b:netrw_curdir") && b:netrw_curdir != a:dirname) +" call Decho(" ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")." ft<".&ft."> g:netrw_fastbrowse=".g:netrw_fastbrowse) + let svposn= netrw#NetrwSavePosn() + if &ft != "netrw" || (exists("b:netrw_curdir") && b:netrw_curdir != a:dirname) || g:netrw_fastbrowse <= 1 sil! keepj call s:NetrwBrowse(1,a:dirname) + call netrw#NetrwRestorePosn(svposn) elseif &ft == "netrw" && line("$") == 1 sil! keepj call s:NetrwBrowse(1,a:dirname) + call netrw#NetrwRestorePosn(svposn) elseif exists("s:treeforceredraw") unlet s:treeforceredraw sil! keepj call s:NetrwBrowse(1,a:dirname) + call netrw#NetrwRestorePosn(svposn) endif endif + " following code wipes out currently unused netrw buffers + " IF g:netrw_fastbrowse is zero (ie. slow browsing selected) + " AND IF the listing style is not a tree listing + if exists("g:netrw_fastbrowse") && g:netrw_fastbrowse == 0 && g:netrw_liststyle != s:TREELIST + let ibuf = 1 + let buflast = bufnr("$") + while ibuf <= buflast + if bufwinnr(ibuf) == -1 && isdirectory(bufname(ibuf)) + exe "sil! ".ibuf."bw!" + endif + let ibuf= ibuf + 1 + endwhile + endif + let @@= ykeep " not a directory, ignore it endfun @@ -7759,12 +7990,12 @@ fun! s:LocalListing() " get the list of files contained in the current directory let dirname = b:netrw_curdir let dirnamelen = s:Strlen(b:netrw_curdir) - let filelist = glob(s:ComposePath(fnameescape(dirname),"*")) + let filelist = glob(s:ComposePath(dirname,"*")) " call Decho("(LocalListing) glob(dirname<".dirname."/*>)=".filelist) if filelist != "" let filelist= filelist."\n" endif - let filelist= filelist.glob(s:ComposePath(fnameescape(dirname),".*")) + let filelist= filelist.glob(s:ComposePath(dirname,".*")) " call Decho("(LocalListing) glob(dirname<".dirname."/.*>)=".filelist) " Coding choice: either elide ./ if present @@ -7806,6 +8037,11 @@ fun! s:LocalListing() " call Decho("(LocalListing) (before while) dirnamelen<".dirnamelen.">") " call Decho("(LocalListing) (before while) filelist<".filelist.">") + + if get(g:, 'netrw_dynamic_maxfilenamelen', 0) + let g:netrw_maxfilenamelen = max(map(split(filelist, '\n'), 'len(fnamemodify(v:val, ":t"))')) + 1 + endif + while filelist != "" if filelist =~ '\n' let filename = substitute(filelist,'\n.*$','','e') @@ -7908,8 +8144,8 @@ fun! s:LocalListing() sil! keepj g/^$/d sil! keepj %s/\r$//e call histdel("/",-1) - exe "setl ts=".g:netrw_maxfilenamelen -" call Decho("(LocalListing) setl ts=".g:netrw_maxfilenamelen) +" call Decho("(LocalListing) exe setl ts=".(g:netrw_maxfilenamelen+1)) + exe "setl ts=".(g:netrw_maxfilenamelen+1) " call Dret("s:LocalListing") endfun @@ -7940,6 +8176,7 @@ fun! s:LocalBrowseShellCmdRefresh() endif let itab = 1 let buftablist = [] + let ykeep = @@ while itab <= tabpagenr("$") let buftablist = buftablist + tabpagebuflist() let itab = itab + 1 @@ -7970,10 +8207,175 @@ fun! s:LocalBrowseShellCmdRefresh() let ibl= ibl + 1 endfor exe curwin."wincmd w" + let @@= ykeep " call Dret("LocalBrowseShellCmdRefresh") endfun +" --------------------------------------------------------------------- +" s:LocalFastBrowser: handles setting up/taking down fast browsing for the local browser {{{2 +" +" g:netrw_ Directory Is +" fastbrowse Local Remote +" slow 0 D D D=Deleting a buffer implies it will not be re-used (slow) +" med 1 D H H=Hiding a buffer implies it may be re-used (fast) +" fast 2 H H +" +" Deleting a buffer means that it will be re-loaded when examined, hence "slow". +" Hiding a buffer means that it will be re-used when examined, hence "fast". +" (re-using a buffer may not be as accurate) +fun! s:LocalFastBrowser() +" call Dfunc("LocalFastBrowser() g:netrw_fastbrowse=".g:netrw_fastbrowse." s:netrw_browser_shellcmd ".(exists("s:netrw_browser_shellcmd")? "exists" : "does not exist")) + + " initialize browselist, a list of buffer numbers that the local browser has used + if !exists("s:netrw_browselist") +" call Decho("initialize s:netrw_browselist") + let s:netrw_browselist= [] + endif + + " append current buffer to fastbrowse list + if empty(s:netrw_browselist) || bufnr("%") > s:netrw_browselist[-1] +" call Decho("appendng current buffer to browselist") + call add(s:netrw_browselist,bufnr("%")) +" call Decho("browselist=".string(s:netrw_browselist)) + endif + + " enable autocmd events to handle refreshing/removing local browser buffers + " If local browse buffer is currently showing: refresh it + " If local browse buffer is currently hidden : wipe it + " g:netrw_fastbrowse=0 : slow speed, never re-use directory listing + " =1 : medium speed, re-use directory listing for remote only + " =2 : fast speed, always re-use directory listing when possible + if !exists("s:netrw_browser_shellcmd") && g:netrw_fastbrowse <= 1 +" call Decho("setting up local-browser shell command refresh") + let s:netrw_browser_shellcmd= 1 + augroup AuNetrwShellCmd + au! + if (has("win32") || has("win95") || has("win64") || has("win16")) +" call Decho("autocmd: ShellCmdPost * call s:LocalBrowseShellCmdRefresh()") + au ShellCmdPost * call s:LocalBrowseShellCmdRefresh() + else + au ShellCmdPost,FocusGained * call s:LocalBrowseShellCmdRefresh() +" call Decho("autocmd: ShellCmdPost,FocusGained * call s:LocalBrowseShellCmdRefresh()") + endif + augroup END + endif + + " user must have changed fastbrowse to its fast setting, so remove + " the associated autocmd events + if g:netrw_fastbrowse > 1 && exists("s:netrw_browser_shellcmd") +" call Decho("remove AuNetrwShellCmd autcmd group") + unlet s:netrw_browser_shellcmd + augroup AuNetrwShellCmd + au! + augroup END + augroup! AuNetrwShellCmd + endif + +" call Dret("LocalFastBrowser : browselist<".string(s:netrw_browselist).">") +endfun + +" --------------------------------------------------------------------- +" s:NetrwLocalExecute: uses system() to execute command under cursor ("X" command support) {{{2 +fun! s:NetrwLocalExecute(cmd) +" call Dfunc("s:NetrwLocalExecute(cmd<".a:cmd.">)") + let ykeep= @@ + " sanity check + if !executable(a:cmd) + call netrw#ErrorMsg(s:ERROR,"the file<".a:cmd."> is not executable!",89) + let @@= ykeep +" call Dret("s:NetrwLocalExecute") + return + endif + + let optargs= input(":!".a:cmd,"","file") +" call Decho("optargs<".optargs.">") + let result= system(a:cmd.optargs) +" call Decho(result) + + " strip any ansi escape sequences off + let result = substitute(result,"\e\\[[0-9;]*m","","g") + + " show user the result(s) + echomsg result + let @@= ykeep + +" call Dret("s:NetrwLocalExecute") +endfun + +" --------------------------------------------------------------------- +" s:NetrwLocalRename: rename a remote file or directory {{{2 +fun! s:NetrwLocalRename(path) range +" call Dfunc("NetrwLocalRename(path<".a:path.">)") + + " preparation for removing multiple files/directories + let ykeep = @@ + let ctr = a:firstline + let svpos = netrw#NetrwSavePosn() + + " rename files given by the markfilelist + if exists("s:netrwmarkfilelist_{bufnr('%')}") + for oldname in s:netrwmarkfilelist_{bufnr("%")} +" call Decho("oldname<".oldname.">") + if exists("subfrom") + let newname= substitute(oldname,subfrom,subto,'') +" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">") + else + call inputsave() + let newname= input("Moving ".oldname." to : ",oldname) + call inputrestore() + if newname =~ '^s/' + let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','') + let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','') +" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">") + let newname = substitute(oldname,subfrom,subto,'') + endif + endif + call rename(oldname,newname) + endfor + call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir) + + else + + " attempt to rename files/directories + while ctr <= a:lastline + exe "keepj ".ctr + + " sanity checks + if line(".") < w:netrw_bannercnt + let ctr= ctr + 1 + continue + endif + let curword= s:NetrwGetWord() + if curword == "./" || curword == "../" + let ctr= ctr + 1 + continue + endif + + keepj norm! 0 + let oldname= s:ComposePath(a:path,curword) +" call Decho("oldname<".oldname.">") + + call inputsave() + let newname= input("Moving ".oldname." to : ",substitute(oldname,'/*$','','e')) + call inputrestore() + + call rename(oldname,newname) +" call Decho("renaming <".oldname."> to <".newname.">") + + let ctr= ctr + 1 + endwhile + endif + + " refresh the directory +" call Decho("refresh the directory listing") + keepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) + keepj call netrw#NetrwRestorePosn(svpos) + let @@= ykeep + +" call Dret("NetrwLocalRename") +endfun + " --------------------------------------------------------------------- " s:NetrwLocalRm: {{{2 fun! s:NetrwLocalRm(path) range @@ -7981,6 +8383,7 @@ fun! s:NetrwLocalRm(path) range " call Decho("firstline=".a:firstline." lastline=".a:lastline) " preparation for removing multiple files/directories + let ykeep = @@ let ret = 0 let all = 0 let svpos = netrw#NetrwSavePosn() @@ -8032,6 +8435,7 @@ fun! s:NetrwLocalRm(path) range keepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) keepj call netrw#NetrwRestorePosn(svpos) endif + let @@= ykeep " call Dret("s:NetrwLocalRm") endfun @@ -8121,186 +8525,6 @@ fun! s:NetrwLocalRmFile(path,fname,all) return ok endfun -" --------------------------------------------------------------------- -" s:NetrwLocalRename: rename a remote file or directory {{{2 -fun! s:NetrwLocalRename(path) range -" call Dfunc("NetrwLocalRename(path<".a:path.">)") - - " preparation for removing multiple files/directories - let ctr = a:firstline - let svpos= netrw#NetrwSavePosn() - - " rename files given by the markfilelist - if exists("s:netrwmarkfilelist_{bufnr('%')}") - for oldname in s:netrwmarkfilelist_{bufnr("%")} -" call Decho("oldname<".oldname.">") - if exists("subfrom") - let newname= substitute(oldname,subfrom,subto,'') -" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">") - else - call inputsave() - let newname= input("Moving ".oldname." to : ",oldname) - call inputrestore() - if newname =~ '^s/' - let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','') - let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','') -" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">") - let newname = substitute(oldname,subfrom,subto,'') - endif - endif - call rename(oldname,newname) - endfor - call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir) - - else - - " attempt to rename files/directories - while ctr <= a:lastline - exe "keepj ".ctr - - " sanity checks - if line(".") < w:netrw_bannercnt - let ctr= ctr + 1 - continue - endif - let curword= s:NetrwGetWord() - if curword == "./" || curword == "../" - let ctr= ctr + 1 - continue - endif - - keepj norm! 0 - let oldname= s:ComposePath(a:path,curword) -" call Decho("oldname<".oldname.">") - - call inputsave() - let newname= input("Moving ".oldname." to : ",substitute(oldname,'/*$','','e')) - call inputrestore() - - call rename(oldname,newname) -" call Decho("renaming <".oldname."> to <".newname.">") - - let ctr= ctr + 1 - endwhile - endif - - " refresh the directory -" call Decho("refresh the directory listing") - keepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) - keepj call netrw#NetrwRestorePosn(svpos) - -" call Dret("NetrwLocalRename") -endfun - -" --------------------------------------------------------------------- -" s:LocalFastBrowser: handles setting up/taking down fast browsing for the local browser {{{2 -" -" g:netrw_ Directory Is -" fastbrowse Local Remote -" slow 0 D D D=Deleting a buffer implies it will not be re-used (slow) -" med 1 D H H=Hiding a buffer implies it may be re-used (fast) -" fast 2 H H -" -" Deleting a buffer means that it will be re-loaded when examined, hence "slow". -" Hiding a buffer means that it will be re-used when examined, hence "fast". -" (re-using a buffer may not be as accurate) -fun! s:LocalFastBrowser() -" call Dfunc("LocalFastBrowser() g:netrw_fastbrowse=".g:netrw_fastbrowse) - - " initialize browselist, a list of buffer numbers that the local browser has used - if !exists("s:netrw_browselist") -" call Decho("initialize s:netrw_browselist") - let s:netrw_browselist= [] - endif - - " append current buffer to fastbrowse list - if empty(s:netrw_browselist) || bufnr("%") > s:netrw_browselist[-1] -" call Decho("appendng current buffer to browselist") - call add(s:netrw_browselist,bufnr("%")) -" call Decho("browselist=".string(s:netrw_browselist)) - endif - - " enable autocmd events to handle refreshing/removing local browser buffers - " If local browse buffer is currently showing: refresh it - " If local browse buffer is currently hidden : wipe it - if !exists("s:netrw_browser_shellcmd") && g:netrw_fastbrowse <= 1 -" call Decho("setting up local-browser shell command refresh") - let s:netrw_browser_shellcmd= 1 - augroup AuNetrwShellCmd - au! - if (has("win32") || has("win95") || has("win64") || has("win16")) -" call Decho("autocmd: ShellCmdPost * call s:LocalBrowseShellCmdRefresh()") - au ShellCmdPost * call s:LocalBrowseShellCmdRefresh() - else - au ShellCmdPost,FocusGained * call s:LocalBrowseShellCmdRefresh() -" call Decho("autocmd: ShellCmdPost,FocusGained * call s:LocalBrowseShellCmdRefresh()") - endif - augroup END - endif - - " user must have changed fastbrowse to its fast setting, so remove - " the associated autocmd events - if g:netrw_fastbrowse > 1 && exists("s:netrw_browser_shellcmd") -" call Decho("remove AuNetrwShellCmd autcmd group") - unlet s:netrw_browser_shellcmd - augroup AuNetrwShellCmd - au! - augroup END - augroup! AuNetrwShellCmd - endif - -" call Dret("LocalFastBrowser : browselist<".string(s:netrw_browselist).">") -endfun - -" --------------------------------------------------------------------- -" netrw#FileUrlRead: handles reading file://* files {{{2 -" Should accept: file://localhost/etc/fstab -" file:///etc/fstab -" file:///c:/WINDOWS/clock.avi -" file:///c|/WINDOWS/clock.avi -" file://localhost/c:/WINDOWS/clock.avi -" file://localhost/c|/WINDOWS/clock.avi -" file://c:/foo.txt -" file:///c:/foo.txt -" and %XX (where X is [0-9a-fA-F] is converted into a character with the given hexadecimal value -fun! netrw#FileUrlRead(fname) -" call Dfunc("netrw#FileUrlRead(fname<".a:fname.">)") - let fname = a:fname - if fname =~ '^file://localhost/' -" call Decho('converting file://localhost/ -to- file:///') - let fname= substitute(fname,'^file://localhost/','file:///','') -" call Decho("fname<".fname.">") - endif - if (has("win32") || has("win95") || has("win64") || has("win16")) - if fname =~ '^file:///\=\a[|:]/' -" call Decho('converting file:///\a|/ -to- file://\a:/') - let fname = substitute(fname,'^file:///\=\(\a\)[|:]/','file://\1:/','') -" call Decho("fname<".fname.">") - endif - endif - let fname2396 = netrw#RFC2396(fname) - let fname2396e= fnameescape(fname2396) - let plainfname= substitute(fname2396,'file://\(.*\)','\1',"") - if (has("win32") || has("win95") || has("win64") || has("win16")) -" call Decho("windows exception for plainfname") - if plainfname =~ '^/\+\a:' -" call Decho('removing leading "/"s') - let plainfname= substitute(plainfname,'^/\+\(\a:\)','\1','') - endif - endif -" call Decho("fname2396<".fname2396.">") -" call Decho("plainfname<".plainfname.">") - exe "sil doau BufReadPre ".fname2396e - exe 'keepj r '.plainfname - exe 'file! '.plainfname - keepj 1d -" call Decho("(FileUrlRead) setl nomod") - setl nomod -" call Decho("(FileUrlRead) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") -" call Dret("netrw#FileUrlRead") - exe "sil doau BufReadPost ".fname2396e -endfun - " --------------------------------------------------------------------- " Support Functions: {{{1 @@ -8739,7 +8963,7 @@ endfun " --------------------------------------------------------------------- " s:NetrwInsureWinVars: insure that a netrw buffer has its w: variables in spite of a wincmd v or s {{{2 fun! s:NetrwInsureWinVars() -" call Dfunc("s:NetrwInsureWinVars()") +" call Dfunc("s:NetrwInsureWinVars() win#".winnr()) if !exists("w:netrw_liststyle") let curbuf = bufnr("%") let curwin = winnr() @@ -8753,7 +8977,7 @@ fun! s:NetrwInsureWinVars() endif let iwin= iwin + 1 endwhile - exe curbuf."wincmd w" + exe curwin."wincmd w" if exists("winvars") " call Decho("copying w#".iwin." window variables to w#".curwin) for k in keys(winvars) @@ -8761,7 +8985,7 @@ fun! s:NetrwInsureWinVars() endfor endif endif -" call Dret("s:NetrwInsureWinVars") +" call Dret("s:NetrwInsureWinVars win#".winnr()) endfun " ------------------------------------------------------------------------ @@ -8975,7 +9199,7 @@ fun! s:SetRexDir(islocal,dirname) " call Dfunc("s:SetRexDir(islocal=".a:islocal." dirname<".a:dirname.">)") let w:netrw_rexdir = a:dirname let w:netrw_rexlocal = a:islocal -" call Dret("s:SetRexDir") +" call Dret("s:SetRexDir : win#".winnr()." ".(a:islocal? "local" : "remote")." dir: ".a:dirname) endfun " --------------------------------------------------------------------- diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim index 38f7299569..ef361dc218 100644 --- a/runtime/autoload/netrwSettings.vim +++ b/runtime/autoload/netrwSettings.vim @@ -106,7 +106,7 @@ fun! netrwSettings#NetrwSettings() put = 'let g:netrw_browsex_viewer = (not defined)' endif put = 'let g:netrw_compress = '.g:netrw_compress - put = 'let g:netrw_cursorline = '.g:netrw_cursorline + put = 'let g:netrw_cursor = '.g:netrw_cursor let decompressline= line("$") put ='let g:netrw_decompress...' put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax @@ -125,9 +125,9 @@ fun! netrwSettings#NetrwSettings() put = 'let g:netrw_list_hide = '.g:netrw_list_hide put = 'let g:netrw_liststyle = '.g:netrw_liststyle put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd - put = 'let g:netrw_local_mkdir = '.g:netrw_local_mkdir + put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd - put = 'let g:netrw_local_rmdir = '.g:netrw_local_rmdir + put = 'let g:netrw_localrmdir = '.g:netrw_localrmdir put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen put = 'let g:netrw_menu = '.g:netrw_menu put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd diff --git a/runtime/autoload/sqlcomplete.vim b/runtime/autoload/sqlcomplete.vim index 360f7e6cec..f830965c41 100644 --- a/runtime/autoload/sqlcomplete.vim +++ b/runtime/autoload/sqlcomplete.vim @@ -1,23 +1,43 @@ " Vim OMNI completion script for SQL " Language: SQL " Maintainer: David Fishburn -" Version: 12.0 -" Last Change: 2012 Feb 08 +" Version: 14.0 +" Last Change: 2012 Dec 04 +" Homepage: http://www.vim.org/scripts/script.php?script_id=1572 " Usage: For detailed help " ":help sql.txt" " or ":help ft-sql-omni" " or read $VIMRUNTIME/doc/sql.txt " History -" Version 12.0 +" +" Version 14.0 (Dec 2012) +" - BF: Added check for cpo +" +" Version 13.0 (Dec 2012) +" - NF: When completing column lists or drilling into a table +" and g:omni_sql_include_owner is enabled, the +" only the table name would be replaced with the column +" list instead of the table name and owner (if specified). +" - NF: When completing column lists using table aliases +" and g:omni_sql_include_owner is enabled, account +" for the owner name when looking up the table +" list instead of the table name and owner (if specified). +" - BF: When completing column lists or drilling into a table +" and g:omni_sql_include_owner is enabled, the +" column list could often not be found for the table. +" - BF: When OMNI popped up, possibly the wrong word +" would be replaced for column and column list options. +" +" Version 12.0 (Feb 2012) " - Partial column name completion did not work when a table " name or table alias was provided (Jonas Enberg). " - Improved the handling of column completion. First we match any " columns from a previous completion. If not matches are found, we -" consider the partial name to be a table or table alias for the +" consider the partial name to be a table or table alias for the " query and attempt to match on it. " -" Version 11.0 +" Version 11.0 (Jan 2012) " Added g:omni_sql_default_compl_type variable " - You can specify which type of completion to default to " when pressing . The entire list of available @@ -40,7 +60,7 @@ " - Prepends error message with SQLComplete so you know who issued " the error. " -" Version 9.0 +" Version 9.0 (May 2010) " This change removes some of the support for tables with spaces in their " names in order to simplify the regexes used to pull out query table " aliases for more robust table name and column name code completion. @@ -51,10 +71,10 @@ " Incorrectly re-executed the g:ftplugin_sql_omni_key_right and g:ftplugin_sql_omni_key_left " when drilling in and out of a column list for a table. " -" Version 7.0 +" Version 7.0 (Jan 2010) " Better handling of object names " -" Version 6.0 +" Version 6.0 (Apr 2008) " Supports object names with spaces "my table name" " " Set completion with CTRL-X CTRL-O to autoloaded function. @@ -71,7 +91,9 @@ endif if exists('g:loaded_sql_completion') finish endif -let g:loaded_sql_completion = 120 +let g:loaded_sql_completion = 130 +let s:keepcpo= &cpo +set cpo&vim " Maintains filename of dictionary let s:sql_file_table = "" @@ -137,6 +159,13 @@ if !exists('g:omni_sql_default_compl_type') endif " This function is used for the 'omnifunc' option. +" It is called twice by omni and it is responsible +" for returning the completion list of items. +" But it must also determine context of what to complete +" and what to "replace" with the completion. +" The a:base, is replaced directly with what the user +" chooses from the choices. +" The s:prepend provides context for the completion. function! sqlcomplete#Complete(findstart, base) " Default to table name completion @@ -145,6 +174,7 @@ function! sqlcomplete#Complete(findstart, base) if exists('b:sql_compl_type') let compl_type = b:sql_compl_type endif + let begindot = 0 " First pass through this function determines how much of the line should " be replaced by whatever is chosen from the completion list @@ -153,7 +183,6 @@ function! sqlcomplete#Complete(findstart, base) let line = getline('.') let start = col('.') - 1 let lastword = -1 - let begindot = 0 " Check if the first character is a ".", for column completion if line[start - 1] == '.' let begindot = 1 @@ -179,7 +208,10 @@ function! sqlcomplete#Complete(findstart, base) " If lastword has already been set for column completion " break from the loop, since we do not also want to pickup " a table name if it was also supplied. + " Unless g:omni_sql_include_owner == 1, then we can + " include the ownername. if lastword != -1 && compl_type == 'column' + \ && g:omni_sql_include_owner == 0 break endif " If column completion was specified stop at the "." if @@ -191,7 +223,7 @@ function! sqlcomplete#Complete(findstart, base) " If omni_sql_include_owner = 0, do not include the table " name as part of the substitution, so break here if lastword == -1 && - \ compl_type =~ 'table\|view\|procedure\column_csv' && + \ compl_type =~ '\<\(table\|view\|procedure\|column\|column_csv\)\>' && \ g:omni_sql_include_owner == 0 let lastword = start break @@ -288,6 +320,12 @@ function! sqlcomplete#Complete(findstart, base) let table = matchstr( base, '^\(.*\.\)\?\zs.*\ze\..*' ) let column = matchstr( base, '.*\.\zs.*' ) + if g:omni_sql_include_owner == 1 && owner == '' && table != '' && column != '' + let owner = table + let table = column + let column = '' + endif + " It is pretty well impossible to determine if the user " has entered: " owner.table @@ -370,7 +408,16 @@ function! sqlcomplete#Complete(findstart, base) let list_type = 'csv' endif - let compl_list = s:SQLCGetColumns(table, list_type) + " If we are including the OWNER for the objects, then for + " table completion, if we have it, it should be included + " as there can be the same table names in a database yet + " with different owner names. + if g:omni_sql_include_owner == 1 && owner != '' && table != '' + let compl_list = s:SQLCGetColumns(owner.'.'.table, list_type) + else + let compl_list = s:SQLCGetColumns(table, list_type) + endif + if column != '' " If no column prefix has been provided and the table " name was provided, append it to each of the items @@ -393,11 +440,14 @@ function! sqlcomplete#Complete(findstart, base) endif elseif compl_type == 'resetCache' " Reset all cached items - let s:tbl_name = [] - let s:tbl_alias = [] - let s:tbl_cols = [] - let s:syn_list = [] - let s:syn_value = [] + let s:tbl_name = [] + let s:tbl_alias = [] + let s:tbl_cols = [] + let s:syn_list = [] + let s:syn_value = [] + let s:sql_file_table = "" + let s:sql_file_procedure = "" + let s:sql_file_view = "" let msg = "All SQL cached items have been removed." call s:SQLCWarningMsg(msg) @@ -423,12 +473,27 @@ function! sqlcomplete#Complete(findstart, base) " let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\(\\.\\)\\?'.base.'\\)"' " let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\([^.]*\\)\\?'.base.'\\)"' let compl_list = filter(deepcopy(compl_list), expr) + + if empty(compl_list) && compl_type == 'table' && base =~ '\.$' + " It is possible we could be looking for column name completion + " and the user simply hit C-X C-O to lets try it as well + " since we had no hits with the tables. + " If the base ends with a . it is hard to know if we are + " completing table names or column names. + let list_type = '' + + let compl_list = s:SQLCGetColumns(base, list_type) + endif endif if exists('b:sql_compl_savefunc') && b:sql_compl_savefunc != "" let &omnifunc = b:sql_compl_savefunc endif + if empty(compl_list) + call s:SQLCWarningMsg( 'Could not find type['.compl_type.'] using prepend[.'.s:prepended.'] base['.a:base.']' ) + endif + return compl_list endfunc @@ -664,8 +729,26 @@ function! s:SQLCGetObjectOwner(object) endfunction function! s:SQLCGetColumns(table_name, list_type) + if a:table_name =~ '\.' + " Check if the owner/creator has been specified + let owner = matchstr( a:table_name, '^\zs.*\ze\..*\..*' ) + let table = matchstr( a:table_name, '^\(.*\.\)\?\zs.*\ze\..*' ) + let column = matchstr( a:table_name, '.*\.\zs.*' ) + + if g:omni_sql_include_owner == 1 && owner == '' && table != '' && column != '' + let owner = table + let table = column + let column = '' + endif + else + let owner = '' + let table = matchstr(a:table_name, '^["\[\]a-zA-Z0-9_ ]\+\ze\.\?') + let column = '' + endif + " Check if the table name was provided as part of the column name - let table_name = matchstr(a:table_name, '^["\[\]a-zA-Z0-9_ ]\+\ze\.\?') + " let table_name = matchstr(a:table_name, '^["\[\]a-zA-Z0-9_ ]\+\ze\.\?') + let table_name = table let table_cols = [] let table_alias = '' let move_to_top = 1 @@ -786,7 +869,12 @@ function! s:SQLCGetColumns(table_name, list_type) if table_name_new != '' let table_alias = table_name - let table_name = matchstr( table_name_new, '^\(.*\.\)\?\zs.*\ze' ) + if g:omni_sql_include_owner == 1 + let table_name = matchstr( table_name_new, '^\zs\(.\{-}\.\)\?\(.\{-}\.\)\?.*\ze' ) + else + " let table_name = matchstr( table_name_new, '^\(.*\.\)\?\zs.*\ze' ) + let table_name = matchstr( table_name_new, '^\(.\{-}\.\)\?\zs\(.\{-}\.\)\?.*\ze' ) + endif let list_idx = index(s:tbl_name, table_name, 0, &ignorecase) if list_idx > -1 @@ -828,7 +916,8 @@ function! s:SQLCGetColumns(table_name, list_type) if empty(table_cols) " Specify silent mode, no messages to the user (tbl, 1) " Specify do not comma separate (tbl, 1, 1) - let table_cols_str = DB_getListColumn(table_name, 1, 1) + " let table_cols_str = DB_getListColumn(table_name, 1, 1) + let table_cols_str = DB_getListColumn((owner!=''?owner.'.':'').table_name, 1, 1) if table_cols_str != "" let s:tbl_name = add( s:tbl_name, table_name ) @@ -854,3 +943,7 @@ function! s:SQLCGetColumns(table_name, list_type) return table_cols endfunction +" Restore: +let &cpo= s:keepcpo +unlet s:keepcpo +" vim: ts=4 fdm=marker diff --git a/runtime/autoload/syntaxcomplete.vim b/runtime/autoload/syntaxcomplete.vim index f36c6683a6..e3ea0e2d81 100644 --- a/runtime/autoload/syntaxcomplete.vim +++ b/runtime/autoload/syntaxcomplete.vim @@ -1,12 +1,32 @@ " Vim completion script " Language: All languages, uses existing syntax highlighting rules " Maintainer: David Fishburn -" Version: 8.0 -" Last Change: 2011 Nov 02 -" Usage: For detailed help, ":help ft-syntax-omni" +" Version: 11.0 +" Last Change: 2012 Dec 04 +" Usage: For detailed help, ":help ft-syntax-omni" " History " +" Version 11.0 +" Corrected which characters required escaping during +" substitution calls. +" +" Version 10.0 +" Cycle through all the character ranges specified in the +" iskeyword option and build a list of valid word separators. +" Prior to this change, only actual characters were used, +" where for example ASCII "45" == "-". If "45" were used +" in iskeyword the hyphen would not be picked up. +" This introduces a new option, since the character ranges +" specified could be multibyte: +" let g:omni_syntax_use_single_byte = 1 +" This by default will only allow single byte ASCII +" characters to be added and an additional check to ensure +" the charater is printable (see documentation for isprint). +" +" Version 9.0 +" Add the check for cpo. +" " Version 8.0 " Updated SyntaxCSyntaxGroupItems() " - Some additional syntax items were also allowed @@ -16,7 +36,7 @@ " Version 7.0 " Updated syntaxcomplete#OmniSyntaxList() " - Looking up the syntax groups defined from a syntax file -" looked for only 1 format of {filetype}GroupName, but some +" looked for only 1 format of {filetype}GroupName, but some " syntax writers use this format as well: " {b:current_syntax}GroupName " OmniSyntaxList() will now check for both if the first @@ -24,11 +44,11 @@ " " Version 6.0 " Added syntaxcomplete#OmniSyntaxList() -" - Allows other plugins to use this for their own +" - Allows other plugins to use this for their own " purposes. " - It will return a List of all syntax items for the -" syntax group name passed in. -" - XPTemplate for SQL will use this function via the +" syntax group name passed in. +" - XPTemplate for SQL will use this function via the " sqlcomplete plugin to populate a Choose box. " " Version 5.0 @@ -38,7 +58,7 @@ " " Set completion with CTRL-X CTRL-O to autoloaded function. " This check is in place in case this script is -" sourced directly instead of using the autoload feature. +" sourced directly instead of using the autoload feature. if exists('+omnifunc') " Do not set the option if already set since this " results in an E117 warning. @@ -48,9 +68,13 @@ if exists('+omnifunc') endif if exists('g:loaded_syntax_completion') - finish + finish endif -let g:loaded_syntax_completion = 80 +let g:loaded_syntax_completion = 110 + +" Turn on support for line continuations when creating the script +let s:cpo_save = &cpo +set cpo&vim " Set ignorecase to the ftplugin standard " This is the default setting, but if you define a buffer local @@ -67,6 +91,18 @@ if !exists('g:omni_syntax_use_iskeyword') let g:omni_syntax_use_iskeyword = 1 endif +" When using iskeyword, this setting controls whether the characters +" should be limited to single byte characters. +if !exists('g:omni_syntax_use_single_byte') + let g:omni_syntax_use_single_byte = 1 +endif + +" When using iskeyword, this setting controls whether the characters +" should be limited to single byte characters. +if !exists('g:omni_syntax_use_iskeyword_numeric') + let g:omni_syntax_use_iskeyword_numeric = 1 +endif + " Only display items in the completion window that are at least " this many characters in length. " This is the default setting, but if you define a buffer local @@ -158,7 +194,7 @@ endfunc function! syntaxcomplete#OmniSyntaxList(...) if a:0 > 0 let parms = [] - if 3 == type(a:1) + if 3 == type(a:1) let parms = a:1 elseif 1 == type(a:1) let parms = split(a:1, ',') @@ -172,7 +208,7 @@ endfunc function! OmniSyntaxList(...) let list_parms = [] if a:0 > 0 - if 3 == type(a:1) + if 3 == type(a:1) let list_parms = a:1 elseif 1 == type(a:1) let list_parms = split(a:1, ',') @@ -208,18 +244,18 @@ function! OmniSyntaxList(...) let saveL = @l let filetype = substitute(&filetype, '\.', '_', 'g') - + if empty(list_parms) " Default the include group to include the requested syntax group let syntax_group_include_{filetype} = '' " Check if there are any overrides specified for this filetype if exists('g:omni_syntax_group_include_'.filetype) let syntax_group_include_{filetype} = - \ substitute( g:omni_syntax_group_include_{filetype},'\s\+','','g') + \ substitute( g:omni_syntax_group_include_{filetype},'\s\+','','g') let list_parms = split(g:omni_syntax_group_include_{filetype}, ',') if syntax_group_include_{filetype} =~ '\w' - let syntax_group_include_{filetype} = - \ substitute( syntax_group_include_{filetype}, + let syntax_group_include_{filetype} = + \ substitute( syntax_group_include_{filetype}, \ '\s*,\s*', '\\|', 'g' \ ) endif @@ -229,11 +265,11 @@ function! OmniSyntaxList(...) endif " Loop through all the syntax groupnames, and build a - " syntax file which contains these names. This can + " syntax file which contains these names. This can " work generically for any filetype that does not already " have a plugin defined. " This ASSUMES the syntax groupname BEGINS with the name - " of the filetype. From my casual viewing of the vim7\syntax + " of the filetype. From my casual viewing of the vim7\syntax " directory this is true for almost all syntax definitions. " As an example, the SQL syntax groups have this pattern: " sqlType @@ -246,7 +282,7 @@ function! OmniSyntaxList(...) let syntax_full = "\n".@l let @l = saveL - if syntax_full =~ 'E28' + if syntax_full =~ 'E28' \ || syntax_full =~ 'E411' \ || syntax_full =~ 'E415' \ || syntax_full =~ 'No Syntax items' @@ -256,7 +292,7 @@ function! OmniSyntaxList(...) let filetype = substitute(&filetype, '\.', '_', 'g') let list_exclude_groups = [] - if a:0 > 0 + if a:0 > 0 " Do nothing since we have specific a specific list of groups else " Default the exclude group to nothing @@ -264,11 +300,11 @@ function! OmniSyntaxList(...) " Check if there are any overrides specified for this filetype if exists('g:omni_syntax_group_exclude_'.filetype) let syntax_group_exclude_{filetype} = - \ substitute( g:omni_syntax_group_exclude_{filetype},'\s\+','','g') + \ substitute( g:omni_syntax_group_exclude_{filetype},'\s\+','','g') let list_exclude_groups = split(g:omni_syntax_group_exclude_{filetype}, ',') - if syntax_group_exclude_{filetype} =~ '\w' - let syntax_group_exclude_{filetype} = - \ substitute( syntax_group_exclude_{filetype}, + if syntax_group_exclude_{filetype} =~ '\w' + let syntax_group_exclude_{filetype} = + \ substitute( syntax_group_exclude_{filetype}, \ '\s*,\s*', '\\|', 'g' \ ) endif @@ -285,14 +321,14 @@ function! OmniSyntaxList(...) while ftindex > -1 let ft_part_name = matchstr( &filetype, '\w\+', ftindex ) - " Syntax rules can contain items for more than just the current + " Syntax rules can contain items for more than just the current " filetype. They can contain additional items added by the user " via autocmds or their vimrc. " Some syntax files can be combined (html, php, jsp). " We want only items that begin with the filetype we are interested in. let next_group_regex = '\n' . \ '\zs'.ft_part_name.'\w\+\ze'. - \ '\s\+xxx\s\+' + \ '\s\+xxx\s\+' let index = 0 let index = match(syntax_full, next_group_regex, index) @@ -306,11 +342,11 @@ function! OmniSyntaxList(...) " syn keyword {syntax_filename}Keyword values ... " let b:current_syntax = "mysql" " So, we will make the format of finding the syntax group names - " a bit more flexible and look for both if the first fails to + " a bit more flexible and look for both if the first fails to " find a match. let next_group_regex = '\n' . \ '\zs'.b:current_syntax.'\w\+\ze'. - \ '\s\+xxx\s\+' + \ '\s\+xxx\s\+' let index = 0 let index = match(syntax_full, next_group_regex, index) endif @@ -324,9 +360,9 @@ function! OmniSyntaxList(...) let get_syn_list = 0 endif endfor - + " This code is no longer needed in version 6.0 since we have - " augmented the syntax list command to only retrieve the syntax + " augmented the syntax list command to only retrieve the syntax " groups we are interested in. " " if get_syn_list == 1 @@ -338,7 +374,7 @@ function! OmniSyntaxList(...) " endif if get_syn_list == 1 - " Pass in the full syntax listing, plus the group name we + " Pass in the full syntax listing, plus the group name we " are interested in. let extra_syn_list = s:SyntaxCSyntaxGroupItems(group_name, syntax_full) let syn_list = syn_list . extra_syn_list . "\n" @@ -392,7 +428,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) " \| - 2nd potential match " \%$ - matches end of the file or string " \) - end a group - let syntax_group = matchstr(a:syntax_full, + let syntax_group = matchstr(a:syntax_full, \ "\n".a:group_name.'\s\+xxx\s\+\zs.\{-}\ze\(\n\w\|\%$\)' \ ) @@ -402,42 +438,42 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) " We only want the words for the lines begining with " containedin, but there could be other items. - + " Tried to remove all lines that do not begin with contained " but this does not work in all cases since you can have " contained nextgroup=... " So this will strip off the ending of lines with known " keywords. - let syn_list = substitute( + let syn_list = substitute( \ syntax_group, '\<\('. \ substitute( \ escape(s:syn_remove_words, '\\/.*$^~[]') \ , ',', '\\|', 'g' \ ). \ '\).\{-}\%($\|'."\n".'\)' - \ , "\n", 'g' + \ , "\n", 'g' \ ) " Now strip off the newline + blank space + contained. " Also include lines with nextgroup=@someName skip_key_words syntax_element - let syn_list = substitute( + let syn_list = substitute( \ syn_list, '\%(^\|\n\)\@<=\s*\<\(contained\|nextgroup=\)' - \ , "", 'g' + \ , "", 'g' \ ) " This can leave lines like this " =@vimMenuList skipwhite onoremenu " Strip the special option keywords first " :h :syn-skipwhite* - let syn_list = substitute( + let syn_list = substitute( \ syn_list, '\<\(skipwhite\|skipnl\|skipempty\)\>' - \ , "", 'g' + \ , "", 'g' \ ) " Now remove the remainder of the nextgroup=@someName lines - let syn_list = substitute( + let syn_list = substitute( \ syn_list, '\%(^\|\n\)\@<=\s*\(@\w\+\)' - \ , "", 'g' + \ , "", 'g' \ ) if b:omni_syntax_use_iskeyword == 0 @@ -446,19 +482,74 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) " This will replace non-word characters with spaces. let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' ) else - let accept_chars = ','.&iskeyword.',' - " Remove all character ranges - " let accept_chars = substitute(accept_chars, ',[^,]\+-[^,]\+,', ',', 'g') - let accept_chars = substitute(accept_chars, ',\@<=[^,]\+-[^,]\+,', '', 'g') - " Remove all numeric specifications - " let accept_chars = substitute(accept_chars, ',\d\{-},', ',', 'g') - let accept_chars = substitute(accept_chars, ',\@<=\d\{-},', '', 'g') - " Remove all commas - let accept_chars = substitute(accept_chars, ',', '', 'g') - " Escape special regex characters - let accept_chars = escape(accept_chars, '\\/.*$^~[]' ) - " Remove all characters that are not acceptable - let syn_list = substitute( syn_list, '[^0-9A-Za-z_ '.accept_chars.']', ' ', 'g' ) + if g:omni_syntax_use_iskeyword_numeric == 1 + " iskeyword can contain value like this + " 38,42,43,45,47-58,60-62,64-90,97-122,_,+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 + " Numeric values convert to their ASCII equivalent using the + " nr2char() function. + " & 38 + " * 42 + " + 43 + " - 45 + " ^ 94 + " Iterate through all numeric specifications and convert those + " to their ascii equivalent ensuring the character is printable. + " If so, add it to the list. + let accepted_chars = '' + for item in split(&iskeyword, ',') + if item =~ '-' + " This is a character range (ie 47-58), + " cycle through each character within the range + let [b:start, b:end] = split(item, '-') + for range_item in range( b:start, b:end ) + if range_item <= 127 || g:omni_syntax_use_single_byte == 0 + if nr2char(range_item) =~ '\p' + let accepted_chars = accepted_chars . nr2char(range_item) + endif + endif + endfor + elseif item =~ '^\d\+$' + " Only numeric, translate to a character + if item < 127 || g:omni_syntax_use_single_byte == 0 + if nr2char(item) =~ '\p' + let accepted_chars = accepted_chars . nr2char(item) + endif + endif + else + if char2nr(item) < 127 || g:omni_syntax_use_single_byte == 0 + if item =~ '\p' + let accepted_chars = accepted_chars . item + endif + endif + endif + endfor + " Escape special regex characters + " Looks like the wrong chars are escaped. In a collection, + " :h /[] + " only `]', `\', `-' and `^' are special: + " let accepted_chars = escape(accepted_chars, '\\/.*$^~[]' ) + let accepted_chars = escape(accepted_chars, ']\-^' ) + " Remove all characters that are not acceptable + let syn_list = substitute( syn_list, '[^A-Za-z'.accepted_chars.']', ' ', 'g' ) + else + let accept_chars = ','.&iskeyword.',' + " Remove all character ranges + " let accept_chars = substitute(accept_chars, ',[^,]\+-[^,]\+,', ',', 'g') + let accept_chars = substitute(accept_chars, ',\@<=[^,]\+-[^,]\+,', '', 'g') + " Remove all numeric specifications + " let accept_chars = substitute(accept_chars, ',\d\{-},', ',', 'g') + let accept_chars = substitute(accept_chars, ',\@<=\d\{-},', '', 'g') + " Remove all commas + let accept_chars = substitute(accept_chars, ',', '', 'g') + " Escape special regex characters + " Looks like the wrong chars are escaped. In a collection, + " :h /[] + " only `]', `\', `-' and `^' are special: + " let accept_chars = escape(accept_chars, '\\/.*$^~[]' ) + let accept_chars = escape(accept_chars, ']\-^' ) + " Remove all characters that are not acceptable + let syn_list = substitute( syn_list, '[^0-9A-Za-z_'.accept_chars.']', ' ', 'g' ) + endif endif if b:omni_syntax_minimum_length > 0 @@ -471,3 +562,27 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) return syn_list endfunction + +function! OmniSyntaxShowChars(spec) + let result = [] + for item in split(a:spec, ',') + if len(item) > 1 + if item == '@-@' + call add(result, char2nr(item)) + else + call extend(result, call('range', split(item, '-'))) + endif + else + if item == '@' " assume this is [A-Za-z] + for [c1, c2] in [['A', 'Z'], ['a', 'z']] + call extend(result, range(char2nr(c1), char2nr(c2))) + endfor + else + call add(result, char2nr(item)) + endif + endif + endfor + return join(map(result, 'nr2char(v:val)'), ', ') +endfunction +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index ceac8f10bf..4a55bae210 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.3. Last change: 2012 Aug 08 +*change.txt* For Vim version 7.3. Last change: 2012 Nov 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -598,8 +598,11 @@ For other systems the tmpnam() library function is used. the flags. *g&* -g& Synonym for `:%s//~/&` (repeat last substitute on all - lines with the same flags). +g& Synonym for `:%s//~/&` (repeat last substitute with + last search pattern on all lines with the same flags). + For exaple, when you first do a substitution with + `:s/pattern/repl/flags` and then `/search` for + something else, `g&` will do `:%s/search/repl/flags`. Mnemonic: global substitute. {not in Vi} *:snomagic* *:sno* diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index b77869fcd1..75a7108c90 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.3. Last change: 2012 Oct 21 +*eval.txt* For Vim version 7.3. Last change: 2012 Dec 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1903,6 +1903,8 @@ repeat( {expr}, {count}) String repeat {expr} {count} times resolve( {filename}) String get filename a shortcut points to reverse( {list}) List reverse {list} in-place round( {expr}) Float round off {expr} +screencol() Number current cursor column +screenrow() Number current cursor row search( {pattern} [, {flags} [, {stopline} [, {timeout}]]]) Number search for {pattern} searchdecl( {name} [, {global} [, {thisblock}]]) @@ -4451,6 +4453,7 @@ printf({fmt}, {expr1} ...) *printf()* Often used items are: %s string + %6S string right-aligned in 6 display cells %6s string right-aligned in 6 bytes %.9s string truncated to 9 bytes %c single byte @@ -4565,6 +4568,10 @@ printf({fmt}, {expr1} ...) *printf()* s The text of the String argument is used. If a precision is specified, no more bytes than the number specified are used. + S The text of the String argument is used. If a + precision is specified, no more display cells than the + number specified are used. Without the |+multi_byte| + feature works just like 's'. *printf-f* *E807* f The Float argument is converted into a string of the @@ -4867,15 +4874,34 @@ round({expr}) *round()* echo round(-4.5) < -5.0 {only available when compiled with the |+float| feature} - - + +screencol() *screencol()* + The result is a Number, which is the current screen column of + the cursor. The leftmost column has number 1. + This function is mainly used for testing. + + Note: Always returns the current screen column, thus if used + in a command (e.g. ":echo screencol()") it will return the + column inside the command line, which is 1 when the command is + executed. To get the cursor position in the file use one of + the following mappings: > + nnoremap GG ":echom ".screencol()."\n" + nnoremap GG :echom screencol() +< +screenrow() *screenrow()* + The result is a Number, which is the current screen row of the + cursor. The top line has number one. + This function is mainly used for testing. + + Note: Same restrictions as with |screencol()|. + search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()* Search for regexp pattern {pattern}. The search starts at the cursor position (you can use |cursor()| to set it). + When a match has been found its line number is returned. If there is no match a 0 is returned and the cursor doesn't move. No error message is given. - When a match has been found its line number is returned. {flags} is a String, which can contain these character flags: 'b' search backward instead of forward @@ -5478,7 +5504,8 @@ split({expr} [, {pattern} [, {keepempty}]]) *split()* empty each white-separated sequence of characters becomes an item. Otherwise the string is split where {pattern} matches, - removing the matched characters. + removing the matched characters. 'ignorecase' is not used + here, add \c to ignore case. |/\c| When the first or last item is empty it is omitted, unless the {keepempty} argument is given and it's non-zero. Other empty items are kept when {pattern} matches at least one @@ -5688,8 +5715,10 @@ substitute({expr}, {pat}, {sub}, {flags}) *substitute()* This works like the ":substitute" command (without any flags). But the matching with {pat} is always done like the 'magic' option is set and 'cpoptions' is empty (to make scripts - portable). 'ignorecase' is still relevant. 'smartcase' is - not used. See |string-match| for how {pat} is used. + portable). 'ignorecase' is still relevant, use |/\c| or |/\C| + if you want to ignore or match case and ignore 'ignorecase'. + 'smartcase' is not used. See |string-match| for how {pat} is + used. A "~" in {sub} is not replaced with the previous {sub}. Note that some codes in {sub} have a special meaning @@ -6154,8 +6183,9 @@ winline() The result is a Number, which is the screen line of the cursor winnr([{arg}]) The result is a Number, which is the number of the current window. The top window has number 1. When the optional argument is "$", the number of the - last window is returned (the window count). - When the optional argument is "#", the number of the last + last window is returned (the window count). > + let window_count = winnr('$') +< When the optional argument is "#", the number of the last accessed window is returned (where |CTRL-W_p| goes to). If there is no previous window or it is in another tab page 0 is returned. @@ -6530,6 +6560,8 @@ See |:verbose-cmd| for more information. is excluded, ":{range}call" will call the function for each line in the range, with the cursor on the start of each line. See |function-range-example|. + The cursor is still moved to the first line of the + range, as is the case with all Ex commands. When the [abort] argument is added, the function will abort as soon as an error is detected. diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 437964d1e2..311d86ca3c 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 7.3. Last change: 2012 May 18 +*helphelp.txt* For Vim version 7.3. Last change: 2012 Nov 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -194,11 +194,12 @@ command: > *E154* *E150* *E151* *E152* *E153* *E670* :helpt[ags] [++t] {dir} Generate the help tags file(s) for directory {dir}. - All "*.txt" and "*.??x" files in the directory are - scanned for a help tag definition in between stars. - The "*.??x" files are for translated docs, they - generate the "tags-??" file, see |help-translated|. - The generated tags files are sorted. + All "*.txt" and "*.??x" files in the directory and + sub-directories are scanned for a help tag definition + in between stars. The "*.??x" files are for + translated docs, they generate the "tags-??" file, see + |help-translated|. The generated tags files are + sorted. When there are duplicates an error message is given. An existing tags file is silently overwritten. The optional "++t" argument forces adding the diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt index a74d880483..05b8b4e86d 100644 --- a/runtime/doc/if_perl.txt +++ b/runtime/doc/if_perl.txt @@ -1,4 +1,4 @@ -*if_perl.txt* For Vim version 7.3. Last change: 2012 Aug 02 +*if_perl.txt* For Vim version 7.3. Last change: 2012 Oct 25 VIM REFERENCE MANUAL by Sven Verdoolaege @@ -175,7 +175,8 @@ VIM::Windows([{wn}...]) With no arguments, returns a list of all the windows VIM::DoCommand({cmd}) Executes Ex command {cmd}. *perl-Eval* -VIM::Eval({expr}) Evaluates {expr} and returns (success, val). +VIM::Eval({expr}) Evaluates {expr} and returns (success, value) in list + context or just value in scalar context. success=1 indicates that val contains the value of {expr}; success=0 indicates a failure to evaluate the expression. '@x' returns the contents of register diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 7754de5a1d..e2dc27bea3 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -7623,7 +7623,7 @@ A jump table for the options with a short description can be found at |Q_op|. For more information about this feature see |undo-persistence|. The undo file is not read when 'undoreload' causes the buffer from before a reload to be saved for undo. - WARNING: this is a very new feature. Use at your own risk! + When 'undofile' is turned off the undo file is NOT deleted. *'undolevels'* *'ul'* 'undolevels' 'ul' number (default 100, 1000 for Unix, VMS, diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 142f08f16f..c17ca5f7c3 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.3. Last change: 2012 Apr 05 +*pi_netrw.txt* For Vim version 7.3. Last change: 2012 Oct 25 ----------------------------------------------------- NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -143,7 +143,7 @@ and has lines resembling > Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: > let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' -< +< Netrw will substitute the host's machine name for MACHINE from the url it is attempting to open, and so one may specify > userid @@ -209,7 +209,7 @@ EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2 default, the option arguments for the http-handling commands are: > elinks : "-source >" - links : "-source >" + links : "-dump >" curl : "-o" wget : "-q -O" fetch : "-o" @@ -1072,6 +1072,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 v Enter the file/directory under the cursor in a new |netrw-v| browser window. A vertical split is used. x View file with an associated program |netrw-x| + X Execute filename under cursor via |system()| |netrw-X| % Open a new file in netrw's current directory |netrw-%| @@ -1589,6 +1590,15 @@ Related topics: |netrw-s| |netrw-S| Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options| +EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* + +Pressing X while the cursor is atop an executable file will yield a prompt +using the filename asking for any arguments. Upon pressing a [return], netrw +will then call |system()| with that command and arguments. The result will +be displayed by |:echomsg|, and so |:messages| will repeat display of the +result. Ansi escape sequences will be stripped out. + + FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2 Remote symbolic links (ie. those listed via ssh or ftp) are problematic @@ -1596,10 +1606,10 @@ in that it is difficult to tell whether they link to a file or to a directory. To force treatment as a file: use > - gd + gf < To force treatment as a directory: use > - gf + gd < GOING UP *netrw--* {{{2 @@ -1957,7 +1967,7 @@ The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for this to work on remote systems. For your local system, see |ctags| on how to get a version. I myself use hdrtags, currently available at -http://mysite.verizon.net/astronaut/src/index.html , and have > +http://www.drchip.org/astronaut/src/index.html , and have > let g:netrw_ctags= "hdrtag" < @@ -2093,6 +2103,9 @@ your browsing preferences. (see also: |netrw-settings|) history. (related: |netrw-qb| |netrw-u| |netrw-U|) + *g:netrw_dynamic_maxfilenamelen* =32: enables dynamic determination of + |g:netrw_maxfilenamelen|, which affects + local file long listing. *g:netrw_errorlvl* =0: error levels greater than or equal to this are permitted to be displayed 0: notes @@ -2843,13 +2856,13 @@ which is loaded automatically at startup (assuming :set nocp). 1. Get the script, available as: - http://mysite.verizon.net/astronaut/vim/index.html#DECHO + http://www.drchip.org/astronaut/vim/index.html#DECHO or http://vim.sourceforge.net/scripts/script.php?script_id=120 It now comes as a "vimball"; if you're using vim 7.0 or earlier, you'll need to update vimball, too. See - http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL + http://www.drchip.org/astronaut/vim/index.html#VIMBALL 2. Edit the file by typing: > @@ -2882,57 +2895,77 @@ which is loaded automatically at startup (assuming :set nocp). ============================================================================== 12. History *netrw-history* {{{1 - v145: Apr 05, 2012 * moved some command from a g:netrw_local_... - format to g:netwr_local... format - * included some NOTE level messages about - commands that aren't executable - * |g:netrw_errorlvl| (default: NOTE=0) - option introduced - v144: Mar 12, 2012 * when |CTRL-W_s| or |CTRL-W_v| are used, - or their wincmd equivalents, on a netrw - buffer, the netrw's w: variables were - not copied over. Fixed. - Mar 13, 2012 * nbcd_curpos_{bufnr('%')} was commented - out, and was mistakenly used during - RestorePosn. Unfortunately, I'm not - sure why it was commented out, so this - "fix" may re-introduce an earlier problem. - Mar 21, 2012 * included s:rexposn internally to make - :Rex return the cursor to the same pos'n - upon restoration of netrw buffer - Mar 27, 2012 * (sjbesse) s:NetrwGetFile() needs to remove - "/" from the netrw buffer's usual |'isk'| - in order to allow "filetype detect" to work - properly for scripts. - v143: Jun 01, 2011 * |g:netrw_winsize| will accept a negative - number; the absolute value of it will then - be used to specify lines/columns instead of - a percentage. - Jul 05, 2011 * the "d" map now supports mkdir via ftp - See |netrw-d| and |g:netrw_remote_mkdir| - Jul 11, 2011 * Changed Explore!, Sexplore!, and Vexplore - to use a percentage of |winwidth()| instead - of a percentage of |winheight()|. - Jul 11, 2011 * included support for https://... I'm just - beginning to test this, however. - Aug 01, 2011 * changed RestoreOptions to also restore - cursor position in netrw buffers. - Aug 12, 2011 * added a note about "%" to the balloon - Aug 30, 2011 * if |g:netrw_nobeval| exists, then balloon - evaluation is suppressed. - Aug 31, 2011 * (Benjamin R Haskell) provided a patch that - implements non-standard port handling for - files opened via the remote browser. - Aug 31, 2011 * Fixed a **//pattern Explorer bug - Sep 15, 2011 * (reported by Francesco Campana) netrw - now permits the "@" to be part of the - user id (if there's an @ that appears - to the right). - Nov 21, 2011 * New option: |g:netrw_ftp_options| - Dec 07, 2011 * (James Sinclair) provided a fix handling - attempts to use a uid and password when - they weren't defined. This affected - NetWrite (NetRead already had that fix). + v146: Oct 20, 2012 * (David Kotchan) reported that under Windows, + directories named with unusual characters + such as "#" or "$" were not being listed + properly. + * (Kenny Lee) reported that the buffer list + was being populated by netrw buffers. + Netrw will now |:bwipe| netrw buffers + upon editing a file if g:netrw_fastbrowse + is zero and its not in tree listing style. + v145: Apr 05, 2012 * moved some command from a g:netrw_local_... + format to g:netwr_local... format + * included some NOTE level messages about + commands that aren't executable + * |g:netrw_errorlvl| (default: NOTE=0) + option introduced + May 18, 2012 * (Ilya Dogolazky) a scenario where a + |g:netrw_fastbrowse| of zero did not + have a local directory refreshed fixed. + Jul 10, 2012 * (Donatas) |netrw-gb| wasn't working due + to an incorrectly used variable. + Aug 09, 2012 * (Bart Baker) netrw was doubling + of entries after a split. + * (code by Takahiro Yoshihara) implemented + |g:netrw_dynamic_maxfilenamelen| + Aug 31, 2012 * (Andrew Wong) netrw refresh overwriting + the yank buffer. + v144: Mar 12, 2012 * when |CTRL-W_s| or |CTRL-W_v| are used, + or their wincmd equivalents, on a netrw + buffer, the netrw's w: variables were + not copied over. Fixed. + Mar 13, 2012 * nbcd_curpos_{bufnr('%')} was commented + out, and was mistakenly used during + RestorePosn. Unfortunately, I'm not + sure why it was commented out, so this + "fix" may re-introduce an earlier problem. + Mar 21, 2012 * included s:rexposn internally to make + :Rex return the cursor to the same pos'n + upon restoration of netrw buffer + Mar 27, 2012 * (sjbesse) s:NetrwGetFile() needs to remove + "/" from the netrw buffer's usual |'isk'| + in order to allow "filetype detect" to work + properly for scripts. + v143: Jun 01, 2011 * |g:netrw_winsize| will accept a negative + number; the absolute value of it will then + be used to specify lines/columns instead of + a percentage. + Jul 05, 2011 * the "d" map now supports mkdir via ftp + See |netrw-d| and |g:netrw_remote_mkdir| + Jul 11, 2011 * Changed Explore!, Sexplore!, and Vexplore + to use a percentage of |winwidth()| instead + of a percentage of |winheight()|. + Jul 11, 2011 * included support for https://... I'm just + beginning to test this, however. + Aug 01, 2011 * changed RestoreOptions to also restore + cursor position in netrw buffers. + Aug 12, 2011 * added a note about "%" to the balloon + Aug 30, 2011 * if |g:netrw_nobeval| exists, then balloon + evaluation is suppressed. + Aug 31, 2011 * (Benjamin R Haskell) provided a patch that + implements non-standard port handling for + files opened via the remote browser. + Aug 31, 2011 * Fixed a **//pattern Explorer bug + Sep 15, 2011 * (reported by Francesco Campana) netrw + now permits the "@" to be part of the + user id (if there's an @ that appears + to the right). + Nov 21, 2011 * New option: |g:netrw_ftp_options| + Dec 07, 2011 * (James Sinclair) provided a fix handling + attempts to use a uid and password when + they weren't defined. This affected + NetWrite (NetRead already had that fix). ============================================================================== diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 9adedc8dc7..f82954c046 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.3. Last change: 2012 Jul 16 +*syntax.txt* For Vim version 7.3. Last change: 2012 Nov 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1090,6 +1090,10 @@ Simpler is setting the filetype to "docbkxml" or "docbksgml": > or: > :set filetype=docbkxml +You can specify the DocBook version: > + :let docbk_ver = 3 +When not set 4 is used. + DOSBATCH *dosbatch.vim* *ft-dosbatch-syntax* @@ -2489,6 +2493,12 @@ This will add highlighting for the commands that BASH (version 2.05a and later, and part earlier) adds. +RESTRUCTURED TEXT *rst.vim* *ft-rst-syntax* + +You may set what syntax definitions should be used for code blocks via + let rst_syntax_code_list = ['vim', 'lisp', ...] + + REXX *rexx.vim* *ft-rexx-syntax* If you notice highlighting errors while scrolling backwards, which are fixed diff --git a/runtime/doc/tags b/runtime/doc/tags index 3233b852ca..c7adfe6c7b 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5782,6 +5782,7 @@ ft-quake-syntax syntax.txt /*ft-quake-syntax* ft-r-indent indent.txt /*ft-r-indent* ft-readline-syntax syntax.txt /*ft-readline-syntax* ft-rexx-syntax syntax.txt /*ft-rexx-syntax* +ft-rst-syntax syntax.txt /*ft-rst-syntax* ft-ruby-omni insert.txt /*ft-ruby-omni* ft-ruby-syntax syntax.txt /*ft-ruby-syntax* ft-scheme-syntax syntax.txt /*ft-scheme-syntax* @@ -5926,6 +5927,7 @@ g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin* g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd* g:netrw_decompress pi_netrw.txt /*g:netrw_decompress* g:netrw_dirhistmax pi_netrw.txt /*g:netrw_dirhistmax* +g:netrw_dynamic_maxfilenamelen pi_netrw.txt /*g:netrw_dynamic_maxfilenamelen* g:netrw_errorlvl pi_netrw.txt /*g:netrw_errorlvl* g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse* g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd* @@ -6930,6 +6932,7 @@ netrw-R pi_netrw.txt /*netrw-R* netrw-S pi_netrw.txt /*netrw-S* netrw-T pi_netrw.txt /*netrw-T* netrw-U pi_netrw.txt /*netrw-U* +netrw-X pi_netrw.txt /*netrw-X* netrw-a pi_netrw.txt /*netrw-a* netrw-activate pi_netrw.txt /*netrw-activate* netrw-bookmark pi_netrw.txt /*netrw-bookmark* @@ -7517,6 +7520,7 @@ rileft.txt rileft.txt /*rileft.txt* riscos os_risc.txt /*riscos* rot13 change.txt /*rot13* round() eval.txt /*round()* +rst.vim syntax.txt /*rst.vim* rsync pi_netrw.txt /*rsync* ruby if_ruby.txt /*ruby* ruby-buffer if_ruby.txt /*ruby-buffer* @@ -7568,6 +7572,8 @@ save-file editing.txt /*save-file* save-settings starting.txt /*save-settings* scheme.vim syntax.txt /*scheme.vim* scp pi_netrw.txt /*scp* +screencol() eval.txt /*screencol()* +screenrow() eval.txt /*screenrow()* script usr_41.txt /*script* script-here if_perl.txt /*script-here* script-local map.txt /*script-local* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 85673109fb..47dbce6dd3 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.3. Last change: 2012 Oct 21 +*todo.txt* For Vim version 7.3. Last change: 2012 Dec 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,6 +34,10 @@ not be repeated below, unless there is extra information. *known-bugs* -------------------- Known bugs and current work ----------------------- +On external command get the message: + SIGCHLD handler called (some thread has SIGCHLD unblocked) +From MzScheme + Go through more coverity reports. Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10) @@ -43,45 +47,44 @@ Checking runtime scripts: Thilo Six, 2012 Jun 6. GTK: problem with 'L' in 'guioptions' changing the window width. (Aaron Cornelius, 2012 Feb 6) -Patch to fix undofile hash computed when not necessary. (Christian Brabandt, -2012 Oct 16, update Oct 18) - -Patch to fix repeating "cgn". (Christian Brabandt, 2012 Oct 16) -Update Oct 17. - Javascript file where indent gets stuck on: GalaxyMaster, 2012 May 3. -Updated French and Esperanto files. (Dominique Pelle, 2012 Aug 19) - -When showing diffs filler lines may be hidden at first. -Patch by Christian Brabandt, 2012 Sep 6. Update Oct 11. - -Patch for memory leaks on exception. (ZyX, 2012 Sep 9) - The CompleteDone autocommand needs some info passed to it: - The word that was selected (empty if abandoned complete) - Type of completion: tag, omnifunc, user func. -Unwanted file name escaping: ":echo input('file:' , '', 'file')" -And use file name completion on a file with spaces. (Frederic Hardy, 2009 Mar -23) -Patch by Christian Brabandt, 2012 Oct 18. Update Oct 19. +Patch for matchit.vim. (Mike Morearty, 2012 Nov 28) -mouse_sgr is not ordered alphabetically in :version output. -Docs list mouse_urxvt as normal feature, should be big. (Hayaki Saito, 2012 -Aug 16) +Patch to fix that the QuitPre autocommand clears the quitmore flag. (Techlive +Zheng, 2012 Nov 28) ":gundo" command: global undo. Undoes changes spread over multiple files in the order they were made. Also ":gredo". Both with a count. Useful when tests fail after making changes and you forgot in which files. Patch to make updating tabline faster. (Arseny Kapoulkine, 2012 Oct 3) +Also remove the "rc" variable. + +Patch to make "- register not always used. (Christian Brabandt, 2012 Nov 28) Crash with vimdiff. (Don Cruickshank, 2012 Sep 23) +Patch to support subdirectories for help files. (Charles Campbell, 2012 Nov +21) + +Patch for mzscheme. (Sergey Khorev, 2012 Nov 19) +What about ignoring SEGV? + Win32: use 'guifontwide' for IME composition. (Taro Muraoka, 2012 Sep 30) Update Oct 2. +Patch to fix :s command with confirm and typing "a". (Christian Brabandt, 2012 +Oct 28) + +/[^\n] does match at a line break. Expected to do the same as /. +Patch by Christian Brabandt, 2012 Dec 1. +Test files in archive in another message. + Patch to make multibyte input work on Win32 console when codepage differs from 'encoding'. (Ken Takata, 2012 Sep 29) @@ -92,6 +95,14 @@ Win32: When a directory name contains an exclamation mark, completion doesn't complete the contents of the directory. No escaping for the "!"? (Jan Stocker, 2012 Jan 5) +Problem parsing expression with function(). (Andy Wokula, 2012 Nov 22) +Patch by Christian Brabandt, Nov 22. Tests in another patch, Nov 23. + +Problem caused by patch 7.3.638: window->open does not update window +correctly. Issue 91. + +Do allow real tags above the !_TAG entries. Undo older patch. Issue 90. + Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep 28) With tests: Oct 9. @@ -103,13 +114,17 @@ Issue 54: document behavior of -complete, also expands arg. New syntax files for apt. (quidame, 2012 Sep 21) +'ff' is wrong for one-line file without EOL. (Issue 77) + Patch for if_lua. (Luis Carvalho, 2012 Aug 26, update Aug 29, another Aug 30, then Sep 1, reminder Oct 14) Issue 72: 'autochdir' causes problems for :vimgrep. -:setlocal does not work in the sandbox, but :set does. Both should work in a -similar way (not setting some options). (Michael Henry, 2012 Oct 20) +Undo problem: line not removed as expected when using setline() from Insert +mode. (Israel Chauca, 2010 May 13, more in second msg) +Break undo when CTRL-R = changes the text? Or save more lines? +Patch by Christian Brabandt, 2012 Nov 16. In the ATTENTION message about an existing swap file, mention the name of the process that is running. It might actually be some other program, e.g. after @@ -118,9 +133,6 @@ a reboot. MS-Windows: Crash opening very long file name starting with "\\". (Christian Brock, 2012 Jun 29) -Win32: patch for current directory, "loading iof conv". (Ken Takata, 2012 Sep -15) - It's probably a good idea to make a negative value for 'sts' use the value of 'sw'. Patch by So8res, Oct 3 2012 @@ -136,9 +148,12 @@ Or use expand('')? Patch for :tabcloseleft, after closing a tab go to left tab. (William Bowers, 2012 Aug 4) -Patch for Tab behavior with 'conceal'. (Dominique Pelle, 2012 Mar 18) -Patch to test functionality of 'conceal' with tabs. (Simon Ruderich, 2012 Sep -5) Update with screencol() and screenrow() functions: Sep 7. +Patch with suggestions for starting.txt. (Tony Mechelynck, 2012 Oct 24) +But use Gnome instead of GTK? + +Should be possible to enable/disable matchparen per window or buffer. +Add a check for b:no_match_paren in Highlight_matching_Pair() (Marcin +Szamotulski, 2012 Nov 8) Crash in autocmd that unloads buffers in a BufUnload event. (Andrew Pimlott, 2012 Aug 11) Disallow :new when BufUnload is being handled? @@ -158,6 +173,9 @@ MS-Windows resizing problems: Help for b:undo_indent'. (Thilo Six, 2012 May 28) Also question if examples are correct. +It should be possible to make globpath() return a list instead of a string, +like with glob(). (Greg Novack, 2012 Nov 2) + The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O. Suggestion for another map. (Philip Mat, 2012 Jun 18) But use "gi" instead of "a". Or use CTRL-\ CTRL-O. @@ -169,11 +187,16 @@ Have an option for spell checking to not mark any Chinese, Japanese or other double-width characters as error. Or perhaps all characters above 256. (Bill Sun) Helps a lot for mixed Asian and latin text. +When there are no command line arguments ":next" and ":argu" give E163, which +is confusing. Should say "the argument list is empty". + URXVT: -- will get stuck if byte sequence does not containe expected semicolon. +- will get stuck if byte sequence does not contain the expected semicolon. - Use urxvt mouse support also in xterm. Explanations: http://www.midnight-commander.org/ticket/2662 +MS-Windows: test 17 fails. Analysis by Michael Soyka, 2012 Nov 5. + Patch to add tests for if_xcmdsrv.c., Jul 8, need some more work. (Brian Burns) New tests Jul 13. Update Jul 17. Discussion Jul 18. @@ -199,8 +222,6 @@ Patch Sep 18. Patch for IME problems. Remove hacking code for old IM. (Yukihiro Nakadaira, 2012 Jul 20) -/[^\n] does match at a line break. Expected to do the same as /. - Patch for has('unnamedplus') docs. (Tony Mechelynck, 2011 Sep 27) And one for gui_x11.txt. @@ -267,12 +288,6 @@ On MS-Windows a temp dir with a & init causes system() to fail. (Ben Fritz, 'list' is set. (Dennis Preiser) Patch 7.3.116 was the wrong solution. Christian Brabandt has another incomplete patch. (2011 Jul 13) -Also: Alignment in help with tabs gets messed up, esp. at ":help index". -Probably need to make a tab work like there was no concealing. Possibly with -an option. Like line wrapping works as if there is no concealing. -Patch by Dominique Pelle, Also fixes "fC" problem. - "fC" doesn't position the cursor correctly when there are concealed - characters. Patch by Christian Brabandt, 2011 Oct 11) With concealed text mouse click doesn't put the cursor in the right position. (Herb Sitz) Fix by Christian Brabandt, 2011 Jun 16. Doesn't work properly, @@ -310,6 +325,9 @@ Oct 26) Bug in repeating Visual "u". (Lawrence Kesteloot, 2010 Dec 20) +Using "p" in Visual mode while specifying the small delete register "- +overwrites the register before it is put. (Marcin Szamotulski, 2012 Nov 23) + With "unamedplus" in 'clipboard' pasting in Visual mode causes error for empty register. (Michael Seiwald, 2011 Jun 28) I can't reproduce it. @@ -333,9 +351,6 @@ Christoph Ebersbach, 2011 Jul 3) Windows keys not set properly on Windows 7? (cncyber, 2010 Aug 26) -This line hangs Vim, because of syntax HL: -call append(line, "INFO ....12....18....24....30....36....42....48....54....60....66....72....78%$") - When using a Vim server, a # in the path causes an error message. (Jeff Lanzarotta, 2011 Feb 17) @@ -388,9 +403,6 @@ mapping, how to restore the script ID? Bug in try/catch: return with invalid compare throws error that isn't caught. (ZyX, 2011 Jan 26) -Highlighting stops working after changing it many times. Script to reproduce -it: Pablo Contreras, 2010 Oct 12 Windows XP and 7. Font is never freed? - When setting a local option value from the global value, add a script ID that indicates this, so that ":verbose set" can give a hint. Check with options in the help file. @@ -617,6 +629,11 @@ Add local time at start of --startuptime output. Requires configure check for localtime(). Use format year-month-day hr:min:sec. +Patch to add "combine" to :syntax, combines highlight attributes. (Nate +Soares, 2012 Dec 3) + +Patch to make ":hi link" also take arguments. (Nate Soares, 2012 Dec 4) + Shell not recognized properly if it ends in "csh -f". (James Vega, 2009 Nov 3) Find tail? Might have a / in argument. Find space? Might have space in path. @@ -655,10 +672,6 @@ Problem with stop directory in findfile(). (Adam Simpkins, 2009 Aug 26) Using ']' as the end of a range in a pattern requires double escaping: /[@-\\]] (Andy Wokula, 2011 Jun 28) -Undo problem: line not removed as expected when using setline() from Insert -mode. (Israel Chauca, 2010 May 13, more in second msg) -Break undo when CTRL-R = changes the text? Or save more lines? - Slow combination of folding and PHP syntax highlighting. Script to reproduce it. Caused by "syntax sync fromstart" in combination with patch 7.2.274. (Christian Brabandt, 2010 May 27) @@ -817,7 +830,7 @@ very high. (Yegappan Lakshmanan, 2010 Jul 22, Michael Peeters, 2010 Jul 22) Directory wrong in session file, caused by ":lcd" in BufEnter autocommand. (Felix Kater, 2009 Mar 3) -Session file generates error upon loading, cause bu --remote-silent-tab. +Session file generates error upon loading, cause by --remote-silent-tab. (7tommm (ytommm) 2010 Nov 24) Using ~ works OK on 'a' with composing char, but not on 0x0418 with composing @@ -938,8 +951,6 @@ error message? Or is this easy to implement? (Nathan Stratton Treadway, 2008 Aug 20) This is in ucs2bytes(), search for 0xBF. Using the ++bad argument is at the other match for 0xBF. -Fix for matchparen HL doesn't work. beep. - When adding "-complete=file" to a user command this also changes how the argument is processed for . (Ivan Tishchenko, 2008 Aug 19) @@ -1276,10 +1287,6 @@ pointer in long and seek offset in 64 bit var. Win32: patch for fullscreen mode. (Liushaolin, 2008 April 17) -Win32: When there is 4 Gbyte of memory mch_avail_mem() doesn't work properly. -Unfinished patch by Jelle Geerts, 2008 Aug 24. -Let mch_avail_mem() return Kbyte instead? - Win32: When 'shell' is bash shellescape() doesn't always do the right thing. Depends on 'shellslash', 'shellquote' and 'shellxquote', but shellescape() only takes 'shellslash' into account. @@ -1589,6 +1596,9 @@ Win32, NTFS: When editing a specific infostream directly and 'backupcopy' is name is something like "c:\path\foo.txt:bar", includes a colon. (Alex Jakushev, 2008 Feb 1) +printf() uses the field width in bytes. Can it be made character width, +perhaps with a modifier? What does Posix say? + Small problem displaying diff filler line when opening windows with a script. (David Luyer, 2007 Mar 1 ~/Mail/oldmail/mool/in.15872 ) diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt index 82481dc27b..d1ed213413 100644 --- a/runtime/doc/uganda.txt +++ b/runtime/doc/uganda.txt @@ -1,4 +1,4 @@ -*uganda.txt* For Vim version 7.3. Last change: 2012 May 28 +*uganda.txt* For Vim version 7.3. Last change: 2012 Dec 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -238,6 +238,7 @@ Canada: Contact Kibaale Children's Fund (KCF) in Surrey, Canada. They Holland: Transfer to the account of "Stichting ICCF Holland" in Lisse. This will allow for tax deduction if you live in Holland. Postbank, nr. 4548774 + IBAN: NL95 INGB 0004 5487 74 Germany: It is possible to make donations that allow for a tax return. Check the ICCF web site for the latest information: diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index b0f27d1fce..45bcc17491 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -1,4 +1,4 @@ -*usr_05.txt* For Vim version 7.3. Last change: 2009 Jun 04 +*usr_05.txt* For Vim version 7.3. Last change: 2012 Nov 20 VIM USER MANUAL - by Bram Moolenaar @@ -49,8 +49,7 @@ For MS-DOS and MS-Windows you can use one of these: The vimrc file can contain all the commands that you type after a colon. The most simple ones are for setting options. For example, if you want Vim to -always start with the 'incsearch' option on, add this line you your vimrc -file: > +always start with the 'incsearch' option on, add this line your vimrc file: > set incsearch diff --git a/runtime/doc/usr_21.txt b/runtime/doc/usr_21.txt index a49c98c2b2..ce7d494546 100644 --- a/runtime/doc/usr_21.txt +++ b/runtime/doc/usr_21.txt @@ -1,4 +1,4 @@ -*usr_21.txt* For Vim version 7.3. Last change: 2008 Nov 09 +*usr_21.txt* For Vim version 7.3. Last change: 2012 Nov 02 VIM USER MANUAL - by Bram Moolenaar @@ -282,7 +282,7 @@ example, use: > SESSION HERE, SESSION THERE The obvious way to use sessions is when working on different projects. -Suppose you store you session files in the directory "~/.vim". You are +Suppose you store your session files in the directory "~/.vim". You are currently working on the "secret" project and have to switch to the "boring" project: > @@ -295,7 +295,7 @@ is saved, using ":mksession!". This overwrites the previous session. The next time you load the secret session you can continue where you were at this point. And finally you load the new "boring" session. -If you open help windows, split and close various window, and generally mess +If you open help windows, split and close various windows, and generally mess up the window layout, you can go back to the last saved session: > :source ~/.vim/boring.vim @@ -423,10 +423,10 @@ and nine numbered 1 to 9. A VIEW WITH A NAME The second basic way to use views is by storing the view in a file with a name -you chose. This view can be loaded while editing another file. Vim will then -switch to editing the file specified in the view. Thus you can use this to -quickly switch to editing another file, with all its options set as you saved -them. +you choose. This view can be loaded while editing another file. Vim will +then switch to editing the file specified in the view. Thus you can use this +to quickly switch to editing another file, with all its options set as you +saved them. For example, to save the view of the current file: > :mkview ~/.vim/main.vim diff --git a/runtime/doc/usr_22.txt b/runtime/doc/usr_22.txt index 8ca034e898..3c527a686c 100644 --- a/runtime/doc/usr_22.txt +++ b/runtime/doc/usr_22.txt @@ -1,4 +1,4 @@ -*usr_22.txt* For Vim version 7.3. Last change: 2010 Feb 21 +*usr_22.txt* For Vim version 7.3. Last change: 2012 Nov 15 VIM USER MANUAL - by Bram Moolenaar @@ -326,9 +326,9 @@ shorter to type: > The output could look like this: - 1 #h "help.txt" line 62 ~ - 2 %a+ "usr_21.txt" line 1 ~ - 3 "usr_toc.txt" line 1 ~ + 1 #h "help.txt" line 62 ~ + 2 %a + "usr_21.txt" line 1 ~ + 3 "usr_toc.txt" line 1 ~ The first column contains the buffer number. You can use this to edit the buffer without having to type the name, see below. diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 830cad4b55..48655b1700 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 7.3. Last change: 2012 Aug 03 +*various.txt* For Vim version 7.3. Last change: 2012 Dec 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -354,54 +354,54 @@ N *+mouseshape* |'mouseshape'| B *+mouse_dec* Unix only: Dec terminal mouse handling |dec-mouse| N *+mouse_gpm* Unix only: Linux console mouse handling |gpm-mouse| B *+mouse_netterm* Unix only: netterm mouse handling |netterm-mouse| -N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal| +N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal| N *+mouse_sysmouse* Unix only: *BSD console mouse handling |sysmouse| B *+mouse_sgr* Unix only: sgr mouse handling |sgr-mouse| -N *+mouse_urxvt* Unix only: urxvt mouse handling |urxvt-mouse| -N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse| -B *+multi_byte* 16 and 32 bit characters |multibyte| +B *+mouse_urxvt* Unix only: urxvt mouse handling |urxvt-mouse| +N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse| +B *+multi_byte* 16 and 32 bit characters |multibyte| *+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime| -N *+multi_lang* non-English language support |multi-lang| +N *+multi_lang* non-English language support |multi-lang| m *+mzscheme* Mzscheme interface |mzscheme| m *+mzscheme/dyn* Mzscheme interface |mzscheme-dynamic| |/dyn| m *+netbeans_intg* |netbeans| m *+odbeditor* MacVim only: ODB Editor Protocol support |odbeditor| -m *+ole* Win32 GUI only: |ole-interface| -N *+path_extra* Up/downwards search in 'path' and 'tags' +m *+ole* Win32 GUI only: |ole-interface| +N *+path_extra* Up/downwards search in 'path' and 'tags' m *+perl* Perl interface |perl| m *+perl/dyn* Perl interface |perl-dynamic| |/dyn| N *+persistent_undo* Persistent undo |undo-persistence| - *+postscript* |:hardcopy| writes a PostScript file + *+postscript* |:hardcopy| writes a PostScript file N *+printer* |:hardcopy| command H *+profile* |:profile| command m *+python* Python 2 interface |python| -m *+python/dyn* Python 2 interface |python-dynamic| |/dyn| +m *+python/dyn* Python 2 interface |python-dynamic| |/dyn| m *+python3* Python 3 interface |python| -m *+python3/dyn* Python 3 interface |python-dynamic| |/dyn| +m *+python3/dyn* Python 3 interface |python-dynamic| |/dyn| N *+quickfix* |:make| and |quickfix| commands N *+reltime* |reltime()| function, 'hlsearch'/'incsearch' timeout, 'redrawtime' option B *+rightleft* Right to left typing |'rightleft'| m *+ruby* Ruby interface |ruby| m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn| -N *+scrollbind* |'scrollbind'| +N *+scrollbind* |'scrollbind'| B *+signs* |:sign| -N *+smartindent* |'smartindent'| +N *+smartindent* |'smartindent'| m *+sniff* SniFF interface |sniff| -N *+startuptime* |--startuptime| argument -N *+statusline* Options 'statusline', 'rulerformat' and special +N *+startuptime* |--startuptime| argument +N *+statusline* Options 'statusline', 'rulerformat' and special formats of 'titlestring' and 'iconstring' m *+sun_workshop* |workshop| N *+syntax* Syntax highlighting |syntax| *+system()* Unix only: opposite of |+fork| -N *+tag_binary* binary searching in tags file |tag-binary-search| +N *+tag_binary* binary searching in tags file |tag-binary-search| N *+tag_old_static* old method for static tags |tag-old-static| m *+tag_any_white* any white space allowed in tags file |tag-any-white| -m *+tcl* Tcl interface |tcl| +m *+tcl* Tcl interface |tcl| m *+tcl/dyn* Tcl interface |tcl-dynamic| |/dyn| *+terminfo* uses |terminfo| instead of termcap N *+termresponse* support for |t_RV| and |v:termresponse| -N *+textobjects* |text-objects| selection +N *+textobjects* |text-objects| selection *+tgetent* non-Unix only: able to use external termcap N *+title* Setting the window 'title' and 'icon' N *+toolbar* |gui-toolbar| @@ -409,22 +409,22 @@ m *+transparency* MacVim only: window background transparency N *+user_commands* User-defined commands. |user-commands| N *+viminfo* |'viminfo'| N *+vertsplit* Vertically split windows |:vsplit| -N *+virtualedit* |'virtualedit'| +N *+virtualedit* |'virtualedit'| S *+visual* Visual mode |Visual-mode| -N *+visualextra* extra Visual mode commands |blockwise-operators| +N *+visualextra* extra Visual mode commands |blockwise-operators| N *+vreplace* |gR| and |gr| -N *+wildignore* |'wildignore'| +N *+wildignore* |'wildignore'| N *+wildmenu* |'wildmenu'| S *+windows* more than one window -m *+writebackup* |'writebackup'| is default on -m *+xim* X input method |xim| +m *+writebackup* |'writebackup'| is default on +m *+xim* X input method |xim| *+xfontset* X fontset support |xfontset| m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support| *+xsmp* XSMP (X session management) support *+xsmp_interact* interactive XSMP (X session management) support N *+xterm_clipboard* Unix only: xterm clipboard handling -m *+xterm_save* save and restore xterm screen |xterm-screens| -N *+X11* Unix only: can restore window title |X11| +m *+xterm_save* save and restore xterm screen |xterm-screens| +N *+X11* Unix only: can restore window title |X11| */dyn* *E370* *E448* To some of the features "/dyn" is added when the diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index b9f771d755..b529ee59e6 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -1,4 +1,4 @@ -*windows.txt* For Vim version 7.3. Last change: 2012 Apr 13 +*windows.txt* For Vim version 7.3. Last change: 2012 Nov 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -939,9 +939,9 @@ list of buffers. |unlisted-buffer| :buffers[!] *:buffers* *:ls* :ls[!] Show all buffers. Example: - 1 #h "/test/text" line 1 ~ - 2u "asdf" line 0 ~ - 3 %a+ "version.c" line 1 ~ + 1 #h "/test/text" line 1 ~ + 2u "asdf" line 0 ~ + 3 %a + "version.c" line 1 ~ When the [!] is included the list will show unlisted buffers (the term "unlisted" is a bit confusing then...). diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 1f59290916..221c0cafc6 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: 2012 Oct 05 +" Last Change: 2012 Nov 28 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -1745,7 +1745,8 @@ au BufNewFile,BufRead *.sgm,*.sgml \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' | \ setf sgmllnx | \ elseif getline(1) =~ ' -" Last Change: 2009 Jun 03 +" Last Change: 2012 Nov 20 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -9,7 +9,7 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl modeline< tw< fo<" +let b:undo_ftplugin = "setl modeline< tw< fo< comments<" " Don't use modelines in e-mail messages, avoid trojan horses and nasty " "jokes" (e.g., setting 'textwidth' to 5). @@ -23,6 +23,9 @@ endif " Set 'formatoptions' to break text lines and keep the comment leader ">". setlocal fo+=tcql +" Add n:> to 'comments, in case it was removed elsewhere +setlocal comments+=n:> + " Add mappings, unless the user doesn't want this. if !exists("no_plugin_maps") && !exists("no_mail_maps") " Quote text by inserting "> " diff --git a/runtime/ftplugin/sql.vim b/runtime/ftplugin/sql.vim index c13dcf1869..39028f318d 100644 --- a/runtime/ftplugin/sql.vim +++ b/runtime/ftplugin/sql.vim @@ -1,8 +1,8 @@ " SQL filetype plugin file " Language: SQL (Common for Oracle, Microsoft SQL Server, Sybase) -" Version: 8.0 +" Version: 10.0 " Maintainer: David Fishburn -" Last Change: 2012 May 18 +" Last Change: 2012 Dec 04 " Download: http://vim.sourceforge.net/script.php?script_id=454 " For more details please use: @@ -30,34 +30,48 @@ " To change the default dialect, add the following to your vimrc: " let g:sql_type_default = 'sqlanywhere' " -" This file also creates a command, SQLGetType, which allows you to +" This file also creates a command, SQLGetType, which allows you to " determine what the current dialect is in use. " :SQLGetType " " History " +" Version 10.0 (Dec 2012) +" +" NF: Changed all maps to use noremap instead of must map +" NF: Changed all visual maps to use xnoremap instead of vnoremap as they +" should only be used in visual mode and not select mode. +" BF: Most of the maps were using doubled up backslashes before they were +" changed to using the search() function, which meant they no longer +" worked. +" +" Version 9.0 +" +" NF: Completes 'b:undo_ftplugin' +" BF: Correctly set cpoptions when creating script +" " Version 8.0 -" +" " NF: Improved the matchit plugin regex (Talek) " " Version 7.0 -" +" " NF: Calls the sqlcomplete#ResetCacheSyntax() function when calling " SQLSetType. " " Version 6.0 -" +" " NF: Adds the command SQLGetType " " Version 5.0 -" -" NF: Adds the ability to choose the keys to control SQL completion, just add +" +" NF: Adds the ability to choose the keys to control SQL completion, just add " the following to your .vimrc: " let g:ftplugin_sql_omni_key = '' " let g:ftplugin_sql_omni_key_right = '' " let g:ftplugin_sql_omni_key_left = '' " -" BF: format-options - Auto-wrap comments using textwidth was turned off +" BF: format-options - Auto-wrap comments using textwidth was turned off " by mistake. @@ -81,7 +95,7 @@ setlocal formatoptions+=c " This works with both Vim 6 and 7. if !exists("*SQL_SetType") - " NOTE: You cannot use function! since this file can be + " NOTE: You cannot use function! since this file can be " sourced from within this function. That will result in " an error reported by Vim. function SQL_GetList(ArgLead, CmdLine, CursorPos) @@ -105,9 +119,9 @@ if !exists("*SQL_SetType") " " Recursively, since there are many filenames that contain " the word SQL in the indent, syntax and ftplugin directory - let sqls = substitute( sqls, - \ '[\n]\%(.\{-}\)\(\w\+\.\w\+\)\n\@=', - \ '\1\n', + let sqls = substitute( sqls, + \ '[\n]\%(.\{-}\)\(\w\+\.\w\+\)\n\@=', + \ '\1\n', \ 'g' \ ) @@ -142,10 +156,10 @@ if !exists("*SQL_SetType") function SQL_SetType(name) " User has decided to override default SQL scripts and - " specify a vendor specific version + " specify a vendor specific version " (ie Oracle, Informix, SQL Anywhere, ...) " So check for an remove any settings that prevent the - " scripts from being executed, and then source the + " scripts from being executed, and then source the " appropriate Vim scripts. if exists("b:did_ftplugin") unlet b:did_ftplugin @@ -163,10 +177,10 @@ if !exists("*SQL_SetType") endif " Ensure the name is in the correct format - let new_sql_type = substitute(a:name, + let new_sql_type = substitute(a:name, \ '\s*\([^\.]\+\)\(\.\w\+\)\?', '\L\1', '') - " Do not specify a buffer local variable if it is + " Do not specify a buffer local variable if it is " the default value if new_sql_type == 'sql' let new_sql_type = 'sqloracle' @@ -203,10 +217,10 @@ endif if !exists("*SQL_GetType") function SQL_GetType() - if exists('b:sql_type_override') + if exists('b:sql_type_override') echomsg "Current SQL dialect in use:".b:sql_type_override else - echomsg "Current SQL dialect in use:".g:sql_type_default + echomsg "Current SQL dialect in use:".g:sql_type_default endif endfunction command! -nargs=0 SQLGetType :call SQL_GetType() @@ -233,7 +247,8 @@ if exists("b:did_ftplugin") finish endif -let b:undo_ftplugin = "setl comments<" +let b:undo_ftplugin = "setl comments< formatoptions< define< omnifunc<" . + \ " | unlet! b:browsefilter b:match_words" " Don't load another plugin for this buffer let b:did_ftplugin = 1 @@ -280,7 +295,7 @@ if !exists("b:match_words") " doend " " case - " when + " when " when " default " end case @@ -296,8 +311,10 @@ if !exists("b:match_words") " create[ or replace] procedure|function|event " \ '^\s*\<\%(do\|for\|while\|loop\)\>.*:'. - let b:match_words = - \ '\:\\W*$,'. + " For ColdFusion support + setlocal matchpairs+=<:> + let b:match_words = &matchpairs . + \ ',\:\\W*$,'. \ \ s:notend . '\:'. \ '\\|\\|\:'. @@ -337,14 +354,14 @@ let &l:define = '\c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\>' " Mappings to move to the next BEGIN ... END block " \W - no characters or digits -nmap ]] :call search('\\c^\\s*begin\\>', 'W' ) -nmap [[ :call search('\\c^\\s*begin\\>', 'bW' ) -nmap ][ :call search('\\c^\\s*end\\W*$', 'W' ) -nmap [] :call search('\\c^\\s*end\\W*$', 'bW' ) -vmap ]] :exec "normal! gv"call search('\\c^\\s*begin\\>', 'W' ) -vmap [[ :exec "normal! gv"call search('\\c^\\s*begin\\>', 'bW' ) -vmap ][ :exec "normal! gv"call search('\\c^\\s*end\\W*$', 'W' ) -vmap [] :exec "normal! gv"call search('\\c^\\s*end\\W*$', 'bW' ) +nnoremap ]] :call search('\c^\s*begin\>', 'W' ) +nnoremap [[ :call search('\c^\s*begin\>', 'bW' ) +nnoremap ][ :call search('\c^\s*end\W*$', 'W' ) +nnoremap [] :call search('\c^\s*end\W*$', 'bW' ) +xnoremap ]] :exec "normal! gv"call search('\c^\s*begin\>', 'W' ) +xnoremap [[ :exec "normal! gv"call search('\c^\s*begin\>', 'bW' ) +xnoremap ][ :exec "normal! gv"call search('\c^\s*end\W*$', 'W' ) +xnoremap [] :exec "normal! gv"call search('\c^\s*end\W*$', 'bW' ) " By default only look for CREATE statements, but allow @@ -361,7 +378,7 @@ endif " backwards, you must use \{,1} if !exists('g:ftplugin_sql_objects') let g:ftplugin_sql_objects = 'function,procedure,event,' . - \ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' . + \ '\(existing\\|global\s\+temporary\s\+\)\{,1}' . \ 'table,trigger' . \ ',schema,service,publication,database,datatype,domain' . \ ',index,subscription,synchronization,view,variable' @@ -382,47 +399,47 @@ endif " Replace all ,'s with bars, except ones with numbers after them. " This will most likely be a \{,1} string. -let s:ftplugin_sql_objects = - \ '\\c^\\s*' . - \ '\\(\\(' . - \ substitute(g:ftplugin_sql_statements, ',\d\@!', '\\\\\\|', 'g') . - \ '\\)\\s\\+\\(or\\s\\+replace\\\s\+\\)\\{,1}\\)\\{,1}' . - \ '\\<\\(' . - \ substitute(g:ftplugin_sql_objects, ',\d\@!', '\\\\\\|', 'g') . - \ '\\)\\>' +let s:ftplugin_sql_objects = + \ '\c^\s*' . + \ '\(\(' . + \ substitute(g:ftplugin_sql_statements, ',\d\@!', '\\\\|', 'g') . + \ '\)\s\+\(or\s\+replace\s\+\)\{,1}\)\{,1}' . + \ '\<\(' . + \ substitute(g:ftplugin_sql_objects, ',\d\@!', '\\\\|', 'g') . + \ '\)\>' " Mappings to move to the next CREATE ... block -exec "nmap ]} :call search('".s:ftplugin_sql_objects."', 'W')" -exec "nmap [{ :call search('".s:ftplugin_sql_objects."', 'bW')" +exec "nnoremap ]} :call search('".s:ftplugin_sql_objects."', 'W')" +exec "nnoremap [{ :call search('".s:ftplugin_sql_objects."', 'bW')" " Could not figure out how to use a :call search() string in visual mode " without it ending visual mode " Unfortunately, this will add a entry to the search history -exec 'vmap ]} /'.s:ftplugin_sql_objects.'' -exec 'vmap [{ ?'.s:ftplugin_sql_objects.'' +exec 'xnoremap ]} /'.s:ftplugin_sql_objects.'' +exec 'xnoremap [{ ?'.s:ftplugin_sql_objects.'' " Mappings to move to the next COMMENT " " Had to double the \ for the \| separator since this has a special " meaning on maps -let b:comment_leader = '\\(--\\\|\\/\\/\\\|\\*\\\|\\/\\*\\\|\\*\\/\\)' +let b:comment_leader = '\(--\\|\/\/\\|\*\\|\/\*\\|\*\/\)' " Find the start of the next comment -let b:comment_start = '^\\(\\s*'.b:comment_leader.'.*\\n\\)\\@ ]" :call search('."'".b:comment_start."'".', "W" )' exec 'nnoremap [" :call search('."'".b:comment_end."'".', "W" )' -exec 'vnoremap ]" :exec "normal! gv"call search('."'".b:comment_start."'".', "W" )' -exec 'vnoremap [" :exec "normal! gv"call search('."'".b:comment_end."'".', "W" )' +exec 'xnoremap ]" :exec "normal! gv"call search('."'".b:comment_start."'".', "W" )' +exec 'xnoremap [" :exec "normal! gv"call search('."'".b:comment_end."'".', "W" )' " Comments can be of the form: " /* @@ -431,7 +448,7 @@ exec 'vnoremap [" :exec "normal! gv"call search('."'" " or " -- " or -" // +" // setlocal comments=s1:/*,mb:*,ex:*/,:--,:// " Set completion with CTRL-X CTRL-O to autoloaded function. @@ -443,7 +460,7 @@ if exists('&omnifunc') " This is used by the sqlcomplete.vim plugin " Source it for it's global functions - runtime autoload/syntaxcomplete.vim + runtime autoload/syntaxcomplete.vim setlocal omnifunc=sqlcomplete#Complete " Prevent the intellisense plugin from loading @@ -451,32 +468,32 @@ if exists('&omnifunc') if !exists('g:omni_sql_no_default_maps') " Static maps which use populate the completion list " using Vim's syntax highlighting rules - exec 'imap '.g:ftplugin_sql_omni_key.'a :call sqlcomplete#Map("syntax")' - exec 'imap '.g:ftplugin_sql_omni_key.'k :call sqlcomplete#Map("sqlKeyword")' - exec 'imap '.g:ftplugin_sql_omni_key.'f :call sqlcomplete#Map("sqlFunction")' - exec 'imap '.g:ftplugin_sql_omni_key.'o :call sqlcomplete#Map("sqlOption")' - exec 'imap '.g:ftplugin_sql_omni_key.'T :call sqlcomplete#Map("sqlType")' - exec 'imap '.g:ftplugin_sql_omni_key.'s :call sqlcomplete#Map("sqlStatement")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'a :call sqlcomplete#Map("syntax")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'k :call sqlcomplete#Map("sqlKeyword")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'f :call sqlcomplete#Map("sqlFunction")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'o :call sqlcomplete#Map("sqlOption")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'T :call sqlcomplete#Map("sqlType")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'s :call sqlcomplete#Map("sqlStatement")' " Dynamic maps which use populate the completion list " using the dbext.vim plugin - exec 'imap '.g:ftplugin_sql_omni_key.'t :call sqlcomplete#Map("table")' - exec 'imap '.g:ftplugin_sql_omni_key.'p :call sqlcomplete#Map("procedure")' - exec 'imap '.g:ftplugin_sql_omni_key.'v :call sqlcomplete#Map("view")' - exec 'imap '.g:ftplugin_sql_omni_key.'c :call sqlcomplete#Map("column")' - exec 'imap '.g:ftplugin_sql_omni_key.'l :call sqlcomplete#Map("column_csv")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'t :call sqlcomplete#Map("table")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'p :call sqlcomplete#Map("procedure")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'v :call sqlcomplete#Map("view")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'c :call sqlcomplete#Map("column")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'l :call sqlcomplete#Map("column_csv")' " The next 3 maps are only to be used while the completion window is " active due to the at the beginning of the map - exec 'imap '.g:ftplugin_sql_omni_key.'L :call sqlcomplete#Map("column_csv")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'L :call sqlcomplete#Map("column_csv")' " is not recognized on most Unix systems, so only create " these additional maps on the Windows platform. " If you would like to use these maps, choose a different key and make " the same map in your vimrc. " if has('win32') - exec 'imap '.g:ftplugin_sql_omni_key_right.' =sqlcomplete#DrillIntoTable()' - exec 'imap '.g:ftplugin_sql_omni_key_left.' =sqlcomplete#DrillOutOfColumns()' + exec 'inoremap '.g:ftplugin_sql_omni_key_right.' =sqlcomplete#DrillIntoTable()' + exec 'inoremap '.g:ftplugin_sql_omni_key_left.' =sqlcomplete#DrillOutOfColumns()' " endif " Remove any cached items useful for schema changes - exec 'imap '.g:ftplugin_sql_omni_key.'R :call sqlcomplete#Map("resetCache")' + exec 'inoremap '.g:ftplugin_sql_omni_key.'R :call sqlcomplete#Map("resetCache")' endif if b:sql_compl_savefunc != "" diff --git a/runtime/indent/sqlanywhere.vim b/runtime/indent/sqlanywhere.vim index afc312f8e0..edc9650ad7 100644 --- a/runtime/indent/sqlanywhere.vim +++ b/runtime/indent/sqlanywhere.vim @@ -1,8 +1,8 @@ " Vim indent file " Language: SQL -" Maintainer: David Fishburn -" Last Change: Mon Apr 02 2007 9:13:47 AM -" Version: 1.5 +" Maintainer: David Fishburn +" Last Change: 2012 Dec 05 +" Version: 3.0 " Download: http://vim.sourceforge.net/script.php?script_id=495 " Notes: @@ -18,6 +18,17 @@ " Known Issues: " The Oracle MERGE statement does not have an end tag associated with " it, this can leave the indent hanging to the right one too many. +" +" History: +" 3.0 (Dec 2012) +" Added cpo check +" +" 2.0 +" Added the FOR keyword to SQLBlockStart to handle (Alec Tica): +" for i in 1..100 loop +" |<-- I expect to have indentation here +" end loop; +" " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -25,6 +36,8 @@ if exists("b:did_indent") endif let b:did_indent = 1 let b:current_indent = "sqlanywhere" +let s:keepcpo= &cpo +set cpo&vim setlocal indentkeys-=0{ setlocal indentkeys-=0} @@ -44,20 +57,13 @@ setlocal indentkeys+==~end,=~else,=~elseif,=~elsif,0=~when,0=) " in the indentkeys is typed setlocal indentexpr=GetSQLIndent() -" Only define the functions once. -if exists("*GetSQLIndent") - finish -endif -let s:keepcpo= &cpo -set cpo&vim - " List of all the statements that start a new block. " These are typically words that start a line. " IS is excluded, since it is difficult to determine when the " ending block is (especially for procedures/functions). let s:SQLBlockStart = '^\s*\%('. - \ 'if\|else\|elseif\|elsif\|'. - \ 'while\|loop\|do\|'. + \ 'if\|else\|elseif\|elsif\|'. + \ 'while\|loop\|do\|for\|'. \ 'begin\|'. \ 'case\|when\|merge\|exception'. \ '\)\>' @@ -66,7 +72,7 @@ let s:SQLBlockEnd = '^\s*\(end\)\>' " The indent level is also based on unmatched paranethesis " If a line has an extra "(" increase the indent " If a line has an extra ")" decrease the indent -function s:CountUnbalancedParan( line, paran_to_check ) +function! s:CountUnbalancedParan( line, paran_to_check ) let l = a:line let lp = substitute(l, '[^(]', '', 'g') let l = a:line @@ -88,7 +94,7 @@ function s:CountUnbalancedParan( line, paran_to_check ) endfunction " Unindent commands based on previous indent level -function s:CheckToIgnoreRightParan( prev_lnum, num_levels ) +function! s:CheckToIgnoreRightParan( prev_lnum, num_levels ) let lnum = a:prev_lnum let line = getline(lnum) let ends = 0 @@ -151,7 +157,7 @@ endfunction " something; " WHEN ... " Should return indent level of exception. -function s:GetStmtStarterIndent( keyword, curr_lnum ) +function! s:GetStmtStarterIndent( keyword, curr_lnum ) let lnum = a:curr_lnum " Default - reduce indent by 1 @@ -193,7 +199,7 @@ endfunction " Check if the line is a comment -function s:IsLineComment(lnum) +function! s:IsLineComment(lnum) let rc = synIDattr( \ synID(a:lnum, \ match(getline(a:lnum), '\S')+1, 0) @@ -205,7 +211,7 @@ endfunction " Check if the column is a comment -function s:IsColComment(lnum, cnum) +function! s:IsColComment(lnum, cnum) let rc = synIDattr(synID(a:lnum, a:cnum, 0), "name") \ =~? "comment" @@ -215,7 +221,7 @@ endfunction " Instead of returning a column position, return " an appropriate value as a factor of shiftwidth. -function s:ModuloIndent(ind) +function! s:ModuloIndent(ind) let ind = a:ind if ind > 0 @@ -231,7 +237,7 @@ endfunction " Find correct indent of a new line based upon the previous line -function GetSQLIndent() +function! GetSQLIndent() let lnum = v:lnum let ind = indent(lnum) @@ -242,35 +248,27 @@ function GetSQLIndent() " return ind " endif - " while 1 - " Get previous non-blank line - let prevlnum = prevnonblank(lnum - 1) - if prevlnum <= 0 - return ind - endif + " Get previous non-blank line + let prevlnum = prevnonblank(lnum - 1) + if prevlnum <= 0 + return ind + endif - if s:IsLineComment(prevlnum) == 1 - if getline(v:lnum) =~ '^\s*\*' - let ind = s:ModuloIndent(indent(prevlnum)) - return ind + 1 - endif - " If the previous line is a comment, then return -1 - " to tell Vim to use the formatoptions setting to determine - " the indent to use - " But only if the next line is blank. This would be true if - " the user is typing, but it would not be true if the user - " is reindenting the file - if getline(v:lnum) =~ '^\s*$' - return -1 - endif + if s:IsLineComment(prevlnum) == 1 + if getline(v:lnum) =~ '^\s*\*' + let ind = s:ModuloIndent(indent(prevlnum)) + return ind + 1 endif - - " let prevline = getline(prevlnum) - " if prevline !~ '^\s*$' - " " echom 'previous non blank - break: ' . prevline - " break - " endif - " endwhile + " If the previous line is a comment, then return -1 + " to tell Vim to use the formatoptions setting to determine + " the indent to use + " But only if the next line is blank. This would be true if + " the user is typing, but it would not be true if the user + " is reindenting the file + if getline(v:lnum) =~ '^\s*$' + return -1 + endif + endif " echom 'PREVIOUS INDENT: ' . indent(prevlnum) . ' LINE: ' . getline(prevlnum) @@ -384,7 +382,7 @@ function GetSQLIndent() return s:ModuloIndent(ind) endfunction -let &cpo = s:keepcpo +" Restore: +let &cpo= s:keepcpo unlet s:keepcpo - -" vim:sw=4: +" vim: ts=4 fdm=marker sw=4 diff --git a/runtime/indent/yaml.vim b/runtime/indent/yaml.vim new file mode 100644 index 0000000000..1d03715773 --- /dev/null +++ b/runtime/indent/yaml.vim @@ -0,0 +1,132 @@ +" Vim indent file +" Language: YAML +" Maintainer: Nikolai Pavlov + +" Only load this indent file when no other was loaded. +if exists('b:did_indent') + finish +endif + +let s:save_cpo = &cpo +set cpo&vim + +let b:did_indent = 1 + +setlocal indentexpr=GetYAMLIndent(v:lnum) +setlocal indentkeys=!^F,o,O,0#,0},0],<:>,- +setlocal nosmartindent + +let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent<' + +" Only define the function once. +if exists('*GetYAMLIndent') + finish +endif + +if exists('*shiftwidth') + let s:shiftwidth = function('shiftwidth') +else + function s:shiftwidth() + return &shiftwidth + endfunction +endif + +function s:FindPrevLessIndentedLine(lnum, ...) + let prevlnum = prevnonblank(a:lnum-1) + let curindent = a:0 ? a:1 : indent(a:lnum) + while prevlnum + \&& indent(prevlnum) >= curindent + \&& getline(prevlnum) !~# '^\s*#' + let prevlnum = prevnonblank(prevlnum-1) + endwhile + return prevlnum +endfunction + +function s:FindPrevLEIndentedLineMatchingRegex(lnum, regex) + let plilnum = s:FindPrevLessIndentedLine(a:lnum, indent(a:lnum)+1) + while plilnum && getline(plilnum) !~# a:regex + let plilnum = s:FindPrevLessIndentedLine(plilnum) + endwhile + return plilnum +endfunction + +let s:mapkeyregex='\v^\s*%(\''%([^'']|'''')*\'''. + \ '|\"%([^"\\]|\\.)*\"'. + \ '|%(%(\:\ )@!.)*)\:%(\ |$)' +let s:liststartregex='\v^\s*%(\-%(\ |$))' + +function GetYAMLIndent(lnum) + if a:lnum == 1 || !prevnonblank(a:lnum-1) + return 0 + endif + + let prevlnum = prevnonblank(a:lnum-1) + let previndent = indent(prevlnum) + + let line = getline(a:lnum) + if line =~# '^\s*#' && getline(a:lnum-1) =~# '^\s*#' + " Comment blocks should have identical indent + return previndent + elseif line =~# '^\s*[\]}]' + " Lines containing only closing braces should have previous indent + return indent(s:FindPrevLessIndentedLine(a:lnum)) + endif + + " Ignore comment lines when calculating indent + while getline(prevlnum) =~# '^\s*#' + let prevlnum = prevnonblank(prevlnum-1) + if !prevlnum + return previndent + endif + endwhile + + let prevline = getline(prevlnum) + let previndent = indent(prevlnum) + + " Any examples below assume that shiftwidth=2 + if prevline =~# '\v[{[:]$|[:-]\ [|>][+\-]?%(\s+\#.*|\s*)$' + " Mapping key: + " nested mapping: ... + " + " - { + " key: [ + " list value + " ] + " } + " + " - |- + " Block scalar without indentation indicator + return previndent+s:shiftwidth() + elseif prevline =~# '\v[:-]\ [|>]%(\d+[+\-]?|[+\-]?\d+)%(\#.*|\s*)$' + " - |+2 + " block scalar with indentation indicator + "#^^ indent+2, not indent+shiftwidth + return previndent + str2nr(matchstr(prevline, + \'\v([:-]\ [|>])@<=[+\-]?\d+%([+\-]?%(\s+\#.*|\s*)$)@=')) + elseif prevline =~# '\v\"%([^"\\]|\\.)*\\$' + " "Multiline string \ + " with escaped end" + let qidx = match(prevline, '\v\"%([^"\\]|\\.)*\\') + return virtcol([prevlnum, qidx+1]) + elseif line =~# s:liststartregex + " List line should have indent equal to previous list line unless it was + " caught by one of the previous rules + return indent(s:FindPrevLEIndentedLineMatchingRegex(a:lnum, + \ s:liststartregex)) + elseif line =~# s:mapkeyregex + " Same for line containing mapping key + return indent(s:FindPrevLEIndentedLineMatchingRegex(a:lnum, + \ s:mapkeyregex)) + elseif prevline =~# '^\s*- ' + " - List with + " multiline scalar + return previndent+2 + elseif prevline =~# s:mapkeyregex + " Mapping with: value + " that is multiline scalar + return previndent+s:shiftwidth() + endif + return previndent +endfunction + +let &cpo = s:save_cpo diff --git a/runtime/lang/menu_cs_cz.iso_8859-2.vim b/runtime/lang/menu_cs_cz.iso_8859-2.vim index 88cf7e2528..410d548ee1 100644 --- a/runtime/lang/menu_cs_cz.iso_8859-2.vim +++ b/runtime/lang/menu_cs_cz.iso_8859-2.vim @@ -1,32 +1,38 @@ -" Menu Translations: Czech for ISO-8859-2 -" Maintainer: Jiri Brezina -" vim:set foldmethod=marker: -" $Revision: 1.3 $ -" $Date: 2005/12/19 22:08:24 $ +" Menu Translations: Czech (ISO-8859-2) +" Maintainer: Jiri Sedlak +" Previous maintainer: Jiri Brezina +" Based on: menu.vim (2012-10-21) " Quit when menu translations have already been done. if exists("did_menu_trans") - finish + finish endif + let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim -scriptencoding ISO-8859-2 +scriptencoding iso-8859-2 " {{{ File menu menutrans &File &Soubor menutrans &Open\.\.\.:e &Otevt\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otevt\ v\ no&vm\ okn\.\.\.:sp +menutrans Open\ Tab\.\.\.:tabnew Otevt\ tab\.\.\.:tabnew menutrans &New:enew &Nov:enew menutrans &Close:close &Zavt:close menutrans &Save:w &Uloit:w menutrans Save\ &As\.\.\.:sav Uloit\ &jako\.\.\.:sav -menutrans Split\ &Diff\ with\.\.\. Rozdlit\ okno\ -\ &Diff\.\.\. -menutrans Split\ Patched\ &By\.\.\. Rozdlit\ okno\ -\ &Patch\.\.\. -menutrans &Print &Tisk -menutrans Sa&ve-Exit:wqa U&loit\ -\ Konec:wqa -menutrans E&xit:qa &Konec:qa +if has("printer") || has("unix") + menutrans &Print &Tisk +endif +menutrans Sa&ve-Exit:wqa U&loit\ a\ ukonit:wqa +menutrans E&xit:qa &Ukonit:qa + +if has("diff") + menutrans Split\ &Diff\ with\.\.\. Rozdlit\ okno\ -\ &Diff\.\.\. + menutrans Split\ Patched\ &By\.\.\. Rozdlit\ okno\ -\ &Patch\.\.\. +endif " }}} " {{{ Edit menu @@ -39,24 +45,32 @@ menutrans &Copy"+y &Kop menutrans &Paste"+gP V&loit"+gP menutrans Put\ &Before[p Vloit\ &ped[p menutrans Put\ &After]p Vloi&t\ za]p -menutrans &Deletex &Smazatx +if has("win32") || has("win16") + menutrans &Deletex &Smazatx +endif menutrans &Select\ AllggVG Vy&brat\ veggVG -menutrans &Find\.\.\. &Hledat\.\.\. -menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. -menutrans Options\.\.\. Volb&y\.\.\. +if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") + menutrans &Find\.\.\. &Hledat\.\.\. + menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. +else + menutrans Find/ &Hledat/ + menutrans Find\ and\ Rep&lace:%s &Nahradit:%s + menutrans Find\ and\ Rep&lace:s &Nahradit:s +endif menutrans Settings\ &Window Nastav&en\ okna - " {{{2 Edit -1 +" {{{2 Edit -1 +menutrans Startup\ &Settings Poten\ &nastaven menutrans &Global\ Settings &Globln\ nastaven menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Pepnout\ zvraznn\ vzoru:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Pepnout\ ignorovn\ &VERZLEK:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Pepnout\ &Showmatch\ \{\(\[\])\}:set\ sm! menutrans &Context\ lines Zobrazit\ konte&xt\ kurzoru menutrans &Virtual\ Edit Virtuln\ p&ozice\ kurzoru - menutrans Never Nikdy - menutrans Block\ Selection Vbr\ Bloku - menutrans Insert\ mode Insert\ md - menutrans Block\ and\ Insert Blok\ a\ Insert - menutrans Always Vdycky +menutrans Never Nikdy +menutrans Block\ Selection Vbr\ Bloku +menutrans Insert\ mode Insert\ md +menutrans Block\ and\ Insert Blok\ a\ Insert +menutrans Always Vdycky menutrans Toggle\ Insert\ &Mode:set\ im! Pepnout\ Insert\ m&d:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Pepnout\ kompatibiln\ reim\ s\ 'vi':set\ cp! menutrans Search\ &Path\.\.\. Nastavit\ &cestu\ k\ prohledvn\.\.\. @@ -65,9 +79,10 @@ menutrans Toggle\ &Toolbar P menutrans Toggle\ &Bottom\ Scrollbar P&epnout\ doln\ rolovac\ litu menutrans Toggle\ &Left\ Scrollbar Pepnout\ &levou\ rolovac\ litu menutrans Toggle\ &Right\ Scrollbar Pepnout\ p&ravou\ rolovac\ litu - " {{{2 Edit -2 +" {{{2 Edit -2 menutrans F&ile\ Settings Nastaven\ so&uboru menutrans Toggle\ Line\ &Numbering:set\ nu! Pepnout\ slovn\ &dk:set\ nu! +menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Pepnout\ relativn\ slovn\ &dk:set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! Pepnout\ &List\ md:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Pepnout\ zala&movn\ dk:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Pepnout\ zl&om\ ve\ slov:set\ lbr! @@ -78,10 +93,12 @@ menutrans &Shiftwidth Nastav&it\ menutrans Soft\ &Tabstop Nastavit\ Soft\ &Tabstop menutrans Te&xt\ Width\.\.\. ka\ te&xtu\.\.\. menutrans &File\ Format\.\.\. &Formt\ souboru\.\.\. - " {{{2 Edit -3 +" {{{2 Edit -3 menutrans C&olor\ Scheme Barevn\ s&chma menutrans &Keymap Klvesov\ m&apa -menutrans Select\ Fo&nt\.\.\. Vybrat\ ps&mo\.\.\. +if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") + menutrans Select\ Fo&nt\.\.\. Vybrat\ ps&mo\.\.\. +endif " }}}1 " {{{ Programming menu @@ -90,46 +107,52 @@ menutrans &Jump\ to\ this\ tagg^] &Sko menutrans Jump\ &back^T Skoit\ &zpt^T menutrans Build\ &Tags\ File &Vytvoit\ soubor\ tag -menutrans &Spelling &Kontrola\ pravopisu -menutrans &Spell\ Check\ On Kontrola\ pravopisu\ &zapnuta -menutrans Spell\ Check\ &Off Kontrola\ pravopisu\ &vypnuta -menutrans To\ Next\ error]s &Dal\ chyba]s -menutrans To\ Previous\ error[s &Pedchoz\ chyba[s -menutrans Suggest\ Correctionsz? &Nvrh\ opravz? -menutrans Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall -menutrans Set\ language\ to\ "en" Nastav\ jazyk\ na\ "en" -menutrans Set\ language\ to\ "en_au" Nastav\ jazyk\ na\ "en_au" -menutrans Set\ language\ to\ "en_ca" Nastav\ jazyk\ na\ "en_ca" -menutrans Set\ language\ to\ "en_gb" Nastav\ jazyk\ na\ "en_gb" -menutrans Set\ language\ to\ "en_nz" Nastav\ jazyk\ na\ "en_nz" -menutrans Set\ language\ to\ "en_us" Nastav\ jazyk\ na\ "en_us" -menutrans Set\ language\ to\ "cz" Nastav\ jazyk\ na\ "cz" -menutrans Set\ language\ to\ "cs_cz" Nastav\ jazyk\ na\ "cs_cz" -menutrans &Find\ More\ Languages Nalzt\ dal\ &jazyky +if has("spell") + menutrans &Spelling &Kontrola\ pravopisu + menutrans &Spell\ Check\ On &Zapnout\ kontrolu\ pravopisu + menutrans Spell\ Check\ &Off &Vypnout \kontrolu\ pravopisu + menutrans To\ &Next\ error]s &Dal\ chyba]s + menutrans To\ &Previous\ error[s &Pedchoz\ chyba[s + menutrans Suggest\ &Correctionsz= &Navrhnout\ opravyz= + menutrans &Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall + menutrans Set\ language\ to\ "en" Nastavit\ jazyk\ na\ "en" + menutrans Set\ language\ to\ "en_au" Nastavit\ jazyk\ na\ "en_au" + menutrans Set\ language\ to\ "en_ca" Nastavit\ jazyk\ na\ "en_ca" + menutrans Set\ language\ to\ "en_gb" Nastavit\ jazyk\ na\ "en_gb" + menutrans Set\ language\ to\ "en_nz" Nastavit\ jazyk\ na\ "en_nz" + menutrans Set\ language\ to\ "en_us" Nastavit\ jazyk\ na\ "en_us" + menutrans &Find\ More\ Languages Nalzt\ dal\ &jazyky + let g:menutrans_set_lang_to = "Nastavit jazyk na" +endif -menutrans &Folding &Foldy -menutrans &Enable/Disable\ foldszi &Ano/Nezi -menutrans &View\ Cursor\ Linezv &Zobrazit\ dek\ kurzoruzv -menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zo&brazit\ pouze\ dek\ kurzoru\ zMzx -menutrans C&lose\ more\ foldszm &Vyjmout\ jednu\ rove\ foldzm -menutrans &Close\ all\ foldszM Zav&t\ vechny\ foldyzM -menutrans O&pen\ more\ foldszr Pidat\ jedn&u\ rove\ foldzr -menutrans &Open\ all\ foldszR &Otevt\ vechny\ foldyzR -menutrans Fold\ Met&hod Metoda\ &skldn - "menutrans M&anual &Run - "menutrans I&ndent &Odsazen - "menutrans E&xpression &Vraz - "menutrans S&yntax &Syntax - "menutrans &Diff &Diff - "menutrans Ma&rker Ma&rker -menutrans Create\ &Foldzf Vytvoit\ &foldzf -menutrans &Delete\ Foldzd Vymazat\ fol&dzd -menutrans Delete\ &All\ FoldszD V&ymazat\ vechny\ foldyzD -menutrans Fold\ col&umn\ width Sloupec\ zob&razen\ fold +if has("Folding") + menutrans &Folding &Skldn + menutrans &Enable/Disable\ foldszi &Ano/Nezi + menutrans &View\ Cursor\ Linezv Zobrazit\ dek\ &kurzoruzv + menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazit\ &pouze\ dek\ kurzoru\ zMzx + menutrans C&lose\ more\ foldszm Sloit\ &jednu\ rove\ skladzm + menutrans &Close\ all\ foldszM Sloit\ vechny\ skladyzM + menutrans O&pen\ more\ foldszr Pidat\ jednu\ rove\ skladzr + menutrans &Open\ all\ foldszR &Otevt\ vechny\ skladyzR + menutrans Fold\ Met&hod &Metoda\ skldn + menutrans M&anual &Run + menutrans I&ndent &Odsazen + menutrans E&xpression &Vraz + menutrans S&yntax &Syntaxe + menutrans &Diff &Rozdly + menutrans Ma&rker &Znaky + menutrans Create\ &Foldzf Vytvoit\ &skladzf + menutrans &Delete\ Foldzd Vymazat\ skla&dzd + menutrans Delete\ &All\ FoldszD Vymazat\ vechny\ skladyzD + menutrans Fold\ col&umn\ width Sloupec\ zob&razen\ sklad +endif + +if has("diff") + menutrans &Update &Obnovit + menutrans &Get\ Block &Sejmout\ Blok + menutrans &Put\ Block &Vloit\ Blok +endif -menutrans &Update &Obnovit -menutrans &Get\ Block &Sejmout\ Blok -menutrans &Put\ Block &Vloit\ Blok menutrans &Make:make &Make:make menutrans &List\ Errors:cl Vpis\ &chyb:cl menutrans L&ist\ Messages:cl! Vp&is\ zprv:cl! @@ -142,7 +165,7 @@ menutrans SeT\ Compiler Nas&taven menutrans &Update:cwin O&bnovit:cwin menutrans &Open:copen &Otevt:copen menutrans &Close:cclose &Zavt:cclose -menutrans &Set\ Compiler N&astavit\ kompiltor +menutrans Se&T\ Compiler N&astavit\ kompiltor menutrans &Convert\ to\ HEX:%!xxd Pevst\ do\ estnctkovho\ formt&u:%!xxd menutrans Conve&rt\ back:%!xxd\ -r P&evst\ zpt:%!xxd\ -r @@ -170,7 +193,6 @@ menutrans &Delete Z&ru menutrans &Alternate &Zmnit menutrans &Next &Dal menutrans &Previous &Pedchoz -menutrans [No\ File] [dn\ soubor] " }}} " {{{ Menu Window @@ -221,6 +243,8 @@ menutrans &Paste &Vlo menutrans &Delete &Smazat menutrans Select\ Blockwise Vybrat\ blokov menutrans Select\ &Word Vybrat\ &slovo +menutrans Select\ Pa&ragraph Vybrat\ &odstavec +menutrans Select\ &Sentence Vybrat\ v&tu menutrans Select\ &Line Vybrat\ &dek menutrans Select\ &Block Vybrat\ &blok menutrans Select\ &All Vybrat\ &ve @@ -228,42 +252,57 @@ menutrans Select\ &All Vybrat\ &v " {{{ The GUI toolbar if has("toolbar") - if exists("*Do_toolbar_tmenu") - delfun Do_toolbar_tmenu - endif - fun Do_toolbar_tmenu() - tmenu ToolBar.Open Otevt soubor - tmenu ToolBar.Save Uloit soubor - tmenu ToolBar.SaveAll Uloit vechny soubory - tmenu ToolBar.Print Tisk - tmenu ToolBar.Undo Zpt - tmenu ToolBar.Redo Zruit vrcen - tmenu ToolBar.Cut Vyznout - tmenu ToolBar.Copy Koprovat - tmenu ToolBar.Paste Vloit - tmenu ToolBar.Find Hledat... - tmenu ToolBar.FindNext Hledat dal - tmenu ToolBar.FindPrev Hledat pedchoz - tmenu ToolBar.Replace Nahradit... - if 0 " disabled; These are in the Windows menu - tmenu ToolBar.New Nov okno - tmenu ToolBar.WinSplit Rozdlit okno - tmenu ToolBar.WinMax Maximalizovat okno - tmenu ToolBar.WinMin Minimalizovat okno - tmenu ToolBar.WinClose Zavt okno - endif - tmenu ToolBar.LoadSesn Nast sezen - tmenu ToolBar.SaveSesn Uloit sezen - tmenu ToolBar.RunScript Spustit skript - tmenu ToolBar.Make Spustit make - tmenu ToolBar.Shell Spustit shell - tmenu ToolBar.RunCtags Spustit ctags - tmenu ToolBar.TagJump Skoit na tag pod kurzorem - tmenu ToolBar.Help Npovda - tmenu ToolBar.FindHelp Hledat npovdu k... - endfun + if exists("*Do_toolbar_tmenu") + delfun Do_toolbar_tmenu + endif + fun Do_toolbar_tmenu() + tmenu ToolBar.Open Otevt soubor + tmenu ToolBar.Save Uloit soubor + tmenu ToolBar.SaveAll Uloit vechny soubory + if has("printer") || has("unix") + tmenu ToolBar.Print Tisk + endif + tmenu ToolBar.Undo Zpt + tmenu ToolBar.Redo Zruit vrcen + tmenu ToolBar.Cut Vyznout + tmenu ToolBar.Copy Koprovat + tmenu ToolBar.Paste Vloit + tmenu ToolBar.Find Hledat... + tmenu ToolBar.FindNext Hledat dal + tmenu ToolBar.FindPrev Hledat pedchoz + tmenu ToolBar.Replace Nahradit... + if 0 " disabled; These are in the Windows menu + tmenu ToolBar.New Nov okno + tmenu ToolBar.WinSplit Rozdlit okno + tmenu ToolBar.WinMax Maximalizovat okno + tmenu ToolBar.WinMin Minimalizovat okno + tmenu ToolBar.WinClose Zavt okno + endif + tmenu ToolBar.LoadSesn Nast sezen + tmenu ToolBar.SaveSesn Uloit sezen + tmenu ToolBar.RunScript Spustit skript + tmenu ToolBar.Make Spustit make + tmenu ToolBar.Shell Spustit shell + tmenu ToolBar.RunCtags Spustit ctags + tmenu ToolBar.TagJump Skoit na tag pod kurzorem + tmenu ToolBar.Help Npovda + tmenu ToolBar.FindHelp Hledat npovdu k... + endfun endif " }}} +" {{{ DIALOG TEXTS +let g:menutrans_no_file = "[dn soubor]" +let g:menutrans_help_dialog = "Zadejte hledan pkaz nebo slovo:\n\n\tPidejte i_ pro pkazy vkldacho reimu (nap. i_CTRL-X)\n\tPidejte c_ pro pkazy pkazov dky (nap. c_)\n\tPidejte ' pro jmno volby (nap. 'shiftwidth')" +let g:menutrans_path_dialog = "Zadejte cesty pro vyhledvn soubor. Jednotliv cesty oddlte rkou" +let g:menutrans_tags_dialog = "Zadejte jmna soubor s tagy. Jmna oddlte rkami." +let g:menutrans_textwidth_dialog = "Zadejte dlku dku (0 pro zakzn formtovn):" +let g:menutrans_fileformat_dialog = "Vyberte typ konce dk" +" }}}" + let &cpo = s:keepcpo unlet s:keepcpo + + + +" vim:set foldmethod=marker expandtab tabstop=3 shiftwidth=3: diff --git a/runtime/lang/menu_cs_cz.latin1.vim b/runtime/lang/menu_cs_cz.latin1.vim index efb28a0037..3bf608de81 100644 --- a/runtime/lang/menu_cs_cz.latin1.vim +++ b/runtime/lang/menu_cs_cz.latin1.vim @@ -1,3 +1,3 @@ " Menu Translations: Czech -source :p:h/menu_czech_czech_republic.1252.vim +source :p:h/menu_czech_czech_republic.ascii.vim diff --git a/runtime/lang/menu_cs_cz.utf-8.vim b/runtime/lang/menu_cs_cz.utf-8.vim new file mode 100644 index 0000000000..91a8eccd46 --- /dev/null +++ b/runtime/lang/menu_cs_cz.utf-8.vim @@ -0,0 +1,308 @@ +" Menu Translations: Czech (UTF-8) +" Maintainer: Jiri Sedlak +" Previous maintainer: Jiri Brezina +" Based on: menu.vim (2012-10-21) + +" Quit when menu translations have already been done. +if exists("did_menu_trans") + finish +endif + +let did_menu_trans = 1 +let s:keepcpo= &cpo +set cpo&vim + +scriptencoding utf-8 + +" {{{ File menu +menutrans &File &Soubor +menutrans &Open\.\.\.:e &Otevřít\.\.\.:e +menutrans Sp&lit-Open\.\.\.:sp Otevřít\ v\ no&vém\ okně\.\.\.:sp +menutrans Open\ Tab\.\.\.:tabnew Otevřít\ tab\.\.\.:tabnew +menutrans &New:enew &Nový:enew +menutrans &Close:close &Zavřít:close +menutrans &Save:w &Uložit:w +menutrans Save\ &As\.\.\.:sav Uložit\ &jako\.\.\.:sav +if has("printer") || has("unix") + menutrans &Print &Tisk +endif +menutrans Sa&ve-Exit:wqa U&ložit\ a\ ukončit:wqa +menutrans E&xit:qa &Ukončit:qa + +if has("diff") + menutrans Split\ &Diff\ with\.\.\. Rozdělit\ okno\ -\ &Diff\.\.\. + menutrans Split\ Patched\ &By\.\.\. Rozdělit\ okno\ -\ &Patch\.\.\. +endif +" }}} + +" {{{ Edit menu +menutrans &Edit Úpr&avy +menutrans &Undou &Zpětu +menutrans &Redo^R Z&rušit\ vrácení^R +menutrans Rep&eat\. &Opakovat\. +menutrans Cu&t"+x &Vyříznout"+x +menutrans &Copy"+y &Kopírovat"+y +menutrans &Paste"+gP V&ložit"+gP +menutrans Put\ &Before[p Vložit\ &před[p +menutrans Put\ &After]p Vloži&t\ za]p +if has("win32") || has("win16") + menutrans &Deletex &Smazatx +endif +menutrans &Select\ AllggVG Vy&brat\ všeggVG +if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") + menutrans &Find\.\.\. &Hledat\.\.\. + menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. +else + menutrans Find/ &Hledat/ + menutrans Find\ and\ Rep&lace:%s &Nahradit:%s + menutrans Find\ and\ Rep&lace:s &Nahradit:s +endif +menutrans Settings\ &Window Nastav&ení\ okna +" {{{2 Edit -1 +menutrans Startup\ &Settings Počáteční\ &nastavení +menutrans &Global\ Settings &Globální\ nastavení +menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Přepnout\ zvýraznění\ vzoru:set\ hls! +menutrans Toggle\ &Ignore-case:set\ ic! Přepnout\ ignorování\ &VERZÁLEK:set\ ic! +menutrans Toggle\ &Showmatch:set\ sm! Přepnout\ &Showmatch\ \{\(\[\])\}:set\ sm! +menutrans &Context\ lines Zobrazit\ konte&xt\ kurzoru +menutrans &Virtual\ Edit Virtuální\ p&ozice\ kurzoru +menutrans Never Nikdy +menutrans Block\ Selection Výběr\ Bloku +menutrans Insert\ mode Insert\ mód +menutrans Block\ and\ Insert Blok\ a\ Insert +menutrans Always Vždycky +menutrans Toggle\ Insert\ &Mode:set\ im! Přepnout\ Insert\ mó&d:set\ im! +menutrans Toggle\ Vi\ C&ompatible:set\ cp! Přepnout\ kompatibilní\ režim\ s\ 'vi':set\ cp! +menutrans Search\ &Path\.\.\. Nastavit\ &cestu\ k\ prohledávání\.\.\. +menutrans Ta&g\ Files\.\.\. Ta&g\ soubory\.\.\. +menutrans Toggle\ &Toolbar Přepnout\ &Toolbar +menutrans Toggle\ &Bottom\ Scrollbar Př&epnout\ dolní\ rolovací\ lištu +menutrans Toggle\ &Left\ Scrollbar Přepnout\ &levou\ rolovací\ lištu +menutrans Toggle\ &Right\ Scrollbar Přepnout\ p&ravou\ rolovací\ lištu +" {{{2 Edit -2 +menutrans F&ile\ Settings Nastavení\ so&uboru +menutrans Toggle\ Line\ &Numbering:set\ nu! Přepnout\ číslování\ řá&dků:set\ nu! +menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Přepnout\ relativní\ číslování\ řá&dků:set\ rnu! +menutrans Toggle\ &List\ Mode:set\ list! Přepnout\ &List\ mód:set\ list! +menutrans Toggle\ Line\ &Wrap:set\ wrap! Přepnout\ zala&mování\ řádků:set\ wrap! +menutrans Toggle\ W&rap\ at\ word:set\ lbr! Přepnout\ zl&om\ ve\ slově:set\ lbr! +menutrans Toggle\ &expand-tab:set\ et! Přepnout\ &expand-tab:set\ et! +menutrans Toggle\ &auto-indent:set\ ai! Přepnout\ &auto-indent:set\ ai! +menutrans Toggle\ &C-indenting:set\ cin! Přepnout\ &C-indenting:set\ cin! +menutrans &Shiftwidth Nastav&it\ šířku\ od&sazení +menutrans Soft\ &Tabstop Nastavit\ Soft\ &Tabstop +menutrans Te&xt\ Width\.\.\. Šířka\ te&xtu\.\.\. +menutrans &File\ Format\.\.\. &Formát\ souboru\.\.\. +" {{{2 Edit -3 +menutrans C&olor\ Scheme Barevné\ s&chéma +menutrans &Keymap Klávesová\ m&apa +if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") + menutrans Select\ Fo&nt\.\.\. Vybrat\ pís&mo\.\.\. +endif +" }}}1 + +" {{{ Programming menu +menutrans &Tools Nást&roje +menutrans &Jump\ to\ this\ tagg^] &Skočit\ na\ tagg^] +menutrans Jump\ &back^T Skočit\ &zpět^T +menutrans Build\ &Tags\ File &Vytvořit\ soubor\ tagů + +if has("spell") + menutrans &Spelling &Kontrola\ pravopisu + menutrans &Spell\ Check\ On &Zapnout\ kontrolu\ pravopisu + menutrans Spell\ Check\ &Off &Vypnout \kontrolu\ pravopisu + menutrans To\ &Next\ error]s &Další\ chyba]s + menutrans To\ &Previous\ error[s &Předchozí\ chyba[s + menutrans Suggest\ &Correctionsz= &Navrhnout\ opravyz= + menutrans &Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall + menutrans Set\ language\ to\ "en" Nastavit\ jazyk\ na\ "en" + menutrans Set\ language\ to\ "en_au" Nastavit\ jazyk\ na\ "en_au" + menutrans Set\ language\ to\ "en_ca" Nastavit\ jazyk\ na\ "en_ca" + menutrans Set\ language\ to\ "en_gb" Nastavit\ jazyk\ na\ "en_gb" + menutrans Set\ language\ to\ "en_nz" Nastavit\ jazyk\ na\ "en_nz" + menutrans Set\ language\ to\ "en_us" Nastavit\ jazyk\ na\ "en_us" + menutrans &Find\ More\ Languages Nalézt\ další\ &jazyky + let g:menutrans_set_lang_to = "Nastavit jazyk na" +endif + +if has("Folding") + menutrans &Folding &Skládání + menutrans &Enable/Disable\ foldszi &Ano/Nezi + menutrans &View\ Cursor\ Linezv Zobrazit\ řádek\ &kurzoruzv + menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazit\ &pouze\ řádek\ kurzoru\ zMzx + menutrans C&lose\ more\ foldszm Složit\ &jednu\ úroveň\ skladůzm + menutrans &Close\ all\ foldszM Složit\ všechny\ skladyzM + menutrans O&pen\ more\ foldszr Přidat\ jednu\ úroveň\ skladůzr + menutrans &Open\ all\ foldszR &Otevřít\ všechny\ skladyzR + menutrans Fold\ Met&hod &Metoda\ skládání + menutrans M&anual &Ručně + menutrans I&ndent &Odsazení + menutrans E&xpression &Výraz + menutrans S&yntax &Syntaxe + menutrans &Diff &Rozdíly + menutrans Ma&rker &Značky + menutrans Create\ &Foldzf Vytvořit\ &skladzf + menutrans &Delete\ Foldzd Vymazat\ skla&dzd + menutrans Delete\ &All\ FoldszD Vymazat\ všechny\ skladyzD + menutrans Fold\ col&umn\ width Sloupec\ zob&razení\ skladů +endif + +if has("diff") + menutrans &Update &Obnovit + menutrans &Get\ Block &Sejmout\ Blok + menutrans &Put\ Block &Vložit\ Blok +endif + +menutrans &Make:make &Make:make +menutrans &List\ Errors:cl Výpis\ &chyb:cl +menutrans L&ist\ Messages:cl! Výp&is\ zpráv:cl! +menutrans &Next\ Error:cn Další\ ch&yba:cn +menutrans &Previous\ Error:cp &Předchozí\ chyba:cp +menutrans &Older\ List:cold Sta&rší\ seznam:cold +menutrans N&ewer\ List:cnew N&ovější\ seznam:cnew +menutrans Error\ &Window Chybové\ o&kno +menutrans SeT\ Compiler Nas&tavení\ kompilátoru +menutrans &Update:cwin O&bnovit:cwin +menutrans &Open:copen &Otevřít:copen +menutrans &Close:cclose &Zavřít:cclose +menutrans Se&T\ Compiler N&astavit\ kompilátor + +menutrans &Convert\ to\ HEX:%!xxd Převést\ do\ šestnáctkového\ formát&u:%!xxd +menutrans Conve&rt\ back:%!xxd\ -r Př&evést\ zpět:%!xxd\ -r +" }}} + +" {{{ Syntax menu +menutrans &Syntax Synta&xe +menutrans Set\ '&syntax'\ only Nastavit\ pouze\ 'synta&x' +menutrans Set\ '&filetype'\ too Nastavit\ také\ '&filetype' +menutrans &Off &Vypnout +menutrans &Manual &Ručně +menutrans A&utomatic A&utomaticky +menutrans on/off\ for\ &This\ file &Přepnout\ (pro\ tento\ soubor) +menutrans o&ff\ (this\ file) vyp&nout\ (pro\ tento\ soubor) +menutrans Co&lor\ test Test\ &barev +menutrans &Highlight\ test &Test\ zvýrazňování +menutrans &Convert\ to\ HTML Převést\ &do\ HTML +menutrans &Show\ filetypes\ in\ menu &Zobrazit\ výběr\ možností +" }}} + +" {{{ Menu Buffers +menutrans &Buffers &Buffery +menutrans &Refresh\ menu &Obnovit\ menu +menutrans &Delete Z&rušit +menutrans &Alternate &Změnit +menutrans &Next &Další +menutrans &Previous &Předchozí +" }}} + +" {{{ Menu Window +menutrans &Window &Okna +menutrans &New^Wn &Nové^Wn +menutrans S&plit^Ws &Rozdělit^Ws +menutrans Sp&lit\ To\ #^W^^ Ro&zdělit\ na\ #^W^^ +menutrans Split\ &Vertically^Wv Rozdělit\ &vertikálně^Wv +menutrans Split\ File\ E&xplorer Rozdělit\ -\ File\ E&xplorer +menutrans Move\ &To &Přesun +menutrans &Top^WK &Nahoru^WK +menutrans &Bottom^WJ &Dolu^WJ +menutrans &Left\ side^WH &Vlevo^WH +menutrans &Right\ side^WL Vp&ravo^WL + +menutrans &Close^Wc Zavří&t^Wc +menutrans Close\ &Other(s)^Wo Zavřít\ &ostatní^Wo +menutrans Ne&xt^Ww &Další^Ww +menutrans P&revious^WW &Předchozí^WW +menutrans &Equal\ Size^W= &Stejná\ výška^W= +menutrans &Max\ Height^W_ Maximální\ výš&ka^W_ +menutrans M&in\ Height^W1_ M&inimální\ výška^W1_ +menutrans Max\ &Width^W\| &Maximální\ šířka^W\| +menutrans Min\ Widt&h^W1\| Minimální\ šířk&a^W1\| +menutrans Rotate\ &Up^WR Rotovat\ na&horu^WR +menutrans Rotate\ &Down^Wr Rotovat\ &dolů^Wr + +" {{{ Help menu +menutrans &Help &Nápověda +menutrans &Overview &Přehled +menutrans &User\ Manual &Uživatelský\ Manuál +menutrans &How-to\ links Ho&wto +menutrans &GUI &Grafické\ rozhraní +menutrans &Credits &Autoři +menutrans Co&pying &Licenční\ politika +menutrans &Sponsor/Register Sponzorování/&Registrace +menutrans &Find\.\.\. &Hledat\.\.\. +menutrans O&rphans O&siřelé\ děti +menutrans &Version &Verze +menutrans &About &O\ aplikaci +" }}} + +" {{{ The popup menu +menutrans &Undo &Zpět +menutrans Cu&t &Vyříznout +menutrans &Copy &Kopírovat +menutrans &Paste &Vložit +menutrans &Delete &Smazat +menutrans Select\ Blockwise Vybrat\ blokově +menutrans Select\ &Word Vybrat\ &slovo +menutrans Select\ Pa&ragraph Vybrat\ &odstavec +menutrans Select\ &Sentence Vybrat\ vě&tu +menutrans Select\ &Line Vybrat\ &řádek +menutrans Select\ &Block Vybrat\ &blok +menutrans Select\ &All Vybrat\ &vše +" }}} + +" {{{ The GUI toolbar +if has("toolbar") + if exists("*Do_toolbar_tmenu") + delfun Do_toolbar_tmenu + endif + fun Do_toolbar_tmenu() + tmenu ToolBar.Open Otevřít soubor + tmenu ToolBar.Save Uložit soubor + tmenu ToolBar.SaveAll Uložit všechny soubory + if has("printer") || has("unix") + tmenu ToolBar.Print Tisk + endif + tmenu ToolBar.Undo Zpět + tmenu ToolBar.Redo Zrušit vrácení + tmenu ToolBar.Cut Vyříznout + tmenu ToolBar.Copy Kopírovat + tmenu ToolBar.Paste Vložit + tmenu ToolBar.Find Hledat... + tmenu ToolBar.FindNext Hledat další + tmenu ToolBar.FindPrev Hledat předchozí + tmenu ToolBar.Replace Nahradit... + if 0 " disabled; These are in the Windows menu + tmenu ToolBar.New Nové okno + tmenu ToolBar.WinSplit Rozdělit okno + tmenu ToolBar.WinMax Maximalizovat okno + tmenu ToolBar.WinMin Minimalizovat okno + tmenu ToolBar.WinClose Zavřít okno + endif + tmenu ToolBar.LoadSesn Načíst sezení + tmenu ToolBar.SaveSesn Uložit sezení + tmenu ToolBar.RunScript Spustit skript + tmenu ToolBar.Make Spustit make + tmenu ToolBar.Shell Spustit shell + tmenu ToolBar.RunCtags Spustit ctags + tmenu ToolBar.TagJump Skočit na tag pod kurzorem + tmenu ToolBar.Help Nápověda + tmenu ToolBar.FindHelp Hledat nápovědu k... + endfun +endif +" }}} + +" {{{ DIALOG TEXTS +let g:menutrans_no_file = "[Žádný soubor]" +let g:menutrans_help_dialog = "Zadejte hledaný příkaz nebo slovo:\n\n\tPřidejte i_ pro příkazy vkládacího režimu (např. i_CTRL-X)\n\tPřidejte c_ pro příkazy příkazové řádky (např. c_)\n\tPřidejte ' pro jméno volby (např. 'shiftwidth')" +let g:menutrans_path_dialog = "Zadejte cesty pro vyhledávání souborů. Jednotlivé cesty oddělte čárkou" +let g:menutrans_tags_dialog = "Zadejte jména souborů s tagy. Jména oddělte čárkami." +let g:menutrans_textwidth_dialog = "Zadejte délku řádku (0 pro zakázání formátování):" +let g:menutrans_fileformat_dialog = "Vyberte typ konce řádků" +" }}}" + +let &cpo = s:keepcpo +unlet s:keepcpo + + + +" vim:set foldmethod=marker expandtab tabstop=3 shiftwidth=3: diff --git a/runtime/lang/menu_czech_czech_republic.1250.vim b/runtime/lang/menu_czech_czech_republic.1250.vim index ebaab9b679..f9c85d038a 100644 --- a/runtime/lang/menu_czech_czech_republic.1250.vim +++ b/runtime/lang/menu_czech_czech_republic.1250.vim @@ -1,13 +1,13 @@ -" Menu Translations: Czech for MS-Windows -" Maintainer: Jiri Brezina -" vim:set foldmethod=marker: -" $Revision: 1.3 $ -" $Date: 2005/12/19 22:13:30 $ +" Menu Translations: Czech (CP1250) +" Maintainer: Jiri Sedlak +" Previous maintainer: Jiri Brezina +" Based on: menu.vim (2012-10-21) " Quit when menu translations have already been done. if exists("did_menu_trans") - finish + finish endif + let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim @@ -18,15 +18,21 @@ scriptencoding cp1250 menutrans &File &Soubor menutrans &Open\.\.\.:e &Otevt\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otevt\ v\ no&vm\ okn\.\.\.:sp +menutrans Open\ Tab\.\.\.:tabnew Otevt\ tab\.\.\.:tabnew menutrans &New:enew &Nov:enew menutrans &Close:close &Zavt:close menutrans &Save:w &Uloit:w menutrans Save\ &As\.\.\.:sav Uloit\ &jako\.\.\.:sav -menutrans Split\ &Diff\ with\.\.\. Rozdlit\ okno\ -\ &Diff\.\.\. -menutrans Split\ Patched\ &By\.\.\. Rozdlit\ okno\ -\ &Patch\.\.\. -menutrans &Print &Tisk -menutrans Sa&ve-Exit:wqa U&loit\ -\ Konec:wqa -menutrans E&xit:qa &Konec:qa +if has("printer") || has("unix") + menutrans &Print &Tisk +endif +menutrans Sa&ve-Exit:wqa U&loit\ a\ ukonit:wqa +menutrans E&xit:qa &Ukonit:qa + +if has("diff") + menutrans Split\ &Diff\ with\.\.\. Rozdlit\ okno\ -\ &Diff\.\.\. + menutrans Split\ Patched\ &By\.\.\. Rozdlit\ okno\ -\ &Patch\.\.\. +endif " }}} " {{{ Edit menu @@ -39,24 +45,32 @@ menutrans &Copy"+y &Kop menutrans &Paste"+gP V&loit"+gP menutrans Put\ &Before[p Vloit\ &ped[p menutrans Put\ &After]p Vloi&t\ za]p -menutrans &Deletex &Smazatx +if has("win32") || has("win16") + menutrans &Deletex &Smazatx +endif menutrans &Select\ AllggVG Vy&brat\ veggVG -menutrans &Find\.\.\. &Hledat\.\.\. -menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. -menutrans Options\.\.\. Volb&y\.\.\. +if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") + menutrans &Find\.\.\. &Hledat\.\.\. + menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. +else + menutrans Find/ &Hledat/ + menutrans Find\ and\ Rep&lace:%s &Nahradit:%s + menutrans Find\ and\ Rep&lace:s &Nahradit:s +endif menutrans Settings\ &Window Nastav&en\ okna - " {{{2 Edit -1 +" {{{2 Edit -1 +menutrans Startup\ &Settings Poten\ &nastaven menutrans &Global\ Settings &Globln\ nastaven menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Pepnout\ zvraznn\ vzoru:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Pepnout\ ignorovn\ &VERZLEK:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Pepnout\ &Showmatch\ \{\(\[\])\}:set\ sm! menutrans &Context\ lines Zobrazit\ konte&xt\ kurzoru menutrans &Virtual\ Edit Virtuln\ p&ozice\ kurzoru - menutrans Never Nikdy - menutrans Block\ Selection Vbr\ Bloku - menutrans Insert\ mode Insert\ md - menutrans Block\ and\ Insert Blok\ a\ Insert - menutrans Always Vdycky +menutrans Never Nikdy +menutrans Block\ Selection Vbr\ Bloku +menutrans Insert\ mode Insert\ md +menutrans Block\ and\ Insert Blok\ a\ Insert +menutrans Always Vdycky menutrans Toggle\ Insert\ &Mode:set\ im! Pepnout\ Insert\ m&d:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Pepnout\ kompatibiln\ reim\ s\ 'vi':set\ cp! menutrans Search\ &Path\.\.\. Nastavit\ &cestu\ k\ prohledvn\.\.\. @@ -65,9 +79,10 @@ menutrans Toggle\ &Toolbar P menutrans Toggle\ &Bottom\ Scrollbar P&epnout\ doln\ rolovac\ litu menutrans Toggle\ &Left\ Scrollbar Pepnout\ &levou\ rolovac\ litu menutrans Toggle\ &Right\ Scrollbar Pepnout\ p&ravou\ rolovac\ litu - " {{{2 Edit -2 +" {{{2 Edit -2 menutrans F&ile\ Settings Nastaven\ so&uboru menutrans Toggle\ Line\ &Numbering:set\ nu! Pepnout\ slovn\ &dk:set\ nu! +menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Pepnout\ relativn\ slovn\ &dk:set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! Pepnout\ &List\ md:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Pepnout\ zala&movn\ dk:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Pepnout\ zl&om\ ve\ slov:set\ lbr! @@ -78,10 +93,12 @@ menutrans &Shiftwidth Nastav&it\ menutrans Soft\ &Tabstop Nastavit\ Soft\ &Tabstop menutrans Te&xt\ Width\.\.\. ka\ te&xtu\.\.\. menutrans &File\ Format\.\.\. &Formt\ souboru\.\.\. - " {{{2 Edit -3 +" {{{2 Edit -3 menutrans C&olor\ Scheme Barevn\ s&chma menutrans &Keymap Klvesov\ m&apa -menutrans Select\ Fo&nt\.\.\. Vybrat\ ps&mo\.\.\. +if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") + menutrans Select\ Fo&nt\.\.\. Vybrat\ ps&mo\.\.\. +endif " }}}1 " {{{ Programming menu @@ -90,46 +107,52 @@ menutrans &Jump\ to\ this\ tagg^] &Sko menutrans Jump\ &back^T Skoit\ &zpt^T menutrans Build\ &Tags\ File &Vytvoit\ soubor\ tag -menutrans &Spelling &Kontrola\ pravopisu -menutrans &Spell\ Check\ On Kontrola\ pravopisu\ &zapnuta -menutrans Spell\ Check\ &Off Kontrola\ pravopisu\ &vypnuta -menutrans To\ Next\ error]s &Dal\ chyba]s -menutrans To\ Previous\ error[s &Pedchoz\ chyba[s -menutrans Suggest\ Correctionsz? &Nvrh\ opravz? -menutrans Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall -menutrans Set\ language\ to\ "en" Nastav\ jazyk\ na\ "en" -menutrans Set\ language\ to\ "en_au" Nastav\ jazyk\ na\ "en_au" -menutrans Set\ language\ to\ "en_ca" Nastav\ jazyk\ na\ "en_ca" -menutrans Set\ language\ to\ "en_gb" Nastav\ jazyk\ na\ "en_gb" -menutrans Set\ language\ to\ "en_nz" Nastav\ jazyk\ na\ "en_nz" -menutrans Set\ language\ to\ "en_us" Nastav\ jazyk\ na\ "en_us" -menutrans Set\ language\ to\ "cz" Nastav\ jazyk\ na\ "cz" -menutrans Set\ language\ to\ "cs_cz" Nastav\ jazyk\ na\ "cs_cz" -menutrans &Find\ More\ Languages Nalzt\ dal\ &jazyky +if has("spell") + menutrans &Spelling &Kontrola\ pravopisu + menutrans &Spell\ Check\ On &Zapnout\ kontrolu\ pravopisu + menutrans Spell\ Check\ &Off &Vypnout \kontrolu\ pravopisu + menutrans To\ &Next\ error]s &Dal\ chyba]s + menutrans To\ &Previous\ error[s &Pedchoz\ chyba[s + menutrans Suggest\ &Correctionsz= &Navrhnout\ opravyz= + menutrans &Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall + menutrans Set\ language\ to\ "en" Nastavit\ jazyk\ na\ "en" + menutrans Set\ language\ to\ "en_au" Nastavit\ jazyk\ na\ "en_au" + menutrans Set\ language\ to\ "en_ca" Nastavit\ jazyk\ na\ "en_ca" + menutrans Set\ language\ to\ "en_gb" Nastavit\ jazyk\ na\ "en_gb" + menutrans Set\ language\ to\ "en_nz" Nastavit\ jazyk\ na\ "en_nz" + menutrans Set\ language\ to\ "en_us" Nastavit\ jazyk\ na\ "en_us" + menutrans &Find\ More\ Languages Nalzt\ dal\ &jazyky + let g:menutrans_set_lang_to = "Nastavit jazyk na" +endif -menutrans &Folding &Foldy -menutrans &Enable/Disable\ foldszi &Ano/Nezi -menutrans &View\ Cursor\ Linezv &Zobrazit\ dek\ kurzoruzv -menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zo&brazit\ pouze\ dek\ kurzoru\ zMzx -menutrans C&lose\ more\ foldszm &Vyjmout\ jednu\ rove\ foldzm -menutrans &Close\ all\ foldszM Zav&t\ vechny\ foldyzM -menutrans O&pen\ more\ foldszr Pidat\ jedn&u\ rove\ foldzr -menutrans &Open\ all\ foldszR &Otevt\ vechny\ foldyzR -menutrans Fold\ Met&hod Metoda\ &skldn - "menutrans M&anual &Run - "menutrans I&ndent &Odsazen - "menutrans E&xpression &Vraz - "menutrans S&yntax &Syntax - "menutrans &Diff &Diff - "menutrans Ma&rker Ma&rker -menutrans Create\ &Foldzf Vytvoit\ &foldzf -menutrans &Delete\ Foldzd Vymazat\ fol&dzd -menutrans Delete\ &All\ FoldszD V&ymazat\ vechny\ foldyzD -menutrans Fold\ col&umn\ width Sloupec\ zob&razen\ fold +if has("Folding") + menutrans &Folding &Skldn + menutrans &Enable/Disable\ foldszi &Ano/Nezi + menutrans &View\ Cursor\ Linezv Zobrazit\ dek\ &kurzoruzv + menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazit\ &pouze\ dek\ kurzoru\ zMzx + menutrans C&lose\ more\ foldszm Sloit\ &jednu\ rove\ skladzm + menutrans &Close\ all\ foldszM Sloit\ vechny\ skladyzM + menutrans O&pen\ more\ foldszr Pidat\ jednu\ rove\ skladzr + menutrans &Open\ all\ foldszR &Otevt\ vechny\ skladyzR + menutrans Fold\ Met&hod &Metoda\ skldn + menutrans M&anual &Run + menutrans I&ndent &Odsazen + menutrans E&xpression &Vraz + menutrans S&yntax &Syntaxe + menutrans &Diff &Rozdly + menutrans Ma&rker &Znaky + menutrans Create\ &Foldzf Vytvoit\ &skladzf + menutrans &Delete\ Foldzd Vymazat\ skla&dzd + menutrans Delete\ &All\ FoldszD Vymazat\ vechny\ skladyzD + menutrans Fold\ col&umn\ width Sloupec\ zob&razen\ sklad +endif + +if has("diff") + menutrans &Update &Obnovit + menutrans &Get\ Block &Sejmout\ Blok + menutrans &Put\ Block &Vloit\ Blok +endif -menutrans &Update &Obnovit -menutrans &Get\ Block &Sejmout\ Blok -menutrans &Put\ Block &Vloit\ Blok menutrans &Make:make &Make:make menutrans &List\ Errors:cl Vpis\ &chyb:cl menutrans L&ist\ Messages:cl! Vp&is\ zprv:cl! @@ -142,7 +165,7 @@ menutrans SeT\ Compiler Nas&taven menutrans &Update:cwin O&bnovit:cwin menutrans &Open:copen &Otevt:copen menutrans &Close:cclose &Zavt:cclose -menutrans &Set\ Compiler N&astavit\ kompiltor +menutrans Se&T\ Compiler N&astavit\ kompiltor menutrans &Convert\ to\ HEX:%!xxd Pevst\ do\ estnctkovho\ formt&u:%!xxd menutrans Conve&rt\ back:%!xxd\ -r P&evst\ zpt:%!xxd\ -r @@ -170,7 +193,6 @@ menutrans &Delete Z&ru menutrans &Alternate &Zmnit menutrans &Next &Dal menutrans &Previous &Pedchoz -menutrans [No\ File] [dn\ soubor] " }}} " {{{ Menu Window @@ -221,6 +243,8 @@ menutrans &Paste &Vlo menutrans &Delete &Smazat menutrans Select\ Blockwise Vybrat\ blokov menutrans Select\ &Word Vybrat\ &slovo +menutrans Select\ Pa&ragraph Vybrat\ &odstavec +menutrans Select\ &Sentence Vybrat\ v&tu menutrans Select\ &Line Vybrat\ &dek menutrans Select\ &Block Vybrat\ &blok menutrans Select\ &All Vybrat\ &ve @@ -228,42 +252,57 @@ menutrans Select\ &All Vybrat\ &v " {{{ The GUI toolbar if has("toolbar") - if exists("*Do_toolbar_tmenu") - delfun Do_toolbar_tmenu - endif - fun Do_toolbar_tmenu() - tmenu ToolBar.Open Otevt soubor - tmenu ToolBar.Save Uloit soubor - tmenu ToolBar.SaveAll Uloit vechny soubory - tmenu ToolBar.Print Tisk - tmenu ToolBar.Undo Zpt - tmenu ToolBar.Redo Zruit vrcen - tmenu ToolBar.Cut Vyznout - tmenu ToolBar.Copy Koprovat - tmenu ToolBar.Paste Vloit - tmenu ToolBar.Find Hledat... - tmenu ToolBar.FindNext Hledat dal - tmenu ToolBar.FindPrev Hledat pedchoz - tmenu ToolBar.Replace Nahradit... - if 0 " disabled; These are in the Windows menu - tmenu ToolBar.New Nov okno - tmenu ToolBar.WinSplit Rozdlit okno - tmenu ToolBar.WinMax Maximalizovat okno - tmenu ToolBar.WinMin Minimalizovat okno - tmenu ToolBar.WinClose Zavt okno - endif - tmenu ToolBar.LoadSesn Nast sezen - tmenu ToolBar.SaveSesn Uloit sezen - tmenu ToolBar.RunScript Spustit skript - tmenu ToolBar.Make Spustit make - tmenu ToolBar.Shell Spustit shell - tmenu ToolBar.RunCtags Spustit ctags - tmenu ToolBar.TagJump Skoit na tag pod kurzorem - tmenu ToolBar.Help Npovda - tmenu ToolBar.FindHelp Hledat npovdu k... - endfun + if exists("*Do_toolbar_tmenu") + delfun Do_toolbar_tmenu + endif + fun Do_toolbar_tmenu() + tmenu ToolBar.Open Otevt soubor + tmenu ToolBar.Save Uloit soubor + tmenu ToolBar.SaveAll Uloit vechny soubory + if has("printer") || has("unix") + tmenu ToolBar.Print Tisk + endif + tmenu ToolBar.Undo Zpt + tmenu ToolBar.Redo Zruit vrcen + tmenu ToolBar.Cut Vyznout + tmenu ToolBar.Copy Koprovat + tmenu ToolBar.Paste Vloit + tmenu ToolBar.Find Hledat... + tmenu ToolBar.FindNext Hledat dal + tmenu ToolBar.FindPrev Hledat pedchoz + tmenu ToolBar.Replace Nahradit... + if 0 " disabled; These are in the Windows menu + tmenu ToolBar.New Nov okno + tmenu ToolBar.WinSplit Rozdlit okno + tmenu ToolBar.WinMax Maximalizovat okno + tmenu ToolBar.WinMin Minimalizovat okno + tmenu ToolBar.WinClose Zavt okno + endif + tmenu ToolBar.LoadSesn Nast sezen + tmenu ToolBar.SaveSesn Uloit sezen + tmenu ToolBar.RunScript Spustit skript + tmenu ToolBar.Make Spustit make + tmenu ToolBar.Shell Spustit shell + tmenu ToolBar.RunCtags Spustit ctags + tmenu ToolBar.TagJump Skoit na tag pod kurzorem + tmenu ToolBar.Help Npovda + tmenu ToolBar.FindHelp Hledat npovdu k... + endfun endif " }}} +" {{{ DIALOG TEXTS +let g:menutrans_no_file = "[dn soubor]" +let g:menutrans_help_dialog = "Zadejte hledan pkaz nebo slovo:\n\n\tPidejte i_ pro pkazy vkldacho reimu (nap. i_CTRL-X)\n\tPidejte c_ pro pkazy pkazov dky (nap. c_)\n\tPidejte ' pro jmno volby (nap. 'shiftwidth')" +let g:menutrans_path_dialog = "Zadejte cesty pro vyhledvn soubor. Jednotliv cesty oddlte rkou" +let g:menutrans_tags_dialog = "Zadejte jmna soubor s tagy. Jmna oddlte rkami." +let g:menutrans_textwidth_dialog = "Zadejte dlku dku (0 pro zakzn formtovn):" +let g:menutrans_fileformat_dialog = "Vyberte typ konce dk" +" }}}" + let &cpo = s:keepcpo unlet s:keepcpo + + + +" vim:set foldmethod=marker expandtab tabstop=3 shiftwidth=3: diff --git a/runtime/lang/menu_czech_czech_republic.ascii.vim b/runtime/lang/menu_czech_czech_republic.ascii.vim index 7ac8c34e04..1c4fb3ed8f 100644 --- a/runtime/lang/menu_czech_czech_republic.ascii.vim +++ b/runtime/lang/menu_czech_czech_republic.ascii.vim @@ -1,30 +1,38 @@ -" Menu Translations: Czech for systems without localization -" Maintainer: Jiri Brezina -" vim:set foldmethod=marker: -" $Revision: 1.3 $ -" $Date: 2005/12/19 22:06:56 $ +" Menu Translations: Czech (latin1 - w/o diacritics) +" Maintainer: Jiri Sedlak +" Previous maintainer: Jiri Brezina +" Based on: menu.vim (2012-10-21) " Quit when menu translations have already been done. if exists("did_menu_trans") - finish + finish endif + let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim +scriptencoding latin1 + " {{{ File menu menutrans &File &Soubor menutrans &Open\.\.\.:e &Otevrit\.\.\.:e menutrans Sp&lit-Open\.\.\.:sp Otevrit\ v\ no&vem\ okne\.\.\.:sp +menutrans Open\ Tab\.\.\.:tabnew Otevrit\ tab\.\.\.:tabnew menutrans &New:enew &Novy:enew menutrans &Close:close &Zavrit:close menutrans &Save:w &Ulozit:w menutrans Save\ &As\.\.\.:sav Ulozit\ &jako\.\.\.:sav -menutrans Split\ &Diff\ with\.\.\. Rozdelit\ okno\ -\ &Diff\.\.\. -menutrans Split\ Patched\ &By\.\.\. Rozdelit\ okno\ -\ &Patch\.\.\. -menutrans &Print &Tisk -menutrans Sa&ve-Exit:wqa U&lozit\ -\ Konec:wqa -menutrans E&xit:qa &Konec:qa +if has("printer") || has("unix") + menutrans &Print &Tisk +endif +menutrans Sa&ve-Exit:wqa U&lozit\ a\ ukoncit:wqa +menutrans E&xit:qa &Ukoncit:qa + +if has("diff") + menutrans Split\ &Diff\ with\.\.\. Rozdelit\ okno\ -\ &Diff\.\.\. + menutrans Split\ Patched\ &By\.\.\. Rozdelit\ okno\ -\ &Patch\.\.\. +endif " }}} " {{{ Edit menu @@ -37,24 +45,32 @@ menutrans &Copy"+y &Kopirovat"+y menutrans &Paste"+gP V&lozit"+gP menutrans Put\ &Before[p Vlozit\ &pred[p menutrans Put\ &After]p Vlozi&t\ za]p -menutrans &Deletex &Smazatx +if has("win32") || has("win16") + menutrans &Deletex &Smazatx +endif menutrans &Select\ AllggVG Vy&brat\ vseggVG -menutrans &Find\.\.\. &Hledat\.\.\. -menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. -menutrans Options\.\.\. Volb&y\.\.\. +if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") + menutrans &Find\.\.\. &Hledat\.\.\. + menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\. +else + menutrans Find/ &Hledat/ + menutrans Find\ and\ Rep&lace:%s &Nahradit:%s + menutrans Find\ and\ Rep&lace:s &Nahradit:s +endif menutrans Settings\ &Window Nastav&eni\ okna - " {{{2 Edit -1 +" {{{2 Edit -1 +menutrans Startup\ &Settings Pocatecni\ &nastaveni menutrans &Global\ Settings &Globalni\ nastaveni menutrans Toggle\ Pattern\ &Highlight:set\ hls! &Prepnout\ zvyrazneni\ vzoru:set\ hls! menutrans Toggle\ &Ignore-case:set\ ic! Prepnout\ ignorovani\ &VERZALEK:set\ ic! menutrans Toggle\ &Showmatch:set\ sm! Prepnout\ &Showmatch\ \{\(\[\])\}:set\ sm! menutrans &Context\ lines Zobrazit\ konte&xt\ kurzoru menutrans &Virtual\ Edit Virtualni\ p&ozice\ kurzoru - menutrans Never Nikdy - menutrans Block\ Selection Vyber\ Bloku - menutrans Insert\ mode Insert\ mod - menutrans Block\ and\ Insert Blok\ a\ Insert - menutrans Always Vzdycky +menutrans Never Nikdy +menutrans Block\ Selection Vyber\ Bloku +menutrans Insert\ mode Insert\ mod +menutrans Block\ and\ Insert Blok\ a\ Insert +menutrans Always Vzdycky menutrans Toggle\ Insert\ &Mode:set\ im! Prepnout\ Insert\ mo&d:set\ im! menutrans Toggle\ Vi\ C&ompatible:set\ cp! Prepnout\ kompatibilni\ rezim\ s\ 'vi':set\ cp! menutrans Search\ &Path\.\.\. Nastavit\ &cestu\ k\ prohledavani\.\.\. @@ -63,9 +79,10 @@ menutrans Toggle\ &Toolbar Prepnout\ &Toolbar menutrans Toggle\ &Bottom\ Scrollbar Pr&epnout\ dolni\ rolovaci\ listu menutrans Toggle\ &Left\ Scrollbar Prepnout\ &levou\ rolovaci\ listu menutrans Toggle\ &Right\ Scrollbar Prepnout\ p&ravou\ rolovaci\ listu - " {{{2 Edit -2 +" {{{2 Edit -2 menutrans F&ile\ Settings Nastaveni\ so&uboru menutrans Toggle\ Line\ &Numbering:set\ nu! Prepnout\ cislovani\ ra&dku:set\ nu! +menutrans Toggle\ relati&ve\ Line\ Numbering:set\ rnu! Prepnout\ relativni\ cislovani\ ra&dku:set\ rnu! menutrans Toggle\ &List\ Mode:set\ list! Prepnout\ &List\ mod:set\ list! menutrans Toggle\ Line\ &Wrap:set\ wrap! Prepnout\ zala&movani\ radku:set\ wrap! menutrans Toggle\ W&rap\ at\ word:set\ lbr! Prepnout\ zl&om\ ve\ slove:set\ lbr! @@ -76,10 +93,12 @@ menutrans &Shiftwidth Nastav&it\ sirku\ od&sazeni menutrans Soft\ &Tabstop Nastavit\ Soft\ &Tabstop menutrans Te&xt\ Width\.\.\. Sirka\ te&xtu\.\.\. menutrans &File\ Format\.\.\. &Format\ souboru\.\.\. - " {{{2 Edit -3 +" {{{2 Edit -3 menutrans C&olor\ Scheme Barevne\ s&chema menutrans &Keymap Klavesova\ m&apa -menutrans Select\ Fo&nt\.\.\. Vybrat\ pis&mo\.\.\. +if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac") + menutrans Select\ Fo&nt\.\.\. Vybrat\ pis&mo\.\.\. +endif " }}}1 " {{{ Programming menu @@ -88,46 +107,52 @@ menutrans &Jump\ to\ this\ tagg^] &Skocit\ na\ tagg^] menutrans Jump\ &back^T Skocit\ &zpet^T menutrans Build\ &Tags\ File &Vytvorit\ soubor\ tagu -menutrans &Spelling &Kontrola\ pravopisu -menutrans &Spell\ Check\ On Kontrola\ pravopisu\ &zapnuta -menutrans Spell\ Check\ &Off Kontrola\ pravopisu\ &vypnuta -menutrans To\ Next\ error]s &Dalsi\ chyba]s -menutrans To\ Previous\ error[s &Predchozi\ chyba[s -menutrans Suggest\ Correctionsz? &Navrh\ opravz? -menutrans Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall -menutrans Set\ language\ to\ "en" Nastav\ jazyk\ na\ "en" -menutrans Set\ language\ to\ "en_au" Nastav\ jazyk\ na\ "en_au" -menutrans Set\ language\ to\ "en_ca" Nastav\ jazyk\ na\ "en_ca" -menutrans Set\ language\ to\ "en_gb" Nastav\ jazyk\ na\ "en_gb" -menutrans Set\ language\ to\ "en_nz" Nastav\ jazyk\ na\ "en_nz" -menutrans Set\ language\ to\ "en_us" Nastav\ jazyk\ na\ "en_us" -menutrans Set\ language\ to\ "cz" Nastav\ jazyk\ na\ "cz" -menutrans Set\ language\ to\ "cs_cz" Nastav\ jazyk\ na\ "cs_cz" -menutrans &Find\ More\ Languages Nalezt\ dalsi\ &jazyky +if has("spell") + menutrans &Spelling &Kontrola\ pravopisu + menutrans &Spell\ Check\ On &Zapnout\ kontrolu\ pravopisu + menutrans Spell\ Check\ &Off &Vypnout \kontrolu\ pravopisu + menutrans To\ &Next\ error]s &Dalsi\ chyba]s + menutrans To\ &Previous\ error[s &Predchozi\ chyba[s + menutrans Suggest\ &Correctionsz= &Navrhnout\ opravyz= + menutrans &Repeat\ correction:spellrepall Zopakovat\ &opravu:spellrepall + menutrans Set\ language\ to\ "en" Nastavit\ jazyk\ na\ "en" + menutrans Set\ language\ to\ "en_au" Nastavit\ jazyk\ na\ "en_au" + menutrans Set\ language\ to\ "en_ca" Nastavit\ jazyk\ na\ "en_ca" + menutrans Set\ language\ to\ "en_gb" Nastavit\ jazyk\ na\ "en_gb" + menutrans Set\ language\ to\ "en_nz" Nastavit\ jazyk\ na\ "en_nz" + menutrans Set\ language\ to\ "en_us" Nastavit\ jazyk\ na\ "en_us" + menutrans &Find\ More\ Languages Nalezt\ dalsi\ &jazyky + let g:menutrans_set_lang_to = "Nastavit jazyk na" +endif -menutrans &Folding &Foldy -menutrans &Enable/Disable\ foldszi &Ano/Nezi -menutrans &View\ Cursor\ Linezv &Zobrazit\ radek\ kurzoruzv -menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zo&brazit\ pouze\ radek\ kurzoru\ zMzx -menutrans C&lose\ more\ foldszm &Vyjmout\ jednu\ uroven\ folduzm -menutrans &Close\ all\ foldszM Zavri&t\ vsechny\ foldyzM -menutrans O&pen\ more\ foldszr Pridat\ jedn&u\ uroven\ folduzr -menutrans &Open\ all\ foldszR &Otevrit\ vsechny\ foldyzR -menutrans Fold\ Met&hod Metoda\ &skladani - "menutrans M&anual &Rucne - "menutrans I&ndent &Odsazeni - "menutrans E&xpression &Vyraz - "menutrans S&yntax &Syntax - "menutrans &Diff &Diff - "menutrans Ma&rker Ma&rker -menutrans Create\ &Foldzf Vytvorit\ &foldzf -menutrans &Delete\ Foldzd Vymazat\ fol&dzd -menutrans Delete\ &All\ FoldszD V&ymazat\ vsechny\ foldyzD -menutrans Fold\ col&umn\ width Sloupec\ zob&razeni\ foldu +if has("Folding") + menutrans &Folding &Skladani + menutrans &Enable/Disable\ foldszi &Ano/Nezi + menutrans &View\ Cursor\ Linezv Zobrazit\ radek\ &kurzoruzv + menutrans Vie&w\ Cursor\ Line\ onlyzMzx Zobrazit\ &pouze\ radek\ kurzoru\ zMzx + menutrans C&lose\ more\ foldszm Slozit\ &jednu\ uroven\ skladuzm + menutrans &Close\ all\ foldszM Slozit\ vsechny\ skladyzM + menutrans O&pen\ more\ foldszr Pridat\ jednu\ uroven\ skladuzr + menutrans &Open\ all\ foldszR &Otevrit\ vsechny\ skladyzR + menutrans Fold\ Met&hod &Metoda\ skladani + menutrans M&anual &Rucne + menutrans I&ndent &Odsazeni + menutrans E&xpression &Vyraz + menutrans S&yntax &Syntaxe + menutrans &Diff &Rozdily + menutrans Ma&rker &Znacky + menutrans Create\ &Foldzf Vytvorit\ &skladzf + menutrans &Delete\ Foldzd Vymazat\ skla&dzd + menutrans Delete\ &All\ FoldszD Vymazat\ vsechny\ skladyzD + menutrans Fold\ col&umn\ width Sloupec\ zob&razeni\ skladu +endif + +if has("diff") + menutrans &Update &Obnovit + menutrans &Get\ Block &Sejmout\ Blok + menutrans &Put\ Block &Vlozit\ Blok +endif -menutrans &Update &Obnovit -menutrans &Get\ Block &Sejmout\ Blok -menutrans &Put\ Block &Vlozit\ Blok menutrans &Make:make &Make:make menutrans &List\ Errors:cl Vypis\ &chyb:cl menutrans L&ist\ Messages:cl! Vyp&is\ zprav:cl! @@ -140,7 +165,7 @@ menutrans SeT\ Compiler Nas&taveni\ kompilatoru menutrans &Update:cwin O&bnovit:cwin menutrans &Open:copen &Otevrit:copen menutrans &Close:cclose &Zavrit:cclose -menutrans &Set\ Compiler N&astavit\ kompilator +menutrans Se&T\ Compiler N&astavit\ kompilator menutrans &Convert\ to\ HEX:%!xxd Prevest\ do\ sestnactkoveho\ format&u:%!xxd menutrans Conve&rt\ back:%!xxd\ -r Pr&evest\ zpet:%!xxd\ -r @@ -168,7 +193,6 @@ menutrans &Delete Z&rusit menutrans &Alternate &Zmenit menutrans &Next &Dalsi menutrans &Previous &Predchozi -menutrans [No\ File] [Zadny\ soubor] " }}} " {{{ Menu Window @@ -219,6 +243,8 @@ menutrans &Paste &Vlozit menutrans &Delete &Smazat menutrans Select\ Blockwise Vybrat\ blokove menutrans Select\ &Word Vybrat\ &slovo +menutrans Select\ Pa&ragraph Vybrat\ &odstavec +menutrans Select\ &Sentence Vybrat\ ve&tu menutrans Select\ &Line Vybrat\ &radek menutrans Select\ &Block Vybrat\ &blok menutrans Select\ &All Vybrat\ &vse @@ -226,42 +252,57 @@ menutrans Select\ &All Vybrat\ &vse " {{{ The GUI toolbar if has("toolbar") - if exists("*Do_toolbar_tmenu") - delfun Do_toolbar_tmenu - endif - fun Do_toolbar_tmenu() - tmenu ToolBar.Open Otevrit soubor - tmenu ToolBar.Save Ulozit soubor - tmenu ToolBar.SaveAll Ulozit vsechny soubory - tmenu ToolBar.Print Tisk - tmenu ToolBar.Undo Zpet - tmenu ToolBar.Redo Zrusit vraceni - tmenu ToolBar.Cut Vyriznout - tmenu ToolBar.Copy Kopirovat - tmenu ToolBar.Paste Vlozit - tmenu ToolBar.Find Hledat... - tmenu ToolBar.FindNext Hledat dalsi - tmenu ToolBar.FindPrev Hledat predchozi - tmenu ToolBar.Replace Nahradit... - if 0 " disabled; These are in the Windows menu - tmenu ToolBar.New Nove okno - tmenu ToolBar.WinSplit Rozdelit okno - tmenu ToolBar.WinMax Maximalizovat okno - tmenu ToolBar.WinMin Minimalizovat okno - tmenu ToolBar.WinClose Zavrit okno - endif - tmenu ToolBar.LoadSesn Nacist sezeni - tmenu ToolBar.SaveSesn Ulozit sezeni - tmenu ToolBar.RunScript Spustit skript - tmenu ToolBar.Make Spustit make - tmenu ToolBar.Shell Spustit shell - tmenu ToolBar.RunCtags Spustit ctags - tmenu ToolBar.TagJump Skocit na tag pod kurzorem - tmenu ToolBar.Help Napoveda - tmenu ToolBar.FindHelp Hledat napovedu k... - endfun + if exists("*Do_toolbar_tmenu") + delfun Do_toolbar_tmenu + endif + fun Do_toolbar_tmenu() + tmenu ToolBar.Open Otevrit soubor + tmenu ToolBar.Save Ulozit soubor + tmenu ToolBar.SaveAll Ulozit vsechny soubory + if has("printer") || has("unix") + tmenu ToolBar.Print Tisk + endif + tmenu ToolBar.Undo Zpet + tmenu ToolBar.Redo Zrusit vraceni + tmenu ToolBar.Cut Vyriznout + tmenu ToolBar.Copy Kopirovat + tmenu ToolBar.Paste Vlozit + tmenu ToolBar.Find Hledat... + tmenu ToolBar.FindNext Hledat dalsi + tmenu ToolBar.FindPrev Hledat predchozi + tmenu ToolBar.Replace Nahradit... + if 0 " disabled; These are in the Windows menu + tmenu ToolBar.New Nove okno + tmenu ToolBar.WinSplit Rozdelit okno + tmenu ToolBar.WinMax Maximalizovat okno + tmenu ToolBar.WinMin Minimalizovat okno + tmenu ToolBar.WinClose Zavrit okno + endif + tmenu ToolBar.LoadSesn Nacist sezeni + tmenu ToolBar.SaveSesn Ulozit sezeni + tmenu ToolBar.RunScript Spustit skript + tmenu ToolBar.Make Spustit make + tmenu ToolBar.Shell Spustit shell + tmenu ToolBar.RunCtags Spustit ctags + tmenu ToolBar.TagJump Skocit na tag pod kurzorem + tmenu ToolBar.Help Napoveda + tmenu ToolBar.FindHelp Hledat napovedu k... + endfun endif " }}} +" {{{ DIALOG TEXTS +let g:menutrans_no_file = "[Zadny soubor]" +let g:menutrans_help_dialog = "Zadejte hledany prikaz nebo slovo:\n\n\tPridejte i_ pro prikazy vkladaciho rezimu (napr. i_CTRL-X)\n\tPridejte c_ pro prikazy prikazove radky (napr. c_)\n\tPridejte ' pro jmeno volby (napr. 'shiftwidth')" +let g:menutrans_path_dialog = "Zadejte cesty pro vyhledavani souboru. Jednotlive cesty oddelte carkou" +let g:menutrans_tags_dialog = "Zadejte jmena souboru s tagy. Jmena oddelte carkami." +let g:menutrans_textwidth_dialog = "Zadejte delku radku (0 pro zakazani formatovani):" +let g:menutrans_fileformat_dialog = "Vyberte typ konce radku" +" }}}" + let &cpo = s:keepcpo unlet s:keepcpo + + + +" vim:set foldmethod=marker expandtab tabstop=3 shiftwidth=3: diff --git a/runtime/macros/justify.vim b/runtime/macros/justify.vim index aa4a9ca585..4ef3bf95fa 100644 --- a/runtime/macros/justify.vim +++ b/runtime/macros/justify.vim @@ -1,4 +1,4 @@ -" Function to left and rigt align text. +" Function to left and right align text. " " Written by: Preben "Peppe" Guldberg " Created: 980806 14:13 (or around that time anyway) @@ -256,18 +256,17 @@ function! Justify(...) range let str = substitute(str, '\s\+$', '', '') let str = substitute(str, '^\s\+', '', '') let str = substitute(str, '\s\+', ' ', 'g') - " Use substitute() hack to get strlen in characters instead of bytes - let str_n = strlen(substitute(str, '.', 'x', 'g')) + let str_n = strdisplaywidth(str) " Possible addition of space after punctuation if exists("join_str") let str = substitute(str, join_str, '\1 ', 'g') endif - let join_n = strlen(substitute(str, '.', 'x', 'g')) - str_n + let join_n = strdisplaywidth(str) - str_n " Can extraspaces be added? " Note that str_n may be less than strlen(str) [joinspaces above] - if strlen(substitute(str, '.', 'x', 'g')) < tw - indent_n && str_n > 0 + if strdisplaywidth(str) <= tw - indent_n && str_n > 0 " How many spaces should be added let s_add = tw - str_n - indent_n - join_n let s_nr = strlen(substitute(str, '\S', '', 'g') ) - join_n diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index 8a66c840d1..ac4dfc6ac9 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 = "v145" +let g:loaded_netrwPlugin = "v146" if v:version < 702 echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None finish diff --git a/runtime/syntax/abap.vim b/runtime/syntax/abap.vim index 8f7306d9dd..fd4b480034 100644 --- a/runtime/syntax/abap.vim +++ b/runtime/syntax/abap.vim @@ -1,8 +1,8 @@ " Vim ABAP syntax file " Language: SAP - ABAP/R4 -" Revision: 2.0 +" Revision: 2.1 " Maintainer: Marius Piedallu van Wyk -" Last Change: 2012 Oct 12 +" Last Change: 2012 Oct 23 " Comment: Thanks to EPI-USE Labs for all your assistance. :) " For version < 6.0: Clear all syntax items @@ -16,7 +16,7 @@ endif " Always ignore case syn case ignore -" Symbol Operators +" Symbol Operators (space delimited) syn match abapSymbolOperator "\W+\W" syn match abapSymbolOperator "\W-\W" syn match abapSymbolOperator "\W/\W" @@ -49,99 +49,105 @@ else set iskeyword=48-57,_,A-Z,a-z,/ endif -syn match abapNamespace "/\w\+/" +syn match abapNamespace "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\<\(EXIT\W\+FROM\W\+STEP\W\+LOOP\|EXIT\)\>" +syn match abapComplexStatement "\<\(BEGIN\W\+OF\W\+\(BLOCK\|LINE\)\|BEGIN\W\+OF\)\>" +syn match abapComplexStatement "\<\(END\W\+OF\W\+\(BLOCK\|LINE\)\|END\W\+OF\)\>" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\<\(PUBLIC\|PRIVATE\|PROTECTED\)\(\W\+SECTION\)\?\>" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\<\(ALL\W\+OCCURRENCES\)\|\(\(FIRST\|LAST\)\W\+OCCURRENCE\)\>" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\<\(UP\W\+\)\?TO\>" " hyphenated-word statements -syn match abapComplexStatement "LINE-COUNT" -syn match abapComplexStatement "ADD-CORRESPONDING" -syn match abapComplexStatement "AUTHORITY-CHECK" -syn match abapComplexStatement "BREAK-POINT" -syn match abapComplexStatement "CLASS-DATA" -syn match abapComplexStatement "CLASS-METHODS" -syn match abapComplexStatement "CLASS-METHOD" -syn match abapComplexStatement "DIVIDE-CORRESPONDING" -syn match abapComplexStatement "EDITOR-CALL" -syn match abapComplexStatement "END-OF-DEFINITION" -syn match abapComplexStatement "END-OF-PAGE" -syn match abapComplexStatement "END-OF-SELECTION" -syn match abapComplexStatement "FIELD-GROUPS" -syn match abapComplexStatement "FIELD-SYMBOLS" -syn match abapComplexStatement "FUNCTION-POOL" -syn match abapComplexStatement "MOVE-CORRESPONDING" -syn match abapComplexStatement "MULTIPLY-CORRESPONDING" -syn match abapComplexStatement "NEW-LINE" -syn match abapComplexStatement "NEW-PAGE" -syn match abapComplexStatement "NEW-SECTION" -syn match abapComplexStatement "PRINT-CONTROL" -syn match abapComplexStatement "RP-PROVIDE-FROM-LAST" -syn match abapComplexStatement "SELECT-OPTIONS" -syn match abapComplexStatement "SELECTION-SCREEN" -syn match abapComplexStatement "START-OF-SELECTION" -syn match abapComplexStatement "SUBTRACT-CORRESPONDING" -syn match abapComplexStatement "SYNTAX-CHECK" -syn match abapComplexStatement "SYNTAX-TRACE" -syn match abapComplexStatement "TOP-OF-PAGE" -syn match abapComplexStatement "TYPE-POOL" -syn match abapComplexStatement "TYPE-POOLS" -syn match abapComplexStatement "LINE-SIZE" -syn match abapComplexStatement "LINE-COUNT" -syn match abapComplexStatement "MESSAGE-ID" -syn match abapComplexStatement "DISPLAY-MODE" -syn match abapComplexStatement "READ\(-ONLY\)\?" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" +syn match abapComplexStatement "\" " ABAP statements syn keyword abapStatement ADD ALIAS ALIASES ASSERT ASSIGN ASSIGNING AT -syn keyword abapStatement BACK BOUND +syn keyword abapStatement BACK syn keyword abapStatement CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY syn keyword abapStatement DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO syn keyword abapStatement ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT syn keyword abapStatement FETCH FIELDS FORM FORMAT FREE FROM FUNCTION syn keyword abapStatement GENERATE GET syn keyword abapStatement HIDE -syn keyword abapStatement IF IMPORT IMPORTING INDEX INFOTYPES INITIAL INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION IS +syn keyword abapStatement IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION syn keyword abapStatement LEAVE LIKE LINE LOAD LOCAL LOOP syn keyword abapStatement MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY syn keyword abapStatement ON OVERLAY OPTIONAL OTHERS syn keyword abapStatement PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT -syn keyword abapStatement RAISE RANGES RECEIVE REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK +syn keyword abapStatement RAISE RANGES RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK syn keyword abapStatement SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS syn keyword abapStatement TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES syn keyword abapStatement UNASSIGN ULINE UNPACK UPDATE syn keyword abapStatement WHEN WHILE WINDOW WRITE " More statemets +syn keyword abapStatement LINES +syn keyword abapStatement INTO GROUP BY HAVING ORDER BY SINGLE +syn keyword abapStatement APPENDING CORRESPONDING FIELDS OF TABLE +syn keyword abapStatement LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER ROWS CONNECTING syn keyword abapStatement OCCURS STRUCTURE OBJECT PROPERTY syn keyword abapStatement CASTING APPEND RAISING VALUE COLOR syn keyword abapStatement CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT syn keyword abapStatement ID NUMBER FOR TITLE OUTPUT " Special ABAP specific tables: -syn match abapSpecial "\(\W\|^\)\(sy\|\(p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)\(\W\|$\)"ms=s+1,me=e-1 -syn match abapSpecialTables "\(sy\|\(p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)-"me=e-1 contained -syn match abapSpecial "\(\W\|^\)\w\+-\(\w\+-\w\+\|\w\+\)"ms=s+1 contains=abapSpecialTables,abapStatement,abapComplexStatement +syn match abapSpecialTables "\<\(sy\|\(p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)-"me=e-1 contained +syn match abapStructure "\<\w\+-[^\>]"me=e-2 contains=abapSpecialTables,abapStatement,abapComplexStatement +syn match abapField "-\w\+"ms=s+1 " Pointer syn match abapSpecial "<\w\+>" -" Abap constants: +" Abap common constants: syn keyword abapSpecial TRUE FALSE NULL SPACE " Includes @@ -155,15 +161,8 @@ syn keyword abapOperator abs sign ceil floor trunc frac acos asin atan cos sin t syn keyword abapOperator cosh sinh tanh exp log log10 sqrt " String operators -syn keyword abapOperator strlen xstrlen charlen numofchar dbmaxlen +syn keyword abapStatement strlen xstrlen charlen numofchar dbmaxlen -" Table operators -syn keyword abapOperator lines - -" Table operators (SELECT operators) -syn keyword abapOperator INTO WHERE GROUP BY HAVING ORDER BY SINGLE -syn keyword abapOperator APPENDING CORRESPONDING FIELDS OF TABLE -syn keyword abapOperator LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING syn keyword abapOperator EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN " An error? Not strictly... but cannot think of reason this is intended. @@ -193,7 +192,7 @@ if version >= 508 || !exists("did_abap_syntax_inits") HiLink abapComplexStatement Statement HiLink abapSpecial Special HiLink abapNamespace Special - HiLink abapSpecialTables PreProc + HiLink abapSpecialTables Special HiLink abapSymbolOperator abapOperator HiLink abapOperator Operator HiLink abapCharString String @@ -201,6 +200,8 @@ if version >= 508 || !exists("did_abap_syntax_inits") HiLink abapFloat Float HiLink abapTypes Type HiLink abapSymbol Structure + HiLink abapStructure Structure + HiLink abapField Variable HiLink abapNumber Number HiLink abapHex Number diff --git a/runtime/syntax/docbk.vim b/runtime/syntax/docbk.vim index 73c1cb4751..fc679eecaf 100644 --- a/runtime/syntax/docbk.vim +++ b/runtime/syntax/docbk.vim @@ -1,9 +1,10 @@ " Vim syntax file " Language: DocBook " Maintainer: Devin Weaver +" Last Updated By: Shlomi Fish " URL: http://tritarget.com/pub/vim/syntax/docbk.vim -" Last Change: $Date: 2005/06/23 22:31:01 $ -" Version: $Revision: 1.2 $ +" Last Change: 2012 Nov 28 +" Version: 1.2 (and modified after that) " Thanks to Johannes Zellner for the default to XML " suggestion. @@ -28,6 +29,15 @@ if !exists('b:docbk_type') let b:docbk_type = 'xml' endif endif + +if !exists('b:docbk_ver') + if exists('docbk_ver') + let b:docbk_ver = docbk_ver + else + let b:docbk_ver = 4 + endif +end + if 'xml' == b:docbk_type doau Syntax xml syn cluster xmlTagHook add=docbkKeyword @@ -40,81 +50,121 @@ elseif 'sgml' == b:docbk_type syn case ignore endif -" has been removed and replace with in DocBook 4.0 -" kept for backwards compatability. -syn keyword docbkKeyword abbrev abstract accel ackno acronym action contained -syn keyword docbkKeyword address affiliation alt anchor answer appendix contained -syn keyword docbkKeyword application area areaset areaspec arg artheader contained -syn keyword docbkKeyword article articleinfo artpagenums attribution audiodata contained -syn keyword docbkKeyword audioobject author authorblurb authorgroup contained -syn keyword docbkKeyword authorinitials beginpage bibliodiv biblioentry contained -syn keyword docbkKeyword bibliography bibliomisc bibliomixed bibliomset contained -syn keyword docbkKeyword biblioset blockquote book bookbiblio bookinfo contained -syn keyword docbkKeyword bridgehead callout calloutlist caption caution contained -syn keyword docbkKeyword chapter citation citerefentry citetitle city contained -syn keyword docbkKeyword classname cmdsynopsis co collab collabname contained -syn keyword docbkKeyword colophon colspec command comment computeroutput contained -syn keyword docbkKeyword confdates confgroup confnum confsponsor conftitle contained -syn keyword docbkKeyword constant contractnum contractsponsor contrib contained -syn keyword docbkKeyword copyright corpauthor corpname country database contained -syn keyword docbkKeyword date dedication docinfo edition editor email contained -syn keyword docbkKeyword emphasis entry entrytbl envar epigraph equation contained -syn keyword docbkKeyword errorcode errorname errortype example fax figure contained -syn keyword docbkKeyword filename firstname firstterm footnote footnoteref contained +syn keyword docbkKeyword abbrev abstract accel acronym address contained +syn keyword docbkKeyword affiliation alt anchor answer appendix contained +syn keyword docbkKeyword application area areaset areaspec arg contained +syn keyword docbkKeyword article artpagenums attribution audiodata contained +syn keyword docbkKeyword audioobject author authorgroup contained +syn keyword docbkKeyword authorinitials bibliocoverage bibliodiv contained +syn keyword docbkKeyword biblioentry bibliography biblioid contained +syn keyword docbkKeyword bibliolist bibliomisc bibliomixed contained +syn keyword docbkKeyword bibliomset biblioref bibliorelation contained +syn keyword docbkKeyword biblioset bibliosource blockquote book contained +syn keyword docbkKeyword bridgehead callout calloutlist caption contained +syn keyword docbkKeyword caution chapter citation citebiblioid contained +syn keyword docbkKeyword citerefentry citetitle city classname contained +syn keyword docbkKeyword classsynopsis classsynopsisinfo cmdsynopsis contained +syn keyword docbkKeyword co code col colgroup collab colophon contained +syn keyword docbkKeyword colspec command computeroutput confdates contained +syn keyword docbkKeyword confgroup confnum confsponsor conftitle contained +syn keyword docbkKeyword constant constructorsynopsis contractnum contained +syn keyword docbkKeyword contractsponsor contrib copyright coref contained +syn keyword docbkKeyword country database date dedication contained +syn keyword docbkKeyword destructorsynopsis edition editor email contained +syn keyword docbkKeyword emphasis entry entrytbl envar epigraph contained +syn keyword docbkKeyword equation errorcode errorname errortext contained +syn keyword docbkKeyword errortype example exceptionname fax contained +syn keyword docbkKeyword fieldsynopsis figure filename firstname contained +syn keyword docbkKeyword firstterm footnote footnoteref contained syn keyword docbkKeyword foreignphrase formalpara funcdef funcparams contained syn keyword docbkKeyword funcprototype funcsynopsis funcsynopsisinfo contained -syn keyword docbkKeyword function glossary glossdef glossdiv glossentry contained -syn keyword docbkKeyword glosslist glosssee glossseealso glossterm graphic contained -syn keyword docbkKeyword graphicco group guibutton guiicon guilabel contained +syn keyword docbkKeyword function glossary glossdef glossdiv contained +syn keyword docbkKeyword glossentry glosslist glosssee glossseealso contained +syn keyword docbkKeyword glossterm group guibutton guiicon guilabel contained syn keyword docbkKeyword guimenu guimenuitem guisubmenu hardware contained -syn keyword docbkKeyword highlights holder honorific imagedata imageobject contained -syn keyword docbkKeyword imageobjectco important index indexdiv indexentry contained -syn keyword docbkKeyword indexterm informalequation informalexample contained -syn keyword docbkKeyword informalfigure informaltable inlineequation contained -syn keyword docbkKeyword inlinegraphic inlinemediaobject interface contained -syn keyword docbkKeyword interfacedefinition invpartnumber isbn issn contained -syn keyword docbkKeyword issuenum itemizedlist itermset jobtitle keycap contained -syn keyword docbkKeyword keycode keycombo keysym keyword keywordset label contained -syn keyword docbkKeyword legalnotice lineage lineannotation link listitem contained -syn keyword docbkKeyword literal literallayout lot lotentry manvolnum contained -syn keyword docbkKeyword markup medialabel mediaobject mediaobjectco contained -syn keyword docbkKeyword member menuchoice modespec mousebutton msg msgaud contained -syn keyword docbkKeyword msgentry msgexplan msginfo msglevel msgmain contained -syn keyword docbkKeyword msgorig msgrel msgset msgsub msgtext note contained -syn keyword docbkKeyword objectinfo olink option optional orderedlist contained -syn keyword docbkKeyword orgdiv orgname otheraddr othercredit othername contained -syn keyword docbkKeyword pagenums para paramdef parameter part partintro contained -syn keyword docbkKeyword phone phrase pob postcode preface primary contained -syn keyword docbkKeyword primaryie printhistory procedure productname contained -syn keyword docbkKeyword productnumber programlisting programlistingco contained -syn keyword docbkKeyword prompt property pubdate publisher publishername contained -syn keyword docbkKeyword pubsnumber qandadiv qandaentry qandaset question contained -syn keyword docbkKeyword quote refclass refdescriptor refentry contained +syn keyword docbkKeyword holder honorific imagedata imageobject contained +syn keyword docbkKeyword imageobjectco important index indexdiv contained +syn keyword docbkKeyword indexentry indexterm informalequation contained +syn keyword docbkKeyword informalexample informalfigure contained +syn keyword docbkKeyword informaltable initializer inlineequation contained +syn keyword docbkKeyword inlinemediaobject interfacename issuenum contained +syn keyword docbkKeyword itemizedlist itermset jobtitle keycap contained +syn keyword docbkKeyword keycode keycombo keysym keyword keywordset contained +syn keyword docbkKeyword label legalnotice lineage lineannotation contained +syn keyword docbkKeyword link listitem literal literallayout contained +syn keyword docbkKeyword manvolnum markup mathphrase mediaobject contained +syn keyword docbkKeyword member menuchoice methodname methodparam contained +syn keyword docbkKeyword methodsynopsis modifier mousebutton msg contained +syn keyword docbkKeyword msgaud msgentry msgexplan msginfo msglevel contained +syn keyword docbkKeyword msgmain msgorig msgrel msgset msgsub contained +syn keyword docbkKeyword msgtext note olink ooclass ooexception contained +syn keyword docbkKeyword oointerface option optional orderedlist contained +syn keyword docbkKeyword orgdiv orgname otheraddr othercredit contained +syn keyword docbkKeyword othername package pagenums para paramdef contained +syn keyword docbkKeyword parameter part partintro personblurb contained +syn keyword docbkKeyword personname phone phrase pob postcode contained +syn keyword docbkKeyword preface primary primaryie printhistory contained +syn keyword docbkKeyword procedure productname productnumber contained +syn keyword docbkKeyword programlisting programlistingco prompt contained +syn keyword docbkKeyword property pubdate publisher publishername contained +syn keyword docbkKeyword qandadiv qandaentry qandaset question quote contained +syn keyword docbkKeyword refclass refdescriptor refentry contained syn keyword docbkKeyword refentrytitle reference refmeta refmiscinfo contained syn keyword docbkKeyword refname refnamediv refpurpose refsect1 contained -syn keyword docbkKeyword refsect1info refsect2 refsect2info refsect3 contained -syn keyword docbkKeyword refsect3info refsynopsisdiv refsynopsisdivinfo contained -syn keyword docbkKeyword releaseinfo remark replaceable returnvalue revhistory contained -syn keyword docbkKeyword revision revnumber revremark row sbr screen contained -syn keyword docbkKeyword screenco screeninfo screenshot secondary contained -syn keyword docbkKeyword secondaryie sect1 sect1info sect2 sect2info sect3 contained -syn keyword docbkKeyword sect3info sect4 sect4info sect5 sect5info section contained -syn keyword docbkKeyword sectioninfo see seealso seealsoie seeie seg contained -syn keyword docbkKeyword seglistitem segmentedlist segtitle seriesinfo contained -syn keyword docbkKeyword seriesvolnums set setindex setinfo sgmltag contained -syn keyword docbkKeyword shortaffil shortcut sidebar simpara simplelist contained -syn keyword docbkKeyword simplesect spanspec state step street structfield contained -syn keyword docbkKeyword structname subject subjectset subjectterm contained -syn keyword docbkKeyword subscript substeps subtitle superscript surname contained -syn keyword docbkKeyword symbol synopfragment synopfragmentref synopsis contained -syn keyword docbkKeyword systemitem table tbody term tertiary tertiaryie contained -syn keyword docbkKeyword textobject tfoot tgroup thead tip title contained -syn keyword docbkKeyword titleabbrev toc tocback tocchap tocentry tocfront contained -syn keyword docbkKeyword toclevel1 toclevel2 toclevel3 toclevel4 toclevel5 contained -syn keyword docbkKeyword tocpart token trademark type ulink userinput contained +syn keyword docbkKeyword refsect2 refsect3 refsection refsynopsisdiv contained +syn keyword docbkKeyword releaseinfo remark replaceable returnvalue contained +syn keyword docbkKeyword revdescription revhistory revision contained +syn keyword docbkKeyword revnumber revremark row sbr screen screenco contained +syn keyword docbkKeyword screenshot secondary secondaryie sect1 contained +syn keyword docbkKeyword sect2 sect3 sect4 sect5 section see seealso contained +syn keyword docbkKeyword seealsoie seeie seg seglistitem contained +syn keyword docbkKeyword segmentedlist segtitle seriesvolnums set contained +syn keyword docbkKeyword setindex shortaffil shortcut sidebar contained +syn keyword docbkKeyword simpara simplelist simplemsgentry contained +syn keyword docbkKeyword simplesect spanspec state step contained +syn keyword docbkKeyword stepalternatives street subject subjectset contained +syn keyword docbkKeyword subjectterm subscript substeps subtitle contained +syn keyword docbkKeyword superscript surname symbol synopfragment contained +syn keyword docbkKeyword synopfragmentref synopsis systemitem table contained +syn keyword docbkKeyword task taskprerequisites taskrelated contained +syn keyword docbkKeyword tasksummary tbody td term termdef tertiary contained +syn keyword docbkKeyword tertiaryie textdata textobject tfoot tgroup contained +syn keyword docbkKeyword th thead tip title titleabbrev toc tocentry contained +syn keyword docbkKeyword token tr trademark type uri userinput contained syn keyword docbkKeyword varargs variablelist varlistentry varname contained -syn keyword docbkKeyword videodata videoobject void volumenum warning contained -syn keyword docbkKeyword wordasword xref year contained +syn keyword docbkKeyword videodata videoobject void volumenum contained +syn keyword docbkKeyword warning wordasword xref year contained + +if b:docbk_ver == 4 + syn keyword docbkKeyword ackno action appendixinfo articleinfo contained + syn keyword docbkKeyword authorblurb beginpage bibliographyinfo contained + syn keyword docbkKeyword blockinfo bookinfo chapterinfo contained + syn keyword docbkKeyword collabname corpauthor corpcredit contained + syn keyword docbkKeyword corpname glossaryinfo graphic graphicco contained + syn keyword docbkKeyword highlights indexinfo inlinegraphic contained + syn keyword docbkKeyword interface invpartnumber isbn issn lot contained + syn keyword docbkKeyword lotentry medialabel mediaobjectco contained + syn keyword docbkKeyword modespec objectinfo partinfo contained + syn keyword docbkKeyword prefaceinfo pubsnumber refentryinfo contained + syn keyword docbkKeyword referenceinfo refsect1info refsect2info contained + syn keyword docbkKeyword refsect3info refsectioninfo contained + syn keyword docbkKeyword refsynopsisdivinfo screeninfo sect1info contained + syn keyword docbkKeyword sect2info sect3info sect4info sect5info contained + syn keyword docbkKeyword sectioninfo setindexinfo setinfo contained + syn keyword docbkKeyword sgmltag sidebarinfo structfield contained + syn keyword docbkKeyword structname tocback tocchap tocfront contained + syn keyword docbkKeyword toclevel1 toclevel2 toclevel3 toclevel4 contained + syn keyword docbkKeyword toclevel5 tocpart ulink contained + +else + syn keyword docbkKeyword acknowledgements annotation arc contained + syn keyword docbkKeyword constraint constraintdef cover contained + syn keyword docbkKeyword extendedlink givenname info lhs locator contained + syn keyword docbkKeyword multimediaparam nonterminal org person contained + syn keyword docbkKeyword production productionrecap contained + syn keyword docbkKeyword productionset rhs tag tocdiv topic contained + +endif " Add special emphasis on some regions. Thanks to Rory Hunter for these ideas. syn region docbkRegion start=""lc=10 end=""me=e-11 contains=xmlRegion,xmlEntity,sgmlRegion,sgmlEntity keepend diff --git a/runtime/syntax/lex.vim b/runtime/syntax/lex.vim index e500f5c072..b7aff34d6b 100644 --- a/runtime/syntax/lex.vim +++ b/runtime/syntax/lex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Lex -" Maintainer: Charles E. Campbell, Jr. -" Last Change: Nov 01, 2010 -" Version: 12 +" Maintainer: Charles E. Campbell +" Last Change: Nov 14, 2012 +" Version: 14 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax " " Option: @@ -17,20 +17,16 @@ elseif exists("b:current_syntax") endif " Read the C/C++ syntax to start with -if version >= 600 - if exists("lex_uses_cpp") - runtime! syntax/cpp.vim - else - runtime! syntax/c.vim - endif - unlet b:current_syntax -else - if exists("lex_uses_cpp") - so :p:h/cpp.vim - else - so :p:h/c.vim +let s:Cpath= fnameescape(expand(":p:h").(exists("g:lex_uses_cpp")? "/cpp.vim" : "/c.vim")) +if !filereadable(s:Cpath) + for s:Cpath in split(globpath(&rtp,(exists("g:lex_uses_cpp")? "syntax/cpp.vim" : "syntax/c.vim")),"\n") + if filereadable(fnameescape(s:Cpath)) + let s:Cpath= fnameescape(s:Cpath) + break endif + endfor endif +exe "syn include @lexCcode ".s:Cpath " --- ========= --- " --- Lex stuff --- @@ -39,10 +35,6 @@ endif " Options Section syn match lexOptions '^%\s*option\>.*$' contains=lexPatString -"I'd prefer to use lex.* , but vim doesn't handle forward definitions yet -syn cluster lexListGroup contains=lexAbbrvBlock,lexAbbrv,lexAbbrv,lexAbbrvRegExp,lexInclude,lexPatBlock,lexPat,lexBrace,lexPatString,lexPatTag,lexPatTag,lexPatComment,lexPatCodeLine,lexMorePat,lexPatSep,lexSlashQuote,lexPatCode,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2,cCommentStartError,cParenError -syn cluster lexListPatCodeGroup contains=lexAbbrvBlock,lexAbbrv,lexAbbrv,lexAbbrvRegExp,lexInclude,lexPatBlock,lexPat,lexBrace,lexPatTag,lexPatTag,lexPatTagZoneStart,lexPatComment,lexPatCodeLine,lexMorePat,lexPatSep,lexSlashQuote,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2,cCommentStartError,cParenError - " Abbreviations Section if has("folding") syn region lexAbbrvBlock fold start="^\(\h\+\s\|%{\)" end="^\ze%%$" skipnl nextgroup=lexPatBlock contains=lexAbbrv,lexInclude,lexAbbrvComment,lexStartState @@ -53,52 +45,69 @@ syn match lexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=lexAbbrvRe syn match lexAbbrv "^%[sx]" contained syn match lexAbbrvRegExp "\s\S.*$"lc=1 contained nextgroup=lexAbbrv,lexInclude if has("folding") - syn region lexInclude fold matchgroup=lexSep start="^%{" end="%}" contained contains=ALLBUT,@lexListGroup + syn region lexInclude fold matchgroup=lexSep start="^%{" end="%}" contained contains=@lexCcode syn region lexAbbrvComment fold start="^\s\+/\*" end="\*/" contains=@Spell + syn region lexAbbrvComment fold start="\%^/\*" end="\*/" contains=@Spell syn region lexStartState fold matchgroup=lexAbbrv start="^%\a\+" end="$" contained else - syn region lexInclude matchgroup=lexSep start="^%{" end="%}" contained contains=ALLBUT,@lexListGroup + syn region lexInclude matchgroup=lexSep start="^%{" end="%}" contained contains=@lexCcode syn region lexAbbrvComment start="^\s\+/\*" end="\*/" contains=@Spell + syn region lexAbbrvComment start="\%^/\*" end="\*/" contains=@Spell syn region lexStartState matchgroup=lexAbbrv start="^%\a\+" end="$" contained endif "%% : Patterns {Actions} if has("folding") - syn region lexPatBlock fold matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatInclude - syn region lexPat fold start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 contained nextgroup=lexMorePat,lexPatSep contains=lexPatTag,lexPatString,lexSlashQuote,lexBrace + syn region lexPatBlock fold matchgroup=Todo start="^%%$" matchgroup=Todo end="^%\ze%$" skipnl skipwhite nextgroup=lexFinalCodeBlock contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatInclude + syn region lexPat fold start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 skipwhite contained nextgroup=lexMorePat,lexPatSep,lexPattern contains=lexPatTag,lexPatString,lexSlashQuote,lexBrace syn region lexPatInclude fold matchgroup=lexSep start="^%{" end="%}" contained contains=lexPatCode syn region lexBrace fold start="\[" skip=+\\\\\|\\+ end="]" contained syn region lexPatString fold matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained else - syn region lexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatInclude - syn region lexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 contained nextgroup=lexMorePat,lexPatSep contains=lexPatTag,lexPatString,lexSlashQuote,lexBrace + syn region lexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite nextgroup=lexFinalCodeBlock contains=lexPatTag,lexPatTagZone,lexPatComment,lexPat,lexPatInclude + syn region lexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 skipwhite contained nextgroup=lexMorePat,lexPatSep,lexPattern contains=lexPatTag,lexPatString,lexSlashQuote,lexBrace syn region lexPatInclude matchgroup=lexSep start="^%{" end="%}" contained contains=lexPatCode syn region lexBrace start="\[" skip=+\\\\\|\\+ end="]" contained syn region lexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained endif syn match lexPatTag "^<\I\i*\(,\I\i*\)*>" contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep -syn match lexPatTagZone "^<\I\i*\(,\I\i*\)*>\s*\ze{" contained nextgroup=lexPatTagZoneStart +syn match lexPatTagZone "^<\I\i*\(,\I\i*\)*>\s\+\ze{" contained nextgroup=lexPatTagZoneStart syn match lexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep + +" Lex Patterns +syn region lexPattern start='[^ \t{}]' end="$" contained contains=lexPatRange +syn region lexPatRange matchgroup=Delimiter start='\[' skip='\\\\\|\\.' end='\]' contains=lexEscape +syn match lexEscape '\%(\\\\\)*\\.' contained + if has("folding") - syn region lexPatTagZoneStart matchgroup=lexPatTag fold start='{' end='}' contained contains=lexPat,lexPatComment + syn region lexPatTagZoneStart matchgroup=lexPatTag fold start='{' end='}' contained contains=lexPat,lexPatComment syn region lexPatComment start="\s\+/\*" end="\*/" fold skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell else - syn region lexPatTagZoneStart matchgroup=lexPatTag start='{' end='}' contained contains=lexPat,lexPatComment + syn region lexPatTagZoneStart matchgroup=lexPatTag start='{' end='}' contained contains=lexPat,lexPatComment syn region lexPatComment start="\s\+/\*" end="\*/" skipnl contained contains=cTodo skipwhite nextgroup=lexPatComment,lexPat,@Spell endif -syn match lexPatCodeLine ".*$" contained contains=ALLBUT,@lexListGroup +syn match lexPatCodeLine "[^{\[].*" contained contains=@lexCcode syn match lexMorePat "\s*|\s*$" skipnl contained nextgroup=lexPat,lexPatTag,lexPatComment syn match lexPatSep "\s\+" contained nextgroup=lexMorePat,lexPatCode,lexPatCodeLine syn match lexSlashQuote +\(\\\\\)*\\"+ contained if has("folding") - syn region lexPatCode matchgroup=Delimiter start="{" end="}" fold skipnl contained contains=ALLBUT,@lexListPatCodeGroup + syn region lexPatCode matchgroup=Delimiter start="{" end="}" fold skipnl contained contains=@lexCcode,lexCFunctions else - syn region lexPatCode matchgroup=Delimiter start="{" end="}" skipnl contained contains=ALLBUT,@lexListPatCodeGroup + syn region lexPatCode matchgroup=Delimiter start="{" end="}" skipnl contained contains=@lexCcode,lexCFunctions endif +" Lex "functions" which may appear in C/C++ code blocks syn keyword lexCFunctions BEGIN input unput woutput yyleng yylook yytext syn keyword lexCFunctions ECHO output winput wunput yyless yymore yywrap +" %% +" lexAbbrevBlock +" %% +" lexPatBlock +" %% +" lexFinalCodeBlock +syn region lexFinalCodeBlock matchgroup=Todo start="%$"me=e-1 end="\%$" contained contains=@lexCcode + " includes several ALLBUTs; these have to be treated so as to exclude lex* groups syn cluster cParenGroup add=lex.* syn cluster cDefineGroup add=lex.* @@ -107,27 +116,27 @@ syn cluster cMultiGroup add=lex.* " Synchronization syn sync clear -syn sync minlines=300 +syn sync minlines=500 syn sync match lexSyncPat grouphere lexPatBlock "^%[a-zA-Z]" syn sync match lexSyncPat groupthere lexPatBlock "^<$" syn sync match lexSyncPat groupthere lexPatBlock "^%%$" " The default highlighting. hi def link lexAbbrvComment lexPatComment -hi def link lexBrace lexPat -hi def link lexPatTagZone lexPatTag -hi def link lexSlashQuote lexPat - hi def link lexAbbrvRegExp Macro hi def link lexAbbrv SpecialChar +hi def link lexBrace lexPat hi def link lexCFunctions Function +hi def link lexCstruct cStructure hi def link lexMorePat SpecialChar hi def link lexOptions PreProc hi def link lexPatComment Comment hi def link lexPat Function hi def link lexPatString Function hi def link lexPatTag Special +hi def link lexPatTagZone lexPatTag hi def link lexSep Delimiter +hi def link lexSlashQuote lexPat hi def link lexStartState Statement let b:current_syntax = "lex" diff --git a/runtime/syntax/progress.vim b/runtime/syntax/progress.vim index 190a0f381b..85a54a6505 100644 --- a/runtime/syntax/progress.vim +++ b/runtime/syntax/progress.vim @@ -3,13 +3,13 @@ " Filename extensions: *.p (collides with Pascal), " *.i (collides with assembler) " *.w (collides with cweb) -" Maintainer: Philip Uren Remove SPAX spam block -" Contributors: Chris Ruprecht -" Philip Uren -" Mikhail Kuperblum -" John Florian -" Version: 12 -" Last Change: Aug 16 2012 +" Maintainer: Philip Uren Remove SPAXY spam block +" Contributors: Matthew Stickney +" Chris Ruprecht +" Mikhail Kuperblum +" John Florian +" Version: 13 +" Last Change: Nov 11 2012 " For version 5.x: Clear all syntax item " For version 6.x: Quit when a syntax file was already loaded @@ -99,8 +99,8 @@ syn keyword ProgressReserved window-maxim[ized] window-minim[ized] window-normal " Strings. Handles embedded quotes. " Note that, for some reason, Progress doesn't use the backslash, "\" " as the escape character; it uses tilde, "~". -syn region ProgressString matchgroup=ProgressQuote start=+"+ end=+"+ skip=+\~'\|\~\~+ contains=@Spell -syn region ProgressString matchgroup=ProgressQuote start=+'+ end=+'+ skip=+\~'\|\~\~+ contains=@Spell +syn region ProgressString matchgroup=ProgressQuote start=+"+ end=+"+ skip=+\~'\|\~\~\|\~"+ contains=@Spell +syn region ProgressString matchgroup=ProgressQuote start=+'+ end=+'+ skip=+\~'\|\~\~\|\~"+ contains=@Spell syn match ProgressIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>()" diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim index b3f37d4053..b68089720b 100644 --- a/runtime/syntax/rst.vim +++ b/runtime/syntax/rst.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: reStructuredText documentation format " Maintainer: Nikolai Weibull -" Latest Revision: 2012-08-05 +" Latest Revision: 2012-11-01 if exists("b:current_syntax") finish @@ -139,6 +139,27 @@ syn match rstStandaloneHyperlink contains=@NoSpell " though. syn sync minlines=50 linebreaks=1 +syn region rstCodeBlock contained matchgroup=rstDirective + \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s+ + \ skip=+^$+ + \ end=+^\s\@!+ + \ contains=@NoSpell +syn cluster rstDirectives add=rstCodeBlock + +if !exists('g:rst_syntax_code_list') + let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php', 'python', 'perl'] +endif + +for code in g:rst_syntax_code_list + unlet! b:current_syntax + exe 'syn include @rst'.code.' syntax/'.code.'.vim' + exe 'syn region rstDirective'.code.' matchgroup=rstDirective fold ' + \.'start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\s*$# ' + \.'skip=#^$# ' + \.'end=#^\s\@!# contains=@NoSpell,@rst'.code + exe 'syn cluster rstDirectives add=rstDirective'.code +endfor + hi def link rstTodo Todo hi def link rstComment Comment hi def link rstSections Title @@ -168,6 +189,7 @@ hi def link rstFootnoteReference Identifier hi def link rstCitationReference Identifier hi def link rstHyperLinkReference Identifier hi def link rstStandaloneHyperlink Identifier +hi def link rstCodeBlock String let b:current_syntax = "rst" diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 355e8eb918..f3c760441b 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: shell (sh) Korn shell (ksh) bash (sh) -" Maintainer: Dr. Charles E. Campbell, Jr. +" Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Mar 19, 2012 -" Version: 122 +" Last Change: Nov 14, 2012 +" Version: 128 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from ?ric Brunet (eric.brunet@ens.fr) @@ -17,15 +17,18 @@ elseif exists("b:current_syntax") endif " AFAICT "." should be considered part of the iskeyword. Using iskeywords in -" syntax is dicey, so the following code permits the user to prevent/override -" its setting. -if exists("g:sh_isk") " override support - exe "setlocal isk=".g:sh_isk -elseif !exists("g:sh_noisk") " prevent modification support - setlocal isk+=. +" syntax is dicey, so the following code permits the user to +" g:sh_isk set to a string : specify iskeyword. +" g:sh_noisk exists : don't change iskeyword +" g:sh_noisk does not exist : (default) append "." to iskeyword +if exists("g:sh_isk") && type(g:sh_isk) == 1 " user specifying iskeyword + exe "setl isk=".g:sh_isk +elseif !exists("g:sh_noisk") " optionally prevent appending '.' to iskeyword + setl isk+=. endif " trying to answer the question: which shell is /bin/sh, really? +" If the user has not specified any of g:is_kornshell, g:is_bash, g:is_posix, g:is_sh, then guess. if !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") if executable("/bin/sh") if resolve("/bin/sh") =~ 'bash$' @@ -76,16 +79,19 @@ elseif g:sh_fold_enabled != 0 && !has("folding") echomsg "Ignoring g:sh_fold_enabled=".g:sh_fold_enabled."; need to re-compile vim for +fold support" endif if !exists("s:sh_fold_functions") - let s:sh_fold_functions = 1 + let s:sh_fold_functions= and(g:sh_fold_enabled,1) endif if !exists("s:sh_fold_heredoc") - let s:sh_fold_heredoc = 2 + let s:sh_fold_heredoc = and(g:sh_fold_enabled,2) endif if !exists("s:sh_fold_ifdofor") - let s:sh_fold_ifdofor = 4 + let s:sh_fold_ifdofor = and(g:sh_fold_enabled,4) endif if g:sh_fold_enabled && &fdm == "manual" - setlocal fdm=syntax + " Given that the user provided g:sh_fold_enabled + " AND g:sh_fold_enabled is manual (usual default) + " implies a desire for syntax-based folding + setl fdm=syntax endif " sh syntax is case sensitive {{{1 @@ -102,12 +108,12 @@ syn cluster shArithList contains=@shArithParenList,shParenError syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq "syn cluster shColonList contains=@shCaseList -syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest,shCtrlSeq,shSpecial +syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest,shCtrlSeq,shSpecial,shCmdParenRegion syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial -syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shPosnParm,shCtrlSeq,shSpecial +syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPPS syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError -syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shExpr,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote +syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shEscape,shExpr,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq @@ -160,7 +166,7 @@ endif " Options: {{{1 " ==================== -syn match shOption "\s\zs[-+][-_a-zA-Z0-9]\+\>" +syn match shOption "\s\zs[-+][-_a-zA-Z0-9#]\+" syn match shOption "\s\zs--[^ \t$`'"|]\+" " File Redirection Highlighted As Operators: {{{1 @@ -204,14 +210,15 @@ syn match shCharClass contained "\[:\(backspace\|escape\|return\|xdigit\|alnum " Loops: do, if, while, until {{{1 " ====== -if (g:sh_fold_enabled % (s:sh_fold_ifdofor * 2))/s:sh_fold_ifdofor +if s:sh_fold_ifdofor syn region shDo fold transparent matchgroup=shConditional start="\" matchgroup=shConditional end="\" contains=@shLoopList syn region shIf fold transparent matchgroup=shConditional start="\+ end="\<;\_s*then\>" end="\" contains=@shIfList - syn region shFor fold matchgroup=shLoop start="\+ end="\<;\_s*then\>" end="\" contains=@shIfList - syn region shFor matchgroup=shLoop start="\\ze\_s*((' endif if exists("b:is_kornshell") || exists("b:is_bash") syn cluster shCaseList add=shRepeat @@ -230,7 +237,7 @@ syn match shComma contained "," " ==== syn match shCaseBar contained skipwhite "\(^\|[^\\]\)\(\\\\\)*\zs|" nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar -if (g:sh_fold_enabled % (s:sh_fold_ifdofor * 2))/s:sh_fold_ifdofor +if s:sh_fold_ifdofor syn region shCase fold contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment syn region shCaseEsac fold matchgroup=shConditional start="\" end="\" contains=@shCaseEsacList else @@ -246,13 +253,17 @@ endif syn region shCaseSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained syn region shCaseDoubleQuote matchgroup=shQuote start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar contained -syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+]+ contained - +if exists("b:is_bash") + syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+\]+ contained contains=shCharClass + syn match shCharClass '\[:\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|or\|xdigit\):\]' contained +else + syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+\]+ contained +endif " Misc: {{{1 "====== syn match shWrapLineOperator "\\$" -syn region shCommandSub start="`" skip="\\\\\|\\." end="`" contains=@shCommandSubList -syn match shEscape contained '\\.' contains=@shCommandSubList +syn region shCommandSub start="`" skip="\\\\\|\\." end="`" contains=@shCommandSubList +syn match shEscape contained '\%(\\\\\)*\\.' " $() and $(()): {{{1 " $(..) is not supported by sh (Bourne shell). However, apparently @@ -268,20 +279,23 @@ if exists("b:is_kornshell") || exists("b:is_bash") elseif !exists("g:sh_no_error") syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList endif +syn region shCmdParenRegion matchgroup=shCmdSubRegion start="(" skip='\\\\\|\\.' end=")" contains=@shCommandSubList if exists("b:is_bash") syn cluster shCommandSubList add=bashSpecialVariables,bashStatement syn cluster shCaseList add=bashAdminStatement,bashStatement syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ALIASES BASH_ARGC BASH_ARGC BASH_ARGV BASH_ARGV BASH_CMDS BASH_CMDS BASH_COMMAND BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_EXECUTION_STRING BASH_LINENO BASH_LINENO BASHOPTS BASHOPTS BASHPID BASHPID BASH_REMATCH BASH_REMATCH BASH_SOURCE BASH_SOURCE BASH_SUBSHELL BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD BASH_XTRACEFD CDPATH COLUMNS COLUMNS COMP_CWORD COMP_CWORD COMP_KEY COMP_KEY COMP_LINE COMP_LINE COMP_POINT COMP_POINT COMPREPLY COMPREPLY COMP_TYPE COMP_TYPE COMP_WORDBREAKS COMP_WORDBREAKS COMP_WORDS COMP_WORDS COPROC COPROC DIRSTACK EMACS EMACS ENV ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNAME FUNCNEST FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_NUMERIC LINENO LINES LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT POSIXLY_CORRECT PPID PROMPT_COMMAND PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_LINE READLINE_POINT READLINE_POINT REPLY SECONDS SHELL SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR TMPDIR UID - syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep install less ls mkdir mv rm rmdir rpm sed sleep sort strip tail touch + syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep less ls mkdir mv rm rmdir rpm sed sleep sort strip tail touch syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop + syn keyword bashStatement command compgen endif if exists("b:is_kornshell") syn cluster shCommandSubList add=kshSpecialVariables,kshStatement syn cluster shCaseList add=kshStatement syn keyword kshSpecialVariables contained CDPATH COLUMNS EDITOR ENV ERRNO FCEDIT FPATH HISTFILE HISTSIZE HOME IFS LINENO LINES MAIL MAILCHECK MAILPATH OLDPWD OPTARG OPTIND PATH PPID PS1 PS2 PS3 PS4 PWD RANDOM REPLY SECONDS SHELL TMOUT VISUAL - syn keyword kshStatement cat chmod clear cp du egrep expr fgrep find grep install killall less ls mkdir mv nice printenv rm rmdir sed sort strip stty tail touch tput + syn keyword kshStatement cat chmod clear cp du egrep expr fgrep find grep killall less ls mkdir mv nice printenv rm rmdir sed sort strip stty tail touch tput + syn keyword kshStatement command setgroups setsenv endif syn match shSource "^\.\s" @@ -309,8 +323,8 @@ syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@" contained syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shSetIdentifier -syn match shSetIdentifier "=" contained nextgroup=shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote +syn match shSetIdentifier "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote if exists("b:is_bash") syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList - syn region shSetList oneline matchgroup=shSet start="\\ze[^/]" end="\ze[;|)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList + syn region shSetList oneline matchgroup=shSet start="\\ze[^/]" end="\ze[;|)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList elseif exists("b:is_kornshell") syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList @@ -390,15 +405,15 @@ if !exists("g:is_posix") endif if exists("b:is_bash") - if (g:sh_fold_enabled % (s:sh_fold_functions * 2))/s:sh_fold_functions - syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment + if s:sh_fold_functions + syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment syn region shFunctionTwo fold matchgroup=shFunction start="\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment else syn region shFunctionOne matchgroup=shFunction start="^\s*\h[-a-zA-Z_0-9]*\s*()\_s*{" end="}" contains=@shFunctionList syn region shFunctionTwo matchgroup=shFunction start="\h[-a-zA-Z_0-9]*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained endif else - if (g:sh_fold_enabled % (s:sh_fold_functions * 2))/s:sh_fold_functions + if s:sh_fold_functions syn region shFunctionOne fold matchgroup=shFunction start="^\s*\h\w*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment syn region shFunctionTwo fold matchgroup=shFunction start="\h\w*\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment else @@ -409,7 +424,7 @@ endif " Parameter Dereferencing: {{{1 " ======================== -syn match shDerefSimple "\$\%(\h\w*\|\d\)" +syn match shDerefSimple "\$\%(\k\+\|\d\)" syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray if !exists("g:sh_no_error") syn match shDerefWordError "[^}$[]" contained @@ -425,12 +440,12 @@ endif " ==================================== if exists("b:is_bash") syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOp - syn match shDerefVar contained "{\@<=!\w\+" nextgroup=@shDerefVarList + syn match shDerefVar contained "{\@<=!\k\+" nextgroup=@shDerefVarList endif syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp -syn match shDerefVar contained "{\@<=\w\+" nextgroup=@shDerefVarList +syn match shDerefVar contained "{\@<=\k\+" nextgroup=@shDerefVarList " sh ksh bash : ${var[... ]...} array reference: {{{1 syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError @@ -477,12 +492,12 @@ if exists("b:is_bash") " bash : ${parameter//pattern/string} " bash : ${parameter//pattern} syn match shDerefPPS contained '/\{1,2}' nextgroup=shDerefPPSleft - syn region shDerefPPSleft contained start='.' skip=@\%(\\\)\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shCommandSubList - syn region shDerefPPSright contained start='.' end='\ze}' contains=@shCommandSubList + syn region shDerefPPSleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shCommandSubList + syn region shDerefPPSright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' contains=@shCommandSubList endif " Arithmetic Parenthesized Expressions: {{{1 -syn region shParen matchgroup=shArithRegion start='(\%(\ze[^(]\|$\)' end=')' contains=@shArithParenList +syn region shParen matchgroup=shArithRegion start='[^$]\zs(\%(\ze[^(]\|$\)' end=')' contains=@shArithParenList " Useful sh Keywords: {{{1 " =================== @@ -557,6 +572,7 @@ hi def link shDoubleQuote shString hi def link shEcho shString hi def link shEchoDelim shOperator hi def link shEchoQuote shString +hi def link shForPP shLoop hi def link shEmbeddedEcho shString hi def link shEscape shCommandSub hi def link shExDoubleQuote shDoubleQuote @@ -592,6 +608,7 @@ if exists("b:is_bash") hi def link bashStatement shStatement hi def link shFunctionParen Delimiter hi def link shFunctionDelim Delimiter + hi def link shCharClass shSpecial endif if exists("b:is_kornshell") hi def link kshSpecialVariables shShellVariables diff --git a/runtime/syntax/sqlhana.vim b/runtime/syntax/sqlhana.vim new file mode 100644 index 0000000000..1410e99eb4 --- /dev/null +++ b/runtime/syntax/sqlhana.vim @@ -0,0 +1,293 @@ +" Vim syntax file +" Language: SQL, SAP HANA In Memory Database +" Maintainer: David Fishburn +" Last Change: 2012 Oct 23 +" Version: SP4 b (Q2 2012) +" Homepage: http://www.vim.org/scripts/script.php?script_id=4275 + +" Description: Updated to SAP HANA SP4 +" +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn case ignore + +" The SQL reserved words, defined as keywords. +" These were pulled from the following SQL reference: +" http://help.sap.com/hana/hana_sql_en.pdf +" An easy approach is to copy all text from the PDF +" into a Vim buffer. The keywords are in UPPER case, +" so you can run the following commands to be left with +" mainly the UPPER case words: +" 1. Delete all words that do not begin with a Capital +" %s/\(\<[^A-Z]\w*\>\)//g +" 2. Remove all words where the 2nd letter is not a Capital +" %s/\(\<[A-Z][^A-Z]\w*\>\)//g +" 3. Remove all non-word (or space) characters +" %s/[^0-9A-Za-z_ ]*//g +" 4. Remove some known words +" %s/\<\(SAP\|HANA\|OK\|AG\|IBM\|DB2\|AIX\|POWER\d\+\|UNIX\)\>//g +" 5. Remove blank lines and trailing spaces +" %s/\s\+$//g +" %s/^\s\+//g +" %s/^$\n//g +" 6. Convert spaces to newlines remove single character +" %s/[ ]\+/\r/g +" %g/^\w$/d +" 7. Sort and remove duplicates +" :sort +" :Uniq +" 8. Use the WhatsMissing plugin against the sqlhana.vim file. +" 9. Generated a file of all UPPER cased words which should not +" be in the syntax file. These items should be removed +" from the list in step 7. You can use WhatsNotMissing +" between step 7 and this new file to weed out the words +" we know are not syntax related. +" 10. Use the WhatsMissingRemoveMatches to remove the words +" from step 9. + +syn keyword sqlSpecial false null true + +" Supported Functions for Date/Time types +syn keyword sqlFunction ADD_DAYS ADD_MONTHS ADD_SECONDS ADD_YEARS COALESCE +syn keyword sqlFunction CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP CURRENT_UTCDATE +syn keyword sqlFunction CURRENT_UTCTIME CURRENT_UTCTIMESTAMP +syn keyword sqlFunction DAYNAME DAYOFMONTH DAYOFYEAR DAYS_BETWEEN EXTRACT +syn keyword sqlFunction GREATEST HOUR IFNULL ISOWEEK LAST_DAY LEAST LOCALTOUTC +syn keyword sqlFunction MINUTE MONTH MONTHNAME NEXT_DAY NOW QUARTER SECOND +syn keyword sqlFunction SECONDS_BETWEEN UTCTOLOCAL WEEK WEEKDAY YEAR + +syn keyword sqlFunction TO_CHAR TO_DATE TO_DATS TO_NCHAR TO_TIME TO_TIMESTAMP UTCTOLOCAL + +" Aggregate +syn keyword sqlFunction COUNT MIN MAX SUM AVG STDDEV VAR + +" Datatype conversion +syn keyword sqlFunction CAST TO_ALPHANUM TO_BIGINT TO_BINARY TO_BLOB TO_CHAR TO_CLOB +syn keyword sqlFunction TO_DATE TO_DATS TO_DECIMAL TO_DOUBLE TO_INT TO_INTEGER TO_NCHAR +syn keyword sqlFunction TO_NCLOB TO_NVARCHAR TO_REAL TO_SECONDDATE TO_SMALLDECIMAL +syn keyword sqlFunction TO_SMALLINT TO_TIME TO_TIMESTAMP TO_TINYINT TO_VARCHAR TO_VARBINARY + +" Number functions +syn keyword sqlFunction ABS ACOS ASIN ATAN ATAN2 BINTOHEX BITAND CEIL COS COSH COT +syn keyword sqlFunction EXP FLOOR GREATEST HEXTOBIN LEAST LN LOG MOD POWER ROUND +syn keyword sqlFunction SIGN SIN SINH SQRT TAN TANH UMINUS + +" String functions +syn keyword sqlFunction ASCII CHAR CONCAT LCASE LENGTH LOCATE LOWER LPAD LTRIM +syn keyword sqlFunction NCHAR REPLACE RPAD RTRIM SUBSTR_AFTER SUBSTR_BEFORE +syn keyword sqlFunction SUBSTRING TRIM UCASE UNICODE UPPER + +" Miscellaneous functions +syn keyword sqlFunction COALESCE CURRENT_CONNECTION CURRENT_SCHEMA CURRENT_USER +syn keyword sqlFunction GROUPING_ID IFNULL MAP NULLIF SESSION_CONTEXT SESSION_USER SYSUUIDSQL +syn keyword sqlFunction GET_NUM_SERVERS + + +" sp_ procedures +" syn keyword sqlFunction sp_addalias + + +" Reserved keywords +syn keyword sqlkeyword ALL AS AT BEFORE +syn keyword sqlkeyword BEGIN BOTH BY +syn keyword sqlkeyword CONDITION +syn keyword sqlkeyword CURRVAL CURSOR DECLARE +syn keyword sqlkeyword DISTINCT DO ELSE ELSEIF ELSIF +syn keyword sqlkeyword END EXCEPTION EXEC +syn keyword sqlkeyword FOR FROM GROUP +syn keyword sqlkeyword HAVING IN +syn keyword sqlkeyword INOUT INTO IS +syn keyword sqlkeyword LEADING +syn keyword sqlkeyword LOOP MINUS NATURAL NEXTVAL +syn keyword sqlkeyword OF ON ORDER OUT +syn keyword sqlkeyword PRIOR RETURN RETURNS REVERSE +syn keyword sqlkeyword ROWID SELECT +syn keyword sqlkeyword SQL START STOP SYSDATE +syn keyword sqlkeyword SYSTIME SYSTIMESTAMP SYSUUID +syn keyword sqlkeyword TRAILING USING UTCDATE +syn keyword sqlkeyword UTCTIME UTCTIMESTAMP VALUES +syn keyword sqlkeyword WHILE +syn keyword sqlkeyword ANY SOME EXISTS ESCAPE + +" IF keywords +syn keyword sqlkeyword IF + +" CASE keywords +syn keyword sqlKeyword WHEN THEN + +" Syntax rules common to TEXT and SHORTTEXT keywords +syn keyword sqlKeyword LANGUAGE DETECTION LINGUISTIC +syn keyword sqlkeyword MIME TYPE +syn keyword sqlkeyword EXACT WEIGHT FUZZY FUZZINESSTHRESHOLD SEARCH +syn keyword sqlkeyword PHRASE INDEX RATIO REBUILD +syn keyword sqlkeyword CONFIGURATION +syn keyword sqlkeyword SEARCH ONLY +syn keyword sqlkeyword FAST PREPROCESS +syn keyword sqlkeyword SYNC SYNCHRONOUS ASYNC ASYNCHRONOUS FLUSH QUEUE +syn keyword sqlkeyword EVERY AFTER MINUTES DOCUMENTS SUSPEND + +" Statement keywords (i.e. after ALTER or CREATE) +syn keyword sqlkeyword AUDIT POLICY +syn keyword sqlkeyword FULLTEXT +syn keyword sqlkeyword SEQUENCE RESTART +syn keyword sqlkeyword TABLE +syn keyword sqlkeyword PROCEDURE STATISTICS +syn keyword sqlkeyword SCHEMA +syn keyword sqlkeyword SYNONYM +syn keyword sqlkeyword VIEW +syn keyword sqlkeyword COLUMN +syn keyword sqlkeyword SYSTEM LICENSE +syn keyword sqlkeyword SESSION +syn keyword sqlkeyword CANCEL WORK +syn keyword sqlkeyword PLAN CACHE +syn keyword sqlkeyword LOGGING NOLOGGING RETENTION +syn keyword sqlkeyword RECONFIGURE SERVICE +syn keyword sqlkeyword RESET MONITORING +syn keyword sqlkeyword SAVE DURATION PERFTRACE FUNCTION_PROFILER +syn keyword sqlkeyword SAVEPOINT +syn keyword sqlkeyword USER +syn keyword sqlkeyword ROLE +syn keyword sqlkeyword ASC DESC +syn keyword sqlkeyword OWNED +syn keyword sqlkeyword DEPENDENCIES SCRAMBLE + +" Create sequence +syn keyword sqlkeyword INCREMENT MAXVALUE MINVALUE CYCLE + +" Create table +syn keyword sqlkeyword HISTORY GLOBAL LOCAL TEMPORARY + +" Create trigger +syn keyword sqlkeyword TRIGGER REFERENCING EACH DEFAULT +syn keyword sqlkeyword SIGNAL RESIGNAL MESSAGE_TEXT OLD NEW +syn keyword sqlkeyword EXIT HANDLER SQL_ERROR_CODE +syn keyword sqlkeyword TARGET CONDITION SIGNAL + +" Alter table +syn keyword sqlkeyword ADD DROP MODIFY GENERATED ALWAYS +syn keyword sqlkeyword UNIQUE BTREE CPBTREE PRIMARY KEY +syn keyword sqlkeyword CONSTRAINT PRELOAD NONE +syn keyword sqlkeyword ROW THREADS BATCH +syn keyword sqlkeyword MOVE PARTITION TO LOCATION PHYSICAL OTHERS +syn keyword sqlkeyword ROUNDROBIN PARTITIONS HASH RANGE VALUE +syn keyword sqlkeyword PERSISTENT DELTA AUTO AUTOMERGE + +" Create audit policy +syn keyword sqlkeyword AUDITING SUCCESSFUL UNSUCCESSFUL +syn keyword sqlkeyword PRIVILEGE STRUCTURED CHANGE LEVEL +syn keyword sqlkeyword EMERGENCY ALERT CRITICAL WARNING INFO + +" Privileges +syn keyword sqlkeyword DEBUG EXECUTE + +" Schema +syn keyword sqlkeyword CASCADE RESTRICT PARAMETERS SCAN + +" Traces +syn keyword sqlkeyword CLIENT CRASHDUMP EMERGENCYDUMP +syn keyword sqlkeyword INDEXSERVER NAMESERVER DAEMON +syn keyword sqlkeyword CLEAR REMOVE TRACES + +" Reclaim +syn keyword sqlkeyword RECLAIM DATA VOLUME VERSION SPACE DEFRAGMENT SPARSIFY + +" Join +syn keyword sqlkeyword INNER OUTER LEFT RIGHT FULL CROSS JOIN +syn keyword sqlkeyword GROUPING SETS ROLLUP CUBE +syn keyword sqlkeyword BEST LIMIT OFFSET +syn keyword sqlkeyword WITH SUBTOTAL BALANCE TOTAL +syn keyword sqlkeyword TEXT_FILTER FILL UP SORT MATCHES TOP +syn keyword sqlkeyword RESULT OVERVIEW PREFIX MULTIPLE RESULTSETS + +" Lock +syn keyword sqlkeyword EXCLUSIVE MODE NOWAIT + +" Transaction +syn keyword sqlkeyword TRANSACTION ISOLATION READ COMMITTED +syn keyword sqlkeyword REPEATABLE SERIALIZABLE WRITE + +" Saml +syn keyword sqlkeyword SAML ASSERTION PROVIDER SUBJECT ISSUER + +" User +syn keyword sqlkeyword PASSWORD IDENTIFIED EXTERNALLY ATTEMPTS ATTEMPTS +syn keyword sqlkeyword ENABLE DISABLE OFF LIFETIME FORCE DEACTIVATE +syn keyword sqlkeyword ACTIVATE IDENTITY KERBEROS + +" Grant +syn keyword sqlkeyword ADMIN BACKUP CATALOG SCENARIO INIFILE MONITOR +syn keyword sqlkeyword OPTIMIZER OPTION +syn keyword sqlkeyword RESOURCE STRUCTUREDPRIVILEGE TRACE + +" Import +syn keyword sqlkeyword CSV FILE CONTROL NO CHECK SKIP FIRST LIST +syn keyword sqlkeyword RECORD DELIMITED FIELD OPTIONALLY ENCLOSED FORMAT + +" Roles +syn keyword sqlkeyword PUBLIC CONTENT_ADMIN MODELING MONITORING + +" Miscellaneous +syn keyword sqlkeyword APPLICATION BINARY IMMEDIATE COREFILE SECURITY DEFINER +syn keyword sqlkeyword DUMMY INVOKER MATERIALIZED MESSEGE_TEXT PARAMETER PARAMETERS +syn keyword sqlkeyword PART +syn keyword sqlkeyword CONSTANT SQLEXCEPTION SQLWARNING + +syn keyword sqlOperator WHERE BETWEEN LIKE NULL CONTAINS +syn keyword sqlOperator AND OR NOT CASE +syn keyword sqlOperator UNION INTERSECT EXCEPT + +syn keyword sqlStatement ALTER CALL CALLS CREATE DROP RENAME TRUNCATE +syn keyword sqlStatement DELETE INSERT UPDATE EXPLAIN +syn keyword sqlStatement MERGE REPLACE UPSERT SELECT +syn keyword sqlStatement SET UNSET LOAD UNLOAD +syn keyword sqlStatement CONNECT DISCONNECT COMMIT LOCK ROLLBACK +syn keyword sqlStatement GRANT REVOKE +syn keyword sqlStatement EXPORT IMPORT + + +syn keyword sqlType DATE TIME SECONDDATE TIMESTAMP TINYINT SMALLINT +syn keyword sqlType INT INTEGER BIGINT SMALLDECIMAL DECIMAL +syn keyword sqlType REAL DOUBLE FLOAT +syn keyword sqlType VARCHAR NVARCHAR ALPHANUM SHORTTEXT VARBINARY +syn keyword sqlType BLOB CLOB NCLOB TEXT DAYDATE + +syn keyword sqlOption Webservice_namespace_host + +" Strings and characters: +syn region sqlString start=+"+ end=+"+ contains=@Spell +syn region sqlString start=+'+ end=+'+ contains=@Spell + +" Numbers: +syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>" + +" Comments: +syn region sqlDashComment start=/--/ end=/$/ contains=@Spell +syn region sqlSlashComment start=/\/\// end=/$/ contains=@Spell +syn region sqlMultiComment start="/\*" end="\*/" contains=sqlMultiComment,@Spell +syn cluster sqlComment contains=sqlDashComment,sqlSlashComment,sqlMultiComment,@Spell +syn sync ccomment sqlComment +syn sync ccomment sqlDashComment +syn sync ccomment sqlSlashComment + +hi def link sqlDashComment Comment +hi def link sqlSlashComment Comment +hi def link sqlMultiComment Comment +hi def link sqlNumber Number +hi def link sqlOperator Operator +hi def link sqlSpecial Special +hi def link sqlKeyword Keyword +hi def link sqlStatement Statement +hi def link sqlString String +hi def link sqlType Type +hi def link sqlFunction Function +hi def link sqlOption PreProc + +let b:current_syntax = "sqlhana" + +" vim:sw=4: diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index 0eeff6f598..d8a384a985 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: Apr 24, 2012 -" Version: 73 +" Maintainer: Charles E. Campbell +" Last Change: Nov 14, 2012 +" Version: 75 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax " " Notes: {{{1 @@ -155,7 +155,7 @@ endif " Try to flag {} and () mismatches: {{{1 if !exists("g:tex_no_error") syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup,texError - syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup,texError + syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup,texError,@NoSpell else syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup @@ -723,7 +723,7 @@ if has("conceal") && &enc == 'utf-8' \ ['leftarrowtail' , '↢'], \ ['leftharpoondown', '↽'], \ ['leftharpoonup' , '↼'], - \ ['leftrightarrow' , '⇔'], + \ ['leftrightarrow' , '↔'], \ ['Leftrightarrow' , '⇔'], \ ['leftrightsquigarrow', '↭'], \ ['leftthreetimes' , '⋋'], diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 2ed771c8dd..f6d6698d8e 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Vim 7.3 script -" Maintainer: Dr. Charles E. Campbell, Jr. -" Last Change: Jan 11, 2012 -" Version: 7.3-13 +" Maintainer: Charles E. Campbell +" Last Change: Nov 14, 2012 +" Version: 7.3-20 " Automatically generated keyword lists: {{{1 " Quit when a syntax file was already loaded {{{2 @@ -80,7 +80,7 @@ syn case match " Function Names {{{2 syn keyword vimFuncName contained abs append argv atan2 bufexists bufname byte2line ceil cindent complete confirm cosh cursor did_filetype empty eventhandler exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdtype getfperm getftype getmatches getqflist gettabvar getwinposy globpath haslocaldir histdel hlexists iconv input inputrestore insert items len line localtime map match matchdelete matchstr min mode nextnonblank pathshorten prevnonblank pumvisible readfile reltimestr remote_foreground remote_read remove repeat reverse search searchpair searchpos serverlist setcmdpos setloclist setpos setreg settabwinvar shellescape sin sort spellbadword split str2float strchars strftime string strpart strtrans submatch synconcealed synIDattr synstack tabpagebuflist tabpagewinnr taglist tanh tolower tr type undotree virtcol winbufnr winheight winnr winrestview winwidth syn keyword vimFuncName contained acos argc asin browse buflisted bufnr byteidx changenr clearmatches complete_add copy count deepcopy diff_filler escape executable expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcmdline getcwd getfsize getline getpid getreg gettabwinvar getwinvar has hasmapto histget hlID indent inputdialog inputsave isdirectory join libcall line2byte log maparg matchadd matchend max mkdir mzeval nr2char pow printf range reltime remote_expr remote_peek remote_send rename resolve round searchdecl searchpairpos server2client setbufvar setline setmatches setqflist settabvar setwinvar simplify sinh soundfold spellsuggest sqrt str2nr strdisplaywidth stridx strlen strridx strwidth substitute synID synIDtrans system tabpagenr tagfiles tan tempname toupper trunc undofile values visualmode wincol winline winrestcmd winsaveview writefile -syn keyword vimFuncName contained add argidx atan browsedir bufloaded bufwinnr call char2nr col complete_check cos cscope_connection delete diff_hlID eval exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdpos getfontname getftime getloclist getpos getregtype getwinposx glob has_key histadd histnr hostname index inputlist inputsecret islocked keys libcallnr lispindent log10 mapcheck matcharg matchlist pyeval py3eval luaeval +syn keyword vimFuncName contained add argidx atan browsedir bufloaded bufwinnr call char2nr col complete_check cos cscope_connection delete diff_hlID eval exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdpos getfontname getftime getloclist getpos getregtype getwinposx glob has_key histadd histnr hostname index inputlist inputsecret islocked keys libcallnr lispindent log10 mapcheck matcharg matchlist "--- syntax above generated by mkvimvim --- " Special Vim Highlighting (not automatic) {{{1 @@ -153,11 +153,12 @@ syn keyword vimAugroupKey contained aug[roup] " Operators: {{{2 " ========= +" COMBAK: vimOperParen used to have "oneline" syn cluster vimOperGroup contains=vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile -syn region vimOperParen oneline matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup -syn region vimOperParen oneline matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar +syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup +syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror") syn match vimOperError ")" endif @@ -207,7 +208,7 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror") endif syn case ignore syn keyword vimUserAttrbKey contained bar ban[g] cou[nt] ra[nge] com[plete] n[args] re[gister] -syn keyword vimUserAttrbCmplt contained augroup buffer command dir environment event expression file function help highlight mapping menu option shellcmd something tag tag_listfiles var +syn keyword vimUserAttrbCmplt contained augroup buffer color command compiler cscope dir environment event expression file file_in_path filetype function help highlight locale mapping menu option shellcmd sign syntax tag tag_listfiles var syn keyword vimUserAttrbCmplt contained custom customlist nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\u\w*\)\+\|\u\w*\)"hs=s+1 nextgroup=vimUserCmdError @@ -332,7 +333,7 @@ syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhit syn match vimMapBang contained "!" skipwhite nextgroup=vimMapMod,vimMapLhs syn match vimMapMod contained "\c<\(buffer\|expr\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs syn match vimMapRhs contained ".*" contains=vimNotation,vimCtrlChar skipnl nextgroup=vimMapRhsExtend -syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimContinue +syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimNotation,vimCtrlChar,vimContinue skipnl nextgroup=vimMapRhsExtend syn case ignore syn keyword vimMapModKey contained buffer expr leader localleader plug script sid silent unique syn case match @@ -364,8 +365,8 @@ syn case match " User Function Highlighting {{{2 " (following Gautam Iyer's suggestion) " ========================== -syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_.]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute -syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_.]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation +syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute +syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation syn match vimNotFunc "\\|\\|\\|\" " Errors And Warnings: {{{2 @@ -433,7 +434,7 @@ syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\k\+" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>" if has("conceal") - syn match vimSynMtchOpt contained "\:p:h")."/lua.vim") if !filereadable(s:luapath) - let s:luapath= fnameescape(globpath(&rtp,"syntax/lua.vim")) + for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n") + if filereadable(fnameescape(s:luapath)) + let s:luapath= fnameescape(s:luapath) + break + endif + endfor endif if (g:vimsyn_embed =~ 'l' && has("lua")) && filereadable(s:luapath) unlet! b:current_syntax @@ -588,7 +595,12 @@ unlet s:luapath " [-- perl --] {{{3 let s:perlpath= fnameescape(expand(":p:h")."/perl.vim") if !filereadable(s:perlpath) - let s:perlpath= fnameescape(globpath(&rtp,"syntax/perl.vim")) + for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n") + if filereadable(fnameescape(s:perlpath)) + let s:perlpath= fnameescape(s:perlpath) + break + endif + endfor endif if (g:vimsyn_embed =~ 'p' && has("perl")) && filereadable(s:perlpath) unlet! b:current_syntax @@ -610,7 +622,12 @@ unlet s:perlpath " [-- ruby --] {{{3 let s:rubypath= fnameescape(expand(":p:h")."/ruby.vim") if !filereadable(s:rubypath) - let s:rubypath= fnameescape(globpath(&rtp,"syntax/ruby.vim")) + for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n") + if filereadable(fnameescape(s:rubypath)) + let s:rubypath= fnameescape(s:rubypath) + break + endif + endfor endif if (g:vimsyn_embed =~ 'r' && has("ruby")) && filereadable(s:rubypath) unlet! b:current_syntax @@ -631,9 +648,14 @@ unlet s:rubypath " [-- python --] {{{3 let s:pythonpath= fnameescape(expand(":p:h")."/python.vim") if !filereadable(s:pythonpath) - let s:pythonpath= fnameescape(globpath(&rtp,"syntax/python.vim")) + for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n") + if filereadable(fnameescape(s:pythonpath)) + let s:pythonpath= fnameescape(s:pythonpath) + break + endif + endfor endif -if (g:vimsyn_embed =~ 'P' && has("python")) && filereadable(s:pythonpath) +if g:vimsyn_embed =~ 'P' && (has("python") || has("python3")) && filereadable(s:pythonpath) unlet! b:current_syntax exe "syn include @vimPythonScript ".s:pythonpath if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'P' @@ -660,7 +682,12 @@ endif if s:trytcl let s:tclpath= fnameescape(expand(":p:h")."/tcl.vim") if !filereadable(s:tclpath) - let s:tclpath= fnameescape(globpath(&rtp,"syntax/tcl.vim")) + for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n") + if filereadable(fnameescape(s:tclpath)) + let s:tclpath= fnameescape(s:tclpath) + break + endif + endfor endif if (g:vimsyn_embed =~ 't' && has("tcl")) && filereadable(s:tclpath) unlet! b:current_syntax @@ -687,7 +714,12 @@ unlet s:trytcl " [-- mzscheme --] {{{3 let s:mzschemepath= fnameescape(expand(":p:h")."/scheme.vim") if !filereadable(s:mzschemepath) - let s:mzschemepath= fnameescape(globpath(&rtp,"syntax/scheme.vim")) + for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n") + if filereadable(fnameescape(s:mzschemepath)) + let s:mzschemepath= fnameescape(s:mzschemepath) + break + endif + endfor endif if (g:vimsyn_embed =~ 'm' && has("mzscheme")) && filereadable(s:mzschemepath) unlet! b:current_syntax @@ -883,6 +915,7 @@ hi def link vimUserCmdError Error hi def link vimUserFunc Normal hi def link vimVar Identifier hi def link vimWarn WarningMsg +hi def link vimHiNmbr Number " Current Syntax Variable: {{{2 let b:current_syntax = "vim" diff --git a/runtime/syntax/yacc.vim b/runtime/syntax/yacc.vim index 4ddf078432..3da7ffc9f9 100644 --- a/runtime/syntax/yacc.vim +++ b/runtime/syntax/yacc.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Yacc -" Maintainer: Charles E. Campbell, Jr. -" Last Change: Aug 12, 2010 -" Version: 9 +" Maintainer: Charles E. Campbell +" Last Change: Nov 14, 2012 +" Version: 10 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax " " Options: {{{1 @@ -20,18 +20,24 @@ endif " --------------------------------------------------------------------- " Folding Support {{{1 if has("folding") - com! -nargs=+ HiFold fold + com! -nargs=+ SynFold fold else - com! -nargs=+ HiFold + com! -nargs=+ SynFold endif " --------------------------------------------------------------------- " Read the C syntax to start with {{{1 -if exists("g:yacc_uses_cpp") - syn include @yaccCode :p:h/cpp.vim -else - syn include @yaccCode :p:h/c.vim +" Read the C/C++ syntax to start with +let s:Cpath= fnameescape(expand(":p:h").(exists("g:yacc_uses_cpp")? "/cpp.vim" : "/c.vim")) +if !filereadable(s:Cpath) + for s:Cpath in split(globpath(&rtp,(exists("g:yacc_uses_cpp")? "syntax/cpp.vim" : "syntax/c.vim")),"\n") + if filereadable(fnameescape(s:Cpath)) + let s:Cpath= fnameescape(s:Cpath) + break + endif + endfor endif +exe "syn include @yaccCode ".s:Cpath " --------------------------------------------------------------------- " Yacc Clusters: {{{1 @@ -40,12 +46,12 @@ syn cluster yaccRulesCluster contains=yaccNonterminal,yaccString " --------------------------------------------------------------------- " Yacc Sections: {{{1 -HiFold syn region yaccInit start='.'ms=s-1,rs=s-1 matchgroup=yaccSectionSep end='^%%$'me=e-2,re=e-2 contains=@yaccInitCluster nextgroup=yaccRules skipwhite skipempty contained -HiFold syn region yaccInit2 start='\%^.'ms=s-1,rs=s-1 matchgroup=yaccSectionSep end='^%%$'me=e-2,re=e-2 contains=@yaccInitCluster nextgroup=yaccRules skipwhite skipempty -HiFold syn region yaccHeader2 matchgroup=yaccSep start="^\s*\zs%{" end="^\s*%}" contains=@yaccCode nextgroup=yaccInit skipwhite skipempty contained -HiFold syn region yaccHeader matchgroup=yaccSep start="^\s*\zs%{" end="^\s*%}" contains=@yaccCode nextgroup=yaccInit skipwhite skipempty -HiFold syn region yaccRules matchgroup=yaccSectionSep start='^%%$' end='^%%$'me=e-2,re=e-2 contains=@yaccRulesCluster nextgroup=yaccEndCode skipwhite skipempty contained -HiFold syn region yaccEndCode matchgroup=yaccSectionSep start='^%%$' end='\%$' contains=@yaccCode contained +SynFold syn region yaccInit start='.'ms=s-1,rs=s-1 matchgroup=yaccSectionSep end='^%%$'me=e-2,re=e-2 contains=@yaccInitCluster nextgroup=yaccRules skipwhite skipempty contained +SynFold syn region yaccInit2 start='\%^.'ms=s-1,rs=s-1 matchgroup=yaccSectionSep end='^%%$'me=e-2,re=e-2 contains=@yaccInitCluster nextgroup=yaccRules skipwhite skipempty +SynFold syn region yaccHeader2 matchgroup=yaccSep start="^\s*\zs%{" end="^\s*%}" contains=@yaccCode nextgroup=yaccInit skipwhite skipempty contained +SynFold syn region yaccHeader matchgroup=yaccSep start="^\s*\zs%{" end="^\s*%}" contains=@yaccCode nextgroup=yaccInit skipwhite skipempty +SynFold syn region yaccRules matchgroup=yaccSectionSep start='^%%$' end='^%%$'me=e-2,re=e-2 contains=@yaccRulesCluster nextgroup=yaccEndCode skipwhite skipempty contained +SynFold syn region yaccEndCode matchgroup=yaccSectionSep start='^%%$' end='\%$' contains=@yaccCode contained " --------------------------------------------------------------------- " Yacc Commands: {{{1 @@ -63,11 +69,11 @@ syn match yaccKey "\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+" contained syn keyword yaccKeyActn yyerrok yyclearin contained syn match yaccUnionStart "^%union" skipwhite skipnl nextgroup=yaccUnion contained -HiFold syn region yaccUnion matchgroup=yaccCurly start="{" matchgroup=yaccCurly end="}" contains=@yaccCode contained +SynFold syn region yaccUnion matchgroup=yaccCurly start="{" matchgroup=yaccCurly end="}" contains=@yaccCode contained syn match yaccBrkt "[<>]" contained syn match yaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=yaccBrkt contained -HiFold syn region yaccNonterminal start="^\s*\a\w*\ze\_s*\(/\*\_.\{-}\*/\)\=\_s*:" matchgroup=yaccDelim end=";" matchgroup=yaccSectionSep end='^%%$'me=e-2,re=e-2 contains=yaccAction,yaccDelim,yaccString,yaccComment contained +SynFold syn region yaccNonterminal start="^\s*\a\w*\ze\_s*\(/\*\_.\{-}\*/\)\=\_s*:" matchgroup=yaccDelim end=";" matchgroup=yaccSectionSep end='^%%$'me=e-2,re=e-2 contains=yaccAction,yaccDelim,yaccString,yaccComment contained syn region yaccComment start="/\*" end="\*/" syn match yaccString "'[^']*'" contained @@ -75,7 +81,8 @@ syn match yaccString "'[^']*'" contained " --------------------------------------------------------------------- " I'd really like to highlight just the outer {}. Any suggestions??? {{{1 syn match yaccCurlyError "[{}]" -HiFold syn region yaccAction matchgroup=yaccCurly start="{" end="}" contains=@yaccCode contained +SynFold syn region yaccAction matchgroup=yaccCurly start="{" end="}" contains=@yaccCode,yaccVar contained +syn match yaccVar '\$\d\+\|\$\$\|\$<\I\i*>\$\|\$<\I\i*>\d\+' containedin=cParen,cPreProc,cMulti contained " --------------------------------------------------------------------- " Yacc synchronization: {{{1 @@ -84,39 +91,30 @@ syn sync fromstart " --------------------------------------------------------------------- " Define the default highlighting. {{{1 if !exists("did_yacc_syn_inits") - command -nargs=+ HiLink hi def link - - " Internal yacc highlighting links {{{2 - HiLink yaccBrkt yaccStmt - HiLink yaccKey yaccStmt - HiLink yaccOper yaccStmt - HiLink yaccUnionStart yaccKey - - " External yacc highlighting links {{{2 - HiLink yaccComment Comment - HiLink yaccCurly Delimiter - HiLink yaccCurlyError Error - HiLink yaccDefines cDefine - HiLink yaccParseParam yaccParseOption - HiLink yaccParseOption cDefine - HiLink yaccNonterminal Function - HiLink yaccDelim Delimiter - HiLink yaccKeyActn Special - HiLink yaccSectionSep Todo - HiLink yaccSep Delimiter - HiLink yaccString String - HiLink yaccStmt Statement - HiLink yaccType Type - - " since Bram doesn't like my Delimiter :| {{{2 - HiLink Delimiter Type - - delcommand HiLink + hi def link yaccBrkt yaccStmt + hi def link yaccComment Comment + hi def link yaccCurly Delimiter + hi def link yaccCurlyError Error + hi def link yaccDefines cDefine + hi def link yaccDelim Delimiter + hi def link yaccKeyActn Special + hi def link yaccKey yaccStmt + hi def link yaccNonterminal Function + hi def link yaccOper yaccStmt + hi def link yaccParseOption cDefine + hi def link yaccParseParam yaccParseOption + hi def link yaccSectionSep Todo + hi def link yaccSep Delimiter + hi def link yaccStmt Statement + hi def link yaccString String + hi def link yaccType Type + hi def link yaccUnionStart yaccKey + hi def link yaccVar Special endif " --------------------------------------------------------------------- " Cleanup: {{{1 -delcommand HiFold +delcommand SynFold let b:current_syntax = "yacc" " --------------------------------------------------------------------- diff --git a/runtime/tutor/tutor.ja.euc b/runtime/tutor/tutor.ja.euc index 69b3d36219..9eabbdc401 100644 --- a/runtime/tutor/tutor.ja.euc +++ b/runtime/tutor/tutor.ja.euc @@ -541,7 +541,7 @@ Note: 4. ǽγ̤˰ưˤ % ȥפޤ礦 - 5. ¾ (,),[,],{ or } ǥư% 򤷤Ƥ뤫ǧޤ礦 + 5. ¾ (,),[,],{ } ǥư% 򤷤Ƥ뤫ǧޤ礦 ---> This ( is a test line with ('s, ['s ] and {'s } in it. )) @@ -655,7 +655,7 @@ Note: 3. ʸ : 򲡤ȡ̤κDz :'<,'> ޤ - 4. w TEST (TESET ¸ߤʤե̾)򥿥פޤ + 4. w TEST (TEST ¸ߤʤե̾)򥿥פޤ Enter 򲡤 :'<,'>w TEST ȤʤäƤ뤳ȤǧƲ 5. Vim TEST Ȥե򤵤줿Ԥ񤭹Ǥ礦 @@ -772,7 +772,7 @@ Note: a, i 3. ִ⡼ɤȴˤ 򲡤ޤԤλĤ꤬ѹƤʤޤޤ ʤ뤳ȤդƤ - 5. Ĥä xxx 򥹥ƥåפ򷫤ִ֤ޤ礦 + 4. Ĥä xxx 򥹥ƥåפ򷫤ִ֤ޤ礦 ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. @@ -869,10 +869,10 @@ Note: 1 ":help" ޥɤ˰Ϳ뤳Ȥˤꡢ̾Υإפ򸫤Ĥ뤳 ǤޤƤߤޤ礦( 򥿥פ˺ʤ褦): - :help w - :help c_ This ( is a test line with ('s, ['s ] and {'s } in it. )) @@ -655,7 +655,7 @@ Note: 3. : ƁAʂ̍ʼn :'<,'> ܂B - 4. w TEST (TESET ݂͑Ȃt@C)^Cv܂B + 4. w TEST (TEST ݂͑Ȃt@C)^Cv܂B Enter O :'<,'>w TEST ƂȂĂ邱ƂmFĉB 5. Vim TEST Ƃt@CɑIꂽsނł傤B @@ -772,7 +772,7 @@ Note: a, i 3. u[h𔲂ɂ ܂Bs̎c肪ύXĂȂ܂܂ Ȃ邱ƂɒӂĂB - 5. c xxx XebvJԂĒu܂傤B + 4. c xxx XebvJԂĒu܂傤B ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. @@ -869,10 +869,10 @@ Note: 1 ":help" R}hɈ^邱ƂɂA薼̃wv‚邱 ł܂BĂ݂܂傤( ^CvYȂ悤): - :help w - :help c_ This ( is a test line with ('s, ['s ] and {'s } in it. )) @@ -655,7 +655,7 @@ Note: ここで Vim を終了し、ファイル名 TEST と共に起動すると 3. 文字 : を押すと、画面の最下部に :'<,'> が現れます。 - 4. w TEST (TESET は存在しないファイル名)をタイプします。 + 4. w TEST (TEST は存在しないファイル名)をタイプします。 Enter を押す前に :'<,'>w TEST となっていることを確認して下さい。 5. Vim は TEST というファイルに選択された行を書き込むでしょう。 @@ -772,7 +772,7 @@ Note: a, i と A は同じ挿入モードへ移りますが、文字が挿入さ 3. 置換モードを抜けるには を押します。行の残りが変更されていないままに なることに注意してください。 - 5. 残った xxx をステップを繰り返して置換しましょう。 + 4. 残った xxx をステップを繰り返して置換しましょう。 ---> Adding 123 to xxx gives you xxx. ---> Adding 123 to 456 gives you 579. @@ -869,10 +869,10 @@ Note: 1つの検索コマンドだけ大文字小文字の区別をやめたい ":help" コマンドに引数を与えることにより、あらゆる題名のヘルプを見つけること ができます。これらを試してみましょう( をタイプし忘れないように): - :help w - :help c_ +!ifdef SDK_INCLUDE_DIR +!include $(SDK_INCLUDE_DIR)\Win32.mak +!else +!include +!endif all: gvimext.dll diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak index 1c6ceda0c4..a56141662f 100644 --- a/src/Make_cyg.mak +++ b/src/Make_cyg.mak @@ -21,7 +21,11 @@ # TCL_VER define to version of TCL being used (83) # DYNAMIC_TCL no or yes: use yes to load the TCL DLL dynamically (yes) # RUBY define to path to Ruby dir to get Ruby support (not defined) -# RUBY_VER define to version of Ruby being used (16) +# RUBY_VER define to version of Ruby being used (16) +# RUBY_VER_LONG same, but in format with dot. (1.6) +# You must set RUBY_VER_LONG when changing RUBY_VER. +# You must set RUBY_API_VER version to RUBY_VER_LONG. +# Don't set ruby API version to RUBY_VER like 191. # DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (yes) # MZSCHEME define to path to MzScheme dir to get MZSCHEME support (not defined) # MZSCHEME_VER define to version of MzScheme being used (209_000) @@ -217,8 +221,15 @@ RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER) endif endif +ifeq (19, $(word 1,$(sort 19 $(RUBY_VER)))) +RUBY_19_OR_LATER = 1 +endif + DEFINES += -DFEAT_RUBY INCLUDES += -I$(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) +ifdef RUBY_19_OR_LATER +INCLUDES += -I$(RUBY)/include/ruby-$(RUBY_VER_LONG) -I$(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM) +endif EXTRA_OBJS += $(OUTDIR)/if_ruby.o ifeq (yes, $(DYNAMIC_RUBY)) diff --git a/src/Make_ming.mak b/src/Make_ming.mak index 8e523a24e3..9402ccce7a 100644 --- a/src/Make_ming.mak +++ b/src/Make_ming.mak @@ -301,7 +301,14 @@ RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER) endif endif -RUBYINC =-I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM) +ifeq (19, $(word 1,$(sort 19 $(RUBY_VER)))) +RUBY_19_OR_LATER = 1 +endif + +RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) +ifdef RUBY_19_OR_LATER +RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM) +endif ifeq (no, $(DYNAMIC_RUBY)) RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME) endif diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index ef75193e2b..4d8b6691bb 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -413,6 +413,9 @@ MSVCVER = 10.0 !if "$(_NMAKE_VER)" == "11.00.50727.1" MSVCVER = 11.0 !endif +!if "$(_NMAKE_VER)" == "11.00.51106.1" +MSVCVER = 11.0 +!endif !endif # Abort bulding VIM if version of VC is unrecognised. diff --git a/src/Makefile b/src/Makefile index d83288c8ff..132b68eda7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1769,10 +1769,11 @@ proto: $(PRO_AUTO) $(PRO_MANUAL) # Filter out arguments that cproto doesn't support. # Don't pass "-pthread" to cproto, it sees it as a list of individual flags. # Don't pass "-fstack-protector" to cproto, for the same reason. +# Don't pass "-g" to cproto. # The -E"gcc -E" argument must be separate to avoid problems with shell # quoting. CPROTO = cproto $(PROTO_FLAGS) -DPROTO \ - `echo '$(LINT_CFLAGS)' | sed -e 's/-pthread//g' -e 's/-fstack-protector//g'` + `echo '$(LINT_CFLAGS)' | sed -e 's/-pthread//g' -e 's/-fstack-protector//g' -e 's/\ -g\ / /g'` ### Would be nice if this would work for "normal" make. ### Currently it only works for (Free)BSD make. diff --git a/src/auto/configure b/src/auto/configure index e1cbb985ef..d370e61a64 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -5005,26 +5005,49 @@ $as_echo "no" >&6; } MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib" fi fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket collects directory" >&5 +$as_echo_n "checking for racket collects directory... " >&6; } if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then - SCHEME_COLLECTS=lib/plt/ + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/ else if test -d $vi_cv_path_mzscheme_pfx/lib/racket/collects; then - SCHEME_COLLECTS=lib/racket/ + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/ + else + if test -d $vi_cv_path_mzscheme_pfx/share/racket/collects; then + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/ + fi fi fi - if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.ss" ; then + if test "X$SCHEME_COLLECTS" != "X" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SCHEME_COLLECTS}" >&5 +$as_echo "${SCHEME_COLLECTS}" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mzscheme_base.c" >&5 +$as_echo_n "checking for mzscheme_base.c... " >&6; } + if test -f "${SCHEME_COLLECTS}collects/scheme/base.ss" ; then MZSCHEME_EXTRA="mzscheme_base.c" else - if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then + if test -f "${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then MZSCHEME_EXTRA="mzscheme_base.c" fi fi if test "X$MZSCHEME_EXTRA" != "X" ; then MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: needed" >&5 +$as_echo "needed" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed" >&5 +$as_echo "not needed" >&6; } fi + MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ - -DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects\"'" + -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" MZSCHEME_SRC="if_mzsch.c" MZSCHEME_OBJ="objects/if_mzsch.o" MZSCHEME_PRO="if_mzsch.pro" diff --git a/src/bigvim64.bat b/src/bigvim64.bat index 360fb181fd..6b58fa0d64 100644 --- a/src/bigvim64.bat +++ b/src/bigvim64.bat @@ -1,6 +1,7 @@ :: command to build big Vim 64 bit with OLE, Perl, Python, Ruby and Tcl :: First run: %VCDIR%\vcvarsall.bat x86_amd64 +:: Ruby and Tcl are excluded, doesn't seem to work. SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\" SET TOOLDIR=E:\ -%VCDIR%\bin\nmake -f Make_mvc.mak CPU=AMD64 GUI=yes OLE=yes PERL=E:\perl514 DYNAMIC_PERL=yes PERL_VER=514 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python32 DYNAMIC_PYTHON3=yes PYTHON3_VER=32 RUBY=%TOOLDIR%ruby192 DYNAMIC_RUBY=yes RUBY_VER=192 RUBY_VER_LONG=1.9.2 TCL=%TOOLDIR%tcl TCL_VER=85 TCL_VER_LONG=8.5 DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes +%VCDIR%\bin\nmake -f Make_mvc.mak CPU=AMD64 GUI=yes OLE=yes PERL=E:\perl514 DYNAMIC_PERL=yes PERL_VER=514 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python32 DYNAMIC_PYTHON3=yes PYTHON3_VER=32 %1 IME=yes CSCOPE=yes diff --git a/src/buffer.c b/src/buffer.c index ec4589edf1..f8db8c241d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1706,6 +1706,11 @@ buflist_new(ffname, sfname, lnum, flags) #endif /* buf->b_nwindows = 0; why was this here? */ free_buffer_stuff(buf, FALSE); /* delete local variables et al. */ + + /* Init the options. */ + buf->b_p_initialized = FALSE; + buf_copy_options(buf, BCO_ENTER); + #ifdef FEAT_KEYMAP /* need to reload lmaps and set b:keymap_name */ curbuf->b_kmap_state |= KEYMAP_INIT; diff --git a/src/configure.in b/src/configure.in index 0845cda1b9..d1dd9a9808 100644 --- a/src/configure.in +++ b/src/configure.in @@ -664,17 +664,30 @@ if test "$enable_mzschemeinterp" = "yes"; then MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib" fi fi + + AC_MSG_CHECKING(for racket collects directory) if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then - SCHEME_COLLECTS=lib/plt/ + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/ else if test -d $vi_cv_path_mzscheme_pfx/lib/racket/collects; then - SCHEME_COLLECTS=lib/racket/ + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/ + else + if test -d $vi_cv_path_mzscheme_pfx/share/racket/collects; then + SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/ + fi fi fi - if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.ss" ; then + if test "X$SCHEME_COLLECTS" != "X" ; then + AC_MSG_RESULT(${SCHEME_COLLECTS}) + else + AC_MSG_RESULT(not found) + fi + + AC_MSG_CHECKING(for mzscheme_base.c) + if test -f "${SCHEME_COLLECTS}collects/scheme/base.ss" ; then MZSCHEME_EXTRA="mzscheme_base.c" else - if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then + if test -f "${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then MZSCHEME_EXTRA="mzscheme_base.c" fi fi @@ -682,9 +695,13 @@ if test "$enable_mzschemeinterp" = "yes"; then dnl need to generate bytecode for MzScheme base MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE" MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" + AC_MSG_RESULT(needed) + else + AC_MSG_RESULT(not needed) fi + MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ - -DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects\"'" + -DMZSCHEME_COLLECTS='\"${SCHEME_COLLECTS}collects\"'" MZSCHEME_SRC="if_mzsch.c" MZSCHEME_OBJ="objects/if_mzsch.o" MZSCHEME_PRO="if_mzsch.pro" diff --git a/src/eval.c b/src/eval.c index c91d091cac..7b89a72d63 100644 --- a/src/eval.c +++ b/src/eval.c @@ -668,6 +668,8 @@ static void f_reverse __ARGS((typval_T *argvars, typval_T *rettv)); #ifdef FEAT_FLOAT static void f_round __ARGS((typval_T *argvars, typval_T *rettv)); #endif +static void f_screencol __ARGS((typval_T *argvars, typval_T *rettv)); +static void f_screenrow __ARGS((typval_T *argvars, typval_T *rettv)); static void f_search __ARGS((typval_T *argvars, typval_T *rettv)); static void f_searchdecl __ARGS((typval_T *argvars, typval_T *rettv)); static void f_searchpair __ARGS((typval_T *argvars, typval_T *rettv)); @@ -8034,6 +8036,8 @@ static struct fst #ifdef FEAT_FLOAT {"round", 1, 1, f_round}, #endif + {"screencol", 0, 0, f_screencol}, + {"screenrow", 0, 0, f_screenrow}, {"search", 1, 4, f_search}, {"searchdecl", 1, 3, f_searchdecl}, {"searchpair", 3, 7, f_searchpair}, @@ -15752,6 +15756,30 @@ f_round(argvars, rettv) } #endif +/* + * "screencol()" function + * + * First column is 1 to be consistent with virtcol(). + */ + static void +f_screencol(argvars, rettv) + typval_T *argvars UNUSED; + typval_T *rettv; +{ + rettv->vval.v_number = screen_screencol() + 1; +} + +/* + * "screenrow()" function + */ + static void +f_screenrow(argvars, rettv) + typval_T *argvars UNUSED; + typval_T *rettv; +{ + rettv->vval.v_number = screen_screenrow() + 1; +} + /* * "search()" function */ @@ -16320,7 +16348,8 @@ set_qf_ll_list(wp, list_arg, action_arg, rettv) action = *act; } - if (l != NULL && set_errorlist(wp, l, action, NULL) == OK) + if (l != NULL && set_errorlist(wp, l, action, + (char_u *)(wp == NULL ? "setqflist()" : "setloclist()")) == OK) rettv->vval.v_number = 0; } #endif diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 889ea62032..a217402476 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -6344,10 +6344,10 @@ ex_helptags(eap) } #ifdef FEAT_MULTI_LANG - /* Get a list of all files in the directory. */ + /* Get a list of all files in the help directory and in subdirectories. */ STRCPY(NameBuff, dirname); add_pathsep(NameBuff); - STRCAT(NameBuff, "*"); + STRCAT(NameBuff, "**"); if (gen_expand_wildcards(1, &NameBuff, &filecount, &files, EW_FILE|EW_SILENT) == FAIL || filecount == 0) @@ -6436,8 +6436,8 @@ ex_helptags(eap) helptags_one(dir, ext, tagfname, add_help_tags) char_u *dir; /* doc directory */ char_u *ext; /* suffix, ".txt", ".itx", ".frx", etc. */ - char_u *tagfname; /* "tags" for English, "tags-fr" for French. */ - int add_help_tags; /* add "help-tags" tag */ + char_u *tagfname; /* "tags" for English, "tags-fr" for French. */ + int add_help_tags; /* add "help-tags" tag */ { FILE *fd_tags; FILE *fd; @@ -6449,6 +6449,7 @@ helptags_one(dir, ext, tagfname, add_help_tags) char_u *s; int i; char_u *fname; + int dirlen; # ifdef FEAT_MBYTE int utf8 = MAYBE; int this_utf8; @@ -6459,9 +6460,9 @@ helptags_one(dir, ext, tagfname, add_help_tags) /* * Find all *.txt files. */ + dirlen = (int)STRLEN(dir); STRCPY(NameBuff, dir); - add_pathsep(NameBuff); - STRCAT(NameBuff, "*"); + STRCAT(NameBuff, "/**/*"); STRCAT(NameBuff, ext); if (gen_expand_wildcards(1, &NameBuff, &filecount, &files, EW_FILE|EW_SILENT) == FAIL @@ -6522,7 +6523,7 @@ helptags_one(dir, ext, tagfname, add_help_tags) EMSG2(_("E153: Unable to open %s for reading"), files[fi]); continue; } - fname = gettail(files[fi]); + fname = files[fi] + dirlen + 1; # ifdef FEAT_MBYTE firstline = TRUE; diff --git a/src/ex_cmds.h b/src/ex_cmds.h index 2311db65ea..a6b5aede4d 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -836,9 +836,9 @@ EX(CMD_set, "set", ex_set, EX(CMD_setfiletype, "setfiletype", ex_setfiletype, TRLBAR|EXTRA|NEEDARG|CMDWIN), EX(CMD_setglobal, "setglobal", ex_set, - TRLBAR|EXTRA|CMDWIN), + TRLBAR|EXTRA|CMDWIN|SBOXOK), EX(CMD_setlocal, "setlocal", ex_set, - TRLBAR|EXTRA|CMDWIN), + TRLBAR|EXTRA|CMDWIN|SBOXOK), EX(CMD_sfind, "sfind", ex_splitview, BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR), EX(CMD_sfirst, "sfirst", ex_rewind, diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 067edccd8a..311685105d 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -1535,7 +1535,9 @@ do_cmdline(cmdline, fgetline, cookie, flags) } } -#ifndef FEAT_EVAL +#ifdef FEAT_EVAL + did_endif = FALSE; /* in case do_cmdline used recursively */ +#else /* * Reset if_level, in case a sourced script file contains more ":if" than * ":endif" (could be ":if x | foo | endif"). @@ -1734,11 +1736,13 @@ do_one_cmd(cmdlinep, sourcing, ++ex_nesting_level; #endif - /* when not editing the last file :q has to be typed twice */ + /* When the last file has not been edited :q has to be typed twice. */ if (quitmore #ifdef FEAT_EVAL /* avoid that a function call in 'statusline' does this */ && !getline_equal(fgetline, cookie, get_func_line) + /* avoid that an autocommand, e.g. QuitPre, does this */ + && !getline_equal(fgetline, cookie, getnextac) #endif ) --quitmore; diff --git a/src/ex_getln.c b/src/ex_getln.c index 0628ecde96..bffbe3a74f 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -102,7 +102,7 @@ static void cmdline_del __ARGS((int from)); static void redrawcmdprompt __ARGS((void)); static void cursorcmd __ARGS((void)); static int ccheck_abbr __ARGS((int)); -static int nextwild __ARGS((expand_T *xp, int type, int options)); +static int nextwild __ARGS((expand_T *xp, int type, int options, int escape)); static void escape_fname __ARGS((char_u **pp)); static int showmatches __ARGS((expand_T *xp, int wildmenu)); static void set_expand_context __ARGS((expand_T *xp)); @@ -810,9 +810,11 @@ getcmdline(firstc, count, indent) did_wild_list = TRUE; } if (wim_flags[wim_index] & WIM_LONGEST) - res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP); + res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP, + firstc != '@'); else if (wim_flags[wim_index] & WIM_FULL) - res = nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP); + res = nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP, + firstc != '@'); else res = OK; /* don't insert 'wildchar' now */ } @@ -823,9 +825,11 @@ getcmdline(firstc, count, indent) /* if 'wildmode' first contains "longest", get longest * common part */ if (wim_flags[0] & WIM_LONGEST) - res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP); + res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP, + firstc != '@'); else - res = nextwild(&xpc, WILD_EXPAND_KEEP, WILD_NO_BEEP); + res = nextwild(&xpc, WILD_EXPAND_KEEP, WILD_NO_BEEP, + firstc != '@'); /* if interrupted while completing, behave like it failed */ if (got_int) @@ -860,7 +864,8 @@ getcmdline(firstc, count, indent) int p_wmnu_save = p_wmnu; p_wmnu = 0; #endif - nextwild(&xpc, WILD_PREV, 0); /* remove match */ + /* remove match */ + nextwild(&xpc, WILD_PREV, 0, firstc != '@'); #ifdef FEAT_WILDMENU p_wmnu = p_wmnu_save; #endif @@ -874,9 +879,11 @@ getcmdline(firstc, count, indent) redrawcmd(); did_wild_list = TRUE; if (wim_flags[wim_index] & WIM_LONGEST) - nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP); + nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP, + firstc != '@'); else if (wim_flags[wim_index] & WIM_FULL) - nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP); + nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP, + firstc != '@'); } else vim_beep(); @@ -899,9 +906,9 @@ getcmdline(firstc, count, indent) /* goes to last match, in a clumsy way */ if (c == K_S_TAB && KeyTyped) { - if (nextwild(&xpc, WILD_EXPAND_KEEP, 0) == OK - && nextwild(&xpc, WILD_PREV, 0) == OK - && nextwild(&xpc, WILD_PREV, 0) == OK) + if (nextwild(&xpc, WILD_EXPAND_KEEP, 0, firstc != '@') == OK + && nextwild(&xpc, WILD_PREV, 0, firstc != '@') == OK + && nextwild(&xpc, WILD_PREV, 0, firstc != '@') == OK) goto cmdline_changed; } @@ -1426,7 +1433,7 @@ getcmdline(firstc, count, indent) goto cmdline_not_changed; case Ctrl_A: /* all matches */ - if (nextwild(&xpc, WILD_ALL, 0) == FAIL) + if (nextwild(&xpc, WILD_ALL, 0, firstc != '@') == FAIL) break; goto cmdline_changed; @@ -1462,7 +1469,7 @@ getcmdline(firstc, count, indent) #endif /* completion: longest common part */ - if (nextwild(&xpc, WILD_LONGEST, 0) == FAIL) + if (nextwild(&xpc, WILD_LONGEST, 0, firstc != '@') == FAIL) break; goto cmdline_changed; @@ -1470,8 +1477,8 @@ getcmdline(firstc, count, indent) case Ctrl_P: /* previous match */ if (xpc.xp_numfiles > 0) { - if (nextwild(&xpc, (c == Ctrl_P) ? WILD_PREV : WILD_NEXT, 0) - == FAIL) + if (nextwild(&xpc, (c == Ctrl_P) ? WILD_PREV : WILD_NEXT, + 0, firstc != '@') == FAIL) break; goto cmdline_changed; } @@ -3349,10 +3356,11 @@ sort_func_compare(s1, s2) * normal character (instead of being expanded). This allows :s/^I^D etc. */ static int -nextwild(xp, type, options) +nextwild(xp, type, options, escape) expand_T *xp; int type; int options; /* extra options for ExpandOne() */ + int escape; /* if TRUE, escape the returned matches */ { int i, j; char_u *p1; @@ -3401,7 +3409,9 @@ nextwild(xp, type, options) else { int use_options = options | - WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE; + WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT; + if (escape) + use_options |= WILD_ESCAPE; if (p_wic) use_options += WILD_ICASE; diff --git a/src/fileio.c b/src/fileio.c index 1bfb095c8a..480f493fba 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -7812,7 +7812,6 @@ static char_u *find_end_event __ARGS((char_u *arg, int have_group)); static int event_ignored __ARGS((event_T event)); static int au_get_grouparg __ARGS((char_u **argp)); static int do_autocmd_event __ARGS((event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group)); -static char_u *getnextac __ARGS((int c, void *cookie, int indent)); static int apply_autocmds_group __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap)); static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last)); @@ -9651,7 +9650,7 @@ auto_next_pat(apc, stop_at_last) * Called by do_cmdline() to get the next line for ":if". * Returns allocated string, or NULL for end of autocommands. */ - static char_u * + char_u * getnextac(c, cookie, indent) int c UNUSED; void *cookie; diff --git a/src/gui.c b/src/gui.c index 67dbd772eb..598dafe7a9 100644 --- a/src/gui.c +++ b/src/gui.c @@ -920,13 +920,7 @@ gui_init_font(font_list, fontset) # endif gui_mch_set_font(gui.norm_font); #endif - gui_set_shellsize(FALSE, -#ifdef MSWIN - TRUE -#else - FALSE -#endif - , RESIZE_BOTH); + gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH); } return ret; diff --git a/src/gui_mac.c b/src/gui_mac.c index 69c1903016..5ba9fec8f3 100644 --- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -5728,7 +5728,7 @@ gui_mch_dialog( case VIM_QUESTION: useIcon = kNoteIcon; break; case VIM_WARNING: useIcon = kCautionIcon; break; case VIM_ERROR: useIcon = kStopIcon; break; - default: useIcon = kStopIcon; + default: useIcon = kStopIcon; } AppendDITL(theDialog, iconDITL, overlayDITL); ReleaseResource(iconDITL); diff --git a/src/gui_photon.c b/src/gui_photon.c index 06c8a6baa7..5db0484c9f 100644 --- a/src/gui_photon.c +++ b/src/gui_photon.c @@ -13,8 +13,11 @@ #include "vim.h" -#ifdef FEAT_TOOLBAR -# include +/* cproto fails on missing include files */ +#ifndef PROTO +# ifdef FEAT_TOOLBAR +# include +# endif #endif #if !defined(__QNX__) diff --git a/src/gui_w16.c b/src/gui_w16.c index aa287d9d7c..ffb6b89df0 100644 --- a/src/gui_w16.c +++ b/src/gui_w16.c @@ -1521,7 +1521,12 @@ get_dialog_font_metrics(void) #if defined(FEAT_TOOLBAR) || defined(PROTO) -#include "gui_w3~1.h" + +/* cproto fails on missing include files */ +#ifndef PROTO +# include "gui_w3~1.h" +#endif + /* * Create the toolbar, initially unpopulated. * (just like the menu, there are no defaults, it's all diff --git a/src/gui_w32.c b/src/gui_w32.c index 3d8d6c7780..04658d6824 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -198,11 +198,17 @@ static BalloonEval *cur_beval = NULL; static UINT_PTR BevalTimerId = 0; static DWORD LastActivity = 0; + +/* cproto fails on missing include files */ +#ifndef PROTO + /* * excerpts from headers since this may not be presented * in the extremely old compilers */ -#include +# include + +#endif typedef struct _DllVersionInfo { @@ -213,7 +219,9 @@ typedef struct _DllVersionInfo DWORD dwPlatformID; } DLLVERSIONINFO; -#include +#ifndef PROTO +# include +#endif typedef struct tagTOOLINFOA_NEW { diff --git a/src/gui_w48.c b/src/gui_w48.c index 4d38c15100..61c53a7d6f 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -25,6 +25,10 @@ #ifdef DEBUG # include #endif + +/* cproto fails on missing include files */ +#ifndef PROTO + #ifndef __MINGW32__ # include #endif @@ -44,6 +48,8 @@ # include "glbl_ime.h" #endif +#endif /* PROTO */ + #ifdef FEAT_MENU # define MENUHINTS /* show menu hints in command line */ #endif diff --git a/src/hashtab.c b/src/hashtab.c index 8b53aa4018..a47fa94b2d 100644 --- a/src/hashtab.c +++ b/src/hashtab.c @@ -138,7 +138,7 @@ hash_lookup(ht, key, hash) hash_T perturb; hashitem_T *freeitem; hashitem_T *hi; - int idx; + unsigned idx; #ifdef HT_DEBUG ++hash_count_lookup; @@ -150,7 +150,7 @@ hash_lookup(ht, key, hash) * - skip over a removed item * - return if the item matches */ - idx = (int)(hash & ht->ht_mask); + idx = (unsigned)(hash & ht->ht_mask); hi = &ht->ht_array[idx]; if (hi->hi_key == NULL) @@ -176,7 +176,7 @@ hash_lookup(ht, key, hash) #ifdef HT_DEBUG ++hash_count_perturb; /* count a "miss" for hashtab lookup */ #endif - idx = (int)((idx << 2) + idx + perturb + 1); + idx = (unsigned)((idx << 2U) + idx + perturb + 1U); hi = &ht->ht_array[idx & ht->ht_mask]; if (hi->hi_key == NULL) return freeitem == NULL ? hi : freeitem; @@ -342,7 +342,7 @@ hash_may_resize(ht, minitems) hashitem_T temparray[HT_INIT_SIZE]; hashitem_T *oldarray, *newarray; hashitem_T *olditem, *newitem; - int newi; + unsigned newi; int todo; long_u oldsize, newsize; long_u minsize; @@ -448,13 +448,13 @@ hash_may_resize(ht, minitems) * the algorithm to find an item in hash_lookup(). But we only * need to search for a NULL key, thus it's simpler. */ - newi = (int)(olditem->hi_hash & newmask); + newi = (unsigned)(olditem->hi_hash & newmask); newitem = &newarray[newi]; if (newitem->hi_key != NULL) for (perturb = olditem->hi_hash; ; perturb >>= PERTURB_SHIFT) { - newi = (int)((newi << 2) + newi + perturb + 1); + newi = (unsigned)((newi << 2U) + newi + perturb + 1U); newitem = &newarray[newi & newmask]; if (newitem->hi_key == NULL) break; diff --git a/src/if_mzsch.c b/src/if_mzsch.c index d6ee4b9c5a..9a92fee87a 100644 --- a/src/if_mzsch.c +++ b/src/if_mzsch.c @@ -142,7 +142,7 @@ static int vim_error_check(void); static int do_mzscheme_command(exarg_T *, void *, Scheme_Closed_Prim *what); static void startup_mzscheme(void); static char *string_to_line(Scheme_Object *obj); -static void do_output(char *mesg, long len); +static void do_output(char *mesg, intptr_t len); static void do_printf(char *format, ...); static void do_flush(void); static Scheme_Object *_apply_thunk_catch_exceptions( @@ -1349,8 +1349,9 @@ do_intrnl_output(char *mesg, int error) } static void -do_output(char *mesg, long len UNUSED) +do_output(char *mesg, intptr_t len UNUSED) { + /* TODO: use len, the string may not be NUL terminated */ do_intrnl_output(mesg, 0); } @@ -1370,7 +1371,7 @@ do_printf(char *format, ...) do_flush(void) { char *buff; - long length; + intptr_t length; buff = scheme_get_sized_string_output(curerr, &length); MZ_GC_CHECK(); @@ -2588,7 +2589,7 @@ string_to_line(Scheme_Object *obj) { char *scheme_str = NULL; char *vim_str = NULL; - long len; + intptr_t len; int i; scheme_str = scheme_display_to_string(obj, &len); @@ -2597,10 +2598,10 @@ string_to_line(Scheme_Object *obj) * are replacing a single line, and we must replace it with * a single line. */ - if (memchr(scheme_str, '\n', len)) + if (memchr(scheme_str, '\n', (size_t)len)) scheme_signal_error(_("string cannot contain newlines")); - vim_str = (char *)alloc(len + 1); + vim_str = (char *)alloc((int)(len + 1)); /* Create a copy of the string, with internal nulls replaced by * newline characters, as is the vim convention. diff --git a/src/if_py_both.h b/src/if_py_both.h index 2398e812c2..339250e99c 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -520,7 +520,13 @@ VimStrwidth(PyObject *self UNUSED, PyObject *args) if (!PyArg_ParseTuple(args, "s", &expr)) return NULL; - return PyLong_FromLong(mb_string2cells((char_u *)expr, (int)STRLEN(expr))); + return PyLong_FromLong( +#ifdef FEAT_MBYTE + mb_string2cells((char_u *)expr, (int)STRLEN(expr)) +#else + STRLEN(expr) +#endif + ); } /* diff --git a/src/if_python3.c b/src/if_python3.c index 3bca569590..4067517acd 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -657,8 +657,7 @@ static Py_ssize_t RangeEnd; static PyObject *globals; static int PythonIO_Init(void); -static void PythonIO_Fini(void); -PyMODINIT_FUNC Py3Init_vim(void); +static PyObject *Py3Init_vim(void); /****************************************************** * 1. Python interpreter main program. @@ -685,7 +684,6 @@ python3_end() // acquire lock before finalizing pygilstate = PyGILState_Ensure(); - PythonIO_Fini(); Py_Finalize(); } @@ -989,13 +987,6 @@ PythonIO_Init(void) return PythonIO_Init_io(); } - static void -PythonIO_Fini(void) -{ - PySys_SetObject("stdout", NULL); - PySys_SetObject("stderr", NULL); -} - /****************************************************** * 3. Implementation of the Vim module for Python */ @@ -1782,8 +1773,8 @@ PyDoc_STRVAR(vim_module_doc,"vim python interface\n"); static struct PyModuleDef vimmodule; -#ifndef PROTO -PyMODINIT_FUNC Py3Init_vim(void) + static PyObject * +Py3Init_vim(void) { PyObject *mod; PyObject *tmp; @@ -1833,7 +1824,6 @@ PyMODINIT_FUNC Py3Init_vim(void) return mod; } -#endif /************************************************************************* * 4. Utility functions for handling the interface between Vim and Python. diff --git a/src/if_ruby.c b/src/if_ruby.c index f3a602787d..34e9a21537 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -339,7 +339,7 @@ static void (*ruby_init_stack)(VALUE*); static void* (*ruby_process_options)(int, char**); #endif -#ifdef RUBY19_OR_LATER +#if defined(RUBY19_OR_LATER) && !defined(PROTO) SIGNED_VALUE rb_num2long_stub(VALUE x) { return dll_rb_num2long(x); diff --git a/src/if_sniff.c b/src/if_sniff.c index a9e9be022c..5cacb72f66 100644 --- a/src/if_sniff.c +++ b/src/if_sniff.c @@ -449,7 +449,7 @@ find_sniff_cmd(cmd) if (!sniff_cmd) { struct sn_cmd_list *list = sniff_cmd_ext; - while(list) + while (list) { if (!strcmp(cmd, list->sniff_cmd->cmd_name)) { @@ -479,7 +479,7 @@ add_sniff_cmd(cmd, def, msg) /* unescape message text */ char *p = msg; char *end = p+strlen(msg); - while(*p) + while (*p) { if (*p == '\\') mch_memmove(p,p+1,end-p); @@ -489,7 +489,7 @@ add_sniff_cmd(cmd, def, msg) SNIFF_TRACE1("request def = %s\n",def); SNIFF_TRACE1("request msg = %s\n",msg); - while(list && list->next_cmd) + while (list && list->next_cmd) list = list->next_cmd; if (!list) sniff_cmd_ext = cmd_node; @@ -628,7 +628,7 @@ sniff_disconnect(immediately) gui_mch_wait_for_chars(0L); #endif #ifdef WIN32 - while(sniffBufStart != NULL) + while (sniffBufStart != NULL) { struct sniffBufNode *node = sniffBufStart; sniffBufStart = sniffBufStart->next; @@ -789,7 +789,7 @@ HandleSniffRequest(buffer) command = buffer[0]; arguments = &buffer[1]; token = strtok(arguments, sniff_rq_sep); - while(argc <3) + while (argc <3) { if (token) { @@ -925,7 +925,7 @@ HandleSniffRequest(buffer) default : break; } - while(argc) + while (argc) vim_free(argv[--argc]); } diff --git a/src/main.c b/src/main.c index 693d0c9170..b4a063e764 100644 --- a/src/main.c +++ b/src/main.c @@ -151,8 +151,8 @@ static char *(main_errors[]) = #define ME_INVALID_ARG 5 }; -#ifndef NO_VIM_MAIN /* skip this for unittests */ #ifndef PROTO /* don't want a prototype for main() */ +#ifndef NO_VIM_MAIN /* skip this for unittests */ int # ifdef VIMDLL _export @@ -592,15 +592,27 @@ main return mzscheme_main(2, args); } } +#endif +#endif /* NO_VIM_MAIN */ -int vim_main2(int argc, char **argv) +/* vim_main2() needs to be produced when FEAT_MZSCHEME is defined even when + * NO_VIM_MAIN is defined. */ +#ifdef FEAT_MZSCHEME + int +vim_main2(int argc UNUSED, char **argv UNUSED) { +# ifndef NO_VIM_MAIN char_u *fname = (char_u *)argv[0]; mparm_T params; memcpy(¶ms, argv[1], sizeof(params)); +# else + return 0; +} +# endif #endif +#ifndef NO_VIM_MAIN /* Execute --cmd arguments. */ exe_pre_commands(¶ms); @@ -1064,8 +1076,8 @@ int vim_main2(int argc, char **argv) return 0; } -#endif /* PROTO */ #endif /* NO_VIM_MAIN */ +#endif /* PROTO */ /* * Main loop: Execute Normal mode commands until exiting Vim. diff --git a/src/message.c b/src/message.c index ef0636e5ae..ff5cb69164 100644 --- a/src/message.c +++ b/src/message.c @@ -4294,6 +4294,7 @@ vim_snprintf(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) case '%': case 'c': case 's': + case 'S': length_modifier = '\0'; str_arg_l = 1; switch (fmt_spec) @@ -4322,6 +4323,7 @@ vim_snprintf(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) } case 's': + case 'S': str_arg = #ifndef HAVE_STDARG_H (char *)get_a_arg(arg_idx); @@ -4358,6 +4360,24 @@ vim_snprintf(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) str_arg_l = (q == NULL) ? precision : (size_t)(q - str_arg); } +#ifdef FEAT_MBYTE + if (fmt_spec == 'S') + { + if (min_field_width != 0) + min_field_width += STRLEN(str_arg) + - mb_string2cells((char_u *)str_arg, -1); + if (precision) + { + char_u *p1 = (char_u *)str_arg; + size_t i; + + for (i = 0; i < precision && *p1; i++) + p1 += mb_ptr2len(p1); + + str_arg_l = precision = p1 - (char_u *)str_arg; + } + } +#endif break; default: diff --git a/src/misc2.c b/src/misc2.c index da5768fef4..151df759ca 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -3866,7 +3866,7 @@ static ulg keys[3]; /* keys defining the pseudo-random sequence */ ush temp; \ \ temp = (ush)keys[2] | 2; \ - t = (int)(((unsigned)(temp * (temp ^ 1)) >> 8) & 0xff); \ + t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \ } /* @@ -4008,7 +4008,7 @@ crypt_decode(ptr, len) ush temp; temp = (ush)keys[2] | 2; - temp = (int)(((unsigned)(temp * (temp ^ 1)) >> 8) & 0xff); + temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); UPDATE_KEYS_ZIP(*p ^= temp); } else diff --git a/src/move.c b/src/move.c index 21a74b8adc..5c8257449c 100644 --- a/src/move.c +++ b/src/move.c @@ -2576,7 +2576,7 @@ get_scroll_overlap(lp, dir) else topline_back(lp); h2 = lp->height; - if (h2 + h1 > min_height) + if (h2 == MAXCOL || h2 + h1 > min_height) { *lp = loff0; /* no overlap */ return; @@ -2588,7 +2588,7 @@ get_scroll_overlap(lp, dir) else topline_back(lp); h3 = lp->height; - if (h3 + h2 > min_height) + if (h3 == MAXCOL || h3 + h2 > min_height) { *lp = loff0; /* no overlap */ return; @@ -2600,7 +2600,7 @@ get_scroll_overlap(lp, dir) else topline_back(lp); h4 = lp->height; - if (h4 + h3 + h2 > min_height || h3 + h2 + h1 > min_height) + if (h4 == MAXCOL || h4 + h3 + h2 > min_height || h3 + h2 + h1 > min_height) *lp = loff1; /* 1 line overlap */ else *lp = loff2; /* 2 lines overlap */ diff --git a/src/netbeans.c b/src/netbeans.c index 42f702e78f..3b8a16effe 100644 --- a/src/netbeans.c +++ b/src/netbeans.c @@ -1007,7 +1007,7 @@ nb_free() buf_list_used = 0; /* free the queued key commands */ - while(key_node != NULL && key_node != &keyHead) + while (key_node != NULL && key_node != &keyHead) { keyQ_T *next = key_node->next; vim_free(key_node->keystr); @@ -1022,7 +1022,7 @@ nb_free() } /* free the queued netbeans commands */ - while(cmd_node != NULL && cmd_node != &head) + while (cmd_node != NULL && cmd_node != &head) { queue_T *next = cmd_node->next; vim_free(cmd_node->buffer); diff --git a/src/option.c b/src/option.c index a35d278c16..b57b64890e 100644 --- a/src/option.c +++ b/src/option.c @@ -11322,6 +11322,19 @@ option_was_set(name) return FALSE; } +/* + * Reset the flag indicating option "name" was set. + */ + void +reset_option_was_set(name) + char_u *name; +{ + int idx = findoption(name); + + if (idx >= 0) + options[idx].flags &= ~P_WAS_SET; +} + /* * compatible_set() - Called when 'compatible' has been set or unset. * diff --git a/src/os_amiga.c b/src/os_amiga.c index e2b1579499..0b63ea1522 100644 --- a/src/os_amiga.c +++ b/src/os_amiga.c @@ -22,6 +22,9 @@ #undef TRUE /* will be redefined by exec/types.h */ #undef FALSE +/* cproto fails on missing include files, skip them */ +#ifndef PROTO + #ifndef LATTICE # include # include @@ -55,6 +58,8 @@ # include #endif +#endif /* PROTO */ + /* * At this point TRUE and FALSE are defined as 1L and 0L, but we want 1 and 0. */ @@ -283,7 +288,9 @@ mch_init() #endif } -#include +#ifndef PROTO +# include +#endif /* * Check_win checks whether we have an interactive window. @@ -1002,7 +1009,9 @@ mch_screenmode(arg) * Heavely modified by mool. */ -#include +#ifndef PROTO +# include +#endif /* * try to get the real window size @@ -1129,9 +1138,11 @@ out_num(n) * say 'oml lib:amiga.lib -r sendpacket.o' */ +#ifndef PROTO /* #include */ /* #include */ -#include +# include +#endif /* * Function - dos_packet written by Phil Lindsay, Carolyn Scheppner, and Andy diff --git a/src/os_amiga.h b/src/os_amiga.h index 0395bceb6f..69a1523e49 100644 --- a/src/os_amiga.h +++ b/src/os_amiga.h @@ -56,6 +56,9 @@ # define TEMPNAMELEN 12 #endif +/* cproto fails on missing include files */ +#ifndef PROTO + #include #include #include @@ -67,6 +70,8 @@ # include #endif +#endif /* PROTO */ + #define FNAME_ILLEGAL ";*?`#%" /* illegal characters in a file name */ /* @@ -85,6 +90,7 @@ typedef long off_t; # include #endif +#ifndef PROTO /* * arpbase.h must be included before functions.h */ @@ -92,6 +98,8 @@ typedef long off_t; # include #endif +#endif /* PROTO */ + /* * This won't be needed if you have a version of Lattice 4.01 without broken * break signal handling. diff --git a/src/os_beos.c b/src/os_beos.c index 10135aa3b2..2eed684b87 100644 --- a/src/os_beos.c +++ b/src/os_beos.c @@ -13,7 +13,10 @@ #include #include -#include +#ifndef PROTO +# include +#endif + #include "vim.h" #if USE_THREAD_FOR_INPUT_WITH_TIMEOUT diff --git a/src/os_beos.h b/src/os_beos.h index 260834e60c..e55c389631 100644 --- a/src/os_beos.h +++ b/src/os_beos.h @@ -22,4 +22,6 @@ /* select emulation */ -#include /* for typedefs and #defines only */ +#ifndef PROTO +# include /* for typedefs and #defines only */ +#endif diff --git a/src/os_msdos.c b/src/os_msdos.c index 2d1cf73ddc..209bdd630c 100644 --- a/src/os_msdos.c +++ b/src/os_msdos.c @@ -23,7 +23,10 @@ #include "vim.h" -#include +/* cproto fails on missing include files */ +#ifndef PROTO +# include +#endif /* * MS-DOS only code, not used for Win16. @@ -31,17 +34,19 @@ #ifndef WIN16 -#include -#ifdef DJGPP -# include -# include -# include -# include -# ifdef FEAT_CLIPBOARD -# include +#ifndef PROTO +# include +# ifdef DJGPP +# include +# include +# include +# include +# ifdef FEAT_CLIPBOARD +# include +# endif +# else +# include # endif -#else -# include #endif #if defined(DJGPP) || defined(PROTO) @@ -2130,8 +2135,10 @@ mch_rename(const char *OldFile, const char *NewFile) #undef setlocale -#include -#include +#ifndef PROTO +# include +# include +#endif #include #define UPCASE (__dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER) diff --git a/src/os_msdos.h b/src/os_msdos.h index 95578bc1f1..735410fa0b 100644 --- a/src/os_msdos.h +++ b/src/os_msdos.h @@ -53,9 +53,12 @@ #define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */ -#include -#include -#include +/* cproto fails on missing include files */ +#ifndef PROTO +# include +# include +# include +#endif #ifdef DJGPP # include diff --git a/src/os_mswin.c b/src/os_mswin.c index b4f662ad52..912864fd6b 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -26,13 +26,18 @@ #ifdef WIN16 # define SHORT_FNAME /* always 8.3 file name */ -# include +/* cproto fails on missing include files */ +# ifndef PROTO +# include +# endif # include #endif #include #include #include -#include +#ifndef PROTO +# include +#endif #undef chdir #ifdef __GNUC__ @@ -43,19 +48,22 @@ # include #endif -#if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32) -# include +#ifndef PROTO +# if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32) +# include +# endif + +# if defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT) +# include +# ifdef WIN3264 +# include +# else +# include +# endif +# include #endif -#if defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT) -# include -# ifdef WIN3264 -# include -# else -# include -# endif -# include -#endif +#endif /* PROTO */ #ifdef __MINGW32__ # ifndef FROM_LEFT_1ST_BUTTON_PRESSED @@ -2410,7 +2418,9 @@ mch_print_set_fg(long_u fgcol) #if defined(FEAT_SHORTCUT) || defined(PROTO) -# include +# ifndef PROTO +# include +# endif /* * When "fname" is the name of a shortcut (*.lnk) resolve the file it points diff --git a/src/os_unix.h b/src/os_unix.h index 3bb9a89738..3c9224cd25 100644 --- a/src/os_unix.h +++ b/src/os_unix.h @@ -198,6 +198,9 @@ # define HAVE_TOTAL_MEM #endif + +#ifndef PROTO + #ifdef VMS # include # include @@ -226,7 +229,11 @@ # ifdef FEAT_GUI_GTK # include "gui_gtk_vms.h" # endif +#endif +#endif /* PROTO */ + +#ifdef VMS typedef struct dsc$descriptor DESC; #endif diff --git a/src/os_win16.c b/src/os_win16.c index b620149e79..49e6e300b9 100644 --- a/src/os_win16.c +++ b/src/os_win16.c @@ -22,16 +22,23 @@ #include "vim.h" -#include +/* cproto fails on missing include files */ +#ifndef PROTO +# include +#endif + #include #include #include #include -#include -#undef chdir -#include -#include /* required for FindExecutable() */ +#ifndef PROTO +# include + +# undef chdir +# include +# include /* required for FindExecutable() */ +#endif /* Record all output and all keyboard & mouse input */ diff --git a/src/os_win16.h b/src/os_win16.h index 17f876c7cc..98f0ece5fe 100644 --- a/src/os_win16.h +++ b/src/os_win16.h @@ -63,16 +63,21 @@ typedef long off_t; #include #include -#include -#include -#ifndef STRICT -# define STRICT -#endif -#ifndef COBJMACROS -# define COBJMACROS /* For OLE: Enable "friendlier" access to objects */ -#endif -#include +/* cproto fails on missing include files */ +#ifndef PROTO +# include +# include + +# ifndef STRICT +# define STRICT +# endif +# ifndef COBJMACROS +# define COBJMACROS /* For OLE: Enable "friendlier" access to objects */ +# endif +# include + +#endif /* PROTO */ /* * plenty of memory, use large buffers diff --git a/src/os_win32.c b/src/os_win32.c index 96e115ca2f..f5e283ef84 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -29,7 +29,11 @@ #include #include #include -#include + +/* cproto fails on missing include files */ +#ifndef PROTO +# include +#endif #undef chdir #ifdef __GNUC__ @@ -40,8 +44,10 @@ # include #endif -#if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32) -# include +#ifndef PROTO +# if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32) +# include +# endif #endif #ifdef __MINGW32__ @@ -125,6 +131,7 @@ typedef int TRUSTEE; typedef int WORD; typedef int WCHAR; typedef void VOID; +typedef int BY_HANDLE_FILE_INFORMATION; #endif #ifndef FEAT_GUI_W32 @@ -152,6 +159,8 @@ static PFNGCKLN s_pfnGetConsoleKeyboardLayoutName = NULL; # define wcsicmp(a, b) wcscmpi((a), (b)) #endif +#ifndef PROTO + /* Enable common dialogs input unicode from IME if posible. */ #ifdef FEAT_MBYTE LRESULT (WINAPI *pDispatchMessage)(LPMSG) = DispatchMessage; @@ -160,6 +169,8 @@ BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG) = IsDialogMessage; BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT) = PeekMessage; #endif +#endif /* PROTO */ + #ifndef FEAT_GUI_W32 /* Win32 Console handles for input and output */ static HANDLE g_hConIn = INVALID_HANDLE_VALUE; @@ -453,7 +464,10 @@ null_libintl_textdomain(const char *domainname) DWORD g_PlatformId; #ifdef HAVE_ACL -# include +# ifndef PROTO +# include +# endif + /* * These are needed to dynamically load the ADVAPI DLL, which is not * implemented under Windows 95 (and causes VIM to crash) @@ -1658,8 +1672,10 @@ theend: #endif /* FEAT_GUI_W32 */ } -#ifndef __MINGW32__ -# include /* required for FindExecutable() */ +#ifndef PROTO +# ifndef __MINGW32__ +# include /* required for FindExecutable() */ +# endif #endif /* diff --git a/src/os_win32.h b/src/os_win32.h index c155fb23fa..71b7609564 100644 --- a/src/os_win32.h +++ b/src/os_win32.h @@ -12,7 +12,10 @@ #include "os_dos.h" /* common MS-DOS and Win32 stuff */ #ifndef __CYGWIN__ -#include /* for _mkdir() */ +/* cproto fails on missing include files */ +# ifndef PROTO +# include /* for _mkdir() */ +# endif #endif /* Stop the VC2005 compiler from nagging. */ @@ -101,7 +104,9 @@ #ifndef COBJMACROS # define COBJMACROS /* For OLE: Enable "friendlier" access to objects */ #endif -#include +#ifndef PROTO +# include +#endif /* * Win32 has plenty of memory, use large buffers @@ -194,6 +199,8 @@ Trace(char *pszFormat, ...); # define vim_mkdir(x, y) mch_mkdir(x) #endif +#ifndef PROTO + /* Enable common dialogs input unicode from IME if posible. */ #ifdef FEAT_MBYTE /* The variables are defined in os_win32.c. */ @@ -207,3 +214,5 @@ extern BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT); # define pIsDialogMessage IsDialogMessage # define pPeekMessage PeekMessage #endif + +#endif /* PROTO */ diff --git a/src/po/eo.po b/src/po/eo.po index 20b396cf1a..82884f1202 100644 --- a/src/po/eo.po +++ b/src/po/eo.po @@ -23,8 +23,8 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Esperanto)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-01-22 15:37+0100\n" -"PO-Revision-Date: 2012-01-22 15:38+0100\n" +"POT-Creation-Date: 2012-08-19 06:35+0200\n" +"PO-Revision-Date: 2012-08-19 06:41+0200\n" "Last-Translator: Dominique PELLÉ \n" "Language-Team: \n" "Language: eo\n" @@ -54,6 +54,9 @@ msgstr "[Listo de lokoj]" msgid "[Quickfix List]" msgstr "[Listo de rapidriparoj]" +msgid "E855: Autocommands caused command to abort" +msgstr "E855: Aŭtokomandoj haltigis komandon" + msgid "E82: Cannot allocate any buffer, exiting..." msgstr "E82: Ne eblas disponigi iun ajn bufron, nun eliras..." @@ -2635,6 +2638,10 @@ msgstr "nepermesita en sabloludejo de Vim" msgid "E836: This Vim cannot execute :python after using :py3" msgstr "E836: Vim ne povas plenumi :python post uzo de :py3" +#. Add conversion from PyInt? +msgid "only string keys are allowed" +msgstr "nur ĉenaj ŝlosiloj estas permisataj" + msgid "" "E263: Sorry, this command is disabled, the Python library could not be " "loaded." @@ -2645,6 +2652,12 @@ msgstr "" msgid "E659: Cannot invoke Python recursively" msgstr "E659: Ne eblas alvoki Pitonon rekursie" +msgid "E858: Eval did not return a valid python object" +msgstr "E858: Eval ne revenis kun valida python-objekto" + +msgid "E859: Failed to convert returned python object to vim value" +msgstr "E859: Konverto de revena python-objekto al vim-valoro fiaskis" + msgid "can't delete OutputObject attributes" msgstr "ne eblas forviŝi atributojn de OutputObject" @@ -2661,6 +2674,12 @@ msgstr "" msgid "E837: This Vim cannot execute :py3 after using :python" msgstr "E837: Vim ne povas plenumi :py3 post uzo de :python" +msgid "E860: Eval did not return a valid python 3 object" +msgstr "E860: Eval ne revenis kun valida python3-objekto" + +msgid "E861: Failed to convert returned python 3 object to vim value" +msgstr "E861: Konverto de revena python3-objekto al vim-valoro fiaskis" + msgid "E265: $_ must be an instance of String" msgstr "E265: $_ devas esti apero de Ĉeno" @@ -2849,12 +2868,6 @@ msgstr "" "E571: Bedaŭrinde tiu komando estas malŝaltita: la biblioteko Tcl ne " "ŝargeblis." -msgid "" -"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org" -msgstr "" -"E281: TCL-ERARO: elira kodo ne estas entjera!? Bv. retpoŝti al vim-dev@vim." -"org" - #, c-format msgid "E572: exit code %d" msgstr "E572: elira kodo %d" @@ -3012,6 +3025,9 @@ msgstr "-v\t\t\tReĝimo Vi (kiel \"vi\")" msgid "-e\t\t\tEx mode (like \"ex\")" msgstr "-e\t\t\tReĝimo Ex (kiel \"ex\")" +msgid "-E\t\t\tImproved Ex mode" +msgstr "-E\t\t\tPlibonigita Ex-reĝimo" + msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")" msgstr "-s\t\t\tSilenta (stapla) reĝimo (nur por \"ex\")" @@ -3269,6 +3285,9 @@ msgstr "--role \tDoni unikan rolon por identigi la ĉefan fenestron" msgid "--socketid \tOpen Vim inside another GTK widget" msgstr "--socketid \tMalfermi Vim en alia GTK fenestraĵo" +msgid "--echo-wid\t\tMake gvim echo the Window ID on stdout" +msgstr "--echo-wid\t\tIgas gvim afiŝi la identigilon de vindozo sur stdout" + msgid "-P \tOpen Vim inside parent application" msgstr "-P \tMalfermi Vim en gepatra aplikaĵo" @@ -6556,6 +6575,42 @@ msgstr "E264: Pitono: Eraro de pravalorizo de eneligaj objektoj" msgid "no such buffer" msgstr "ne estas tia bufro" +msgid "failed to add key to dictionary" +msgstr "aldono de ŝlosilo al vortaro fiaskis" + +msgid "dict is locked" +msgstr "vortaro estas ŝlosita" + +msgid "no such key in dictionary" +msgstr "tiu ŝlosilo ne ekzistas en vortaro" + +msgid "internal error: failed to get vim list item" +msgstr "interna eraro: obteno de vim-a listero fiaskis" + +msgid "list is locked" +msgstr "listo estas ŝlosita" + +msgid "Failed to add item to list" +msgstr "Aldono de listero fiaskis" + +msgid "internal error: no vim list item" +msgstr "interna eraro: neniu vim-a listero" + +msgid "can only assign lists to slice" +msgstr "nur eblas pravalorizi listojn al segmento" + +msgid "internal error: failed to add item to list" +msgstr "interna eraro: aldono de listero fiaskis" + +msgid "can only concatenate with lists" +msgstr "eblas nur kunmeti kun listoj" + +msgid "'self' argument must be a dictionary" +msgstr "argumento 'self' devas esti vortaro" + +msgid "failed to run function" +msgstr "fiaskis ruli funkcion" + msgid "attempt to refer to deleted window" msgstr "provo de referenco al forviŝita fenestro" @@ -6583,22 +6638,11 @@ msgstr "ne estas tia fenestro" msgid "attempt to refer to deleted buffer" msgstr "provo de referenco al forviŝita bufro" -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (RISC OS version):\n" -#~ msgstr "" -#~ "\n" -#~ "Argumentoj agnoskitaj de gvim (versio RISC OS):\n" +msgid "unable to convert to vim structure" +msgstr "ne povis konverti al vim-strukturo" -#~ msgid "--columns \tInitial width of window in columns" -#~ msgstr "--columns \tKomenca larĝo de fenestro en kolumnoj" +msgid "NULL reference passed" +msgstr "NULL-referenco argumento" -#~ msgid "--rows \tInitial height of window in rows" -#~ msgstr "--rows \tKomenca alto de fenestro en vicoj" - -#~ msgid "" -#~ "\n" -#~ "RISC OS version" -#~ msgstr "" -#~ "\n" -#~ "Versio RISC operaciumo" +msgid "internal error: invalid value type" +msgstr "interna eraro: nevalida typo de valoro" diff --git a/src/po/fr.po b/src/po/fr.po index 8b3f29fd99..fa41abe3ef 100644 --- a/src/po/fr.po +++ b/src/po/fr.po @@ -6,7 +6,7 @@ # FIRST AUTHOR DindinX 2000. # SECOND AUTHOR Adrien Beau 2002, 2003. # THIRD AUTHOR David Blanchet 2006, 2008. -# FOURTH AUTHOR Dominique Pell 2008, 2011. +# FOURTH AUTHOR Dominique Pell 2008, 2012. # # Latest translation available at: # http://dominique.pelle.free.fr/vim-fr.php @@ -15,8 +15,8 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Franais)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-01-22 15:37+0100\n" -"PO-Revision-Date: 2012-01-22 15:40+0100\n" +"POT-Creation-Date: 2012-08-19 06:35+0200\n" +"PO-Revision-Date: 2012-08-19 06:48+0200\n" "Last-Translator: Dominique Pell \n" "Language-Team: \n" "Language: fr\n" @@ -46,6 +46,9 @@ msgstr "[Liste des emplacements]" msgid "[Quickfix List]" msgstr "[Liste Quickfix]" +msgid "E855: Autocommands caused command to abort" +msgstr "E855: Des autocommandes ont caus la termination de la commande" + # AB - Il faut respecter l'esprit plus que la lettre. msgid "E82: Cannot allocate any buffer, exiting..." msgstr "E82: Aucun tampon ne peut tre allou, Vim doit s'arrter" @@ -2866,6 +2869,10 @@ msgstr "non autoris msgid "E836: This Vim cannot execute :python after using :py3" msgstr "E836: Vim ne peut pas excuter :python aprs avoir utilis :py3" +#. Add conversion from PyInt? +msgid "only string keys are allowed" +msgstr "seule une chaine est autorise comme cl" + msgid "" "E263: Sorry, this command is disabled, the Python library could not be " "loaded." @@ -2876,6 +2883,12 @@ msgstr "" msgid "E659: Cannot invoke Python recursively" msgstr "E659: Impossible d'invoquer Python rcursivement" +msgid "E858: Eval did not return a valid python object" +msgstr "E858: Eval n'a pas retourn un objet python valide" + +msgid "E859: Failed to convert returned python object to vim value" +msgstr "E859: Conversion d'objet python une valeur de vim a chou" + msgid "can't delete OutputObject attributes" msgstr "impossible d'effacer les attributs d'OutputObject" @@ -2892,6 +2905,12 @@ msgstr "\tOpen Vim inside another GTK widget" msgstr "--socketid \tOuvrir Vim dans un autre widget GTK" +msgid "--echo-wid\t\tMake gvim echo the Window ID on stdout" +msgstr "--echo-wid\t\tGvim affiche l'ID de la fentre sur stdout" + msgid "-P \tOpen Vim inside parent application" msgstr "-P \tOuvrir Vim dans une application parente" @@ -6820,7 +6840,43 @@ msgid "E264: Python: Error initialising I/O objects" msgstr "E264: Python : Erreur d'initialisation des objets d'E/S" msgid "no such buffer" -msgstr "Ce tampon n'existe pas" +msgstr "ce tampon n'existe pas" + +msgid "failed to add key to dictionary" +msgstr "l'ajout de cl au dictionnaire a chou" + +msgid "dict is locked" +msgstr "dictionnaire est verrouill" + +msgid "no such key in dictionary" +msgstr "cette cl est inexistante dans le dictionnaire" + +msgid "internal error: failed to get vim list item" +msgstr "erreur interne : accs un lment de liste a chou" + +msgid "list is locked" +msgstr "liste verrouille" + +msgid "Failed to add item to list" +msgstr "Ajout la liste a chou" + +msgid "internal error: no vim list item" +msgstr "erreur interne : pas d'lment de liste vim" + +msgid "can only assign lists to slice" +msgstr "seules des tranches peuvent tre assignes aux listes" + +msgid "internal error: failed to add item to list" +msgstr "erreur interne : ajout d'lment la liste a chou" + +msgid "can only concatenate with lists" +msgstr "on ne peut que concatner avec des listes" + +msgid "'self' argument must be a dictionary" +msgstr "l'argument 'self' doit tre un dictionnaire" + +msgid "failed to run function" +msgstr "excution de la fonction a chou" msgid "attempt to refer to deleted window" msgstr "tentative de rfrencer une fentre efface" @@ -6849,25 +6905,11 @@ msgstr "Cette fen msgid "attempt to refer to deleted buffer" msgstr "tentative de rfrencer un tampon effac" -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (RISC OS version):\n" -#~ msgstr "" -#~ "\n" -#~ "Arguments reconnus par gvim (version RISC OS) :\n" +msgid "unable to convert to vim structure" +msgstr "conversion une structure vim impossible" -#~ msgid "--columns \tInitial width of window in columns" -#~ msgstr "--columns \tNombre de colonnes initial de la fentre" +msgid "NULL reference passed" +msgstr "rfrence NULL passe" -#~ msgid "--rows \tInitial height of window in rows" -#~ msgstr "--rows \tNombre de lignes initial de la fentre" - -#~ msgid "" -#~ "\n" -#~ "RISC OS version" -#~ msgstr "" -#~ "\n" -#~ "Version RISC OS" - -#~ msgid "E505: " -#~ msgstr "E505: " +msgid "internal error: invalid value type" +msgstr "erreur interne : type de valeur invalide" diff --git a/src/proto/digraph.pro b/src/proto/digraph.pro index be5be71ed0..5573b8c36d 100644 --- a/src/proto/digraph.pro +++ b/src/proto/digraph.pro @@ -1,7 +1,7 @@ /* digraph.c */ int do_digraph __ARGS((int c)); int get_digraph __ARGS((int cmdline)); -int getdigraph __ARGS((int char1, int char2, int meta)); +int getdigraph __ARGS((int char1, int char2, int meta_char)); void putdigraph __ARGS((char_u *str)); void listdigraphs __ARGS((void)); char_u *keymap_init __ARGS((void)); diff --git a/src/proto/fileio.pro b/src/proto/fileio.pro index baf6216646..113b668bdf 100644 --- a/src/proto/fileio.pro +++ b/src/proto/fileio.pro @@ -47,6 +47,7 @@ int has_cursormovedI __ARGS((void)); int has_insertcharpre __ARGS((void)); void block_autocmds __ARGS((void)); void unblock_autocmds __ARGS((void)); +char_u *getnextac __ARGS((int c, void *cookie, int indent)); int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf)); char_u *get_augroup_name __ARGS((expand_T *xp, int idx)); char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd)); diff --git a/src/proto/fold.pro b/src/proto/fold.pro index 3318bbde75..10f72012a2 100644 --- a/src/proto/fold.pro +++ b/src/proto/fold.pro @@ -27,7 +27,7 @@ void clearFolding __ARGS((win_T *win)); void foldUpdate __ARGS((win_T *wp, linenr_T top, linenr_T bot)); void foldUpdateAll __ARGS((win_T *win)); int foldMoveTo __ARGS((int updown, int dir, long count)); -void foldInitWin __ARGS((win_T *newwin)); +void foldInitWin __ARGS((win_T *new_win)); int find_wl_entry __ARGS((win_T *win, linenr_T lnum)); void foldAdjustVisual __ARGS((void)); void foldAdjustCursor __ARGS((void)); diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro index e74cf9efdd..d362e9cca9 100644 --- a/src/proto/misc1.pro +++ b/src/proto/misc1.pro @@ -5,8 +5,8 @@ int get_indent_buf __ARGS((buf_T *buf, linenr_T lnum)); int get_indent_str __ARGS((char_u *ptr, int ts)); int set_indent __ARGS((int size, int flags)); int get_number_indent __ARGS((linenr_T lnum)); -int open_line __ARGS((int dir, int flags, int old_indent)); -int get_leader_len __ARGS((char_u *line, char_u **flags, int backward, int do_skip_space)); +int open_line __ARGS((int dir, int flags, int second_line_indent)); +int get_leader_len __ARGS((char_u *line, char_u **flags, int backward, int include_space)); int get_last_leader_offset __ARGS((char_u *line, char_u **flags)); int plines __ARGS((linenr_T lnum)); int plines_win __ARGS((win_T *wp, linenr_T lnum, int winheight)); @@ -59,7 +59,7 @@ char_u *vim_getenv __ARGS((char_u *name, int *mustfree)); void vim_setenv __ARGS((char_u *name, char_u *val)); char_u *get_env_name __ARGS((expand_T *xp, int idx)); char_u *get_users __ARGS((expand_T *xp, int idx)); -int match_user __ARGS((char_u* name)); +int match_user __ARGS((char_u *name)); void home_replace __ARGS((buf_T *buf, char_u *src, char_u *dst, int dstlen, int one)); char_u *home_replace_save __ARGS((buf_T *buf, char_u *src)); int fullpathcmp __ARGS((char_u *s1, char_u *s2, int checkname)); diff --git a/src/proto/move.pro b/src/proto/move.pro index 5fe3844d74..595e3b8dd7 100644 --- a/src/proto/move.pro +++ b/src/proto/move.pro @@ -24,7 +24,7 @@ int win_col_off __ARGS((win_T *wp)); int curwin_col_off __ARGS((void)); int win_col_off2 __ARGS((win_T *wp)); int curwin_col_off2 __ARGS((void)); -void curs_columns __ARGS((int scroll)); +void curs_columns __ARGS((int may_scroll)); void scrolldown __ARGS((long line_count, int byfold)); void scrollup __ARGS((long line_count, int byfold)); void check_topfill __ARGS((win_T *wp, int down)); diff --git a/src/proto/option.pro b/src/proto/option.pro index fd71704ec1..63570fa4c5 100644 --- a/src/proto/option.pro +++ b/src/proto/option.pro @@ -52,6 +52,7 @@ int shortmess __ARGS((int x)); void vimrc_found __ARGS((char_u *fname, char_u *envname)); void change_compatible __ARGS((int on)); int option_was_set __ARGS((char_u *name)); +void reset_option_was_set __ARGS((char_u *name)); int can_bs __ARGS((int what)); void save_file_ff __ARGS((buf_T *buf)); int file_ff_differs __ARGS((buf_T *buf, int ignore_empty)); diff --git a/src/proto/os_mswin.pro b/src/proto/os_mswin.pro index 2bf927d019..5aa0dbb0b8 100644 --- a/src/proto/os_mswin.pro +++ b/src/proto/os_mswin.pro @@ -28,11 +28,11 @@ void MultiByteToWideChar_alloc __ARGS((UINT cp, DWORD flags, LPCSTR in, int inle void WideCharToMultiByte_alloc __ARGS((UINT cp, DWORD flags, LPCWSTR in, int inlen, LPSTR *out, int *outlen, LPCSTR def, LPBOOL useddef)); int clip_mch_own_selection __ARGS((VimClipboard *cbd)); void clip_mch_lose_selection __ARGS((VimClipboard *cbd)); +void clip_mch_request_selection __ARGS((VimClipboard *cbd)); +void clip_mch_set_selection __ARGS((VimClipboard *cbd)); short_u *enc_to_utf16 __ARGS((char_u *str, int *lenp)); char_u *utf16_to_enc __ARGS((short_u *str, int *lenp)); -void clip_mch_request_selection __ARGS((VimClipboard *cbd)); void acp_to_enc __ARGS((char_u *str, int str_size, char_u **out, int *outlen)); -void clip_mch_set_selection __ARGS((VimClipboard *cbd)); void DumpPutS __ARGS((const char *psz)); int mch_get_winpos __ARGS((int *x, int *y)); void mch_set_winpos __ARGS((int x, int y)); diff --git a/src/proto/os_win32.pro b/src/proto/os_win32.pro index 68d4ee2aa3..2ae24521c3 100644 --- a/src/proto/os_win32.pro +++ b/src/proto/os_win32.pro @@ -22,7 +22,7 @@ void mch_hide __ARGS((char_u *name)); int mch_isdir __ARGS((char_u *name)); int mch_mkdir __ARGS((char_u *name)); int mch_is_linked __ARGS((char_u *fname)); -int win32_fileinfo __ARGS((char_u *name, BY_HANDLE_FILE_INFORMATION *lpFileInfo)); +int win32_fileinfo __ARGS((char_u *fname, BY_HANDLE_FILE_INFORMATION *info)); int mch_writable __ARGS((char_u *name)); int mch_can_exe __ARGS((char_u *name)); int mch_nodetype __ARGS((char_u *name)); diff --git a/src/proto/screen.pro b/src/proto/screen.pro index be791e0c45..81fa6a701e 100644 --- a/src/proto/screen.pro +++ b/src/proto/screen.pro @@ -31,8 +31,8 @@ void reset_cterm_colors __ARGS((void)); void screen_draw_rectangle __ARGS((int row, int col, int height, int width, int invert)); void screen_fill __ARGS((int start_row, int end_row, int start_col, int end_col, int c1, int c2, int attr)); void check_for_delay __ARGS((int check_msg_scroll)); -int screen_valid __ARGS((int clear)); -void screenalloc __ARGS((int clear)); +int screen_valid __ARGS((int doclear)); +void screenalloc __ARGS((int doclear)); void free_screenlines __ARGS((void)); void screenclear __ARGS((void)); int can_clear __ARGS((char_u *p)); @@ -50,4 +50,6 @@ int redrawing __ARGS((void)); int messaging __ARGS((void)); void showruler __ARGS((int always)); int number_width __ARGS((win_T *wp)); +int screen_screencol __ARGS((void)); +int screen_screenrow __ARGS((void)); /* vim: set ft=c : */ diff --git a/src/proto/search.pro b/src/proto/search.pro index 9b1fc63962..f94fb69ab2 100644 --- a/src/proto/search.pro +++ b/src/proto/search.pro @@ -27,12 +27,12 @@ int bck_word __ARGS((long count, int bigword, int stop)); int end_word __ARGS((long count, int bigword, int stop, int empty)); int bckend_word __ARGS((long count, int bigword, int eol)); int current_word __ARGS((oparg_T *oap, long count, int include, int bigword)); -int current_search __ARGS((long count, int forward)); int current_sent __ARGS((oparg_T *oap, long count, int include)); int current_block __ARGS((oparg_T *oap, long count, int include, int what, int other)); int current_tagblock __ARGS((oparg_T *oap, long count_arg, int include)); int current_par __ARGS((oparg_T *oap, long count, int include, int type)); int current_quote __ARGS((oparg_T *oap, long count, int include, int quotechar)); +int current_search __ARGS((long count, int forward)); int linewhite __ARGS((linenr_T lnum)); void find_pattern_in_path __ARGS((char_u *ptr, int dir, int len, int whole, int skip_comments, int type, long count, int action, linenr_T start_lnum, linenr_T end_lnum)); int read_viminfo_search_pattern __ARGS((vir_T *virp, int force)); diff --git a/src/quickfix.c b/src/quickfix.c index a1c4fe5c55..ac9366952b 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2124,13 +2124,23 @@ qf_free(qi, idx) int idx; { qfline_T *qfp; + int stop = FALSE; while (qi->qf_lists[idx].qf_count) { qfp = qi->qf_lists[idx].qf_start->qf_next; - vim_free(qi->qf_lists[idx].qf_start->qf_text); - vim_free(qi->qf_lists[idx].qf_start->qf_pattern); - vim_free(qi->qf_lists[idx].qf_start); + if (qi->qf_lists[idx].qf_title != NULL && !stop) + { + vim_free(qi->qf_lists[idx].qf_start->qf_text); + stop = (qi->qf_lists[idx].qf_start == qfp); + vim_free(qi->qf_lists[idx].qf_start->qf_pattern); + vim_free(qi->qf_lists[idx].qf_start); + if (stop) + /* Somehow qf_count may have an incorrect value, set it to 1 + * to avoid crashing when it's wrong. + * TODO: Avoid qf_count being incorrect. */ + qi->qf_lists[idx].qf_count = 1; + } qi->qf_lists[idx].qf_start = qfp; --qi->qf_lists[idx].qf_count; } @@ -2340,8 +2350,10 @@ ex_copen(eap) /* The current window becomes the previous window afterwards. */ win = curwin; - if (eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow) - /* Create the new window at the very bottom. */ + if ((eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow) + && cmdmod.split == 0) + /* Create the new window at the very bottom, except when + * :belowright or :aboveleft is used. */ win_goto(lastwin); if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL) return; /* not enough room for window */ @@ -3510,6 +3522,7 @@ restore_start_dir(dirname_start) ea.cmdidx = (curwin->w_localdir == NULL) ? CMD_cd : CMD_lcd; ex_cd(&ea); } + vim_free(dirname_now); } } diff --git a/src/screen.c b/src/screen.c index a1447812b5..e30a707254 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4269,7 +4269,20 @@ win_line(wp, lnum, startrow, endrow, nochange) { /* tab amount depends on current column */ n_extra = (int)wp->w_buffer->b_p_ts - - VCOL_HLC % (int)wp->w_buffer->b_p_ts - 1; + - vcol % (int)wp->w_buffer->b_p_ts - 1; +#ifdef FEAT_CONCEAL + /* Tab alignment should be identical regardless of + * 'conceallevel' value. So tab compensates of all + * previous concealed characters, and thus resets vcol_off + * and boguscols accumulated so far in the line. Note that + * the tab can be longer than 'tabstop' when there + * are concealed characters. */ + n_extra += vcol_off; + vcol -= vcol_off; + vcol_off = 0; + col -= boguscols; + boguscols = 0; +#endif #ifdef FEAT_MBYTE mb_utf8 = FALSE; /* don't draw as UTF-8 */ #endif @@ -10280,3 +10293,23 @@ number_width(wp) return n; } #endif + +/* + * Return the current cursor column. This is the actual position on the + * screen. First column is 0. + */ + int +screen_screencol() +{ + return screen_cur_col; +} + +/* + * Return the current cursor row. This is the actual position on the screen. + * First row is 0. + */ + int +screen_screenrow() +{ + return screen_cur_row; +} diff --git a/src/sha256.c b/src/sha256.c index 0b931a8f62..3392fc08e8 100644 --- a/src/sha256.c +++ b/src/sha256.c @@ -7,9 +7,11 @@ * See README.txt for an overview of the Vim source code. * * FIPS-180-2 compliant SHA-256 implementation - * GPL by Christophe Devine. + * GPL by Christophe Devine, applies to older version. * Modified for md5deep, in public domain. * Modified For Vim, Mohsin Ahmed, http://www.cs.albany.edu/~mosh + * Mohsin Ahmed states this work is distributed under the VIM License or GPL, + * at your choice. * * Vim specific notes: * Functions exported by this file: diff --git a/src/term.c b/src/term.c index 3efa7a7a14..2c0d35ad99 100644 --- a/src/term.c +++ b/src/term.c @@ -1864,7 +1864,12 @@ set_termname(term) } # endif if (p != NULL) + { set_option_value((char_u *)"ttym", 0L, p, 0); + /* Reset the WAS_SET flag, 'ttymouse' can be set to "sgr" or + * "xterm2" in check_termcode(). */ + reset_option_was_set((char_u *)"ttym"); + } if (p == NULL # ifdef FEAT_GUI || gui.in_use diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index 39f66e987c..701c304fcd 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -31,7 +31,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test66.out test67.out test68.out test69.out test70.out \ test71.out test72.out test73.out test74.out test75.out \ test76.out test77.out test78.out test79.out test80.out \ - test81.out test82.out test83.out test84.out + test81.out test82.out test83.out test84.out test88.out .SUFFIXES: .in .out @@ -135,3 +135,4 @@ test81.out: test81.in test82.out: test82.in test83.out: test83.in test84.out: test84.in +test88.out: test88.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index b52f249f00..e902be3be5 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -30,7 +30,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test68.out test69.out test71.out test72.out test73.out \ test74.out test75.out test76.out test77.out test78.out \ test79.out test80.out test81.out test82.out test83.out \ - test84.out test85.out test86.out test87.out + test84.out test85.out test86.out test87.out test88.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index c150424684..c7bbb540f6 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -50,7 +50,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test68.out test69.out test71.out test72.out test73.out \ test74.out test75.out test76.out test77.out test78.out \ test79.out test80.out test81.out test82.out test83.out \ - test84.out test85.out test86.out test87.out + test84.out test85.out test86.out test87.out test88.out SCRIPTS32 = test50.out test70.out diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index 9a918d4902..d930926009 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -31,7 +31,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test66.out test67.out test68.out test69.out test70.out \ test71.out test72.out test73.out test74.out test75.out \ test76.out test77.out test78.out test79.out test80.out \ - test81.out test82.out test83.out test84.out + test81.out test82.out test83.out test84.out test88.out .SUFFIXES: .in .out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index 6608d70677..5398031339 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # -# Last change: 2012 Oct 06 +# Last change: 2012 Dec 05 # # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. # Edit the lines in the Configuration section below to select. @@ -76,7 +76,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test66.out test67.out test68.out test69.out \ test71.out test72.out test74.out test75.out test76.out \ test77.out test78.out test79.out test80.out test81.out \ - test82.out test83.out test84.out + test82.out test83.out test84.out test88.out # Known problems: # Test 30: a problem around mac format - unknown reason diff --git a/src/testdir/Makefile b/src/testdir/Makefile index c3923e0ccc..d29b4f5b15 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -13,7 +13,7 @@ VIMPROG = ../vim SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test7.out test8.out test9.out test10.out test11.out \ - test12.out test13.out test14.out test15.out test17.out \ + test12.out test13.out test14.out test15.out test17.out \ test18.out test19.out test20.out test21.out test22.out \ test23.out test24.out test25.out test26.out test27.out \ test28.out test29.out test30.out test31.out test32.out \ @@ -27,7 +27,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test69.out test70.out test71.out test72.out test73.out \ test74.out test75.out test76.out test77.out test78.out \ test79.out test80.out test81.out test82.out test83.out \ - test84.out test85.out test86.out test87.out + test84.out test85.out test86.out test87.out test88.out SCRIPTS_GUI = test16.out @@ -47,12 +47,16 @@ report: $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) +RM_ON_RUN = test.out X* viminfo +RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok +RUN_VIM = $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in + clean: - -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok X* valgrind.* viminfo + -rm -rf *.out *.failed *.rej *.orig test.log $(RM_ON_RUN) $(RM_ON_START) valgrind.* test1.out: test1.in - -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok X* viminfo - $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in + -rm -rf $*.failed $(RM_ON_RUN) $(RM_ON_START) + $(RUN_VIM) $*.in @/bin/sh -c "if diff test.out $*.ok; \ then mv -f test.out $*.out; \ else echo; \ @@ -61,11 +65,22 @@ test1.out: test1.in -rm -rf X* viminfo .in.out: - -rm -rf $*.failed test.ok test.out X* viminfo + -rm -rf $*.failed test.ok $(RM_ON_RUN) cp $*.ok test.ok # Sleep a moment to avoid that the xterm title is messed up @-sleep .2 - -$(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in + -$(RUN_VIM) $*.in + + # For flaky tests retry one time. + @/bin/sh -c "if test -f test.out -a $* = test61; then \ + if diff test.out $*.ok; \ + then echo flaky test ok first time; \ + else rm -rf $*.failed $(RM_ON_RUN); \ + $(RUN_VIM) $*.in; \ + fi \ + fi" + + # Check if the test.out file matches test.ok. @/bin/sh -c "if test -f test.out; then\ if diff test.out $*.ok; \ then mv -f test.out $*.out; \ diff --git a/src/testdir/test49.ok b/src/testdir/test49.ok index 1842af2592..0caef818d6 100644 --- a/src/testdir/test49.ok +++ b/src/testdir/test49.ok @@ -85,8 +85,10 @@ Results of test49.vim: *** Test 83: OK (2835) *** Test 84: OK (934782101) *** Test 85: OK (198689) ---- Test 86: All tests were run with throwing exceptions on error. +--- Test 86: No Crash for vimgrep on BufUnload +*** Test 86: OK (0) +--- Test 87: All tests were run with throwing exceptions on error. The $VIMNOERRTHROW control is not configured. ---- Test 86: All tests were run with throwing exceptions on interrupt. +--- Test 87: All tests were run with throwing exceptions on interrupt. The $VIMNOINTTHROW control is not configured. -*** Test 86: OK (50443995) +*** Test 87: OK (50443995) diff --git a/src/testdir/test49.vim b/src/testdir/test49.vim index 5e24e30242..f32f114933 100644 --- a/src/testdir/test49.vim +++ b/src/testdir/test49.vim @@ -1,6 +1,6 @@ " Vim script language tests " Author: Servatius Brandt -" Last Change: 2010 Sep 29 +" Last Change: 2012 Nov 23 "------------------------------------------------------------------------------- " Test environment {{{1 @@ -9603,9 +9603,28 @@ delfunction Delete_autocommands Xcheck 198689 +"------------------------------------------------------------------------------- +" Test 86: setloclist crash {{{1 +" +" Executing a setloclist() on BufUnload shouldn't crash Vim +"------------------------------------------------------------------------------- + +func F + au BufUnload * :call setloclist(0, [{'bufnr':1, 'lnum':1, 'col':1, 'text': 'tango down'}]) + + :lvimgrep /.*/ * +endfunc + +XpathINIT + +ExecAsScript F + +delfunction F +Xout "No Crash for vimgrep on BufUnload" +Xcheck 0 "------------------------------------------------------------------------------- -" Test 86: $VIMNOERRTHROW and $VIMNOINTTHROW support {{{1 +" Test 87: $VIMNOERRTHROW and $VIMNOINTTHROW support {{{1 " " It is possible to configure Vim for throwing exceptions on error " or interrupt, controlled by variables $VIMNOERRTHROW and diff --git a/src/testdir/test88.in b/src/testdir/test88.in new file mode 100644 index 0000000000..1536b3bba7 --- /dev/null +++ b/src/testdir/test88.in @@ -0,0 +1,85 @@ +vim: set ft=vim + +Tests for correct display (cursor column position) with +conceal and +tabulators. + +STARTTEST +:so small.vim +:if !has('conceal') + e! test.ok + wq! test.out +:endif +:" Conceal settings. +:set conceallevel=2 +:set concealcursor=nc +:syntax match test /|/ conceal +:" Save current cursor position. Only works in mode, can't be used +:" with :normal because it moves the cursor to the command line. Thanks to ZyX +:" for the idea to use an mapping. +:let positions = [] +:nnoremap GG ":let positions += ['".screenrow().":".screencol()."']\n" +:" Start test. +/^start: +:normal ztj +GGk +:" We should end up in the same column when running these commands on the two +:" lines. +:normal ft +GGk +:normal $ +GGk +:normal 0j +GGk +:normal ft +GGk +:normal $ +GGk +:normal 0j0j +GGk +:" Same for next test block. +:normal ft +GGk +:normal $ +GGk +:normal 0j +GGk +:normal ft +GGk +:normal $ +GGk +:normal 0j0j +GGk +:" And check W with multiple tabs and conceals in a line. +:normal W +GGk +:normal W +GGk +:normal W +GGk +:normal $ +GGk +:normal 0j +GGk +:normal W +GGk +:normal W +GGk +:normal W +GGk +:normal $ +GGk +:" Display result. +:call append('$', 'end:') +:call append('$', positions) +:/^end/,$wq! test.out +ENDTEST + +start: +.concealed. text +|concealed| text + + .concealed. text + |concealed| text + +.a. .b. .c. .d. +|a| |b| |c| |d| diff --git a/src/testdir/test88.ok b/src/testdir/test88.ok new file mode 100644 index 0000000000..e726258a55 --- /dev/null +++ b/src/testdir/test88.ok @@ -0,0 +1,23 @@ +end: +2:1 +2:17 +2:20 +3:1 +3:17 +3:20 +5:8 +5:25 +5:28 +6:8 +6:25 +6:28 +8:1 +8:9 +8:17 +8:25 +8:27 +9:1 +9:9 +9:17 +9:25 +9:26 diff --git a/src/version.c b/src/version.c index 5a3ccaec68..cce8995b36 100644 --- a/src/version.c +++ b/src/version.c @@ -740,6 +740,90 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 754, +/**/ + 753, +/**/ + 752, +/**/ + 751, +/**/ + 750, +/**/ + 749, +/**/ + 748, +/**/ + 747, +/**/ + 746, +/**/ + 745, +/**/ + 744, +/**/ + 743, +/**/ + 742, +/**/ + 741, +/**/ + 740, +/**/ + 739, +/**/ + 738, +/**/ + 737, +/**/ + 736, +/**/ + 735, +/**/ + 734, +/**/ + 733, +/**/ + 732, +/**/ + 731, +/**/ + 730, +/**/ + 729, +/**/ + 728, +/**/ + 727, +/**/ + 726, +/**/ + 725, +/**/ + 724, +/**/ + 723, +/**/ + 722, +/**/ + 721, +/**/ + 720, +/**/ + 719, +/**/ + 718, +/**/ + 717, +/**/ + 716, +/**/ + 715, +/**/ + 714, +/**/ + 713, /**/ 712, /**/ diff --git a/src/vimio.h b/src/vimio.h index 71a52cd210..a4dd03096e 100644 --- a/src/vimio.h +++ b/src/vimio.h @@ -13,4 +13,7 @@ # define _CRT_NONSTDC_NO_DEPRECATE #endif -#include +/* cproto fails on missing include files */ +#ifndef PROTO +# include +#endif diff --git a/src/xpm_w32.c b/src/xpm_w32.c index 2ec32ed9f0..7241fb6a94 100644 --- a/src/xpm_w32.c +++ b/src/xpm_w32.c @@ -55,7 +55,7 @@ LoadXpmImage(filename, hImage, hShape) return -1; if (shp == NULL) { - if (img) + if (img) XDestroyImage(img); return -1; }