# HG changeset patch # User vimboss # Date 1091090633 0 # Node ID db5102f7e29fa0e4319243a98f5e89a314738723 # Parent 4ac1dce8dd5e8d8e97e3e7b921f3ada9db2fe2de updated for version 7.0013 diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt For Vim version 6.2. Last change: Jun 25, 2004 +*pi_netrw.txt For Vim version 6.2. Last change: Jul 26, 2004 VIM REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -503,22 +503,22 @@ 7. Remote Directory Browser *netrw-brows ?..........Help....................................|netrw-help| .......Browsing................................|netrw-cr| ......Refreshing the Listing..................|netrw-c-l| - ......Removing Files or Directories...........|netrw-delete| - D..........Removing Files or Directories...........|netrw-D| - \H.........Edit File/Directory Hiding List.........|netrw-H| - \M.........Make A New Directory....................|netrw-M| - R..........Renaming Files or Directories...........|netrw-R| + ......Deleting Files or Directories...........|netrw-delete| -..........Going Up................................|netrw--| a..........Hiding Files or Directories.............|netrw-a| + D..........Deleting Files or Directories...........|netrw-D| + \h.........Edit File/Directory Hiding List.........|netrw-h| i..........Long Listing............................|netrw-i| + \m.........Make A New Directory....................|netrw-m| o..........Browsing with a Horizontal Split........|netrw-o| r..........Reversing Sorting Order.................|netrw-r| + R..........Renaming Files or Directories...........|netrw-R| s..........Selecting Sorting Style.................|netrw-s| v..........Browsing with a Vertical Split..........|netrw-v| x..........Customizing Browsing....................|netrw-x| - *netrw-browse-cmds* + +QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds* > - Quick Reference Commands Table ------- ----------- Command Explanation ------- ----------- @@ -530,8 +530,9 @@ 7. Remote Directory Browser *netrw-brows R Netrw will attempt to rename the file(s)/directory(ies) - Makes Netrw go up one directory a Show all of a directory (temporarily ignore g:netrw_list_hide) - h Edit file hiding list + \h Edit file hiding list i Toggles between long and short listing + \m Make a directory o Enter the file/directory under the cursor in a new browser window. A horizontal split is used. r Reverse sorting order @@ -540,7 +541,7 @@ 7. Remote Directory Browser *netrw-brows window. A vertical split is used. x Apply a function to a file. < - *netrw-browse-var* +NETRW BROWSER VARIABLES *netrw-browse-var* > --- ----------- Var Explanation @@ -556,6 +557,7 @@ 7. Remote Directory Browser *netrw-brows g:netrw_rm_cmd supports removing files g:netrw_rmdir_cmd supports removing directories g:netrw_rmf_cmd supports removing softlinks to directories + g:netrw_hide if true, the hiding list is used g:netrw_sort_by sort by "name", "time", or "size" g:netrw_sort_direction sorting direction: "normal" or "reverse" g:netrw_sort_sequence when sorting by name, first sort by the @@ -577,6 +579,8 @@ trailing slash and it will be interprete vim [protocol]://[user@]hostname/path/ +To get no-password directory listings, scp, ssh interaction, etc, see +|netrw-list-hack|. REFRESHING THE LISTING *netrw-c-l* @@ -615,18 +619,18 @@ directories or displays the filename, fi time and date of last modification for local directories. -MAKING A NEW DIRECTORY *netrw-M* +MAKING A NEW DIRECTORY *netrw-m* -Actually M, where the is, by default, the backslash. +Actually m, where the is, by default, the backslash. -With the "M" map one may make a new directory either remotely (which +With the "m" map one may make a new directory either remotely (which depends on the global variable g:netrw_mkdir_cmd) or locally (which depends on the global variable g:netrw_local_mkdir). Netrw will issue a request for the new directory's name. A bare at that point will abort the making of the directory. Attempts to make a local directory that already exists (as either a file or a directory) will be detected, reported on, and ignored. -REMOVING FILES OR DIRECTORIES *netrw-delete* *netrw-remove* *netrw-D* +DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* Deleting/removing files and directories involves moving the cursor to the file/directory to be deleted and pressing "D". Directories must be empty first @@ -668,30 +672,32 @@ value is: ssh HOSTNAME mv +One may rename a block of files and directories by selecting them with +the V (|linewise-visual|). -HIDING FILES OR DIRECTORIES *g:netrw_a* *g:netrw_list_hide* +HIDING FILES OR DIRECTORIES *g:netrw-a* *g:netrw_list_hide* -The "a" map lets the browser ignore the g:netrw_list_hide variable. Normally -the g:netrw_list_hide variable holds a comma separated list of patterns which -will be hidden (removed) from the directory listing. Mnemonically, the -"a" stands for show All. +The "a" map toggles the netrw vim file browser (both remote and local) between +displaying hidden files (show-all) versus hiding files. For files to be +hidden, the g:netrw_list_hide variable must hold a comma delimited list of +patterns (ex. \.obj) to be hidden from normal listing. (see |netrw-h|) -EDIT FILE OR DIRECTORY HIDING LIST *netrw-H* +EDIT FILE OR DIRECTORY HIDING LIST *netrw-h* -Actually H, where the is, by default, the backslash. +Actually h, where the is, by default, the backslash. -The "H" map brings up a requestor allowing the user to change the -file/directory hiding list. The hiding list consists of one or more -patterns delimited by commas. Files and/or directories satisfying -these patterns will be hidden (ie. not shown). +The "h" map brings up a requestor allowing the user to change the +file/directory hiding list. The hiding list consists of one or more patterns +delimited by commas. Files and/or directories satisfying these patterns will +be hidden (ie. not shown). BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* -Normally one enters a file or directory using the . However, the "o" -map allows one to open a new window to hold the new directory listing or -file. A horizontal split is used. (also see |netrw-v|) +Normally one enters a file or directory using the . However, the "o" map +allows one to open a new window to hold the new directory listing or file. A +horizontal split is used. (also see |netrw-v|) SELECTING SORTING STYLE *netrw-s* @@ -779,7 +785,7 @@ which is loaded automatically at startup ============================================================================== 9. History *netrw-history* - v47: * + v47: * now handles local directory browsing. v46: * now handles remote directory browsing * g:netrw_silent (if 1) will cause all transfers to be silent'd v45: * made the [user@]hostname:path form a bit more restrictive diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 7.0aa. Last change: 2004 Jul 11 +*quickref.txt* For Vim version 7.0aa. Last change: 2004 Jul 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -934,6 +934,8 @@ Short explanation of each option: *opti position |ga| ga show ascii value of character under cursor in decimal, hex, and octal +|g8| g8 for utf-8 encoding: show byte sequence for + character under cursor in hex. |g_CTRL-G| g CTRL-G show cursor column, line, and character position |CTRL-C| CTRL-C during searches: Interrupt the search diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.0aa. Last change: 2004 Jul 26 +*todo.txt* For Vim version 7.0aa. Last change: 2004 Jul 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -36,6 +36,14 @@ Aborting at the ATTENTION prompt causes ":sbuf" and ":ball" leave an empty window behind. Change in handle_swap_exists() also in 6.3? +Add remap-abbreviation solution to Vim 6.3? It's about adding REMAP_SKIP and +RM_ABBR in getchar.c. + +Added ga_append() here: (also to 6.3?) + script_get(eap, cmd) + gui_do_findrepl(flags, find_text, repl_text, down) + serverGetVimNames(dpy) if_xcmdsrv.c, os_mswin.c + For version 7.0: - Include many PATCHES: @@ -3093,6 +3101,8 @@ 7 When formatting text, allow to break paragraphs). Complements the '2' flag. Use '>' flag when larger indent starts a new paragraph, use '<' flag when smaller indent starts a new paragraph. Both start a new paragraph on any indent change. +7 Add a way to define an item list with a pattern in 'formatoptions'. The + 'n' flag doesn't work for "6.3" or "6a.". 8 Add 'formatexpr' option: Used for formatting operator "gq" instead of the builtin formatting or 'formatprg'. 8 Allow using a trailing space to signal a paragraph that continues on the diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -1,4 +1,4 @@ -*version7.txt* For Vim version 7.0aa. Last change: 2004 Jul 25 +*version7.txt* For Vim version 7.0aa. Last change: 2004 Jul 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -289,4 +289,8 @@ resizing the GUI shell upon startup. Python: Using buffer.append(f.readlines()) didn't work. Allow appending a string with a trailing newline. The newline is ignored. +When using the ":saveas f2" command for buffer "f1", the Buffers menu would +contain "f2" twice, one of them leading to "f1". Also trigger the BufFilePre +and BufFilePost events for the alternate buffer that gets the old name. + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/mswin.vim b/runtime/mswin.vim --- a/runtime/mswin.vim +++ b/runtime/mswin.vim @@ -1,7 +1,12 @@ " Set options and add mapping such that Vim behaves a lot like MS-Windows " " Maintainer: Bram Moolenaar -" Last change: 2004 May 26 +" Last change: 2004 Jul 27 + +" bail out if this isn't wanted (mrsvim.vim uses this). +if exists("g:skip_loading_mswin") && g:skip_loading_mswin + finish +endif " set the 'cpoptions' to its Vim default if 1 " only do this when compiled with expression evaluation diff --git a/runtime/plugin/NetrwFileHandlers.vim b/runtime/plugin/NetrwFileHandlers.vim --- a/runtime/plugin/NetrwFileHandlers.vim +++ b/runtime/plugin/NetrwFileHandlers.vim @@ -1,8 +1,8 @@ " NetrwFileHandlers: contains various extension-based file handlers for -" netrw's browsers' x command +" netrw's browsers' x command ("eXecute launcher") " Author: Charles E. Campbell, Jr. -" Date: Jul 06, 2004 -" Version: 3 +" Date: Jul 09, 2004 +" Version: 1 " --------------------------------------------------------------------- " NetrwFileHandler_html: handles html when the user hits "x" when the @@ -105,7 +105,7 @@ fun! NetrwFileHandler_pnm(pnmfile) endfun " --------------------------------------------------------------------- -" NetrwFileHandler_bmp: +" NetrwFileHandler_bmp: visualize bmp files fun! NetrwFileHandler_bmp(bmpfile) " call Dfunc("NetrwFileHandler_bmp(bmpfile<".a:bmpfile.">)") @@ -123,3 +123,84 @@ fun! NetrwFileHandler_bmp(bmpfile) endfun " --------------------------------------------------------------------- +" NetrwFileHandler_pdf: visualize pdf files +fun! NetrwFileHandler_pdf(pdf) + " call Dfunc("NetrwFileHandler_pdf(pdf<".a:pdf.">)") + if executable("gs") + exe "silent! !gs ".a:pdf + else + " call Dret("NetrwFileHandler_pdf 0") + return 0 + endif + + " call Dret("NetrwFileHandler_pdf 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" NetrwFileHandler_sxw: visualize sxw files +fun! NetrwFileHandler_sxw(sxw) + " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)") + if executable("gs") + exe "silent! !gs ".a:sxw + else + " call Dret("NetrwFileHandler_sxw 0") + return 0 + endif + + " call Dret("NetrwFileHandler_sxw 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" NetrwFileHandler_doc: visualize doc files +fun! NetrwFileHandler_doc(doc) + " call Dfunc("NetrwFileHandler_doc(doc<".a:doc.">)") + + if executable("oowriter") + exe "silent! !oowriter ".a:doc + redraw! + else + " call Dret("NetrwFileHandler_doc 0") + return 0 + endif + + " call Dret("NetrwFileHandler_doc 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" NetrwFileHandler_sxw: visualize sxw files +fun! NetrwFileHandler_sxw(sxw) + " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)") + + if executable("oowriter") + exe "silent! !oowriter ".a:sxw + redraw! + else + " call Dret("NetrwFileHandler_sxw 0") + return 0 + endif + + " call Dret("NetrwFileHandler_sxw 1") + return 1 +endfun + +" --------------------------------------------------------------------- +" NetrwFileHandler_xls: visualize xls files +fun! NetrwFileHandler_xls(xls) + " call Dfunc("NetrwFileHandler_xls(xls<".a:xls.">)") + + if executable("oocalc") + exe "silent! !oocalc ".a:xls + redraw! + else + " call Dret("NetrwFileHandler_xls 0") + return 0 + endif + + " call Dret("NetrwFileHandler_xls 1") + return 1 +endfun + +" --------------------------------------------------------------------- diff --git a/runtime/plugin/netrw.vim b/runtime/plugin/netrw.vim --- a/runtime/plugin/netrw.vim +++ b/runtime/plugin/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across a network -" Last Change: Jul 08, 2004 +" Last Change: Jul 26, 2004 " Maintainer: Charles E. Campbell, Jr. PhD -" Version: 47l ASTRO-ONLY +" Version: 47m " License: Vim License (see vim's :help license) " " But be doers of the word, and not only hearers, deluding your own selves @@ -12,7 +12,7 @@ if exists("loaded_netrw") || &cp finish endif -let loaded_netrw = "v47l ASTRO-ONLY" +let loaded_netrw = "v47m" let s:save_cpo = &cpo let loaded_explorer = 1 set cpo&vim @@ -79,7 +79,7 @@ if !exists("g:netrw_longlist") || g:netr let g:netrw_longlist= 0 else let g:netrw_longlist= 1 - let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa -l" + let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa -lk" endif if !exists("g:netrw_timefmt") let g:netrw_timefmt= "%c" @@ -100,6 +100,9 @@ endif if !exists("g:netrw_mkdir_cmd") let g:netrw_mkdir_cmd= "ssh HOSTNAME mkdir" endif +if !exists("g:netrw_hide") + let g:netrw_hide= 1 +endif " BufEnter event ignored by decho when following variable is true " Has a side effect that doau BufReadPost doesn't work, so @@ -173,7 +176,7 @@ if version >= 600 endif au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("")|exe "Nread 0r ".expand("")|exe "silent doau BufReadPost ".expand("") au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("")|exe "Nread " .expand("")|exe "silent doau BufReadPost ".expand("") - au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "Nwrite " .expand("")|call NetRestorePosn() + au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("")|exe "Nwrite " .expand("")|exe "silent doau BufWritePost ".expand("") augroup END endif @@ -986,6 +989,7 @@ fun! NetBrowse(dirname) " call Dret("NetBrowse 0 : badly formatted dirname") return 0 endif + let method = substitute(a:dirname,dirpat,'\1','') let user = substitute(a:dirname,dirpat,'\2','') let machine = substitute(a:dirname,dirpat,'\3','') @@ -1061,13 +1065,14 @@ fun! NetBrowse(dirname) endif setlocal ts=32 bt=nofile bh=wipe nobl exe 'file '.escape(bufname,' ') +" call Decho("renaming file to bufname<".bufname.">") setlocal bt=nowrite bh=hide nobl nnoremap :exe "norm! 0"call NetBrowse(NetBrowseChgDir(expand("%"),NetGetDir())) nnoremap :exe "norm! 0"call NetBrowse(NetBrowseChgDir(expand("%"),'./')) nnoremap - :exe "norm! 0"call NetBrowse(NetBrowseChgDir(expand("%"),'../')) - nnoremap a :let g:netrw_list_showall=1exe "norm! 0"call NetBrowse(NetBrowseChgDir(expand("%"),'./')) - nnoremap H :call NetHideEdit(0) - nnoremap i :call NetLongList(0) + nnoremap a :let g:netrw_hide=!g:netrw_hideexe "norm! 0"call NetBrowse(NetBrowseChgDir(expand("%"),'./')) + nnoremap h :call NetHideEdit(0) + nnoremap i :call NetSavePosn()call NetLongList(0)call NetRestorePosn() nnoremap o :exe g:netrw_winsize."wincmd s"exe "norm! 0"call NetBrowse(NetBrowseChgDir(expand("%"),NetGetDir())) nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'exe "norm! 0"call NetBrowse(NetBrowseChgDir(expand("%"),NetGetDir())) nnoremap s :let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'exe "norm! 0"call NetBrowse(NetBrowseChgDir(expand("%"),'./')) @@ -1079,7 +1084,8 @@ fun! NetBrowse(dirname) exe 'nnoremap D :exe "norm! 0"call NetBrowseRm("'.user.machine.'","'.path.'")' exe 'vnoremap D :call NetBrowseRm("'.user.machine.'","'.path.'")' exe 'nnoremap R :exe "norm! 0"call NetBrowseRename("'.user.machine.'","'.path.'")' - exe 'nnoremap M :call NetMakeDir("'.user.machine.'")' + exe 'vnoremap R :call NetBrowseRename("'.user.machine.'","'.path.'")' + exe 'nnoremap m :call NetMakeDir("'.user.machine.'")' nnoremap ? :he netrw-browse-cmds setlocal ma @@ -1098,7 +1104,7 @@ fun! NetBrowse(dirname) " sorted by size or date keepjumps put ='\" Sorted by '.g:netrw_sort_by endif - if g:netrw_list_hide != "" && !exists("g:netrw_list_showall") + if g:netrw_list_hide != "" && g:netrw_hide keepjumps put ='\" Hiding: '.g:netrw_list_hide let g:netrw_bannercnt= g:netrw_bannercnt + 1 endif @@ -1111,18 +1117,14 @@ fun! NetBrowse(dirname) " manipulate the directory listing (hide, sort) setlocal ft=netrwlist if line("$") >= g:netrw_bannercnt - if !exists("g:netrw_list_showall") - if g:netrw_list_hide != "" - call s:NetrwListHide() - endif - else - unlet g:netrw_list_showall + if g:netrw_hide && g:netrw_list_hide != "" + call s:NetrwListHide() endif if g:netrw_longlist " do a long listing; these substitutions need to be done prior to sorting keepjumps silent /^total\s*\d\+$/d exe 'keepjumps silent '.g:netrw_bannercnt.',$s/ -> .*$//e' - exe 'keepjumps silent '.g:netrw_bannercnt.',$s/\(\S\+\s\+\S\+\s\+\S\+\s\+\S\+\s\+\S\+\s\+\S\+\s\+\S\+\s\+\S\+\)\s\+\(\S\+\)$/\2\t\1/e' + exe 'keepjumps silent '.g:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e' exe g:netrw_bannercnt endif if g:netrw_sort_by =~ "^n" @@ -1130,10 +1132,10 @@ fun! NetBrowse(dirname) exe 'keepjumps silent '.g:netrw_bannercnt.',$call s:NetSort()' exe 'keepjumps silent '.g:netrw_bannercnt.',$s/^\d\{3}\///e' endif - endif - let prvbuf= bufnr(bufname) - if prvbuf != -1 - exe "silent! b ".prvbuf + if g:netrw_longlist + " shorten the list to keep its width <= 80 characters + exe "keepjumps silent ".g:netrw_bannercnt.',$s/\t[-dstrwx]\+/\t/e' + endif endif setlocal noma nomod @@ -1188,7 +1190,7 @@ endfun " --------------------------------------------------------------------- " NetGetDir: it gets the directory named under the cursor fun! NetGetDir() -" call Dfunc("NetGetDir()") +" call Dfunc("NetGetDir() line#".line(".")) let dirname= getline(".") if dirname =~ '\t' let dirname= substitute(dirname,'\t.*$','','e') @@ -1211,7 +1213,7 @@ fun! NetBrowseRm(usrhost,path) rang exe ctr norm! 0 - let rmfile= a:path.expand("") + let rmfile= a:path.s:NetGetDir() " call Decho("rmfile<".rmfile.">") if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '/$') @@ -1265,7 +1267,7 @@ endfun " --------------------------------------------------------------------- " NetBrowseRename: rename a remote file or directory {{{2 -fun! NetBrowseRename(usrhost,path) +fun! NetBrowseRename(usrhost,path) range " call Dfunc("NetBrowseRename(usrhost<".a:usrhost."> path<".a:path.">)") " preparation for removing multiple files/directories @@ -1277,7 +1279,7 @@ fun! NetBrowseRename(usrhost,path) exe "keepjumps ".ctr norm! 0 - let oldname= a:path.expand("") + let oldname= a:path.s:NetGetDir() " call Decho("oldname<".oldname.">") call inputsave() @@ -1426,6 +1428,7 @@ fun! NetMakeDir(usrhost) " call Dret("NetMakeDir : user aborted with bare ") return endif + let newdirname= escape(newdirname,' ') if a:usrhost == "" @@ -1485,8 +1488,8 @@ fun! LocalBrowse(dirname) " one can no longer enter the DBG buffer. " call Dfunc("LocalBrowse(dirname<".a:dirname.">)") - exe 'cd '.escape(a:dirname,' ') - let dirname= getcwd()."/" + exe 'cd '.escape(substitute(a:dirname,'\\','/','ge'),' ') + let dirname= substitute(getcwd(),'\\','/','ge')."/" " call Decho("dirname<".dirname.">") " make this buffer modifiable @@ -1502,64 +1505,84 @@ fun! LocalBrowse(dirname) let dirnamenr= bufnr(substitute(dirname,'/$','','e')) endif " call Decho("bufnr(dirname<".dirname.">)=".dirnamenr) +" call Dredir("file") if dirnamenr != -1 && bufexists(dirname) " buffer already exists (hidden), so switch to it! +" call Dredir("file") exe "b ".dirnamenr - exe 'cd '.escape(dirname,' ') +" call Dredir("file") + exe 'cd '.escape(substitute(a:dirname,'\\','/','ge'),' ') +" call Dredir("file") " call Decho("changed directory to<".dirname.">") +" call Dredir("file") if a:dirname != "." && line("$") >= 5 " call Dret("LocalBrowse : buffer already exists with info") return endif +" call Dredir("file") " call Decho("buffer already exists, but needs listing (buf#".dirnamenr.")") keepjumps %d +" call Dredir("file") + if expand("%:p") != escape(dirname,' ') + exe 'silent! file '.escape(dirname,' ') +" call Decho("renamed file to<".escape(dirname,' ').">") + endif +" call Dredir("file") else " call Dredir("ls!") -" call Decho("generate new buffer named<".dirname.">") +" call Decho("generate new buffer named<".escape(dirname,' ').">") silent! enew! exe 'silent! file '.escape(dirname,' ') +" call Decho("renamed file to<".escape(dirname,' ').">") endif " set standard browser options on buffer setlocal ts=32 bt=nowrite bh=hide nobl " set up all the maps - nnoremap :exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(expand("%:p"),NetGetDir())) - nnoremap :exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(expand("%:p"),'./')) - nnoremap - :exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(expand("%:p"),'../')) - nnoremap a :let g:netrw_list_showall=1exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(expand("%:p"),'./')) - nnoremap H :call NetHideEdit(1) - nnoremap M :call NetMakeDir("") +" call Decho("Setting up local browser maps") + nnoremap :exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(getcwd(),NetGetDir())) + nnoremap :exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(getcwd(),'./')) + nnoremap - :exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(getcwd(),'../')) + nnoremap a :let g:netrw_hide=!g:netrw_hideexe "norm! 0"call LocalBrowse(LocalBrowseChgDir(getcwd(),'./')) + nnoremap h :call NetHideEdit(1) + nnoremap m :call NetMakeDir("") nnoremap i :call NetLongList(1) - nnoremap o :exe g:netrw_winsize."wincmd s"exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(expand("%:p"),NetGetDir())) - nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(expand("%:p"),NetGetDir())) - nnoremap s :let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(expand("%:p"),'./')) - nnoremap v :exe g:netrw_winsize."wincmd v"exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(expand("%:p"),NetGetDir())) - nnoremap x :exe "norm! 0"call NetBrowseX(LocalBrowseChgDir(expand("%:p"),NetGetDir()),0) - nnoremap <2-leftmouse> :exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(expand("%:p"),NetGetDir())) - exe 'nnoremap :exe "norm! 0"call LocalBrowseRm("'.expand("%:p").NetGetDir().'")' - exe 'vnoremap :call LocalBrowseRm("'.expand("%:p").NetGetDir().'")' - exe 'nnoremap D :exe "norm! 0"call LocalBrowseRm("'.expand("%:p").NetGetDir().'")' - exe 'vnoremap D :call LocalBrowseRm("'.expand("%:p").NetGetDir().'")' - exe 'nnoremap R :exe "norm! 0"call LocalBrowseRename("'.expand("%:p").NetGetDir().'")' + nnoremap o :exe g:netrw_winsize."wincmd s"exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(getcwd(),NetGetDir())) + nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(getcwd(),NetGetDir())) + nnoremap s :let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(getcwd(),'./')) + nnoremap v :exe g:netrw_winsize."wincmd v"exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(getcwd(),NetGetDir())) + nnoremap x :exe "norm! 0"call NetBrowseX(LocalBrowseChgDir(getcwd(),NetGetDir()),0) + nnoremap <2-leftmouse> :exe "norm! 0"call LocalBrowse(LocalBrowseChgDir(getcwd(),NetGetDir())) + exe 'nnoremap :exe "norm! 0"call LocalBrowseRm("'.getcwd().'/")' + exe 'vnoremap :call LocalBrowseRm("'.getcwd().'/")' + exe 'nnoremap D :exe "norm! 0"call LocalBrowseRm("'.getcwd().'/")' + exe 'vnoremap D :call LocalBrowseRm("'.getcwd().'/")' + exe 'nnoremap R :exe "norm! 0"call LocalBrowseRename("'.getcwd().'/")' + exe 'vnoremap R :call LocalBrowseRename("'.getcwd().'/")' + exe 'nnoremap m :call NetMakeDir("")' nnoremap ? :he netrw-dir " Set up the banner +" call Decho("set up banner") keepjumps put ='\" =================' keepjumps 1d keepjumps put ='\" Directory Listing' keepjumps put ='\" '.dirname let g:netrw_bannercnt= 6 + if g:netrw_sort_by =~ "^n" +" call Decho("directories will be sorted by name") " sorted by name let g:netrw_bannercnt= g:netrw_bannercnt + 1 keepjumps put ='\" Sorted by '.g:netrw_sort_by keepjumps put ='\" Sort sequence: '.g:netrw_sort_sequence else +" call Decho("directories will be sorted by size or date") " sorted by size or date keepjumps put ='\" Sorted by '.g:netrw_sort_by endif - if g:netrw_list_hide != "" && !exists("g:netrw_list_showall") + if g:netrw_list_hide != "" && g:netrw_hide keepjumps put ='\" Hiding: '.g:netrw_list_hide let g:netrw_bannercnt= g:netrw_bannercnt + 1 endif @@ -1571,12 +1594,8 @@ fun! LocalBrowse(dirname) " manipulate the directory listing (hide, sort) setlocal ft=netrwlist if line("$") >= g:netrw_bannercnt - if !exists("g:netrw_list_showall") - if g:netrw_list_hide != "" - call s:NetrwListHide() - endif - else - unlet g:netrw_list_showall + if g:netrw_hide && g:netrw_list_hide != "" + call s:NetrwListHide() endif if g:netrw_sort_by =~ "^n" call s:SetSort() @@ -1588,16 +1607,10 @@ fun! LocalBrowse(dirname) endif endif exe g:netrw_bannercnt - try - exe 'cd '.escape(substitute(dirname,'/$','','e'),' ') -" call Decho("changed directory to<".dirname.">") - catch - echoerr "Not a directory: <".dirname.">" - endtry setlocal noma nomod -" call Dret("LocalBrowse") +" call Dret("LocalBrowse : file<".expand("%:p").">") endfun " --------------------------------------------------------------------- @@ -1623,7 +1636,9 @@ fun! LocalBrowseList(dirname) endif let pfile= strpart(pfile,dirnamelen) if g:netrw_longlist - let pfile= pfile."\t".getfsize(file)."\t".strftime(g:netrw_timefmt,getftime(file)) + let sz = getfsize(file) + let fsz = strpart(" ",1,15-strlen(sz)).sz + let pfile= pfile."\t".fsz." ".strftime(g:netrw_timefmt,getftime(file)) endif if g:netrw_sort_by =~ "^t" " sort by time (handles time up to 1 quintillion seconds, US) @@ -1655,7 +1670,7 @@ endfun fun! LocalBrowseChgDir(dirname,newdir) " call Dfunc("LocalBrowseChgDir(dirname<".a:dirname."> newdir<".a:newdir.">)") - let dirname= a:dirname + let dirname= substitute(a:dirname,'\\','/','ge') let newdir = a:newdir if dirname !~ '/$' @@ -1706,7 +1721,7 @@ fun! LocalBrowseRm(path) range exe ctr norm! 0 - let rmfile= a:path.expand("") + let rmfile= a:path.s:NetGetDir() " call Decho("rmfile<".rmfile.">") if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '/$') @@ -1724,7 +1739,7 @@ fun! LocalBrowseRm(path) range call inputsave() let ok= input("Confirm deletion of directory<".rmfile."> ","y") call inputrestore() - let rmfile= substitute(rmfile,'/$','','e') + let rmfile= escape(substitute(rmfile,'/$','','e'),' ') if ok == "y" call system(g:netrw_local_rmdir." ".rmfile) @@ -1764,7 +1779,7 @@ endfun " --------------------------------------------------------------------- " LocalBrowseRename: rename a remote file or directory {{{2 -fun! LocalBrowseRename(path) +fun! LocalBrowseRename(path) range " call Dfunc("LocalBrowseRename(path<".a:path.">)") " preparation for removing multiple files/directories @@ -1775,7 +1790,7 @@ fun! LocalBrowseRename(path) exe "keepjumps ".ctr norm! 0 - let oldname= a:path.expand("") + let oldname= a:path.s:NetGetDir() " call Decho("oldname<".oldname.">") call inputsave() @@ -1790,6 +1805,7 @@ fun! LocalBrowseRename(path) " refresh the directory let curline= line(".") +" call Decho("refresh the directory listing") call LocalBrowse(LocalBrowseChgDir(expand("%"),'./')) exe "keepjumps ".curline " call Dret("LocalBrowseRename") diff --git a/runtime/syntax/logtalk.vim b/runtime/syntax/logtalk.vim --- a/runtime/syntax/logtalk.vim +++ b/runtime/syntax/logtalk.vim @@ -2,7 +2,7 @@ " " Language: Logtalk " Maintainer: Paulo Moura -" Last Change: 2004 June 1 +" Last Change: 2004 July 7 " Quit when a syntax file was already loaded: @@ -75,6 +75,7 @@ syn region logtalkDir matchgroup=logtal syn region logtalkDir matchgroup=logtalkDirTag start=":- dynamic(" matchgroup=logtalkDirTag end=")\." contains=ALL syn match logtalkDirTag ":- dynamic\." syn region logtalkDir matchgroup=logtalkDirTag start=":- discontiguous(" matchgroup=logtalkDirTag end=")\." contains=ALL +syn region logtalkDir matchgroup=logtalkDirTag start=":- multifile(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- public(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- protected(" matchgroup=logtalkDirTag end=")\." contains=ALL syn region logtalkDir matchgroup=logtalkDirTag start=":- private(" matchgroup=logtalkDirTag end=")\." contains=ALL diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -8065,6 +8065,7 @@ f_winrestcmd(argvars, retvar) # endif ++winnr; } + ga_append(&ga, NUL); retvar->var_val.var_string = ga.ga_data; #else diff --git a/src/ex_cmds.c b/src/ex_cmds.c --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2203,6 +2203,7 @@ do_write(eap) buf_T *was_curbuf = curbuf; apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf); + apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, alt_buf); # ifdef FEAT_EVAL if (curbuf != was_curbuf || aborting()) # else @@ -2231,6 +2232,7 @@ do_write(eap) buf_name_changed(curbuf); #ifdef FEAT_AUTOCMD apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf); + apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, alt_buf); if (!alt_buf->b_p_bl) { alt_buf->b_p_bl = TRUE; diff --git a/src/ex_eval.c b/src/ex_eval.c --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -1193,9 +1193,9 @@ ex_throw(eap) } /* - * Throw the current exception through the specified cstack. Common routine for - * ":throw" (user exception) and error and interrupt exceptions. Also used for - * rethrowing an uncaught exception. + * Throw the current exception through the specified cstack. Common routine + * for ":throw" (user exception) and error and interrupt exceptions. Also + * used for rethrowing an uncaught exception. */ void do_throw(cstack) @@ -1210,8 +1210,8 @@ do_throw(cstack) * conditional itself, so that its ACTIVE flag can be tested below. But * if a previous error or interrupt has not been converted to an exception, * inactivate the try conditional, too, as if the conversion had been done, - * and reset the did_emsg or got_int flag, so this won't happen again at the - * next surrounding try conditional. + * and reset the did_emsg or got_int flag, so this won't happen again at + * the next surrounding try conditional. */ if (did_emsg && !THROW_ON_ERROR) { @@ -1228,16 +1228,16 @@ do_throw(cstack) { /* * If this try conditional is active and we are before its first - * ":catch", set THROWN so that the ":catch" commands will check whether - * the exception matches. When the exception came from any of the - * catch clauses, it will be made pending at the ":finally" (if present) - * and rethrown at the ":endtry". This will also happen if the try - * conditional is inactive. This is the case when we are throwing an - * exception due to an error or interrupt on the way from a preceding - * ":continue", ":break", ":return", ":finish", error or interrupt (not - * converted to an exception) to the finally clause or from a preceding - * throw of a user or error or interrupt exception to the matching catch - * clause or the finally clause. + * ":catch", set THROWN so that the ":catch" commands will check + * whether the exception matches. When the exception came from any of + * the catch clauses, it will be made pending at the ":finally" (if + * present) and rethrown at the ":endtry". This will also happen if + * the try conditional is inactive. This is the case when we are + * throwing an exception due to an error or interrupt on the way from + * a preceding ":continue", ":break", ":return", ":finish", error or + * interrupt (not converted to an exception) to the finally clause or + * from a preceding throw of a user or error or interrupt exception to + * the matching catch clause or the finally clause. */ if (!(cstack->cs_flags[idx] & CSF_CAUGHT)) { @@ -1253,8 +1253,8 @@ do_throw(cstack) cstack->cs_exception[idx] = current_exception; } #if 0 - /* TODO: Add optimization below. Not yet done because of interface problems - * to eval.c and ex_cmds2.c. (Servatius) */ + /* TODO: Add optimization below. Not yet done because of interface + * problems to eval.c and ex_cmds2.c. (Servatius) */ else { /* diff --git a/src/ex_getln.c b/src/ex_getln.c --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -5476,6 +5476,7 @@ script_get(eap, cmd) ga_append(&ga, '\n'); vim_free(theline); } + ga_append(&ga, NUL); return (char_u *)ga.ga_data; } diff --git a/src/gui.c b/src/gui.c --- a/src/gui.c +++ b/src/gui.c @@ -4586,12 +4586,14 @@ gui_do_findrepl(flags, find_text, repl_t ga_concat(&ga, (char_u *)"/"); concat_esc(&ga, repl_text, '/'); /* escape slashes */ ga_concat(&ga, (char_u *)"/g"); + ga_append(&ga, NUL); do_cmdline_cmd(ga.ga_data); } else { /* Search for the next match. */ i = msg_scroll; + ga_append(&ga, NUL); do_search(NULL, down ? '/' : '?', ga.ga_data, 1L, SEARCH_MSG + SEARCH_MARK); msg_scroll = i; /* don't let an error message set msg_scroll */ diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c --- a/src/if_xcmdsrv.c +++ b/src/if_xcmdsrv.c @@ -683,6 +683,7 @@ serverGetVimNames(dpy) } if (regProp != empty_prop) XFree(regProp); + ga_append(&ga, NUL); return ga.ga_data; } @@ -1258,7 +1259,7 @@ serverEventProc(dpy, eventPtr) ga_append(&reply, 0); ga_concat(&reply, (char_u *)"-c 1"); } - ga_append(&reply, 0); + ga_append(&reply, NUL); (void)AppendPropCarefully(dpy, resWindow, commProperty, reply.ga_data, reply.ga_len); } @@ -1363,7 +1364,7 @@ serverEventProc(dpy, eventPtr) if ((r = ServerReplyFind(win, SROP_Add)) != NULL) { ga_concat(&(r->strings), str); - ga_append(&(r->strings), 0); + ga_append(&(r->strings), NUL); } #ifdef FEAT_AUTOCMD sprintf((char *)winstr, "0x%x", (unsigned int)win); diff --git a/src/macros.h b/src/macros.h --- a/src/macros.h +++ b/src/macros.h @@ -159,7 +159,6 @@ # define mch_fopen(n, p) fopen((n), (p)) # endif # define mch_fstat(n, p) fstat((n), (p)) -# define mch_lstat(n, p) lstat((n), (p)) # ifdef MSWIN /* has it's own mch_stat() function */ # define mch_stat(n, p) vim_stat((n), (p)) # else @@ -173,6 +172,12 @@ # endif #endif +#ifdef HAVE_LSTAT +# define mch_lstat(n, p) lstat((n), (p)) +#else +# define mch_lstat(n, p) mch_stat((n), (p)) +#endif + #ifdef MACOS_CLASSIC /* MacOS classic doesn't support perm but MacOS X does. */ # define mch_open(n, m, p) open((n), (m)) diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -5312,11 +5312,13 @@ did_set_string_option(opt_idx, varp, new #ifdef FEAT_PRINTER else if (varp == &p_popt) - errmsg = parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS); + errmsg = parse_list_options(p_popt, printer_opts, + OPT_PRINT_NUM_OPTIONS); # if defined(FEAT_MBYTE) && defined(FEAT_POSTSCRIPT) else if (varp == &p_pmfn) - errmsg = parse_list_options(p_pmfn, mbfont_opts, OPT_MBFONT_NUM_OPTIONS); + errmsg = parse_list_options(p_pmfn, mbfont_opts, + OPT_MBFONT_NUM_OPTIONS); # endif #endif diff --git a/src/os_mswin.c b/src/os_mswin.c --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -2689,6 +2689,7 @@ serverGetVimNames(void) ga_init2(&ga, 1, 100); EnumWindows(enumWindowsGetNames, (LPARAM)(&ga)); + ga_append(&ga, NUL); return ga.ga_data; }