]> granicus.if.org Git - vim/commitdiff
updated for version 7.0123
authorBram Moolenaar <Bram@vim.org>
Thu, 4 Aug 2005 21:29:45 +0000 (21:29 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 4 Aug 2005 21:29:45 +0000 (21:29 +0000)
Filelist
runtime/doc/pi_netrw.txt
runtime/doc/tags
runtime/plugin/netrw.vim
src/ex_docmd.c
src/fileio.c
src/misc2.c
src/po/check.vim [new file with mode: 0644]
src/proto/fileio.pro
src/quickfix.c
src/version.h

index 2c36a1ad70a9d5f33474585b4fe1ed849c15de35..3378c5cfb5b7a815ec0d19c8fcbad63da33682e2 100644 (file)
--- a/Filelist
+++ b/Filelist
@@ -702,6 +702,7 @@ LANG_SRC = \
                src/po/README.txt \
                src/po/README_mingw.txt \
                src/po/README_mvc.txt \
+               src/po/check.vim \
                src/po/cleanup.vim \
                src/po/Makefile \
                src/po/Make_cyg.mak \
index f1144a5f5ffaebd4edab047f65665df285f97103..ab152de6d08689a32e490bc991a5198ee8d500d7 100644 (file)
@@ -1,4 +1,4 @@
-*pi_netrw.txt*  For Vim version 6.3.  Last change: Jul 09, 2005
+*pi_netrw.txt*  For Vim version 7.0.  Last change: Aug 01, 2005
 
 
                VIM REFERENCE MANUAL    by Charles E. Campbell, Jr.
@@ -1143,9 +1143,15 @@ which is loaded automatically at startup (assuming :set nocp).
 ==============================================================================
 10. History                                            *netrw-history*
 
+       v57: * Explore and relatives can now handle RO files
+            * reverse sort restored with vim7's sort command
+            * g:netrw_keepdir now being used to keep the current directory
+              unchanged as intended (sense change)
+            * vim 6.3 still supported
        v56: * LocalBrowse now saves autochdir setting, unsets it, and
               restores it before returning.
             * using vim's rename() instead of system + local_rename variable
+            * avoids changing directory when g:netrw_keepdir is false
        v55: * -bar used with :Explore :Sexplore etc to allow multiple
               commands to be separated by |s
             * browser listings now use the "nowrap" option
index 20ed1bf82edbad51c1360ae2c5ee1ef33abbf886..09184811b668865c6345eec4671e09ed850105da 100644 (file)
@@ -1596,7 +1596,6 @@ $VIMRUNTIME       starting.txt    /*$VIMRUNTIME*
 45.4   usr_45.txt      /*45.4*
 45.5   usr_45.txt      /*45.5*
 755    spell.txt       /*755*
-767    eval.txt        /*767*
 90.1   usr_90.txt      /*90.1*
 90.2   usr_90.txt      /*90.2*
 90.3   usr_90.txt      /*90.3*
@@ -3736,6 +3735,8 @@ E763      spell.txt       /*E763*
 E764   spell.txt       /*E764*
 E765   options.txt     /*E765*
 E766   eval.txt        /*E766*
+E767   eval.txt        /*E767*
+E768   message.txt     /*E768*
 E77    message.txt     /*E77*
 E78    motion.txt      /*E78*
 E79    message.txt     /*E79*
@@ -5840,6 +5841,7 @@ new-line-continuation     version5.txt    /*new-line-continuation*
 new-manpage-trans      version7.txt    /*new-manpage-trans*
 new-multi-byte version5.txt    /*new-multi-byte*
 new-multi-lang version6.txt    /*new-multi-lang*
+new-netrw-explore      version7.txt    /*new-netrw-explore*
 new-network-files      version6.txt    /*new-network-files*
 new-operator-mod       version6.txt    /*new-operator-mod*
 new-options-5.2        version5.txt    /*new-options-5.2*
index 52220120aa36c41f5b4fb0d9d9392cc375bc1821..c515b8b9dc37ef8f96ad1a33e8df4c9f9bd42688 100644 (file)
@@ -1,7 +1,7 @@
 " netrw.vim: Handles file transfer and remote directory listing across a network
-" Last Change: Aug 01, 2005
+" Last Change: Aug 02, 2005
 " Maintainer:  Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
-" Version:     56
+" Version:     58b     NOT RELEASED
 " License:     Vim License  (see vim's :help license)
 "
 "  But be doers of the Word, and not only hearers, deluding your own selves
@@ -14,7 +14,7 @@
 if exists("g:loaded_netrw") || &cp
   finish
 endif
-let g:loaded_netrw  = "v56"
+let g:loaded_netrw  = "v58b"
 let loaded_explorer = 1
 let s:keepcpo       = &cpo
 set cpo&vim
@@ -90,9 +90,12 @@ if !exists("g:netrw_sort_direction")
 endif
 if !exists("g:netrw_longlist") || g:netrw_longlist == 0
  let g:netrw_longlist= 0
+ let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
 else
  let g:netrw_longlist= 1
- let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa -lk"
+ let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa -l"
+endif
+if !exists("g:netrw_list_cmd")
 endif
 if !exists("g:netrw_timefmt")
  let g:netrw_timefmt= "%c"
@@ -232,10 +235,12 @@ com! -range=% -nargs=*    Nwrite          call s:NetSavePosn()<bar><line1>,<line2>call s:Ne
 com! -nargs=*          NetUserPass     call NetUserPass(<f-args>)
 
 " Commands: :Explore, :Sexplore, Hexplore, Vexplore {{{1
-com! -nargs=? -bar -bang       Explore         call s:Explore(0,0+<bang>0,<q-args>)
-com! -nargs=? -bar -bang       Sexplore        call s:Explore(1,0+<bang>0,<q-args>)
-com! -nargs=? -bar -bang       Hexplore        call s:Explore(1,2+<bang>0,<q-args>)
-com! -nargs=? -bar -bang       Vexplore        call s:Explore(1,4+<bang>0,<q-args>)
+com! -nargs=? -bar -bang -count=0      Explore         call s:Explore(<count>,0,0+<bang>0,<q-args>)
+com! -nargs=? -bar -bang -count=0      Sexplore        call s:Explore(<count>,1,0+<bang>0,<q-args>)
+com! -nargs=? -bar -bang -count=0      Hexplore        call s:Explore(<count>,1,2+<bang>0,<q-args>)
+com! -nargs=? -bar -bang -count=0      Vexplore        call s:Explore(<count>,1,4+<bang>0,<q-args>)
+com! -nargs=? -bar -bang               Nexplore        call s:Explore(-1,0,0,<q-args>)
+com! -nargs=? -bar -bang               Pexplore        call s:Explore(-2,0,0,<q-args>)
 
 " ------------------------------------------------------------------------
 " NetSavePosn: saves position of cursor on screen {{{1
@@ -682,7 +687,11 @@ fun! s:NetGetFile(readcmd, fname, method)
 "   call Dredir("ls!","starting buffer list")
 
    " rename the current buffer to the temp file (ie. fname)
-   keepalt exe "file ".fname
+   if v:version < 700
+    exe "file ".fname
+   else
+    keepalt exe "file ".fname
+   endif
 "   call Dredir("ls!","after renaming current buffer to <".fname.">")
 
    " edit temporary file
@@ -690,7 +699,11 @@ fun! s:NetGetFile(readcmd, fname, method)
 "   call Dredir("ls!","after editing temporary file")
 
    " rename buffer back to remote filename
-   keepalt exe "file ".rfile
+   if v:version < 700
+    exe "file ".rfile
+   else
+    keepalt exe "file ".rfile
+   endif
 "   call Dredir("ls!","renaming buffer back to remote filename<".rfile.">")
    let line1 = 1
    let line2 = line("$")
@@ -1232,7 +1245,6 @@ fun! <SID>NetBrowse(dirname)
    " use ftp to get remote file listing
 "   call Decho("use ftp to get remote file listing")
    call NetBrowseFtpCmd(path,listcmd)
-
    keepjumps 1d
 
    if !g:netrw_longlist
@@ -1269,15 +1281,28 @@ fun! <SID>NetBrowse(dirname)
    let shq= &shq? &shq : ( &sxq? &sxq : "'")
 "   call Decho("exe silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq)
    exe "silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq
+if !exists("g:junk")
+ let g:junk=1
+else
+ put ='testing'
+ return
+endif
    keepjumps 1d
    " cleanup
    if g:netrw_ftp_browse_reject != ""
     exe "silent! g/".g:netrw_ssh_browse_reject."/keepjumps d"
-    endif
+   endif
+  endif
+
+  " set up syntax highlighting
+  if has("syntax")
+   setlocal ft=netrwlist
+   if !has("syntax_items")
+    setlocal ft=
+   endif
   endif
 
   " manipulate the directory listing (hide, sort)
-  setlocal ft=netrwlist
   if line("$") >= s:netrw_bannercnt
    if g:netrw_hide && g:netrw_list_hide != ""
     call s:NetrwListHide()
@@ -1316,8 +1341,10 @@ fun! <SID>NetBrowse(dirname)
      call s:SetSort()
      if v:version < 700
       exe 'keepjumps silent '.s:netrw_bannercnt.',$call s:NetSort()'
-     else
+     elseif g:netrw_sort_direction =~ 'n'
       exe 'keepjumps silent '.s:netrw_bannercnt.',$sort'
+     else
+      exe 'keepjumps silent '.s:netrw_bannercnt.',$sort!'
      endif
      exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\d\{3}\///e'
     endif
@@ -1352,7 +1379,7 @@ fun! <SID>NetBrowseChgDir(dirname,newdir)
   elseif newdir == './'
    " refresh the directory list
 "   call Decho("refresh directory listing")
-   setlocal ma
+   setlocal ma nobl bh=hide
    %d
 
   elseif newdir == '../'
@@ -1623,8 +1650,7 @@ fun! NetBrowseFtpCmd(path,cmd)
   " for the unwanted first blank line (doing a :put to an empty
   " buffer yields a blank first line)
   let ffkeep= &ff
-  setlocal ma
-  setlocal ff=unix
+  setlocal ma ff=unix
   let curline= s:netrw_bannercnt+1
   exe "silent! keepjumps ".curline.",$d"
 
@@ -1772,14 +1798,18 @@ fun! <SID>NetLongList(mode)
 
   if g:netrw_longlist != 0
    " turn long listing off
+"   call Decho("turn long listing off")
    let g:netrw_longlist = 0
    let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
 
   else
    " turn long listing on
+"   call Decho("turn long listing on")
    let g:netrw_longlist = 1
    let g:netrw_list_cmd = g:netrw_list_cmd." -l"
   endif
+  setlocal ma
+  %d
 
   " refresh the listing
   if a:mode == 0
@@ -1861,7 +1891,7 @@ fun! <SID>NetMakeDir(usrhost)
 "    call Decho("netrw_origdir<".netrw_origdir."> b:netrw_curdir<".b:netrw_curdir.">")
 "    call Decho("exe silent! !".g:netrw_local_mkdir.' "'.newdirname.'"')
     exe "silent! !".g:netrw_local_mkdir.' "'.newdirname.'"'
-    if g:netrw_keepdir | exe 'keepjumps cd '.netrw_origdir | endif
+    if !g:netrw_keepdir | exe 'keepjumps cd '.netrw_origdir | endif
    endif
 
    if v:shell_error == 0
@@ -2013,7 +2043,6 @@ fun! <SID>LocalBrowse(dirname)
   " unfortunate interaction -- when putting debugging calls
   " above one can no longer enter the DBG buffer.
 "  call Dfunc("LocalBrowse(dirname<".a:dirname.">) buf#".bufnr("%")." winnr=".winnr())
-"  call Decho("winbufnr1=".winbufnr(1)." winbufnr2=".winbufnr(2)." winbufnr3=".winbufnr(3))
 "  call Dredir("ls!")
 
   if v:version < 603
@@ -2026,26 +2055,70 @@ fun! <SID>LocalBrowse(dirname)
   endif
 
   " record autochdir setting and then insure its unset (tnx to David Fishburn)
-  let keep_autochdir= &autochdir
-  set noautochdir
+  if has("netbeans_intg") || has("sun_workshop")
+   let keep_autochdir= &autochdir
+   set noautochdir
+  endif
+
+  " find buffer number of buffer named precisely the same as a:dirname
+  let bufnum= bufnr(a:dirname)
+"  call Decho("findbuf: bufnum=".bufnum)
+  if bufnum > 0 && bufname(bufnum) != a:dirname
+   let ibuf= 1
+   let buflast= bufnr("$")
+   while bufname(ibuf) !~ '^'.a:dirname.'\=$' && ibuf <= buflast
+"    call Decho("findbuf: ibuf=".ibuf. " bufname<".bufname(ibuf)."> dirname<".a:dirname.">")
+    let ibuf= ibuf + 1
+   endwhile
+   if ibuf > buflast
+    let bufnum= -1
+   else
+    let bufnum= ibuf
+   endif
+"   call Decho("findbuf: bufnum=".bufnum." (final)")
+  endif
 
-  " record and change current directory
+  " get cleared buffer
+  if bufnum < 0
+   if v:version < 700
+    enew!
+   else
+    keepalt enew!
+   endif
+"   call Decho("enew buffer")
+  else
+   let eikeep= &ei
+   set ei=BufEnter
+   if v:version < 700
+    exe "b ".bufnum
+   else
+    exe "keepalt b ".bufnum
+   endif
+   let &ei= eikeep
+   if getline(2) =~ '^" Directory Listing '
+"    call Dret("LocalBrowse : reusing buffer#".bufnum."<".a:dirname.">")
+    return
+   endif
+  endif
+
+  " get the new directory name
   let b:netrw_curdir= substitute(a:dirname,'\\','/','ge')
   if b:netrw_curdir =~ '[/\\]$'
    let b:netrw_curdir= substitute(b:netrw_curdir,'[/\\]$','','e')
   endif
 "  call Decho("b:netrw_curdir<".b:netrw_curdir.">")
+
   " make netrw's idea of the current directory vim's if the user wishes
-  if g:netrw_keepdir
+  if !g:netrw_keepdir
 "   call Decho("change directory: cd ".b:netrw_curdir)
    exe 'cd '.b:netrw_curdir
   endif
 
   " change the name of the buffer to reflect the b:netrw_curdir
-  exe 'silent file '.escape(b:netrw_curdir,s:netrw_cd_escape)
+  exe 'silent! file '.escape(b:netrw_curdir,s:netrw_cd_escape)
 
-  " make this buffer modifiable
-  setlocal ma
+  " make this buffer modifiable and hidden
+  setlocal ma hidden nonu
 
   " ---------------------------
   "  Perform Directory Listing:
@@ -2132,35 +2205,52 @@ fun! <SID>LocalBrowse(dirname)
   " generate the requested directory listing
   call LocalBrowseList()
 
+  " set up syntax highlighting
+  if has("syntax")
+   setlocal ft=netrwlist
+   if !has("syntax_items")
+    setlocal ft=
+   endif
+  endif
+
   " manipulate the directory listing (hide, sort)
-  setlocal ft=netrwlist
   if line("$") >= s:netrw_bannercnt
    if g:netrw_hide && g:netrw_list_hide != ""
     call s:NetrwListHide()
    endif
    if line("$") >= s:netrw_bannercnt
+
     if g:netrw_sort_by =~ "^n"
      call s:SetSort()
+
      if v:version < 700
       exe 'keepjumps silent '.s:netrw_bannercnt.',$call s:NetSort()'
-     else
+     elseif g:netrw_sort_direction =~ 'n'
       exe 'keepjumps silent '.s:netrw_bannercnt.',$sort'
+     else
+      exe 'keepjumps silent '.s:netrw_bannercnt.',$sort!'
      endif
      exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\d\{3}\///e'
+
     else
      if v:version < 700
       exe 'keepjumps silent '.s:netrw_bannercnt.',$call s:NetSort()'
-     else
+     elseif g:netrw_sort_direction =~ 'n'
       exe 'keepjumps silent '.s:netrw_bannercnt.',$sort'
+     else
+      exe 'keepjumps silent '.s:netrw_bannercnt.',$sort!'
      endif
      exe 'keepjumps silent '.s:netrw_bannercnt.',$s/^\d\{-}\///e'
     endif
+
    endif
   endif
   exe s:netrw_bannercnt
 
-  setlocal noma nomod nonu
-  let &autochdir= keep_autochdir
+  setlocal noma nomod nonu bh=hide nobl
+  if has("netbeans_intg") || has("sun_workshop")
+   let &autochdir= keep_autochdir
+  endif
 
 "  call Dret("LocalBrowse : file<".expand("%:p")."> bufname<".bufname("%").">")
 endfun
@@ -2226,8 +2316,12 @@ fun! LocalBrowseList()
 
    if g:netrw_longlist
     let sz   = getfsize(filename)
-    let fsz  = strpart("               ",1,15-strlen(sz)).sz
-    let pfile= pfile."\t".fsz." ".strftime(g:netrw_timefmt,getftime(filename))
+    if v:version <= 700
+     let fsz  = strpart("               ",1,15-strlen(sz)).sz
+     let pfile= pfile."\t".fsz." ".strftime(g:netrw_timefmt,getftime(filename))
+    else
+     let pfile= printf('%-'.g:netrw_maxfilenamelen.'s%15d%s',pfile,sz,getftime(filename))
+    endif
 "    call Decho("sz=".sz." fsz=".fsz)
    endif
 
@@ -2274,8 +2368,6 @@ fun! <SID>LocalBrowseChgDir(dirname,newdir,...)
    " is removing the "/".  Bad idea, so I have to put it back.
    let dirname= dirname.'/'
 "   call Decho("adjusting dirname<".dirname.">")
-   setlocal ma
-   %d
   endif
 
   if newdir !~ '[\/]$'
@@ -2297,15 +2389,11 @@ fun! <SID>LocalBrowseChgDir(dirname,newdir,...)
    " go up one directory
    let dirname= substitute(dirname,'^\(.*/\)\([^/]\+[\/]$\)','\1','e')
 "   call Decho("go up one dir: dirname<".dirname.">")
-   setlocal ma
-   %d
 
   else
    " go down one directory
    let dirname= dirname.newdir
 "   call Decho("go down one dir: dirname<".dirname."> newdir<".newdir.">")
-   setlocal ma
-   %d
   endif
 
 "  call Dret("LocalBrowseChgDir <".dirname.">")
@@ -2488,8 +2576,8 @@ endfun
 "                      been modified
 "          dosplit==1: the window will be split before running the local
 "                      browser
-fun! s:Explore(dosplit,style,...)
-"  call Dfunc("Explore(dosplit=".a:dosplit." style=".a:style.")")
+fun! s:Explore(indx,dosplit,style,...)
+"  call Dfunc("Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.")")
 
   " if dosplit or file has been modified
   if a:dosplit || &modified
@@ -2509,13 +2597,60 @@ fun! s:Explore(dosplit,style,...)
   endif
   norm! 0
 
-  if a:1 == ""
+  if a:1 == "" && a:indx >= 0
    let newdir= substitute(expand("%:p"),'^\(.*\)[/\\][^/\\]*$','\1','e')
+"   call Decho("calling LocalBrowse(newdir<".newdir.">)")
+   call s:LocalBrowse(newdir)
+
+  elseif a:1 =~ '\*\*' || a:indx < 0
+
+   if has("path_extra")
+    if !exists("s:indx")
+     let s:indx= 0
+    endif
+    let indx = a:indx
+    if indx == -1
+     let indx= s:indx + 1
+    elseif indx == -2
+     let indx= s:indx - 1
+    else
+     let s:indx        = 0
+     let s:explorelist = split(expand(b:netrw_curdir."/".a:1),'\n')
+     let s:listlen     = len(s:explorelist)
+    endif
+    let s:indx = indx
+"    call Decho("explorelist<".join(s:explorelist,',')."> len=".s:listlen)
+
+    " sanity check
+    if indx >= s:listlen
+     echoerr "***netrw*** no more directories with matching files"
+     call inputsave()|call input("Press <cr> to continue")|call inputrestore()
+"     call Dret("Explore")
+     return
+    endif
+
+    exe "let dirfile= s:explorelist[".indx."]"
+"    call Decho("dirfile<".dirfile."> indx=".indx)
+    let newdir= substitute(dirfile,'/[^/]*$','','e')
+"    call Decho("newdir<".newdir.">")
+"    call Decho("calling LocalBrowse(newdir<".newdir.">)")
+    call s:LocalBrowse(newdir)
+    call search(substitute(dirfile,"^.*/","",""),"W")
+
+   else
+    if v:version < 700
+     echoerr "***netrw*** you need vim version 7.0 or later for Exploring with **!"
+    elseif !exists("g:netrw_quiet")
+     echoerr "***netrw*** your vim needs the path_extra feature for Exploring with **!"
+    endif
+    call inputsave()|call input("Press <cr> to continue")|call inputrestore()
+   endif
+
   else
    let newdir= a:1
+"   call Decho("calling LocalBrowse(newdir<".newdir.">)")
+   call s:LocalBrowse(newdir)
   endif
-"  call Decho("newdir<".newdir.">")
-  call s:LocalBrowse(newdir)
 
 "  call Dret("Explore")
 endfun
index ab11dffd7154ba06fb719413cd5f9a8614c5a3e0..bb0758224d5754b21cf7ae4a0f51a853e98eb37b 100644 (file)
@@ -6665,11 +6665,25 @@ ex_splitview(eap)
 #endif
            && eap->cmdidx != CMD_new)
     {
-       fname = do_browse(0, (char_u *)_("Edit File in new window"),
+       if (
+# ifdef FEAT_GUI
+           !gui.in_use &&
+# endif
+               au_has_group((char_u *)"FileExplorer"))
+       {
+           /* No browsing supported but we do have the file explorer:
+            * Edit the directory. */
+           if (*eap->arg == NUL || !mch_isdir(eap->arg))
+               eap->arg = (char_u *)".";
+       }
+       else
+       {
+           fname = do_browse(0, (char_u *)_("Edit File in new window"),
                                          eap->arg, NULL, NULL, NULL, curbuf);
-       if (fname == NULL)
-           goto theend;
-       eap->arg = fname;
+           if (fname == NULL)
+               goto theend;
+           eap->arg = fname;
+       }
     }
     cmdmod.browse = FALSE;     /* Don't browse again in do_ecmd(). */
 #endif
index 7e14155ece173ee9a5e92c1c65d05e038985ee22..7c4c9ac17c9046f215ba35a963ffd2de48073a6c 100644 (file)
@@ -7059,6 +7059,18 @@ au_find_group(name)
     return AUGROUP_ERROR;
 }
 
+#if defined(FEAT_BROWSE) || defined(PROTO)
+/*
+ * Return TRUE if augroup "name" exists.
+ */
+    int
+au_has_group(name)
+    char_u     *name;
+{
+    return au_find_group(name) != AUGROUP_ERROR;
+}
+#endif
+
 /*
  * ":augroup {name}".
  */
index 93b3bbe56ef7312d8873024d429a5fe5404ef50f..704e176936fc0406c11683e1c904ede8cb34af59 100644 (file)
@@ -4058,7 +4058,7 @@ vim_findfile_init(path, filename, stopdirs, level, free_visited, need_dir,
                else
                    ff_expand_buffer[len++] = FF_MAX_STAR_STAR_EXPAND;
                wc_part = (char_u *)errpt;
-               if (*wc_part != PATHSEP && *wc_part != NUL)
+               if (*wc_part != NUL && !vim_ispathsep(*wc_part))
                {
                    EMSG2(_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."), PATHSEPSTR);
                    goto error_return;
@@ -4582,10 +4582,10 @@ vim_findfile(search_ctx)
 
            /* cut of last dir */
            while (path_end > ff_search_ctx->ffsc_start_dir
-                   && *path_end == PATHSEP)
+                   && vim_ispathsep(*path_end))
                path_end--;
            while (path_end > ff_search_ctx->ffsc_start_dir
-                   && *(path_end-1) != PATHSEP)
+                   && !vim_ispathsep(path_end[-1]))
                path_end--;
            *path_end = 0;
            path_end--;
@@ -5050,7 +5050,7 @@ ff_path_in_stoplist(path, path_len, stopdirs_v)
     int                i = 0;
 
     /* eat up trailing path separators, except the first */
-    while (path_len > 1 && path[path_len - 1] == PATHSEP)
+    while (path_len > 1 && vim_ispathsep(path[path_len - 1]))
        path_len--;
 
     /* if no path consider it as match */
@@ -5066,7 +5066,7 @@ ff_path_in_stoplist(path, path_len, stopdirs_v)
             * '/home/r' would also match '/home/rks'
             */
            if (fnamencmp(stopdirs_v[i], path, path_len) == 0
-                   && stopdirs_v[i][path_len] == PATHSEP)
+                   && vim_ispathsep(stopdirs_v[i][path_len]))
                return TRUE;
        }
        else
diff --git a/src/po/check.vim b/src/po/check.vim
new file mode 100644 (file)
index 0000000..a5f25aa
--- /dev/null
@@ -0,0 +1,58 @@
+" Vim script for checking .po files.
+"
+" Go through the file and verify that all %...s items in "msgid" are identical
+" to the ones in "msgstr".
+
+if 1   " Only execute this if the eval feature is available.
+
+" Function to get a split line at the cursor.
+" Used for both msgid and msgstr lines.
+" Removes all text except % items and returns the result.
+func! GetMline()
+  let idline = substitute(getline('.'), '"\(.*\)"$', '\1', '')
+  while line('.') < line('$')
+    +
+    let line = getline('.')
+    if line[0] != '"'
+      break
+    endif
+    let idline .= substitute(line, '"\(.*\)"$', '\1', '')
+  endwhile
+
+  " remove everything but % items.
+  return substitute(idline, '[^%]*\(%[-+ #''.0-9*]*l\=[dsuxXpoc%]\)\=', '\1', 'g')
+endfunc
+
+" Start at the first "msgid" line.
+1
+/^msgid
+let startline = line('.')
+let error = 0
+
+while 1
+  if getline(line('.') - 1) !~ "no-c-format"
+    let fromline = GetMline()
+    if getline('.') !~ '^msgstr'
+      echo 'Missing "msgstr" in line ' . line('.')
+      let error = 1
+    endif
+    let toline = GetMline()
+    if fromline != toline
+      echo 'Mismatching % in line ' . (line('.') - 1)
+      let error = 1
+    endif
+  endif
+
+  " Find next msgid.
+  " Wrap around at the end of the file, quit when back at the first one.
+  /^msgid
+  if line('.') == startline
+    break
+  endif
+endwhile
+
+if error == 0
+  echo "OK"
+endif
+
+endif
index 8b051130cfbc54bdfdef23e2c47f180b48c1f93b..2f5897c33417b6bead3a84ca92bb4c2953806ff0 100644 (file)
@@ -22,6 +22,7 @@ void vim_deltempdir __ARGS((void));
 char_u *vim_tempname __ARGS((int extra_char));
 void forward_slash __ARGS((char_u *fname));
 void aubuflocal_remove __ARGS((buf_T *buf));
+int au_has_group __ARGS((char_u *name));
 void do_augroup __ARGS((char_u *arg, int del_group));
 void free_all_autocmds __ARGS((void));
 int check_ei __ARGS((void));
index 5847ae19d6da51005dfe38a4c43f2b045e268b38..bf0b0b8c6c60ec208f5db77c3d5fb1eef751c8fe 100644 (file)
@@ -323,13 +323,12 @@ qf_init_ext(efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast)
                                         && efmp[1] != '\\' && efmp[1] != '%')
                    {
                        /* A file name may contain spaces, but this isn't in
-                        * "\f".  use "[^x]\+" instead (x is next character) */
-                       *ptr++ = '[';
-                       *ptr++ = '^';
-                       *ptr++ = efmp[1];
-                       *ptr++ = ']';
-                       *ptr++ = '\\';
-                       *ptr++ = '+';
+                        * "\f".  For "%f:%l:%m" there may be a ":" in the
+                        * file name.  Use ".\{-1,}x" instead (x is the next
+                        * character), the requirement that :999: follows
+                        * should work. */
+                       STRCPY(ptr, ".\\{-1,}");
+                       ptr += 7;
                    }
                    else
                    {
index 2c5193ec2d6eca6b4e4535f6c77e1d38a263ec5d..3fff8d6116d21797c3c7914a754bd73ee57a6ccc 100644 (file)
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT      "vim70aa"
 #define VIM_VERSION_SHORT      "7.0aa"
 #define VIM_VERSION_MEDIUM     "7.0aa ALPHA"
-#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 1)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 1, compiled "
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 4)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 4, compiled "