• R/O
  • SSH

vim: 提交

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

修訂3b705e71c7b07ba1309d08a8b370ae8ad3fc17cd (tree)
時間2005-08-06 06:35:02
作者vimboss
Commitervimboss

Log Message

updated for version 7.0124

Change Summary

差異

diff -r 8411e13e6dcb -r 3b705e71c7b0 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt Fri Aug 05 21:27:51 2005 +0000
+++ b/runtime/doc/eval.txt Fri Aug 05 21:35:02 2005 +0000
@@ -1,4 +1,4 @@
1-*eval.txt* For Vim version 7.0aa. Last change: 2005 Aug 01
1+*eval.txt* For Vim version 7.0aa. Last change: 2005 Aug 05
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1474,6 +1474,8 @@
14741474 char2nr( {expr}) Number ASCII value of first char in {expr}
14751475 cindent( {lnum}) Number C indent for line {lnum}
14761476 col( {expr}) Number column nr of cursor or mark
1477+complete_add( {expr}) Number add completion match
1478+complete_check() Number check for key typed during completion
14771479 confirm( {msg} [, {choices} [, {default} [, {type}]]])
14781480 Number number of choice picked by user
14791481 copy( {expr}) any make a shallow copy of {expr}
@@ -1886,6 +1888,22 @@
18861888 \<C-O>:echo col(".") . "\n" <Bar>
18871889 \let &ve = save_ve<CR>
18881890 <
1891+
1892+complete_add({expr}) *complete_add()*
1893+ Add {expr} to the list of matches. Only to be used by the
1894+ function specified with the 'completefunc' option.
1895+ Returns 0 for failure (empty string or out of memory),
1896+ 1 when the match was added, 2 when the match was already in
1897+ the list.
1898+
1899+complete_check() *complete_check()*
1900+ Check for a key typed while looking for completion matches.
1901+ This is to be used when looking for matches takes some time.
1902+ Returns non-zero when searching for matches is to be aborted,
1903+ zero otherwise.
1904+ Only to be used by the function specified with the
1905+ 'completefunc' option.
1906+
18891907 *confirm()*
18901908 confirm({msg} [, {choices} [, {default} [, {type}]]])
18911909 Confirm() offers the user a dialog, from which a choice can be
@@ -5233,8 +5251,8 @@
52335251 value of each item.
52345252 When an error is detected for a command inside the
52355253 loop, execution continues after the "endfor".
5236- Changing {list} affects what items are used. Make a
5237- copy if this is unwanted: >
5254+ Changing {list} inside the loop affects what items are
5255+ used. Make a copy if this is unwanted: >
52385256 :for item in copy(mylist)
52395257 < When not making a copy, Vim stores a reference to the
52405258 next item in the list, before executing the commands
@@ -5252,12 +5270,6 @@
52525270 changing. Unlet the variable at the end of the loop
52535271 to allow multiple item types.
52545272
5255-:for {var} in {string}
5256-:endfo[r] Like ":for" above, but use each character in {string}
5257- as a list item.
5258- Composing characters are used as separate characters.
5259- A Number is first converted to a String.
5260-
52615273 :for [{var1}, {var2}, ...] in {listlist}
52625274 :endfo[r]
52635275 Like ":for" above, but each item in {listlist} must be
diff -r 8411e13e6dcb -r 3b705e71c7b0 runtime/doc/options.txt
--- a/runtime/doc/options.txt Fri Aug 05 21:27:51 2005 +0000
+++ b/runtime/doc/options.txt Fri Aug 05 21:35:02 2005 +0000
@@ -1,4 +1,4 @@
1-*options.txt* For Vim version 7.0aa. Last change: 2005 Aug 01
1+*options.txt* For Vim version 7.0aa. Last change: 2005 Aug 05
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1607,7 +1607,15 @@
16071607 with the matching words. These matches should include the "a:base"
16081608 text. When there are no matches return an empty List.
16091609
1610+ When searching for matches takes some time call |complete_add()| to
1611+ add each match to the total list. These matches should then not
1612+ appear in the returned list! Call |complete_check()| now and then to
1613+ allow the user to press a key while still searching for matches. Stop
1614+ searching when it returns non-zero.
1615+
16101616 The function must not move the cursor!
1617+ This option cannot be set from a |modeline| or in the |sandbox|, for
1618+ security reasons.
16111619
16121620 An example that completes the names of the months: >
16131621 fun! CompleteMonths(findstart, col, base)
@@ -1632,6 +1640,32 @@
16321640 endfun
16331641 set completefunc=CompleteMonths
16341642 <
1643+ The same, but now pretending searching for matches is slow: >
1644+ fun! CompleteMonths(findstart, col, base)
1645+ if a:findstart
1646+ " locate the start of the word
1647+ let line = getline('.')
1648+ let start = a:col
1649+ while start > 0 && line[start - 1] =~ '\a'
1650+ let start -= 1
1651+ endwhile
1652+ return start
1653+ else
1654+ " find months matching with "a:base"
1655+ for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
1656+ if m =~ '^' . a:base
1657+ call complete_add(m)
1658+ endif
1659+ sleep 300m " simulate searching for next match
1660+ if complete_check()
1661+ break
1662+ endif
1663+ endfor
1664+ return []
1665+ endif
1666+ endfun
1667+ set completefunc=CompleteMonths
1668+<
16351669
16361670 *'confirm'* *'cf'* *'noconfirm'* *'nocf'*
16371671 'confirm' 'cf' boolean (default off)
diff -r 8411e13e6dcb -r 3b705e71c7b0 runtime/doc/pi_netrw.txt
--- a/runtime/doc/pi_netrw.txt Fri Aug 05 21:27:51 2005 +0000
+++ b/runtime/doc/pi_netrw.txt Fri Aug 05 21:35:02 2005 +0000
@@ -1,4 +1,4 @@
1-*pi_netrw.txt* For Vim version 7.0. Last change: Aug 01, 2005
1+*pi_netrw.txt* For Vim version 7.0. Last change: Aug 04, 2005
22
33
44 VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
@@ -584,6 +584,8 @@
584584 :Sexplore[!] [dir].Split & Explore directory of current file|netrw-explore|
585585 :Hexplore[!] [dir].Horizontal Split & Explore...............|netrw-explore|
586586 :Vexplore[!] [dir].Vertical Split & Explore.................|netrw-explore|
587+ :Pexplore[!] [dir].Vertical Split & Explore.................|netrw-explore|
588+ :Nexplore[!] [dir].Vertical Split & Explore.................|netrw-explore|
587589
588590 QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
589591 >
@@ -606,6 +608,7 @@
606608 <c-l> Causes Netrw to refresh the directory listing
607609 o Enter the file/directory under the cursor in a new browser
608610 window. A horizontal split is used.
611+ p Preview the file
609612 r Reverse sorting order
610613 s Select sorting style: by name, time, or file size
611614 v Enter the file/directory under the cursor in a new browser
@@ -741,10 +744,12 @@
741744
742745 DIRECTORY EXPLORING COMMANDS *netrw-explore*
743746
744- :Explore[!] [dir].Explore directory of current file
745- :Sexplore[!] [dir].Split & Explore directory of current file
746- :Hexplore[!] [dir].Horizontal Split & Explore
747- :Vexplore[!] [dir].Vertical Split & Explore
747+ :Explore[!] [dir]... Explore directory of current file
748+ :Sexplore[!] [dir]... Split & Explore directory of current file
749+ :Hexplore[!] [dir]... Horizontal Split & Explore
750+ :Vexplore[!] [dir]... Vertical Split & Explore
751+ :Nexplore............. used with **/patterns; go to next matching file
752+ :Pexplore............. used with **/patterns; go to previous matching file
748753
749754 The Explore command will open the local-directory browser on the current
750755 file's directory (or on directory [dir] if specified). The window
@@ -762,6 +767,23 @@
762767 Vexplore does an Explore with |leftabove| vertical splitting; the optiona
763768 ! does an Explore with |topleft| vertical splitting.
764769
770+(Following needs v7.0 or later)
771+When Explore, Sexplore, Hexplore, or Vexplore are used with
772+**/filename-patterns, netrw will attempt to find a (sub)directory which
773+matches the filename pattern. The Nexplore and Pexplore commands enable
774+one to proceed to the next/previous matching file, respectively. If your
775+console or gui produce recognizable shift-up or shift-down sequences, then
776+
777+ <s-down> == Nexplore, and
778+ <s-up> == Pexplore.
779+
780+As an example, consider >
781+
782+ :Explore **/*.c
783+ :Nexplore
784+ :Nexplore
785+ :Pexplore
786+<
765787
766788 REFRESHING THE LISTING *netrw-ctrl-l*
767789
@@ -993,10 +1015,10 @@
9931015
9941016 BOOKMARKING A DIRECTORY *netrw-b* *netrw-bookmark* *netrw-bookmarks*
9951017
996-One may easily "bookmark" a directory by using
1018+One may easily "bookmark" a directory by using >
9971019
9981020 {cnt}b
999-
1021+<
10001022 Any count may be used. One may use viminfo's "!" option to retain bookmarks
10011023 between vim sessions. See |netrw-B| for how to return to a bookmark and
10021024 |netrw-q| for how to list them.
@@ -1143,6 +1165,21 @@
11431165 ==============================================================================
11441166 10. History *netrw-history*
11451167
1168+ v58: * Explore and relatives can now handle **/somefilepattern (v7)
1169+ * Nexplore and Pexplore introduced (v7). shift-down and shift-up
1170+ cursor keys will invoke Nexplore and Pexplore, respectively.
1171+ * bug fixed with o and v
1172+ * autochdir only worked around for vim when it has been
1173+ compiled with either |+netbeans_intg| or |+sun_workshop|
1174+ * Under Windows, all directories and files were being preceded
1175+ with a "/" when local browsing. Fixed.
1176+ * When: syntax highlighting is off, laststatus=2, and remote
1177+ browsing is used, sometimes the laststatus highlighting
1178+ bleeds into the entire display. Work around - do an extra
1179+ redraw in that case.
1180+ * Bugfix: when g:netrw_keepdir=0, due to re-use of buffers,
1181+ netrw didn't change the directory when it should've
1182+ * Bugfix: D and R commands work again
11461183 v57: * Explore and relatives can now handle RO files
11471184 * reverse sort restored with vim7's sort command
11481185 * g:netrw_keepdir now being used to keep the current directory
diff -r 8411e13e6dcb -r 3b705e71c7b0 runtime/doc/tags
--- a/runtime/doc/tags Fri Aug 05 21:27:51 2005 +0000
+++ b/runtime/doc/tags Fri Aug 05 21:35:02 2005 +0000
@@ -4456,6 +4456,8 @@
44564456 compl-tag insert.txt /*compl-tag*
44574457 compl-vim insert.txt /*compl-vim*
44584458 compl-whole-line insert.txt /*compl-whole-line*
4459+complete_add() eval.txt /*complete_add()*
4460+complete_check() eval.txt /*complete_check()*
44594461 complex-change change.txt /*complex-change*
44604462 complex-repeat repeat.txt /*complex-repeat*
44614463 compress pi_gzip.txt /*compress*
@@ -5163,6 +5165,7 @@
51635165 hebrew.txt hebrew.txt /*hebrew.txt*
51645166 help various.txt /*help*
51655167 help-context help.txt /*help-context*
5168+help-tags tags 1
51665169 help-translated various.txt /*help-translated*
51675170 help-xterm-window various.txt /*help-xterm-window*
51685171 help.txt help.txt /*help.txt*
diff -r 8411e13e6dcb -r 3b705e71c7b0 runtime/doc/todo.txt
--- a/runtime/doc/todo.txt Fri Aug 05 21:27:51 2005 +0000
+++ b/runtime/doc/todo.txt Fri Aug 05 21:35:02 2005 +0000
@@ -1,4 +1,4 @@
1-*todo.txt* For Vim version 7.0aa. Last change: 2005 Aug 02
1+*todo.txt* For Vim version 7.0aa. Last change: 2005 Aug 05
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -66,8 +66,6 @@
6666 make it work for all completion methods.
6767
6868 First cleanup the Insert-mode completion.
69- - check security of 'completefunc'.
70- - use callback to interrupt searching for matches.
7169
7270 UI:
7371 - At first: use 'wildmenu' kind of thing.
@@ -76,7 +74,8 @@
7674 alternatives).
7775
7876 Completion logic:
79- Use 'coupler' option to list items that connect words. For C: ".,->".
77+ Use something like 'completefunc'?
78+ runtime/complete/{filetype}.vim files?
8079 In function arguments suggest variables of expected type.
8180
8281 Ideas from others:
@@ -102,7 +101,7 @@
102101 "Visual Assist" http://www.wholetomato.com/products:
103102 Completion in .NET framework SharpDevelop: http://www.icsharpcode.net
104103
105- - Pre-expand abbreviations, show which abbrevs would match?
104+ - Pre-expand abbreviations, show which abbrevs would match?
106105
107106 - UNDO TREE: keep all states of the text, don't delete undo info.
108107 When making a change, instead of clearing any future undo (thus redo)
diff -r 8411e13e6dcb -r 3b705e71c7b0 runtime/doc/version7.txt
--- a/runtime/doc/version7.txt Fri Aug 05 21:27:51 2005 +0000
+++ b/runtime/doc/version7.txt Fri Aug 05 21:35:02 2005 +0000
@@ -1,4 +1,4 @@
1-*version7.txt* For Vim version 7.0aa. Last change: 2005 Aug 04
1+*version7.txt* For Vim version 7.0aa. Last change: 2005 Aug 05
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -399,6 +399,8 @@
399399 |browsedir()| dialog to select a directory
400400 |byteidx()| index of a character (Ilya Sher)
401401 |call()| call a function with List as arguments
402+|complete_add()| add match for 'completefunc'
403+|complete_check()| check for key pressed, for 'completefunc'
402404 |copy()| make a shallow copy of a List or Dictionary
403405 |count()| count nr of times a value is in a List or Dictionary
404406 |deepcopy()| make a full copy of a List or Dictionary
diff -r 8411e13e6dcb -r 3b705e71c7b0 runtime/plugin/netrw.vim
--- a/runtime/plugin/netrw.vim Fri Aug 05 21:27:51 2005 +0000
+++ b/runtime/plugin/netrw.vim Fri Aug 05 21:35:02 2005 +0000
@@ -1,8 +1,16 @@
11 " netrw.vim: Handles file transfer and remote directory listing across a network
2-" Last Change: Aug 02, 2005
2+" Last Change: Aug 05, 2005
33 " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
4-" Version: 58b NOT RELEASED
4+" Version: 58e ASTRO-ONLY
55 " License: Vim License (see vim's :help license)
6+" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr.
7+" Permission is hereby granted to use and distribute this code,
8+" with or without modifications, provided that this copyright
9+" notice is copied with it. Like anything else that's free,
10+" netrw.vim is provided *as is* and comes with no
11+" warranty of any kind, either expressed or implied. In no
12+" event will the copyright holder be liable for any damages
13+" resulting from the use of this software.
614 "
715 " But be doers of the Word, and not only hearers, deluding your own selves
816 " (James 1:22 RSV)
@@ -14,7 +22,7 @@
1422 if exists("g:loaded_netrw") || &cp
1523 finish
1624 endif
17-let g:loaded_netrw = "v58b"
25+let g:loaded_netrw = "v58e"
1826 let loaded_explorer = 1
1927 let s:keepcpo = &cpo
2028 set cpo&vim
@@ -263,15 +271,17 @@
263271 " NetRestorePosn: restores the cursor and file position as saved by NetSavePosn() {{{1
264272 fun! <SID>NetRestorePosn()
265273 " call Dfunc("NetRestorePosn() winnr=".s:netrw_winnr." line=".s:netrw_line." col=".s:netrw_col." hline=".s:netrw_hline)
274+ let eikeep= &ei
275+ set ei=all
266276
267277 " restore window
268278 " call Decho("restore window: exe silent! ".s:netrw_winnr."wincmd w")
269279 exe "silent! ".s:netrw_winnr."wincmd w"
270- if v:shell_error == 0
271- " as suggested by Bram M: redraw on no error
272- " allows protocol error messages to remain visible
273- redraw!
274- endif
280+" if v:shell_error == 0
281+" " as suggested by Bram M: redraw on no error
282+" " allows protocol error messages to remain visible
283+" redraw!
284+" endif
275285
276286 " restore top-of-screen line
277287 " call Decho("restore topofscreen: exe norm! ".s:netrw_hline."G0z")
@@ -281,6 +291,7 @@
281291 " call Decho("restore posn: exe norm! ".s:netrw_line."G0".s:netrw_col."|")
282292 exe "norm! ".s:netrw_line."G0".s:netrw_col."\<bar>"
283293
294+ let &ei= eikeep
284295 " call Dret("NetRestorePosn")
285296 endfun
286297
@@ -354,7 +365,7 @@
354365 let ichoice = ichoice + 1
355366 if ichoice > a:0
356367 if !exists("g:netrw_quiet")
357- echoerr "***netrw*** Unbalanced string in filename '". wholechoice ."'"
368+ echohl Error | echo "***netrw*** Unbalanced string in filename '". wholechoice ."'" | echohl None
358369 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
359370 endif
360371 " call Dret("NetRead")
@@ -441,7 +452,7 @@
441452 if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
442453 let debugkeep= &debug
443454 set debug=msg
444- echoerr "***netrw*** ".getline(1)
455+ echohl Error | echo "***netrw*** ".getline(1) | echohl None
445456 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
446457 let &debug= debugkeep
447458 endif
@@ -487,7 +498,7 @@
487498 if getline(1) !~ "^$"
488499 " call Decho("error<".getline(1).">")
489500 if !exists("g:netrw_quiet")
490- echoerr "***netrw*** ".getline(1)
501+ echohl Error | echo "***netrw*** ".getline(1) | echohl None
491502 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
492503 endif
493504 endif
@@ -520,7 +531,7 @@
520531 " call Decho("read via http (method #5)")
521532 if g:netrw_http_cmd == ""
522533 if !exists("g:netrw_quiet")
523- echoerr "***netrw*** neither wget nor fetch command is available"
534+ echohl Error | echo "***netrw*** neither wget nor fetch command is available" | echohl None
524535 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
525536 endif
526537 exit
@@ -598,7 +609,7 @@
598609 elseif b:netrw_method == 8 " read with fetch
599610 if g:netrw_fetch_cmd == ""
600611 if !exists("g:netrw_quiet")
601- echoerr "***netrw*** fetch command not available"
612+ echohl Error | echo "***netrw*** fetch command not available" | echohl None
602613 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
603614 endif
604615 exit
@@ -805,7 +816,7 @@
805816 let ichoice = ichoice + 1
806817 if choice > a:0
807818 if !exists("g:netrw_quiet")
808- echoerr "***netrw*** Unbalanced string in filename '". wholechoice ."'"
819+ echohl Error | echo "***netrw*** Unbalanced string in filename '". wholechoice ."'" | echohl None
809820 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
810821 endif
811822 " call Dret("NetWrite")
@@ -876,7 +887,7 @@
876887 " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
877888 if getline(1) !~ "^$"
878889 if !exists("g:netrw_quiet")
879- echoerr "***netrw*** ".getline(1)
890+ echohl Error | echo "***netrw*** ".getline(1) | echohl None
880891 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
881892 endif
882893 let mod=1
@@ -916,7 +927,7 @@
916927 " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
917928 if getline(1) !~ "^$"
918929 if !exists("g:netrw_quiet")
919- echoerr "***netrw*** ".getline(1)
930+ echohl Error | echo "***netrw*** ".getline(1) | echohl None
920931 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
921932 endif
922933 let mod=1
@@ -945,7 +956,7 @@
945956 " http: NetWrite Method #5
946957 elseif b:netrw_method == 5
947958 if !exists("g:netrw_quiet")
948- echoerr "***netrw*** currently <netrw.vim> does not support writing using http:"
959+ echohl Error | echo "***netrw*** currently <netrw.vim> does not support writing using http:" | echohl None
949960 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
950961 endif
951962
@@ -1044,7 +1055,7 @@
10441055 " call Decho("b:netrw_method=".b:netrw_method)
10451056 if !executable("ftp")
10461057 if !exists("g:netrw_quiet")
1047- echoerr "***netrw*** this system doesn't support remote directory listing via ftp"
1058+ echohl Error | echo "***netrw*** this system doesn't support remote directory listing via ftp" | echohl None
10481059 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
10491060 endif
10501061 " call Dret("NetBrowse")
@@ -1052,9 +1063,10 @@
10521063 endif
10531064 elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ''
10541065 if !exists("g:netrw_quiet")
1055- echoerr "***netrw*** this system doesn't support remote directory listing via ssh"
1066+ echohl Error | echo "***netrw*** this system doesn't support remote directory listing via ssh" | echohl None
10561067 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
10571068 endif
1069+
10581070 " call Dret("NetBrowse")
10591071 return
10601072 endif
@@ -1068,7 +1080,7 @@
10681080 " call Decho("dirpat<".dirpat.">")
10691081 if dirname !~ dirpat
10701082 if !exists("g:netrw_quiet")
1071- echoerr "***netrw*** netrw doesn't understand your dirname<".dirname.">"
1083+ echohl Error | echo "***netrw*** netrw doesn't understand your dirname<".dirname.">" | echohl None
10721084 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
10731085 endif
10741086 " call Dret("NetBrowse : badly formatted dirname<".dirname.">")
@@ -1100,7 +1112,7 @@
11001112
11011113 " optionally sort by time (-t) or by size (-S)
11021114 if listcmd == "dir" && g:netrw_sort_by =~ "^[ts]"
1103- echoerr "***netrw*** windows' ftp doesn't support time/size sorts (get cygwin, set g:netrw_cygwin)"
1115+ echohl WarningMsg | echo "***netrw*** windows' ftp doesn't support time/size sorts (get cygwin, set g:netrw_cygwin)" | echohl None
11041116 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
11051117 else
11061118 if g:netrw_sort_by =~ "^t"
@@ -1140,7 +1152,8 @@
11401152 silent call s:NetRead(method."://".user.machine."/".path)
11411153 exe "silent doau BufReadPost ".fname
11421154 keepjumps 1d
1143- setlocal nomod
1155+
1156+ setlocal nonu nomod noma
11441157
11451158 " call Dret("NetBrowse : file<".fname.">")
11461159 return
@@ -1180,7 +1193,7 @@
11801193 " set up buffer-local mappings
11811194 " call Decho("set up buffer-local mappings")
11821195 nnoremap <buffer> <silent> <cr> :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
1183- nnoremap <buffer> <silent> <c-l> :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
1196+ nnoremap <buffer> <silent> <c-l> :call <SID>NetRefresh(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
11841197 nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'../'))<cr>
11851198 nnoremap <buffer> <silent> a :let g:netrw_hide=(g:netrw_hide+1)%3<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
11861199 nnoremap <buffer> <silent> b :<c-u>call <SID>NetBookmarkDir(0,expand("%"))<cr>
@@ -1279,26 +1292,25 @@
12791292 " use ssh to get remote file listing
12801293 " call Decho("use ssh to get remote file listing")
12811294 let shq= &shq? &shq : ( &sxq? &sxq : "'")
1282-" call Decho("exe silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq)
1295+" call Decho("exe silent r! ".listcmd." '".shq.escape(path,s:netrw_cd_escape).shq."'")
12831296 exe "silent r! ".listcmd." ".shq.escape(path,s:netrw_cd_escape).shq
1284-if !exists("g:junk")
1285- let g:junk=1
1286-else
1287- put ='testing'
1288- return
1289-endif
12901297 keepjumps 1d
12911298 " cleanup
12921299 if g:netrw_ftp_browse_reject != ""
12931300 exe "silent! g/".g:netrw_ssh_browse_reject."/keepjumps d"
12941301 endif
12951302 endif
1303+
12961304
12971305 " set up syntax highlighting
12981306 if has("syntax")
12991307 setlocal ft=netrwlist
1300- if !has("syntax_items")
1308+ if !exists("g:syntax_on") || !g:syntax_on
13011309 setlocal ft=
1310+ " Ugly workaround -- when syntax highlighting is off and laststatus==2,
1311+ " sometimes the laststatus highlight bleeds into the entire display.
1312+ " Only seems to happen with remote browsing. Weird.
1313+ redraw
13021314 endif
13031315 endif
13041316
@@ -1315,7 +1327,7 @@
13151327 if method == "ftp"
13161328 " cleanup
13171329 exe "keepjumps ".s:netrw_bannercnt
1318- while getline(".") =~ '^total\s\+\d\+$' || getline(".") =~ 'Trying\s\+\d\+.*$'
1330+ while getline(".") =~ g:netrw_ftp_browse_reject
13191331 keepjumps d
13201332 endwhile
13211333 " if there's no ../ listed, then put ./ and ../ in
@@ -1355,9 +1367,8 @@
13551367 endif
13561368 endif
13571369 exe "keepjumps ".s:netrw_bannercnt
1358- setlocal nomod
1359- setlocal noma
1360- setlocal nonu
1370+
1371+ setlocal nomod noma nonu
13611372
13621373 " call Dret("NetBrowse")
13631374 return
@@ -1497,7 +1508,7 @@
14971508 " call Decho("returned=".ret." errcode=".v:shell_error)
14981509
14991510 if v:shell_error != 0 && !exists("g:netrw_quiet")
1500- echoerr "***netrw*** unable to remove directory<".rmfile."> -- is it empty?"
1511+ echohl Error | echo "***netrw*** unable to remove directory<".rmfile."> -- is it empty?" | echohl None
15011512 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
15021513 endif
15031514 endif
@@ -1561,6 +1572,17 @@
15611572 endfun
15621573
15631574 " ---------------------------------------------------------------------
1575+" NetRefresh: {{{2
1576+fun! <SID>NetRefresh(dirname)
1577+" call Dfunc("NetRefresh(dirname<".a:dirname.">)")
1578+ set ma
1579+ %d
1580+ call <SID>NetBrowse(dirname)
1581+ redraw!
1582+" call Dret("NetRefresh")
1583+endfun
1584+
1585+" ---------------------------------------------------------------------
15641586 " NetBrowseX: allows users to write custom functions to operate on {{{2
15651587 " files given their extension. Passes 0=local, 1=remote
15661588 fun! <SID>NetBrowseX(fname,remote)
@@ -1580,10 +1602,8 @@
15801602 let fname= tempname().".".exten
15811603 " call Decho("create a local copy of <".a:fname."> as <".fname.">")
15821604 exe "keepjumps silent bot 1new ".a:fname
1583- let eikeep= &ei
1584- set ei=all bh=delete
1605+ set bh=delete
15851606 exe "w! ".fname
1586- let &ei= eikeep
15871607 q
15881608 endif
15891609 " call Decho("exten<".exten."> "."NetrwFileHandler_".exten."():exists=".exists("*NetrwFileHandler_".exten))
@@ -1627,10 +1647,8 @@
16271647 endif
16281648
16291649 if a:remote == 1
1630- let eikeep= &ei
1631- set ei=all bh=delete bt=nofile noswf
1650+ set bh=delete bt=nofile noswf
16321651 exe "norm! \<c-o>"
1633- let &ei= eikeep
16341652 redraw!
16351653 endif
16361654
@@ -1764,7 +1782,7 @@
17641782 if a:mode == 0
17651783 silent call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
17661784 else
1767- silent call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,"./"))
1785+ silent call s:LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,"./"))
17681786 endif
17691787
17701788 " call Dret("NetHideEdit")
@@ -1809,6 +1827,8 @@
18091827 let g:netrw_list_cmd = g:netrw_list_cmd." -l"
18101828 endif
18111829 setlocal ma
1830+
1831+ " clear buffer - this will cause NetBrowse/LocalBrowse to do a refresh
18121832 %d
18131833
18141834 " refresh the listing
@@ -1818,7 +1838,7 @@
18181838 silent call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,"./"))
18191839 endif
18201840
1821- call s:NetRestorePosn()
1841+" call s:NetRestorePosn()
18221842 " call Dret("NetLongList : g:netrw_longlist=".g:netrw_longlist)
18231843 endfun
18241844
@@ -1866,7 +1886,7 @@
18661886 " call Decho("fullnewdir<".fullnewdir.">")
18671887 if isdirectory(fullnewdir)
18681888 if !exists("g:netrw_quiet")
1869- echoerr "***netrw*** <".newdirname."> is already a directory!"
1889+ echohl WarningMsg | echo "***netrw*** <".newdirname."> is already a directory!" | echohl None
18701890 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
18711891 endif
18721892 " call Dret("NetMakeDir : directory<".newdirname."> exists previously")
@@ -1874,7 +1894,7 @@
18741894 endif
18751895 if filereadable(fullnewdir)
18761896 if !exists("g:netrw_quiet")
1877- echoerr "***netrw*** <".newdirname."> is already a file!"
1897+ echohl WarningMsg | echo "***netrw*** <".newdirname."> is already a file!" | echohl None
18781898 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
18791899 endif
18801900 " call Dret("NetMakeDir : file<".newdirname."> exists previously")
@@ -1900,11 +1920,12 @@
19001920 let linenum= line(".")
19011921 norm! H0
19021922 let hline = line(".")
1923+ set ma|norm! 2D
19031924 call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,'./'))
19041925 exe "norm! ".hline."G0z\<CR>"
19051926 exe linenum
19061927 elseif !exists("g:netrw_quiet")
1907- echoerr "***netrw*** unable to make directory<".newdirname.">"
1928+ echohl Error | echo "***netrw*** unable to make directory<".newdirname.">" | echohl None
19081929 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
19091930 endif
19101931 redraw!
@@ -1924,7 +1945,7 @@
19241945 exe "norm! ".hline."G0z\<CR>"
19251946 exe linenum
19261947 elseif !exists("g:netrw_quiet")
1927- echoerr "***netrw*** unable to make directory<".newdirname.">"
1948+ echohl Error | echo "***netrw*** unable to make directory<".newdirname.">" | echohl None
19281949 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
19291950 endif
19301951 redraw!
@@ -1935,8 +1956,12 @@
19351956
19361957 " ---------------------------------------------------------------------
19371958 " NetBookmarkDir: {{{2
1938-" 0: bookmark the current directory
1939-" 1: change to the bookmarked directory
1959+" 0: (user: <b>) bookmark current directory
1960+" 1: (user: <B>) change to the bookmarked directory
1961+" 2: (user: <q>) list bookmarks
1962+" 3: (LocalBrowse) record current directory history
1963+" 4: (user: <u>) go up (previous) bookmark
1964+" 5: (user: <U>) go down (next) bookmark
19401965 fun! <SID>NetBookmarkDir(chg,curdir)
19411966 " call Dfunc("NetBookmarkDir(chg=".a:chg." curdir<".a:curdir.">) cnt=".v:count)
19421967
@@ -1958,8 +1983,8 @@
19581983 endif
19591984
19601985 elseif a:chg == 2
1986+ " list user's bookmarks
19611987 if exists("g:NETRW_BOOKMARKMAX")
1962- " list user's bookmarks
19631988 " call Decho("list bookmarks [0,".g:NETRW_BOOKMARKMAX."]")
19641989 let cnt= 0
19651990 while cnt <= g:NETRW_BOOKMARKMAX
@@ -1990,10 +2015,12 @@
19902015 endwhile
19912016
19922017 elseif a:chg == 3
1993- " saves most recently visited directories
1994- let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
1995- let g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}= substitute(a:curdir,'[/\\]$','','e')
1996-" call Decho("save dirhist#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
2018+ " saves most recently visited directories (when they differ)
2019+ if !exists("g:NETRW_DIRHIST_0") || g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT} != a:curdir
2020+ let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
2021+ let g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}= substitute(a:curdir,'[/\\]$','','e')
2022+" call Decho("save dirhist#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
2023+ endif
19972024
19982025 elseif a:chg == 4
19992026 " u: change to the previous directory stored on the history list
@@ -2042,12 +2069,12 @@
20422069
20432070 " unfortunate interaction -- when putting debugging calls
20442071 " above one can no longer enter the DBG buffer.
2045-" call Dfunc("LocalBrowse(dirname<".a:dirname.">) buf#".bufnr("%")." winnr=".winnr())
2072+" call Dfunc("LocalBrowse(dirname<".a:dirname.">) buf#".bufnr("%")." winnr=".winnr()." sortby=".g:netrw_sort_by)
20462073 " call Dredir("ls!")
20472074
20482075 if v:version < 603
20492076 if !exists("g:netrw_quiet")
2050- echoerr "***netrw*** vim version<".v:version."> too old for browsing with netrw"
2077+ echohl Error | echo "***netrw*** vim version<".v:version."> too old for browsing with netrw" | echohl None
20512078 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
20522079 endif
20532080 " call Dret("LocalBrowse : vim version<".v:version."> too old")
@@ -2087,19 +2114,23 @@
20872114 endif
20882115 " call Decho("enew buffer")
20892116 else
2090- let eikeep= &ei
2091- set ei=BufEnter
20922117 if v:version < 700
20932118 exe "b ".bufnum
20942119 else
20952120 exe "keepalt b ".bufnum
20962121 endif
2097- let &ei= eikeep
2098- if getline(2) =~ '^" Directory Listing '
2099-" call Dret("LocalBrowse : reusing buffer#".bufnum."<".a:dirname.">")
2100- return
2122+ if exists("s:last_sort_by") && g:netrw_sort_by == s:last_sort_by
2123+ if getline(2) =~ '^" Directory Listing '
2124+ if !g:netrw_keepdir
2125+" call Decho("change directory: cd ".b:netrw_curdir)
2126+ exe 'cd '.b:netrw_curdir
2127+ endif
2128+" call Dret("LocalBrowse : reusing buffer#".bufnum."<".a:dirname.">")
2129+ return
2130+ endif
21012131 endif
21022132 endif
2133+ let s:last_sort_by= g:netrw_sort_by
21032134
21042135 " get the new directory name
21052136 let b:netrw_curdir= substitute(a:dirname,'\\','/','ge')
@@ -2119,6 +2150,7 @@
21192150
21202151 " make this buffer modifiable and hidden
21212152 setlocal ma hidden nonu
2153+ keepalt silent! %d
21222154
21232155 " ---------------------------
21242156 " Perform Directory Listing:
@@ -2129,9 +2161,9 @@
21292161 " set up all the maps
21302162 " call Decho("Setting up local browser maps")
21312163 nnoremap <buffer> <silent> <cr> :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
2132- nnoremap <buffer> <silent> <c-l> :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
2164+ nnoremap <buffer> <silent> <c-l> :set ma<bar>%d<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>redraw!<cr>
21332165 nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'../'))<cr>
2134- nnoremap <buffer> <silent> a :let g:netrw_hide=(g:netrw_hide+1)%3<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
2166+ nnoremap <buffer> <silent> a :let g:netrw_hide=(g:netrw_hide+1)%3<bar>exe "norm! 0"<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<cr>
21352167 nnoremap <buffer> <silent> b :<c-u>call <SID>NetBookmarkDir(0,b:netrw_curdir)<cr>
21362168 nnoremap <buffer> <silent> B :<c-u>call <SID>NetBookmarkDir(1,b:netrw_curdir)<cr>
21372169 nnoremap <buffer> <silent> c :exe "cd ".b:netrw_curdir<cr>
@@ -2148,7 +2180,9 @@
21482180 nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
21492181 nnoremap <buffer> <silent> v :exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
21502182 nnoremap <buffer> <silent> x :exe "norm! 0"<bar>call <SID>NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)<cr>
2151- nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
2183+ nnoremap <buffer> <silent> <2-leftmouse> :exe "norm! 0"<bar>call <SID>LocalRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
2184+ nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
2185+ nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
21522186 exe 'nnoremap <buffer> <silent> <del> :exe "norm! 0"<bar>call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
21532187 exe 'vnoremap <buffer> <silent> <del> :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
21542188 exe 'nnoremap <buffer> <silent> D :exe "norm! 0"<bar>call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
@@ -2208,7 +2242,7 @@
22082242 " set up syntax highlighting
22092243 if has("syntax")
22102244 setlocal ft=netrwlist
2211- if !has("syntax_items")
2245+ if !exists("g:syntax_on") || !g:syntax_on
22122246 setlocal ft=
22132247 endif
22142248 endif
@@ -2305,11 +2339,11 @@
23052339 if isdirectory(filename)
23062340 let pfile= filename."/"
23072341 endif
2308- let pfile= substitute(pfile,'^/','','e')
23092342 if pfile =~ '//$'
23102343 let pfile= substitute(pfile,'//$','/','e')
23112344 endif
23122345 let pfile= strpart(pfile,dirnamelen)
2346+ let pfile= substitute(pfile,'^/','','e')
23132347 " call Decho(" ")
23142348 " call Decho("filename<".filename.">")
23152349 " call Decho("pfile <".pfile.">")
@@ -2401,7 +2435,7 @@
24012435 endfun
24022436
24032437 " ---------------------------------------------------------------------
2404-" LocalBrowseRm:
2438+" LocalBrowseRm: {{{2
24052439 fun! <SID>LocalBrowseRm(path) range
24062440 " call Dfunc("LocalBrowseRm(path<".a:path.">)")
24072441 " call Decho("firstline=".a:firstline." lastline=".a:lastline)
@@ -2480,11 +2514,11 @@
24802514 " call Decho("3rd attempt to remove directory<".rmfile.">")
24812515 call system("rm ".rmfile)
24822516 if v:shell_error != 0 && !exists("g:netrw_quiet")
2483- echoerr "***netrw*** unable to remove directory<".rmfile."> -- is it empty?"
2517+ echohl Error | echo "***netrw*** unable to remove directory<".rmfile."> -- is it empty?" | echohl None
24842518 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
24852519 endif
24862520 elseif !exists("g:netrw_quiet")
2487- echoerr "***netrw*** unable to remove directory<".rmfile."> -- is it empty?"
2521+ echohl Error | echo "***netrw*** unable to remove directory<".rmfile."> -- is it empty?" | echohl None
24882522 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
24892523 endif
24902524 endif
@@ -2501,7 +2535,7 @@
25012535 " refresh the directory
25022536 let curline= line(".")
25032537 " call Decho("refresh the directory")
2504- call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))
2538+ call s:LocalRefresh(s:LocalBrowseChgDir(b:netrw_curdir,'./'))
25052539 exe curline
25062540
25072541 " call Dret("LocalBrowseRm")
@@ -2531,7 +2565,7 @@
25312565 endif
25322566
25332567 norm! 0
2534- let oldname= a:path.curword
2568+ let oldname= a:path."/".curword
25352569 " call Decho("oldname<".oldname.">")
25362570
25372571 call inputsave()
@@ -2547,7 +2581,7 @@
25472581 " refresh the directory
25482582 let curline= line(".")
25492583 " call Decho("refresh the directory listing")
2550- call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))
2584+ call s:LocalRefresh(s:LocalBrowseChgDir(b:netrw_curdir,'./'))
25512585 exe "keepjumps ".curline
25522586 " call Dret("LocalBrowseRename")
25532587 endfun
@@ -2560,17 +2594,28 @@
25602594 if !isdirectory(a:path)
25612595 exe "pedit ".a:path
25622596 elseif !exists("g:netrw_quiet")
2563- echoerr "***netrw*** sorry, cannot preview a directory such as <".a:path.">"
2597+ echohl WarningMsg | echo "***netrw*** sorry, cannot preview a directory such as <".a:path.">" | echohl None
25642598 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
25652599 endif
25662600 elseif !exists("g:netrw_quiet")
2567- echoerr "***netrw*** sorry, to preview your vim needs the quickfix feature compiled in"
2601+ echohl WarningMsg | echo "***netrw*** sorry, to preview your vim needs the quickfix feature compiled in" | echohl None
25682602 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
25692603 endif
25702604 " call Dret("LocalPreview")
25712605 endfun
25722606
25732607 " ---------------------------------------------------------------------
2608+" LocalRefresh: {{{2
2609+fun! <SID>LocalRefresh(dirname)
2610+" call Dfunc("LocalRefresh(dirname<".a:dirname.">)")
2611+ set ma
2612+ %d
2613+ call <SID>LocalBrowse(a:dirname)
2614+ redraw!
2615+" call Dret("LocalRefresh")
2616+endfun
2617+
2618+" ---------------------------------------------------------------------
25742619 " Explore: launch the local browser in the directory of the current file {{{2
25752620 " dosplit==0: the window will be split iff the current file has
25762621 " been modified
@@ -2602,7 +2647,7 @@
26022647 " call Decho("calling LocalBrowse(newdir<".newdir.">)")
26032648 call s:LocalBrowse(newdir)
26042649
2605- elseif a:1 =~ '\*\*' || a:indx < 0
2650+ elseif a:1 =~ '\*\*/' || a:indx < 0
26062651
26072652 if has("path_extra")
26082653 if !exists("s:indx")
@@ -2617,13 +2662,20 @@
26172662 let s:indx = 0
26182663 let s:explorelist = split(expand(b:netrw_curdir."/".a:1),'\n')
26192664 let s:listlen = len(s:explorelist)
2665+ if s:listlen == 1 && s:explorelist[0] =~ '\*\*\/'
2666+ echohl WarningMsg | echo "***netrw*** no files matched" | echohl None
2667+ call inputsave()|call input("Press <cr> to continue")|call inputrestore()
2668+" call Dret("Explore")
2669+ return
2670+ endif
26202671 endif
26212672 let s:indx = indx
26222673 " call Decho("explorelist<".join(s:explorelist,',')."> len=".s:listlen)
26232674
26242675 " sanity check
2625- if indx >= s:listlen
2626- echoerr "***netrw*** no more directories with matching files"
2676+ if indx >= s:listlen || indx < 0
2677+ let indx= (indx < 0)? 0 : ( s:listlen - 1 )
2678+ echohl WarningMsg | echo "***netrw*** no more files match Explore pattern" | echohl None
26272679 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
26282680 " call Dret("Explore")
26292681 return
@@ -2639,9 +2691,9 @@
26392691
26402692 else
26412693 if v:version < 700
2642- echoerr "***netrw*** you need vim version 7.0 or later for Exploring with **!"
2694+ echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for Exploring with **!" | echohl None
26432695 elseif !exists("g:netrw_quiet")
2644- echoerr "***netrw*** your vim needs the path_extra feature for Exploring with **!"
2696+ echohl WarningMsg | echo "***netrw*** your vim needs the +path_extra feature for Exploring with **!" | echohl None | echohl None
26452697 endif
26462698 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
26472699 endif
@@ -2847,7 +2899,7 @@
28472899
28482900 else
28492901 if !exists("g:netrw_quiet")
2850- echoerr "***netrw*** cannot determine method"
2902+ echohl Error | echo "***netrw*** cannot determine method" | echohl None
28512903 call inputsave()|call input("Press <cr> to continue")|call inputrestore()
28522904 endif
28532905 let b:netrw_method = -1
diff -r 8411e13e6dcb -r 3b705e71c7b0 runtime/syntax/sh.vim
--- a/runtime/syntax/sh.vim Fri Aug 05 21:27:51 2005 +0000
+++ b/runtime/syntax/sh.vim Fri Aug 05 21:35:02 2005 +0000
@@ -2,8 +2,8 @@
22 " Language: shell (sh) Korn shell (ksh) bash (sh)
33 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
44 " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
5-" Last Change: Mar 24, 2005
6-" Version: 74
5+" Last Change: Jul 01, 2005
6+" Version: 75
77 " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
88 "
99 " Using the following VIM variables: {{{1
@@ -71,6 +71,7 @@
7171 syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shSpecial
7272 syn cluster shColonList contains=@shCaseList
7373 syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shNumber,shOperator,shPosnParm,shSpecial,shExSingleQuote,shSingleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest
74+syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial
7475 syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shSpecial,shPosnParm
7576 syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError
7677 syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError
@@ -154,7 +155,7 @@
154155 " ======
155156 syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
156157 syn region shIf transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen
157-syn region shFor matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen
158+syn region shFor matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
158159 if exists("b:is_kornshell") || exists("b:is_bash")
159160 syn cluster shCaseList add=shRepeat
160161 syn region shRepeat matchgroup=shLoop start="\<while\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace
@@ -164,6 +165,8 @@
164165 syn region shRepeat matchgroup=shLoop start="\<while\>" end="\<do\>"me=e-2 contains=@shLoopList
165166 syn region shRepeat matchgroup=shLoop start="\<until\>" end="\<do\>"me=e-2 contains=@shLoopList
166167 endif
168+syn region shCurlyIn contained matchgroup=Delimiter start="{" end="}" contains=@shCurlyList
169+syn match shComma contained ","
167170
168171 " Case: case...esac {{{1
169172 " ====
diff -r 8411e13e6dcb -r 3b705e71c7b0 runtime/syntax/vim.vim
--- a/runtime/syntax/vim.vim Fri Aug 05 21:27:51 2005 +0000
+++ b/runtime/syntax/vim.vim Fri Aug 05 21:35:02 2005 +0000
@@ -1,8 +1,8 @@
11 " Vim syntax file
22 " Language: Vim 7.0 script
33 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
4-" Last Change: March 21, 2005
5-" Version: 7.0-10
4+" Last Change: August 02, 2005
5+" Version: 7.0-11
66 " Automatically generated keyword lists: {{{1
77
88 " Quit when a syntax file was already loaded {{{2
@@ -16,11 +16,11 @@
1616 syn cluster vimCommentGroup contains=vimTodo,@Spell
1717
1818 " regular vim commands {{{2
19-syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] lan[guage] la[st] lc[d] lch[dir] le[ft] lefta[bove] l[ist] lm[ap] lmapc[lear] ln[oremap] lo[adview] loc[kmarks] lockv[ar] ls lu[nmap] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] nbkey new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] prof[ile] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] sandbox sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st] sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] so[urce] sp[lit] spr[evious] sre[wind] sta[g] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unlo[ckvar] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] v[global] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] y[ank]
19+syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cad[dfile] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cex[pr] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis diffu[pdate] dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] lan[guage] la[st] lc[d] lch[dir] le[ft] lefta[bove] l[ist] lm[ap] lmapc[lear] ln[oremap] lo[adview] loc[kmarks] lockv[ar] ls lu[nmap] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mksp[ell] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] nbkey new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] profd[el] prof[ile] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] san[dbox] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st] sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] sor[t] so[urce] spelld[ump] spe[llgood] spellr[epall] spellw[rong] sp[lit] spr[evious] sre[wind] sta[g] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unlo[ckvar] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] v[global] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] y[ank]
2020 syn match vimCommand contained "\<z[-+^.=]"
2121
2222 " vimOptions are caught only when contained in a vimSet {{{2
23-syn keyword vimOption contained : acd ai akm al aleph allowrevins altkeymap ambiwidth ambw anti antialias ar arab arabic arabicshape ari arshape autochdir autoindent autoread autowrite autowriteall aw awa background backspace backup backupcopy backupdir backupext backupskip balloondelay ballooneval balloonexpr bdir bdlay beval bex bexpr bg bh bin binary biosk bioskey bk bkc bl bomb breakat brk browsedir bs bsdir bsk bt bufhidden buflisted buftype casemap cb ccv cd cdpath cedit cf cfu ch charconvert ci cin cindent cink cinkeys cino cinoptions cinw cinwords clipboard cmdheight cmdwinheight cmp cms co columns com comments commentstring compatible complete completefunc confirm consk conskey copyindent cp cpo cpoptions cpt cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder cscopeverbose cspc csprg csqf cst csto csverb cwh debug deco def define delcombine dex dg dict dictionary diff diffexpr diffopt digraph dip dir directory display dy ea ead eadirection eb ed edcompatible ef efm ei ek enc encoding endofline eol ep equalalways equalprg errorbells errorfile errorformat esckeys et eventignore ex expandtab exrc fcl fcs fdc fde fdi fdl fdls fdm fdn fdo fdt fen fenc fencs ff ffs fileencoding fileencodings fileformat fileformats filetype fillchars fk fkmap flp fml fmr fo foldclose foldcolumn foldenable foldexpr foldignore foldlevel foldlevelstart foldmarker foldmethod foldminlines foldnestmax foldopen foldtext formatlistpat formatoptions formatprg fp fs fsync ft gcr gd gdefault gfm gfn gfs gfw ghr go gp grepformat grepprg guicursor guifont guifontset guifontwide guiheadroom guioptions guipty helpfile helpheight helplang hf hh hi hid hidden highlight history hk hkmap hkmapp hkp hl hlg hls hlsearch ic icon iconstring ignorecase im imactivatekey imak imc imcmdline imd imdisable imi iminsert ims imsearch inc include includeexpr incsearch inde indentexpr indentkeys indk inex inf infercase insertmode is isf isfname isi isident isk iskeyword isp isprint joinspaces js key keymap keymodel keywordprg km kmp kp langmap langmenu laststatus lazyredraw lbr lcs linebreak lines linespace lisp lispwords list listchars lm lmap loadplugins lpl ls lsp lw lz ma magic makeef makeprg mat matchpairs matchtime maxfuncdepth maxmapdepth maxmem maxmempattern maxmemtot mef menuitems mfd mh mis ml mls mm mmd mmp mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps mzq mzquantum nf nrformats nu number numberwidth nuw oft osfiletype pa para paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn pheader pi pm pmbcs pmbfn popt preserveindent previewheight previewwindow printdevice printencoding printexpr printfont printheader printmbcharset printmbfont printoptions prompt pt pvh pvw qe quoteescape readonly remap report restorescreen revins ri rightleft rightleftcmd rl rlc ro rs rtp ru ruf ruler rulerformat runtimepath sb sbo sbr sc scb scr scroll scrollbind scrolljump scrolloff scrollopt scs sect sections secure sel selection selectmode sessionoptions sft sh shcf shell shellcmdflag shellpipe shellquote shellredir shellslash shelltemp shelltype shellxquote shiftround shiftwidth shm shortmess shortname showbreak showcmd showfulltag showmatch showmode shq si sidescroll sidescrolloff siso sj slm sm smartcase smartindent smarttab smd sn so softtabstop sol sp spell spelllang spl splitbelow splitright spr sr srr ss ssl ssop st sta startofline statusline stl stmp sts su sua suffixes suffixesadd sw swapfile swapsync swb swf switchbuf sws sxq syn syntax ta tabstop tag tagbsearch taglength tagrelative tags tagstack tb tbi tbidi tbis tbs tenc term termbidi termencoding terse textauto textmode textwidth tf tgst thesaurus tildeop timeout timeoutlen title titlelen titleold titlestring tl tm to toolbar toolbariconsize top tr ts tsl tsr ttimeout ttimeoutlen ttm tty ttybuiltin ttyfast ttym ttymouse ttyscroll ttytype tw tx uc ul undolevels updatecount updatetime ut vb vbs vdir ve verbose vi viewdir viewoptions viminfo virtualedit visualbell vop wa wak warn wb wc wcm wd weirdinvert wfh wh whichwrap wi wig wildchar wildcharm wildignore wildmenu wildmode wildoptions wim winaltkeys window winfixheight winheight winminheight winminwidth winwidth wiv wiw wm wmh wmnu wmw wop wrap wrapmargin wrapscan write writeany writebackup writedelay ws ww
23+syn keyword vimOption contained : acd ai akm al aleph allowrevins altkeymap ambiwidth ambw anti antialias ar arab arabic arabicshape ari arshape autochdir autoindent autoread autowrite autowriteall aw awa background backspace backup backupcopy backupdir backupext backupskip balloondelay ballooneval balloonexpr bdir bdlay beval bex bexpr bg bh bin binary biosk bioskey bk bkc bl bomb breakat brk browsedir bs bsdir bsk bt bufhidden buflisted buftype casemap cb ccv cd cdpath cedit cf cfu ch charconvert ci cin cindent cink cinkeys cino cinoptions cinw cinwords clipboard cmdheight cmdwinheight cmp cms co columns com comments commentstring compatible complete completefunc confirm consk conskey copyindent cp cpo cpoptions cpt cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder cscopeverbose cspc csprg csqf cst csto csverb cwh debug deco def define delcombine dex dg dict dictionary diff diffexpr diffopt digraph dip dir directory display dy ea ead eadirection eb ed edcompatible ef efm ei ek enc encoding endofline eol ep equalalways equalprg errorbells errorfile errorformat esckeys et eventignore ex expandtab exrc fcl fcs fdc fde fdi fdl fdls fdm fdn fdo fdt fen fenc fencs ff ffs fileencoding fileencodings fileformat fileformats filetype fillchars fk fkmap flp fml fmr fo foldclose foldcolumn foldenable foldexpr foldignore foldlevel foldlevelstart foldmarker foldmethod foldminlines foldnestmax foldopen foldtext formatlistpat formatoptions formatprg fp fs fsync ft gcr gd gdefault gfm gfn gfs gfw ghr go gp grepformat grepprg guicursor guifont guifontset guifontwide guiheadroom guioptions guipty helpfile helpheight helplang hf hh hi hid hidden highlight history hk hkmap hkmapp hkp hl hlg hls hlsearch ic icon iconstring ignorecase im imactivatekey imak imc imcmdline imd imdisable imi iminsert ims imsearch inc include includeexpr incsearch inde indentexpr indentkeys indk inex inf infercase insertmode is isf isfname isi isident isk iskeyword isp isprint joinspaces js key keymap keymodel keywordprg km kmp kp langmap langmenu laststatus lazyredraw lbr lcs linebreak lines linespace lisp lispwords list listchars lm lmap loadplugins lpl ls lsp lw lz ma magic makeef makeprg mat matchpairs matchtime maxfuncdepth maxmapdepth maxmem maxmempattern maxmemtot mef menuitems mfd mh mis ml mls mm mmd mmp mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps mzq mzquantum nf nrformats nu number numberwidth nuw oft osfiletype pa para paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn pheader pi pm pmbcs pmbfn popt preserveindent previewheight previewwindow printdevice printencoding printexpr printfont printheader printmbcharset printmbfont printoptions prompt pt pvh pvw qe quoteescape readonly remap report restorescreen revins ri rightleft rightleftcmd rl rlc ro rs rtp ru ruf ruler rulerformat runtimepath sb sbo sbr sc scb scr scroll scrollbind scrolljump scrolloff scrollopt scs sect sections secure sel selection selectmode sessionoptions sft sh shcf shell shellcmdflag shellpipe shellquote shellredir shellslash shelltemp shelltype shellxquote shiftround shiftwidth shm shortmess shortname showbreak showcmd showfulltag showmatch showmode shq si sidescroll sidescrolloff siso sj slm sm smartcase smartindent smarttab smc smd sn so softtabstop sol sp spc spell spellcapcheck spellfile spelllang spellsuggest spf spl splitbelow splitright spr sps sr srr ss ssl ssop st sta startofline statusline stl stmp sts su sua suffixes suffixesadd sw swapfile swapsync swb swf switchbuf sws sxq syn synmaxcol syntax ta tabstop tag tagbsearch taglength tagrelative tags tagstack tb tbi tbidi tbis tbs tenc term termbidi termencoding terse textauto textmode textwidth tf tgst thesaurus tildeop timeout timeoutlen title titlelen titleold titlestring tl tm to toolbar toolbariconsize top tr ts tsl tsr ttimeout ttimeoutlen ttm tty ttybuiltin ttyfast ttym ttymouse ttyscroll ttytype tw tx uc ul undolevels updatecount updatetime ut vb vbs vdir ve verbose verbosefile vfile vi viewdir viewoptions viminfo virtualedit visualbell vop wa wak warn wb wc wcm wd weirdinvert wfh wh whichwrap wi wig wildchar wildcharm wildignore wildmenu wildmode wildoptions wim winaltkeys window winfixheight winheight winminheight winminwidth winwidth wiv wiw wm wmh wmnu wmw wop wrap wrapmargin wrapscan write writeany writebackup writedelay ws ww
2424
2525 " vimOptions: These are the turn-off setting variants {{{2
2626 syn keyword vimOption contained noacd noai noakm noallowrevins noaltkeymap noanti noantialias noar noarab noarabic noarabicshape noari noarshape noautochdir noautoindent noautoread noautowrite noautowriteall noaw noawa nobackup noballooneval nobeval nobin nobinary nobiosk nobioskey nobk nobl nobomb nobuflisted nocf noci nocin nocindent nocompatible noconfirm noconsk noconskey nocopyindent nocp nocscopetag nocscopeverbose nocst nocsverb nodeco nodelcombine nodg nodiff nodigraph nodisable noea noeb noed noedcompatible noek noendofline noeol noequalalways noerrorbells noesckeys noet noex noexpandtab noexrc nofen nofk nofkmap nofoldenable nogd nogdefault noguipty nohid nohidden nohk nohkmap nohkmapp nohkp nohls nohlsearch noic noicon noignorecase noim noimc noimcmdline noimd noincsearch noinf noinfercase noinsertmode nois nojoinspaces nojs nolazyredraw nolbr nolinebreak nolisp nolist noloadplugins nolpl nolz noma nomagic nomh noml nomod nomodeline nomodifiable nomodified nomore nomousef nomousefocus nomousehide nonu nonumber nopaste nopi nopreserveindent nopreviewwindow noprompt nopvw noreadonly noremap norestorescreen norevins nori norightleft norightleftcmd norl norlc noro nors noru noruler nosb nosc noscb noscrollbind noscs nosecure nosft noshellslash noshelltemp noshiftround noshortname noshowcmd noshowfulltag noshowmatch noshowmode nosi nosm nosmartcase nosmartindent nosmarttab nosmd nosn nosol nospell nosplitbelow nosplitright nospr nosr nossl nosta nostartofline nostmp noswapfile noswf nota notagbsearch notagrelative notagstack notbi notbidi notbs notermbidi noterse notextauto notextmode notf notgst notildeop notimeout notitle noto notop notr nottimeout nottybuiltin nottyfast notx novb novisualbell nowa nowarn nowb noweirdinvert nowfh nowildmenu nowinfixheight nowiv nowmnu nowrap nowrapscan nowrite nowriteany nowritebackup nows
@@ -44,18 +44,18 @@
4444
4545 " AutoBuf Events {{{2
4646 syn case ignore
47-syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CursorHold E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter InsertChange InsertEnter InsertLeave QuickFixCmdPost QuickFixCmdPre RemoteReply StdinReadPost StdinReadPre Syntax TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave
47+syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CursorHold E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter InsertChange InsertEnter InsertLeave MenuPopup QuickFixCmdPost QuickFixCmdPre RemoteReply StdinReadPost StdinReadPre Syntax TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave
4848
4949 " Highlight commonly used Groupnames {{{2
5050 syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
5151
5252 " Default highlighting groups {{{2
53-syn keyword vimHLGroup contained Cursor CursorIM DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr Menu ModeMsg MoreMsg NonText Normal Question Scrollbar Search SignColumn SpecialKey SpellBad SpellLocal SpellRare StatusLine StatusLineNC Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu
53+syn keyword vimHLGroup contained Cursor CursorIM DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr Menu ModeMsg MoreMsg NonText Normal Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu
5454 syn match vimHLGroup contained "Conceal"
5555 syn case match
5656
5757 " Function Names {{{2
58-syn keyword vimFuncName contained add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call char2nr cindent col confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty errorlist escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function get getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfontname getfperm getfsize getftime getftype getline getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputrestore inputsave inputsecret insert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matchend matchlist matchstr max min mkdir mode nextnonblank nr2char prevnonblank range readfile remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchpair server2client serverlist setbufvar setcmdpos setline setreg setwinvar simplify sort split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system taglist tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth writefile soundfold spellsuggest spellbadword
58+syn keyword vimFuncName contained add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call char2nr cindent col confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function garbagecollect get getbufline getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfontname getfperm getfsize getftime getftype getline getqflist getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputrestore inputsave inputsecret insert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matchend matchlist matchstr max min mkdir mode nextnonblank nr2char prevnonblank printf range readfile remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchpair server2client serverlist setbufvar setcmdpos setline setqflist setreg setwinvar simplify sort soundfold spellbadword spellsuggest split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system taglist tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth writefile
5959
6060 "--- syntax above generated by mkvimvim ---
6161 " Special Vim Highlighting (not automatic) {{{1
diff -r 8411e13e6dcb -r 3b705e71c7b0 src/edit.c
--- a/src/edit.c Fri Aug 05 21:27:51 2005 +0000
+++ b/src/edit.c Fri Aug 05 21:35:02 2005 +0000
@@ -34,8 +34,6 @@
3434 #define CTRL_X_OCCULT 13
3535 #define CTRL_X_LOCAL_MSG 14 /* only used in "ctrl_x_msgs" */
3636
37-#define CHECK_KEYS_TIME 30
38-
3937 #define CTRL_X_MSG(i) ctrl_x_msgs[(i) & ~CTRL_X_WANT_IDENT]
4038
4139 static char *ctrl_x_msgs[] =
@@ -62,18 +60,18 @@
6260 /*
6361 * Structure used to store one match for insert completion.
6462 */
63+typedef struct Completion compl_T;
6564 struct Completion
6665 {
67- struct Completion *next;
68- struct Completion *prev;
69- char_u *str; /* matched text */
70- char_u *fname; /* file containing the match */
71- int original; /* ORIGINAL_TEXT, CONT_S_IPOS or FREE_FNAME */
72- int number; /* sequence number */
66+ compl_T *cp_next;
67+ compl_T *cp_prev;
68+ char_u *cp_str; /* matched text */
69+ char_u *cp_fname; /* file containing the match */
70+ int cp_flags; /* ORIGINAL_TEXT, CONT_S_IPOS or FREE_FNAME */
71+ int cp_number; /* sequence number */
7372 };
7473
75-/* the original text when the expansion begun */
76-#define ORIGINAL_TEXT (1)
74+#define ORIGINAL_TEXT (1) /* the original text when the expansion begun */
7775 #define FREE_FNAME (2)
7876
7977 /*
@@ -83,31 +81,30 @@
8381 * "compl_shown_match" is different from compl_curr_match during
8482 * ins_compl_get_exp().
8583 */
86-static struct Completion *compl_first_match = NULL;
87-static struct Completion *compl_curr_match = NULL;
88-static struct Completion *compl_shown_match = NULL;
84+static compl_T *compl_first_match = NULL;
85+static compl_T *compl_curr_match = NULL;
86+static compl_T *compl_shown_match = NULL;
8987
9088 /* When the first completion is done "compl_started" is set. When it's
9189 * FALSE the word to be completed must be located. */
9290 static int compl_started = FALSE;
9391
94-static int compl_matches = 0;
95-static char_u *compl_pattern = NULL;
96-static int compl_direction = FORWARD;
97-static int compl_shows_dir = FORWARD;
98-static int compl_pending = FALSE;
99-static pos_T compl_startpos;
100-static colnr_T compl_col = 0; /* column where the text starts
101- that is being completed */
102-static int save_sm = -1;
103-static char_u *compl_orig_text = NULL; /* text as it was before
104- completion started */
105-static int compl_cont_mode = 0;
106-static expand_T compl_xp;
92+static int compl_matches = 0;
93+static char_u *compl_pattern = NULL;
94+static int compl_direction = FORWARD;
95+static int compl_shows_dir = FORWARD;
96+static int compl_pending = FALSE;
97+static pos_T compl_startpos;
98+static colnr_T compl_col = 0; /* column where the text starts
99+ * that is being completed */
100+static int save_sm = -1;
101+static char_u *compl_orig_text = NULL; /* text as it was before
102+ * completion started */
103+static int compl_cont_mode = 0;
104+static expand_T compl_xp;
107105
108106 static void ins_ctrl_x __ARGS((void));
109107 static int has_compl_option __ARGS((int dict_opt));
110-static int ins_compl_add __ARGS((char_u *str, int len, char_u *, int dir, int reuse));
111108 static void ins_compl_add_matches __ARGS((int num_matches, char_u **matches, int dir));
112109 static int ins_compl_make_cyclic __ARGS((void));
113110 static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int dir, int flags, int thesaurus));
@@ -657,7 +654,8 @@
657654 #ifdef FEAT_INS_EXPAND
658655 /* Prepare for or stop CTRL-X mode. This doesn't do completion, but
659656 * it does fix up the text when finishing completion. */
660- ins_compl_prep(c);
657+ if (c != K_IGNORE)
658+ ins_compl_prep(c);
661659 #endif
662660
663661 /* CTRL-\ CTRL-N goes to Normal mode, CTRL-\ CTRL-G goes to mode
@@ -800,20 +798,6 @@
800798 }
801799 continue;
802800
803- case K_INS: /* toggle insert/replace mode */
804- case K_KINS:
805- ins_insert(replaceState);
806- break;
807-
808-#ifdef FEAT_INS_EXPAND
809- case Ctrl_X: /* Enter CTRL-X mode */
810- ins_ctrl_x();
811- break;
812-#endif
813-
814- case K_SELECT: /* end of Select mode mapping - ignore */
815- break;
816-
817801 case Ctrl_Z: /* suspend when 'insertmode' set */
818802 if (!p_im)
819803 goto normalchar; /* insert CTRL-Z as normal char */
@@ -832,6 +816,14 @@
832816 count = 0;
833817 goto doESCkey;
834818
819+ case K_INS: /* toggle insert/replace mode */
820+ case K_KINS:
821+ ins_insert(replaceState);
822+ break;
823+
824+ case K_SELECT: /* end of Select mode mapping - ignore */
825+ break;
826+
835827 #ifdef FEAT_SNIFF
836828 case K_SNIFF: /* Sniff command received */
837829 stuffcharReadbuff(K_SNIFF);
@@ -1112,6 +1104,10 @@
11121104 #endif
11131105
11141106 #ifdef FEAT_INS_EXPAND
1107+ case Ctrl_X: /* Enter CTRL-X mode */
1108+ ins_ctrl_x();
1109+ break;
1110+
11151111 case Ctrl_RSB: /* Tag name completion after ^X */
11161112 if (ctrl_x_mode != CTRL_X_TAGS)
11171113 goto normalchar;
@@ -1803,7 +1799,7 @@
18031799 || c == Ctrl_L || c == Ctrl_F || c == Ctrl_RSB
18041800 || c == Ctrl_I || c == Ctrl_D || c == Ctrl_P
18051801 || c == Ctrl_N || c == Ctrl_T || c == Ctrl_V
1806- || c == Ctrl_Q);
1802+ || c == Ctrl_Q || c == Ctrl_U || c == Ctrl_O);
18071803 case CTRL_X_SCROLL:
18081804 return (c == Ctrl_Y || c == Ctrl_E);
18091805 case CTRL_X_WHOLE_LINE:
@@ -1844,12 +1840,12 @@
18441840 * TODO: make this work for multi-byte characters.
18451841 */
18461842 int
1847-ins_compl_add_infercase(str, len, fname, dir, reuse)
1843+ins_compl_add_infercase(str, len, fname, dir, flags)
18481844 char_u *str;
18491845 int len;
18501846 char_u *fname;
18511847 int dir;
1852- int reuse;
1848+ int flags;
18531849 {
18541850 int has_lower = FALSE;
18551851 int was_letter = FALSE;
@@ -1900,30 +1896,35 @@
19001896 /* Copy the original case of the part we typed */
19011897 STRNCPY(IObuff, compl_orig_text, compl_length);
19021898
1903- return ins_compl_add(IObuff, len, fname, dir, reuse);
1904- }
1905- return ins_compl_add(str, len, fname, dir, reuse);
1899+ return ins_compl_add(IObuff, len, fname, dir, flags);
1900+ }
1901+ return ins_compl_add(str, len, fname, dir, flags);
19061902 }
19071903
19081904 /*
19091905 * Add a match to the list of matches.
19101906 * If the given string is already in the list of completions, then return
19111907 * FAIL, otherwise add it to the list and return OK. If there is an error,
1912- * maybe because alloc returns NULL, then RET_ERROR is returned -- webb.
1908+ * maybe because alloc() returns NULL, then RET_ERROR is returned -- webb.
1909+ *
1910+ * New:
1911+ * If the given string is already in the list of completions, then return
1912+ * NOTDONE, otherwise add it to the list and return OK. If there is an error,
1913+ * maybe because alloc() returns NULL, then FAIL is returned -- webb.
19131914 */
1914- static int
1915-ins_compl_add(str, len, fname, dir, reuse)
1915+ int
1916+ins_compl_add(str, len, fname, dir, flags)
19161917 char_u *str;
19171918 int len;
19181919 char_u *fname;
19191920 int dir;
1920- int reuse;
1921+ int flags;
19211922 {
1922- struct Completion *match;
1923+ compl_T *match;
19231924
19241925 ui_breakcheck();
19251926 if (got_int)
1926- return RET_ERROR;
1927+ return FAIL;
19271928 if (len < 0)
19281929 len = (int)STRLEN(str);
19291930
@@ -1935,11 +1936,11 @@
19351936 match = compl_first_match;
19361937 do
19371938 {
1938- if ( !(match->original & ORIGINAL_TEXT)
1939- && STRNCMP(match->str, str, (size_t)len) == 0
1940- && match->str[len] == NUL)
1941- return FAIL;
1942- match = match->next;
1939+ if ( !(match->cp_flags & ORIGINAL_TEXT)
1940+ && STRNCMP(match->cp_str, str, (size_t)len) == 0
1941+ && match->cp_str[len] == NUL)
1942+ return NOTDONE;
1943+ match = match->cp_next;
19431944 } while (match != NULL && match != compl_first_match);
19441945 }
19451946
@@ -1947,52 +1948,52 @@
19471948 * Allocate a new match structure.
19481949 * Copy the values to the new match structure.
19491950 */
1950- match = (struct Completion *)alloc((unsigned)sizeof(struct Completion));
1951+ match = (compl_T *)alloc((unsigned)sizeof(compl_T));
19511952 if (match == NULL)
1952- return RET_ERROR;
1953- match->number = -1;
1954- if (reuse & ORIGINAL_TEXT)
1955- {
1956- match->number = 0;
1957- match->str = compl_orig_text;
1958- }
1959- else if ((match->str = vim_strnsave(str, len)) == NULL)
1953+ return FAIL;
1954+ match->cp_number = -1;
1955+ if (flags & ORIGINAL_TEXT)
1956+ {
1957+ match->cp_number = 0;
1958+ match->cp_str = compl_orig_text;
1959+ }
1960+ else if ((match->cp_str = vim_strnsave(str, len)) == NULL)
19601961 {
19611962 vim_free(match);
1962- return RET_ERROR;
1963+ return FAIL;
19631964 }
19641965 /* match-fname is:
1965- * - compl_curr_match->fname if it is a string equal to fname.
1966+ * - compl_curr_match->cp_fname if it is a string equal to fname.
19661967 * - a copy of fname, FREE_FNAME is set to free later THE allocated mem.
19671968 * - NULL otherwise. --Acevedo */
1968- if (fname && compl_curr_match && compl_curr_match->fname
1969- && STRCMP(fname, compl_curr_match->fname) == 0)
1970- match->fname = compl_curr_match->fname;
1971- else if (fname && (match->fname = vim_strsave(fname)) != NULL)
1972- reuse |= FREE_FNAME;
1969+ if (fname && compl_curr_match && compl_curr_match->cp_fname
1970+ && STRCMP(fname, compl_curr_match->cp_fname) == 0)
1971+ match->cp_fname = compl_curr_match->cp_fname;
1972+ else if (fname && (match->cp_fname = vim_strsave(fname)) != NULL)
1973+ flags |= FREE_FNAME;
19731974 else
1974- match->fname = NULL;
1975- match->original = reuse;
1975+ match->cp_fname = NULL;
1976+ match->cp_flags = flags;
19761977
19771978 /*
19781979 * Link the new match structure in the list of matches.
19791980 */
19801981 if (compl_first_match == NULL)
1981- match->next = match->prev = NULL;
1982+ match->cp_next = match->cp_prev = NULL;
19821983 else if (dir == FORWARD)
19831984 {
1984- match->next = compl_curr_match->next;
1985- match->prev = compl_curr_match;
1985+ match->cp_next = compl_curr_match->cp_next;
1986+ match->cp_prev = compl_curr_match;
19861987 }
19871988 else /* BACKWARD */
19881989 {
1989- match->next = compl_curr_match;
1990- match->prev = compl_curr_match->prev;
1991- }
1992- if (match->next)
1993- match->next->prev = match;
1994- if (match->prev)
1995- match->prev->next = match;
1990+ match->cp_next = compl_curr_match;
1991+ match->cp_prev = compl_curr_match->cp_prev;
1992+ }
1993+ if (match->cp_next)
1994+ match->cp_next->cp_prev = match;
1995+ if (match->cp_prev)
1996+ match->cp_prev->cp_next = match;
19961997 else /* if there's nothing before, it is the first match */
19971998 compl_first_match = match;
19981999 compl_curr_match = match;
@@ -2014,7 +2015,7 @@
20142015 int add_r = OK;
20152016 int ldir = dir;
20162017
2017- for (i = 0; i < num_matches && add_r != RET_ERROR; i++)
2018+ for (i = 0; i < num_matches && add_r != FAIL; i++)
20182019 if ((add_r = ins_compl_add(matches[i], -1, NULL, ldir, 0)) == OK)
20192020 /* if dir was BACKWARD then honor it just once */
20202021 ldir = FORWARD;
@@ -2027,7 +2028,7 @@
20272028 static int
20282029 ins_compl_make_cyclic()
20292030 {
2030- struct Completion *match;
2031+ compl_T *match;
20312032 int count = 0;
20322033
20332034 if (compl_first_match != NULL)
@@ -2037,13 +2038,13 @@
20372038 */
20382039 match = compl_first_match;
20392040 /* there's always an entry for the compl_orig_text, it doesn't count. */
2040- while (match->next != NULL && match->next != compl_first_match)
2041- {
2042- match = match->next;
2041+ while (match->cp_next != NULL && match->cp_next != compl_first_match)
2042+ {
2043+ match = match->cp_next;
20432044 ++count;
20442045 }
2045- match->next = compl_first_match;
2046- compl_first_match->prev = match;
2046+ match->cp_next = compl_first_match;
2047+ compl_first_match->cp_prev = match;
20472048 }
20482049 return count;
20492050 }
@@ -2168,7 +2169,7 @@
21682169 if (add_r == OK)
21692170 /* if dir was BACKWARD then honor it just once */
21702171 dir = FORWARD;
2171- else if (add_r == RET_ERROR)
2172+ else if (add_r == FAIL)
21722173 break;
21732174 /* avoid expensive call to vim_regexec() when at end
21742175 * of line */
@@ -2176,7 +2177,7 @@
21762177 break;
21772178 }
21782179 line_breakcheck();
2179- ins_compl_check_keys();
2180+ ins_compl_check_keys(50);
21802181 }
21812182 fclose(fp);
21822183 }
@@ -2245,7 +2246,7 @@
22452246 static void
22462247 ins_compl_free()
22472248 {
2248- struct Completion *match;
2249+ compl_T *match;
22492250
22502251 vim_free(compl_pattern);
22512252 compl_pattern = NULL;
@@ -2256,11 +2257,11 @@
22562257 do
22572258 {
22582259 match = compl_curr_match;
2259- compl_curr_match = compl_curr_match->next;
2260- vim_free(match->str);
2260+ compl_curr_match = compl_curr_match->cp_next;
2261+ vim_free(match->cp_str);
22612262 /* several entries may use the same fname, free it just once. */
2262- if (match->original & FREE_FNAME)
2263- vim_free(match->fname);
2263+ if (match->cp_flags & FREE_FNAME)
2264+ vim_free(match->cp_fname);
22642265 vim_free(match);
22652266 } while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
22662267 compl_first_match = compl_curr_match = NULL;
@@ -2280,6 +2281,7 @@
22802281
22812282 /*
22822283 * Prepare for Insert mode completion, or stop it.
2284+ * Called just after typing a character in Insert mode.
22832285 */
22842286 static void
22852287 ins_compl_prep(c)
@@ -2430,7 +2432,7 @@
24302432 * the redo buffer. We add as few as necessary to delete
24312433 * just the part of the original text that has changed.
24322434 */
2433- ptr = compl_curr_match->str;
2435+ ptr = compl_curr_match->cp_str;
24342436 p = compl_orig_text;
24352437 while (*p && *p == *ptr)
24362438 {
@@ -2647,20 +2649,20 @@
26472649 certain type. */
26482650 static buf_T *ins_buf = NULL; /* buffer being scanned */
26492651
2650- pos_T *pos;
2651- char_u **matches;
2652- int save_p_scs;
2653- int save_p_ws;
2654- int save_p_ic;
2655- int i;
2656- int num_matches;
2657- int len;
2658- int found_new_match;
2659- int type = ctrl_x_mode;
2660- char_u *ptr;
2661- char_u *dict = NULL;
2662- int dict_f = 0;
2663- struct Completion *old_match;
2652+ pos_T *pos;
2653+ char_u **matches;
2654+ int save_p_scs;
2655+ int save_p_ws;
2656+ int save_p_ic;
2657+ int i;
2658+ int num_matches;
2659+ int len;
2660+ int found_new_match;
2661+ int type = ctrl_x_mode;
2662+ char_u *ptr;
2663+ char_u *dict = NULL;
2664+ int dict_f = 0;
2665+ compl_T *old_match;
26642666
26652667 if (!compl_started)
26662668 {
@@ -2872,7 +2874,7 @@
28722874 p_ws = TRUE;
28732875 for (;;)
28742876 {
2875- int reuse = 0;
2877+ int flags = 0;
28762878
28772879 /* ctrl_x_mode == CTRL_X_WHOLE_LINE || word-wise search that has
28782880 * added a word that was at the beginning of the line */
@@ -2973,7 +2975,7 @@
29732975 tmp_ptr = ptr + IOSIZE - len - 1;
29742976 STRNCPY(IObuff + len, ptr, tmp_ptr - ptr);
29752977 len += (int)(tmp_ptr - ptr);
2976- reuse |= CONT_S_IPOS;
2978+ flags |= CONT_S_IPOS;
29772979 }
29782980 IObuff[len] = NUL;
29792981 ptr = IObuff;
@@ -2984,7 +2986,7 @@
29842986 }
29852987 if (ins_compl_add_infercase(ptr, len,
29862988 ins_buf == curbuf ? NULL : ins_buf->b_sfname,
2987- dir, reuse) != FAIL)
2989+ dir, flags) != NOTDONE)
29882990 {
29892991 found_new_match = OK;
29902992 break;
@@ -3024,7 +3026,7 @@
30243026 /* If several matches were added (FORWARD) or the search failed and has
30253027 * just been made cyclic then we have to move compl_curr_match to the next
30263028 * or previous entry (if any) -- Acevedo */
3027- compl_curr_match = dir == FORWARD ? old_match->next : old_match->prev;
3029+ compl_curr_match = dir == FORWARD ? old_match->cp_next : old_match->cp_prev;
30283030 if (compl_curr_match == NULL)
30293031 compl_curr_match = old_match;
30303032 return i;
@@ -3049,24 +3051,24 @@
30493051 static void
30503052 ins_compl_insert()
30513053 {
3052- ins_bytes(compl_shown_match->str + curwin->w_cursor.col - compl_col);
3054+ ins_bytes(compl_shown_match->cp_str + curwin->w_cursor.col - compl_col);
30533055 }
30543056
30553057 /*
30563058 * Fill in the next completion in the current direction.
3057- * If allow_get_expansion is TRUE, then we may call ins_compl_get_exp() to get
3058- * more completions. If it is FALSE, then we just do nothing when there are
3059- * no more completions in a given direction. The latter case is used when we
3060- * are still in the middle of finding completions, to allow browsing through
3061- * the ones found so far.
3059+ * If "allow_get_expansion" is TRUE, then we may call ins_compl_get_exp() to
3060+ * get more completions. If it is FALSE, then we just do nothing when there
3061+ * are no more completions in a given direction. The latter case is used when
3062+ * we are still in the middle of finding completions, to allow browsing
3063+ * through the ones found so far.
30623064 * Return the total number of matches, or -1 if still unknown -- webb.
30633065 *
30643066 * compl_curr_match is currently being used by ins_compl_get_exp(), so we use
30653067 * compl_shown_match here.
30663068 *
30673069 * Note that this function may be called recursively once only. First with
3068- * allow_get_expansion TRUE, which calls ins_compl_get_exp(), which in turn
3069- * calls this function with allow_get_expansion FALSE.
3070+ * "allow_get_expansion" TRUE, which calls ins_compl_get_exp(), which in turn
3071+ * calls this function with "allow_get_expansion" FALSE.
30703072 */
30713073 static int
30723074 ins_compl_next(allow_get_expansion)
@@ -3081,10 +3083,10 @@
30813083 ins_compl_delete();
30823084 }
30833085 compl_pending = FALSE;
3084- if (compl_shows_dir == FORWARD && compl_shown_match->next != NULL)
3085- compl_shown_match = compl_shown_match->next;
3086- else if (compl_shows_dir == BACKWARD && compl_shown_match->prev != NULL)
3087- compl_shown_match = compl_shown_match->prev;
3086+ if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL)
3087+ compl_shown_match = compl_shown_match->cp_next;
3088+ else if (compl_shows_dir == BACKWARD && compl_shown_match->cp_prev != NULL)
3089+ compl_shown_match = compl_shown_match->cp_prev;
30883090 else
30893091 {
30903092 compl_pending = TRUE;
@@ -3119,15 +3121,15 @@
31193121 * Show the file name for the match (if any)
31203122 * Truncate the file name to avoid a wait for return.
31213123 */
3122- if (compl_shown_match->fname != NULL)
3124+ if (compl_shown_match->cp_fname != NULL)
31233125 {
31243126 STRCPY(IObuff, "match in file ");
3125- i = (vim_strsize(compl_shown_match->fname) + 16) - sc_col;
3127+ i = (vim_strsize(compl_shown_match->cp_fname) + 16) - sc_col;
31263128 if (i <= 0)
31273129 i = 0;
31283130 else
31293131 STRCAT(IObuff, "<");
3130- STRCAT(IObuff, compl_shown_match->fname + i);
3132+ STRCAT(IObuff, compl_shown_match->cp_fname + i);
31313133 msg(IObuff);
31323134 redraw_cmdline = FALSE; /* don't overwrite! */
31333135 }
@@ -3140,9 +3142,11 @@
31403142 * that should change the currently displayed completion, or exit completion
31413143 * mode. Also, when compl_pending is TRUE, show a completion as soon as
31423144 * possible. -- webb
3145+ * "frequency" specifies out of how many calls we actually check.
31433146 */
31443147 void
3145-ins_compl_check_keys()
3148+ins_compl_check_keys(frequency)
3149+ int frequency;
31463150 {
31473151 static int count = 0;
31483152
@@ -3154,7 +3158,7 @@
31543158 return;
31553159
31563160 /* Only do this at regular intervals */
3157- if (++count < CHECK_KEYS_TIME)
3161+ if (++count < frequency)
31583162 return;
31593163 count = 0;
31603164
@@ -3577,7 +3581,7 @@
35773581 }
35783582
35793583 /* we found no match if the list has only the "compl_orig_text"-entry */
3580- if (compl_first_match == compl_first_match->next)
3584+ if (compl_first_match == compl_first_match->cp_next)
35813585 {
35823586 edit_submode_extra = (compl_cont_status & CONT_ADDING)
35833587 && compl_length > 1
@@ -3595,14 +3599,14 @@
35953599 compl_cont_status &= ~CONT_N_ADDS;
35963600 }
35973601
3598- if (compl_curr_match->original & CONT_S_IPOS)
3602+ if (compl_curr_match->cp_flags & CONT_S_IPOS)
35993603 compl_cont_status |= CONT_S_IPOS;
36003604 else
36013605 compl_cont_status &= ~CONT_S_IPOS;
36023606
36033607 if (edit_submode_extra == NULL)
36043608 {
3605- if (compl_curr_match->original & ORIGINAL_TEXT)
3609+ if (compl_curr_match->cp_flags & ORIGINAL_TEXT)
36063610 {
36073611 edit_submode_extra = (char_u *)_("Back at original");
36083612 edit_submode_highl = HLF_W;
@@ -3612,7 +3616,7 @@
36123616 edit_submode_extra = (char_u *)_("Word from other line");
36133617 edit_submode_highl = HLF_COUNT;
36143618 }
3615- else if (compl_curr_match->next == compl_curr_match->prev)
3619+ else if (compl_curr_match->cp_next == compl_curr_match->cp_prev)
36163620 {
36173621 edit_submode_extra = (char_u *)_("The only match");
36183622 edit_submode_highl = HLF_COUNT;
@@ -3620,64 +3624,68 @@
36203624 else
36213625 {
36223626 /* Update completion sequence number when needed. */
3623- if (compl_curr_match->number == -1)
3627+ if (compl_curr_match->cp_number == -1)
36243628 {
3625- int number = 0;
3626- struct Completion *match;
3629+ int number = 0;
3630+ compl_T *match;
36273631
36283632 if (compl_direction == FORWARD)
36293633 {
36303634 /* search backwards for the first valid (!= -1) number.
36313635 * This should normally succeed already at the first loop
36323636 * cycle, so it's fast! */
3633- for (match = compl_curr_match->prev; match != NULL
3634- && match != compl_first_match; match = match->prev)
3635- if (match->number != -1)
3637+ for (match = compl_curr_match->cp_prev; match != NULL
3638+ && match != compl_first_match;
3639+ match = match->cp_prev)
3640+ if (match->cp_number != -1)
36363641 {
3637- number = match->number;
3642+ number = match->cp_number;
36383643 break;
36393644 }
36403645 if (match != NULL)
36413646 /* go up and assign all numbers which are not assigned
36423647 * yet */
3643- for (match = match->next; match
3644- && match->number == -1; match = match->next)
3645- match->number = ++number;
3648+ for (match = match->cp_next; match
3649+ && match->cp_number == -1;
3650+ match = match->cp_next)
3651+ match->cp_number = ++number;
36463652 }
36473653 else /* BACKWARD */
36483654 {
36493655 /* search forwards (upwards) for the first valid (!= -1)
36503656 * number. This should normally succeed already at the
36513657 * first loop cycle, so it's fast! */
3652- for (match = compl_curr_match->next; match != NULL
3653- && match != compl_first_match; match = match->next)
3654- if (match->number != -1)
3658+ for (match = compl_curr_match->cp_next; match != NULL
3659+ && match != compl_first_match;
3660+ match = match->cp_next)
3661+ if (match->cp_number != -1)
36553662 {
3656- number = match->number;
3663+ number = match->cp_number;
36573664 break;
36583665 }
36593666 if (match != NULL)
36603667 /* go down and assign all numbers which are not
36613668 * assigned yet */
3662- for (match = match->prev; match
3663- && match->number == -1; match = match->prev)
3664- match->number = ++number;
3669+ for (match = match->cp_prev; match
3670+ && match->cp_number == -1;
3671+ match = match->cp_prev)
3672+ match->cp_number = ++number;
36653673 }
36663674 }
36673675
36683676 /* The match should always have a sequnce number now, this is just
36693677 * a safety check. */
3670- if (compl_curr_match->number != -1)
3678+ if (compl_curr_match->cp_number != -1)
36713679 {
36723680 /* Space for 10 text chars. + 2x10-digit no.s */
36733681 static char_u match_ref[31];
36743682
36753683 if (compl_matches > 0)
36763684 sprintf((char *)IObuff, _("match %d of %d"),
3677- compl_curr_match->number, compl_matches);
3685+ compl_curr_match->cp_number, compl_matches);
36783686 else
36793687 sprintf((char *)IObuff, _("match %d"),
3680- compl_curr_match->number);
3688+ compl_curr_match->cp_number);
36813689 vim_strncpy(match_ref, IObuff, 30);
36823690 edit_submode_extra = match_ref;
36833691 edit_submode_highl = HLF_R;
@@ -3742,7 +3750,7 @@
37423750 }
37433751 if (dest != NULL)
37443752 *dest++ = *src;
3745-#ifdef FEAT_MBYTE
3753+# ifdef FEAT_MBYTE
37463754 /* Copy remaining bytes of a multibyte character. */
37473755 if (has_mbyte)
37483756 {
@@ -3758,7 +3766,7 @@
37583766 *dest++ = *src;
37593767 }
37603768 }
3761-#endif
3769+# endif
37623770 }
37633771 if (dest != NULL)
37643772 *dest = NUL;
diff -r 8411e13e6dcb -r 3b705e71c7b0 src/eval.c
--- a/src/eval.c Fri Aug 05 21:27:51 2005 +0000
+++ b/src/eval.c Fri Aug 05 21:35:02 2005 +0000
@@ -460,6 +460,10 @@
460460 static void f_char2nr __ARGS((typval_T *argvars, typval_T *rettv));
461461 static void f_cindent __ARGS((typval_T *argvars, typval_T *rettv));
462462 static void f_col __ARGS((typval_T *argvars, typval_T *rettv));
463+#if defined(FEAT_INS_EXPAND)
464+static void f_complete_add __ARGS((typval_T *argvars, typval_T *rettv));
465+static void f_complete_check __ARGS((typval_T *argvars, typval_T *rettv));
466+#endif
463467 static void f_confirm __ARGS((typval_T *argvars, typval_T *rettv));
464468 static void f_copy __ARGS((typval_T *argvars, typval_T *rettv));
465469 static void f_count __ARGS((typval_T *argvars, typval_T *rettv));
@@ -6690,6 +6694,10 @@
66906694 {"char2nr", 1, 1, f_char2nr},
66916695 {"cindent", 1, 1, f_cindent},
66926696 {"col", 1, 1, f_col},
6697+#if defined(FEAT_INS_EXPAND)
6698+ {"complete_add", 1, 1, f_complete_add},
6699+ {"complete_check", 0, 0, f_complete_check},
6700+#endif
66936701 {"confirm", 1, 4, f_confirm},
66946702 {"copy", 1, 1, f_copy},
66956703 {"count", 2, 4, f_count},
@@ -7871,6 +7879,41 @@
78717879 rettv->vval.v_number = col;
78727880 }
78737881
7882+#if defined(FEAT_INS_EXPAND)
7883+/*
7884+ * "complete_add()" function
7885+ */
7886+/*ARGSUSED*/
7887+ static void
7888+f_complete_add(argvars, rettv)
7889+ typval_T *argvars;
7890+ typval_T *rettv;
7891+{
7892+ char_u *s;
7893+
7894+ s = get_tv_string_chk(&argvars[0]);
7895+ if (s != NULL)
7896+ rettv->vval.v_number = ins_compl_add(s, -1, NULL, FORWARD, 0);
7897+}
7898+
7899+/*
7900+ * "complete_check()" function
7901+ */
7902+/*ARGSUSED*/
7903+ static void
7904+f_complete_check(argvars, rettv)
7905+ typval_T *argvars;
7906+ typval_T *rettv;
7907+{
7908+ int saved = RedrawingDisabled;
7909+
7910+ RedrawingDisabled = 0;
7911+ ins_compl_check_keys(0);
7912+ rettv->vval.v_number = compl_interrupted;
7913+ RedrawingDisabled = saved;
7914+}
7915+#endif
7916+
78747917 /*
78757918 * "confirm(message, buttons[, default [, type]])" function
78767919 */
diff -r 8411e13e6dcb -r 3b705e71c7b0 src/proto/edit.pro
--- a/src/proto/edit.pro Fri Aug 05 21:27:51 2005 +0000
+++ b/src/proto/edit.pro Fri Aug 05 21:35:02 2005 +0000
@@ -7,10 +7,11 @@
77 void truncate_spaces __ARGS((char_u *line));
88 void backspace_until_column __ARGS((int col));
99 int vim_is_ctrl_x_key __ARGS((int c));
10-int ins_compl_add_infercase __ARGS((char_u *str, int len, char_u *fname, int dir, int reuse));
10+int ins_compl_add_infercase __ARGS((char_u *str, int len, char_u *fname, int dir, int flags));
11+int ins_compl_add __ARGS((char_u *str, int len, char_u *fname, int dir, int flags));
1112 char_u *find_word_start __ARGS((char_u *ptr));
1213 char_u *find_word_end __ARGS((char_u *ptr));
13-void ins_compl_check_keys __ARGS((void));
14+void ins_compl_check_keys __ARGS((int frequency));
1415 int get_literal __ARGS((void));
1516 void insertchar __ARGS((int c, int flags, int second_indent));
1617 void auto_format __ARGS((int trailblank, int prev_line));
diff -r 8411e13e6dcb -r 3b705e71c7b0 src/search.c
--- a/src/search.c Fri Aug 05 21:27:51 2005 +0000
+++ b/src/search.c Fri Aug 05 21:35:02 2005 +0000
@@ -4743,7 +4743,7 @@
47434743 if (add_r == OK)
47444744 /* if dir was BACKWARD then honor it just once */
47454745 dir = FORWARD;
4746- else if (add_r == RET_ERROR)
4746+ else if (add_r == FAIL)
47474747 break;
47484748 }
47494749 else
@@ -4873,7 +4873,7 @@
48734873 line_breakcheck();
48744874 #ifdef FEAT_INS_EXPAND
48754875 if (action == ACTION_EXPAND)
4876- ins_compl_check_keys();
4876+ ins_compl_check_keys(30);
48774877 if (got_int || compl_interrupted)
48784878 #else
48794879 if (got_int)
diff -r 8411e13e6dcb -r 3b705e71c7b0 src/tag.c
--- a/src/tag.c Fri Aug 05 21:27:51 2005 +0000
+++ b/src/tag.c Fri Aug 05 21:35:02 2005 +0000
@@ -1382,7 +1382,7 @@
13821382 line_breakcheck(); /* check for CTRL-C typed */
13831383 #ifdef FEAT_INS_EXPAND
13841384 if ((flags & TAG_INS_COMP)) /* Double brackets for gcc */
1385- ins_compl_check_keys();
1385+ ins_compl_check_keys(30);
13861386 if (got_int || compl_interrupted)
13871387 #else
13881388 if (got_int)
diff -r 8411e13e6dcb -r 3b705e71c7b0 src/version.h
--- a/src/version.h Fri Aug 05 21:27:51 2005 +0000
+++ b/src/version.h Fri Aug 05 21:35:02 2005 +0000
@@ -36,5 +36,5 @@
3636 #define VIM_VERSION_NODOT "vim70aa"
3737 #define VIM_VERSION_SHORT "7.0aa"
3838 #define VIM_VERSION_MEDIUM "7.0aa ALPHA"
39-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 4)"
40-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 4, compiled "
39+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 5)"
40+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 5, compiled "
Show on old repository browser