updated for version 7.0224

This commit is contained in:
Bram Moolenaar
2006-03-14 23:00:46 +00:00
parent 3b1ddfed51
commit 1f4d4de1ba
9 changed files with 358 additions and 78 deletions

View File

@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across a network
" AUTOLOAD PORTION
" Date: Mar 09, 2006
" Version: 79
" Date: Mar 13, 2006
" Version: 80
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
@ -23,7 +23,7 @@
if &cp || exists("g:loaded_netrw")
finish
endif
let g:loaded_netrw = "v79"
let g:loaded_netrw = "v80"
if v:version < 700
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None
finish
@ -2802,6 +2802,23 @@ fun! netrw#DirBrowse(dirname)
endif
let s:last_sort_by= g:netrw_sort_by
" set up ShellCmdPost handling. Append current buffer to browselist
if !exists("s:netrw_browselist")
let s:netrw_browselist= []
endif
if g:netrw_fastbrowse <= 1 && (empty(s:netrw_browselist) || bufnr("%") > s:netrw_browselist[-1])
call add(s:netrw_browselist,bufnr("%"))
" call Decho("browselist=".string(s:netrw_browselist))
endif
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!
au ShellCmdPost * call s:LocalBrowseShellCmdRefresh()
augroup END
endif
" get the new directory name
if has("win32") || has("win95") || has("win64") || has("win16")
let b:netrw_curdir= substitute(a:dirname,'\\','/','ge')
@ -3161,6 +3178,36 @@ fun! s:LocalBrowseChgDir(dirname,newdir,...)
return dirname
endfun
" ---------------------------------------------------------------------
" LocalBrowseShellCmdRefresh: this function is called after a user has {{{2
" performed any shell command. The idea is to cause all local-browsing
" buffers to be refreshed after a user has executed some shell command,
" on the chance that s/he removed/created a file/directory with it.
fun! s:LocalBrowseShellCmdRefresh()
" call Dfunc("LocalBrowseShellCmdRefresh() browselist=".string(s:netrw_browselist))
" go through all buffers,
" including unlisted (which is why I can't use bufdo)
let curwin = winnr()
let ibl = 0
for ibuf in s:netrw_browselist
if bufwinnr(ibuf) == -1
" call Decho("wiping buf#".ibuf)
exe "bw ".ibuf
call remove(s:netrw_browselist,ibl)
" call Decho("browselist=".string(s:netrw_browselist))
continue
else
" call Decho("refresh buf#".ibuf.'-> win#'.bufwinnr(ibuf))
exe bufwinnr(ibuf)."wincmd w"
call s:NetRefresh(s:LocalBrowseChgDir(b:netrw_curdir,'./'),1)
endif
let ibl= ibl + 1
endfor
exe curwin."wincmd w"
" call Dret("LocalBrowseShellCmdRefresh")
endfun
" ---------------------------------------------------------------------
" LocalBrowseRm: {{{2
fun! s:LocalBrowseRm(path) range
@ -3465,7 +3512,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w")
endif
let w:netrw_explore_mtchcnt = indx + 1
let w:netrw_explore_bufnr = bufnr(".")
let w:netrw_explore_bufnr = bufnr("%")
let w:netrw_explore_line = line(".")
call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}')
" call Decho("explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line)
@ -3537,8 +3584,8 @@ fun! NetrwStatusLine()
" let g:stlmsg=""
" if !exists("w:netrw_explore_bufnr")
" let g:stlmsg="!X<explore_bufnr>"
" elseif w:netrw_explore_bufnr != bufnr(".")
" let g:stlmsg="explore_bufnr!=".bufnr(".")
" elseif w:netrw_explore_bufnr != bufnr("%")
" let g:stlmsg="explore_bufnr!=".bufnr("%")
" endif
" if !exists("w:netrw_explore_line")
" let g:stlmsg=" !X<explore_line>"
@ -3550,7 +3597,7 @@ fun! NetrwStatusLine()
" endif
" ^^^ NetrwStatusLine() debugging ^^^
if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr(".") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
" restore user's status line
let &stl = s:netrw_users_stl
let &laststatus = s:netrw_users_ls

View File

@ -1,4 +1,4 @@
*diff.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
*diff.txt* For Vim version 7.0aa. Last change: 2006 Mar 14
VIM REFERENCE MANUAL by Bram Moolenaar
@ -378,7 +378,7 @@ will have the same effect. These variables are set to the file names used:
Example (this does the same as 'patchexpr' being empty): >
let patchexpr=MyPatch
let patchexpr=MyPatch()
function MyPatch
:call system("patch -o " . v:fname_out . " " . v:fname_in .
\ " < " . v:fname_diff)

View File

@ -1,4 +1,4 @@
*pi_netrw.txt* For Vim version 7.0. Last change: Mar 09, 2006
*pi_netrw.txt* For Vim version 7.0. Last change: Mar 10, 2006
VIM REFERENCE MANUAL by Charles E. Campbell, Jr.

View File

@ -1965,6 +1965,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:dsp tagsrch.txt /*:dsp*
:dsplit tagsrch.txt /*:dsplit*
:e editing.txt /*:e*
:ea undo.txt /*:ea*
:earlier undo.txt /*:earlier*
:ec eval.txt /*:ec*
:echo eval.txt /*:echo*
:echoe eval.txt /*:echoe*
@ -2142,6 +2144,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:lang mlang.txt /*:lang*
:language mlang.txt /*:language*
:last editing.txt /*:last*
:lat undo.txt /*:lat*
:later undo.txt /*:later*
:lb quickfix.txt /*:lb*
:lbuffer quickfix.txt /*:lbuffer*
:lc editing.txt /*:lc*
@ -5281,7 +5285,9 @@ g$ motion.txt /*g$*
g& change.txt /*g&*
g' motion.txt /*g'*
g'a motion.txt /*g'a*
g+ undo.txt /*g+*
g, motion.txt /*g,*
g- undo.txt /*g-*
g0 motion.txt /*g0*
g8 various.txt /*g8*
g:DrChipTopLvlMenu pi_netrw.txt /*g:DrChipTopLvlMenu*
@ -6254,6 +6260,7 @@ new-searchpat version6.txt /*new-searchpat*
new-session-files version5.txt /*new-session-files*
new-spell version7.txt /*new-spell*
new-tab-pages version7.txt /*new-tab-pages*
new-undo-branches version7.txt /*new-undo-branches*
new-unlisted-buffers version6.txt /*new-unlisted-buffers*
new-user-defined version5.txt /*new-user-defined*
new-user-manual version6.txt /*new-user-manual*
@ -7212,6 +7219,7 @@ undercurl syntax.txt /*undercurl*
underline syntax.txt /*underline*
undo undo.txt /*undo*
undo-blocks undo.txt /*undo-blocks*
undo-branches undo.txt /*undo-branches*
undo-commands undo.txt /*undo-commands*
undo-redo undo.txt /*undo-redo*
undo-remarks undo.txt /*undo-remarks*

View File

@ -1,4 +1,4 @@
*undo.txt* For Vim version 7.0aa. Last change: 2006 Feb 28
*undo.txt* For Vim version 7.0aa. Last change: 2006 Mar 14
VIM REFERENCE MANUAL by Bram Moolenaar
@ -11,7 +11,8 @@ The basics are explained in section |02.5| of the user manual.
1. Undo and redo commands |undo-commands|
2. Two ways of undo |undo-two-ways|
3. Undo blocks |undo-blocks|
4. Remarks about undo |undo-remarks|
4. Undo branches |undo-branches|
5. Remarks about undo |undo-remarks|
==============================================================================
1. Undo and redo commands *undo-commands*
@ -102,7 +103,88 @@ After this an "u" command will undo the delete command and the previous
change.
==============================================================================
4. Remarks about undo *undo-remarks*
4. Undo branches *undo-branches*
Above we only discussed one line of undo. But it is also possible to branch
off. This happens when you undo a few changes and then make a new change.
The undone changes become a branch. You can go to that branch with the
following commands.
What matters here is the order in which the changes are made. Undo and redo
are not considered changes in this context. After each change you have a new
state of the text.
*g-*
g- Go to older text state. With a count repeat that many
times. {not in Vi}
*:ea* *:earlier*
:earlier {count} Go to older text state {count} times.
:earlier {N}s Go to older text state about {N} seconds before.
:earlier {N}m Go to older text state about {N} minutes before.
:earlier {N}h Go to older text state about {N} hours before.
*g+*
g+ Go to newer text state. With a count repeat that many
times. {not in Vi}
*:lat* *:later*
:later {count} Go to newer text state {count} times.
:later {N}s Go to newer text state about {N} seconds later.
:later {N}m Go to newer text state about {N} minutes later.
:later {N}h Go to newer text state about {N} hours later.
Note that text states will become unreachable when undo information is cleared
for 'undolevels'.
Don't be surprised when moving through time shows multiple changes to take
place at a time. This happens when moving through the undo tree and then
making a new change.
EXAMPLE
Start with this text:
one two three ~
Delete the first word by pressing "x" three times:
ne two three ~
e two three ~
two three ~
Now undo that by pressing "u" three times:
e two three ~
ne two three ~
one two three ~
Delete the second word by pressing "x" three times:
one wo three ~
one o three ~
one three ~
Now undo that by using "g-" three times:
one o three ~
one wo three ~
one two three ~
Continue going back in time by pressing "g-" one more time:
two three ~
You are now back in the first undo branch, after deleting "one". Repeating
"g-" will now bring you back to the original text:
e two three ~
ne two three ~
one two three ~
Jump to the last change with ":later 1h":
one three ~
And back to the start again with ":earlier 1h":
one two three ~
Note that using "u" and CTRL-R will not get you to all possible text states
while repeating "g-" and "g+" does.
==============================================================================
5. Remarks about undo *undo-remarks*
The number of changes that are remembered is set with the 'undolevels' option.
If it is zero, the Vi-compatible way is always used. If it is negative no