• R/O
  • SSH

vim: Commit

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


Commit MetaInfo

Revision83a006f81bac04bf9b975347bf8d6bddc7996eb6 (tree)
Time2006-02-17 07:11:02
Authorvimboss
Commitervimboss

Log Message

updated for version 7.0199

Change Summary

Incremental Difference

diff -r f892bda292a8 -r 83a006f81bac runtime/doc/syntax.txt
--- a/runtime/doc/syntax.txt Wed Feb 15 22:18:42 2006 +0000
+++ b/runtime/doc/syntax.txt Thu Feb 16 22:11:02 2006 +0000
@@ -1,4 +1,4 @@
1-*syntax.txt* For Vim version 7.0aa. Last change: 2006 Jan 23
1+*syntax.txt* For Vim version 7.0aa. Last change: 2006 Feb 16
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4257,9 +4257,8 @@
42574257 <
42584258 *colortest.vim*
42594259 To test your color setup, a file has been included in the Vim distribution.
4260-To use it, execute these commands: >
4261- :e $VIMRUNTIME/syntax/colortest.vim
4262- :so %
4260+To use it, execute this command: >
4261+ :runtime syntax/colortest.vim
42634262
42644263 Some versions of xterm (and other terminals, like the Linux console) can
42654264 output lighter foreground colors, even though the number of colors is defined
diff -r f892bda292a8 -r 83a006f81bac runtime/doc/tips.txt
--- a/runtime/doc/tips.txt Wed Feb 15 22:18:42 2006 +0000
+++ b/runtime/doc/tips.txt Thu Feb 16 22:11:02 2006 +0000
@@ -1,4 +1,4 @@
1-*tips.txt* For Vim version 7.0aa. Last change: 2006 Feb 13
1+*tips.txt* For Vim version 7.0aa. Last change: 2006 Feb 16
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -494,7 +494,7 @@
494494 endif
495495 endfunction
496496
497- autocmd CursorMoved * call s:Highlight_Matching_Paren()
497+ autocmd CursorMoved,CursorMovedI * call s:Highlight_Matching_Paren()
498498 autocmd InsertEnter * match none
499499 <
500500
diff -r f892bda292a8 -r 83a006f81bac runtime/doc/todo.txt
--- a/runtime/doc/todo.txt Wed Feb 15 22:18:42 2006 +0000
+++ b/runtime/doc/todo.txt Thu Feb 16 22:11:02 2006 +0000
@@ -1,4 +1,4 @@
1-*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 15
1+*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 16
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -32,20 +32,23 @@
3232
3333 Support WINDOW TABS. Works like several pages, each with their own split
3434 windows. Let's call them "tab pages".
35- - Mouse click in tab name should select that tab.
36- - line at top of frame with tabs.
37- for the name ignore the help window, unless it's the only one).
38- Add a number for the window count?
39- Add a '+' if one of the windows is modified?
40- Add 'tabtext' option, like 'statusline'.
41- Add an "X" to close the current tab (like firefox).
42- - When deleting a buffer also close windows in other tab pages.
43- - check all places where firstwin and lastwin are used
35+ - check all places where lastwin is used
36+ - check all places where win_valid() is used
37+ - check all places where last_window() is used
38+ - ":tabclose N" close tab N
39+ - Add ":tabonly" - close all other tabs.
4440 - check all places wheren only_one_window() is used.
4541 - Add tabpage(): returns current tab page number.
42+ - ":tabsplit" makes a copy of the current tab page.
43+ - Add TabLeavePre and TabEnterPost autocommands
44+ - line at top of frame with tabs.
45+ Add 'tabtext' option, like 'statusline'.
46+ - make a diff for each tab page separately.
4647 - E999
47- - ":tabclose N" close tab N
4848 - docs:
49+ General remark: commands that work on windows only work on the windows
50+ in the current tab page. Including :windo.
51+ Session file only contains the current tab page.
4952 :tabedit
5053 :tabfind
5154 :tab N
@@ -57,6 +60,12 @@
5760 next one. Hint in docs: To mess with another buffer, without
5861 changing the window layout, do this in another tab.
5962 'tabline' values 0/1/2
63+ mouse click in tabline:
64+ select a tab page
65+ X closes current tab page
66+ :argall and :ball only opens window for buffers that are not in any
67+ window in any tab page
68+ :diffoff only in the current tab page
6069 - add GUI Tabs for some systems.
6170 Patch for GTK 1.2 passed on by Christian Michon, 2004 Jan 6.
6271 Simple patch for GTK by Luis M (nov 7).
@@ -65,11 +74,15 @@
6574
6675 Crash with X command server (Ciaran McCreesh).
6776
68-Ctags still hasn't included the patch...
77+Ctags still hasn't included the patch. Darren is looking for someone to do
78+maintanance.
6979
7080 "fsutil hardlink" can create a hard link on an NTFS file system. (Daniel
7181 Einspanjer) What library function can detect that?
7282
83+Win32: use GetFileInformationByHandle() to detect hard links on NTFS?
84+(George Reilly)
85+
7386 spelling:
7487 - Also use the spelling dictionary for dictionary completion.
7588 When 'dictionary' is empty and/or when "kspell" is in 'complete'.
diff -r f892bda292a8 -r 83a006f81bac runtime/doc/usr_06.txt
--- a/runtime/doc/usr_06.txt Wed Feb 15 22:18:42 2006 +0000
+++ b/runtime/doc/usr_06.txt Thu Feb 16 22:11:02 2006 +0000
@@ -1,4 +1,4 @@
1-*usr_06.txt* For Vim version 7.0aa. Last change: 2002 Jul 14
1+*usr_06.txt* For Vim version 7.0aa. Last change: 2006 Feb 16
22
33 VIM USER MANUAL - by Bram Moolenaar
44
@@ -179,10 +179,9 @@
179179 colorscheme mine
180180
181181 If you want to see what the most often used color combinations look like, use
182-these commands: >
182+this command: >
183183
184- :edit $VIMRUNTIME/syntax/colortest.vim
185- :source %
184+ :runtime syntax/colortest.vim
186185
187186 You will see text in various color combinations. You can check which ones are
188187 readable and look nice.
diff -r f892bda292a8 -r 83a006f81bac runtime/doc/version7.txt
--- a/runtime/doc/version7.txt Wed Feb 15 22:18:42 2006 +0000
+++ b/runtime/doc/version7.txt Thu Feb 16 22:11:02 2006 +0000
@@ -1,4 +1,4 @@
1-*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 14
1+*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 16
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1010,6 +1010,9 @@
10101010
10111011 Insert mode completion for whole lines now also searches unloaded buffers.
10121012
1013+The colortest.vim script can now be invoked directly with ":source" or
1014+":runtime".
1015+
10131016 ==============================================================================
10141017 COMPILE TIME CHANGES *compile-changes-7*
10151018
@@ -1696,4 +1699,6 @@
16961699
16971700 'titleold' was included in ":mkexrc" and ":mksession" files.
16981701
1702+":set background&" didn't use the same logic as was used when starting up.
1703+
16991704 vim:tw=78:ts=8:ft=help:norl:
diff -r f892bda292a8 -r 83a006f81bac runtime/ftplugin/vhdl.vim
--- a/runtime/ftplugin/vhdl.vim Wed Feb 15 22:18:42 2006 +0000
+++ b/runtime/ftplugin/vhdl.vim Thu Feb 16 22:11:02 2006 +0000
@@ -1,8 +1,8 @@
1-" Vim filetype plugin file
2-" Language: VHDL
3-" Maintainer: R.Shankar (shankar at txc.stpn.soft.net)
4-" Last Change: Tue Oct 8
5-
1+" VHDL filetype plugin
2+" Language: VHDL
3+" Maintainer: R.Shankar <shankar.r?freescale.com>
4+" Modified By: Gerald Lai <laigera+vim?gmail.com>
5+" Last Change: 2006 Feb 16
66
77 " Only do this when not done yet for this buffer
88 if exists("b:did_ftplugin")
@@ -20,7 +20,7 @@
2020 "setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
2121
2222 " Format comments to be up to 78 characters long
23-setlocal tw=75
23+"setlocal tw=75
2424
2525 set cpo-=C
2626
@@ -34,8 +34,51 @@
3434 if ! exists("b:match_words") && exists("loaded_matchit")
3535 let b:match_ignorecase=1
3636 let s:notend = '\%(\<end\s\+\)\@<!'
37- let b:match_words=
38- \ s:notend . '\<if\>:\<elsif\>:\<else\>:\<end\>\s\+\<if\>,' .
39- \ s:notend . '\<case\>:\<when\>:\<end\>\s\+\<case\>,' .
40- \ s:notend . '\<process\>:\<end\>\s\+\<process\>'
37+ let b:match_words =
38+ \ s:notend.'\<if\>:\<elsif\>:\<else\>:\<end\s\+if\>,'.
39+ \ s:notend.'\<case\>:\<when\>:\<end\s\+case\>,'.
40+ \ s:notend.'\<loop\>:\<end\s\+loop\>,'.
41+ \ s:notend.'\<for\>:\<end\s\+for\>,'.
42+ \ s:notend.'\<generate\>:\<end\s\+generate\>,'.
43+ \ s:notend.'\<record\>:\<end\s\+record\>,'.
44+ \ s:notend.'\<units\>:\<end\s\+units\>,'.
45+ \ s:notend.'\<process\>:\<end\s\+process\>,'.
46+ \ s:notend.'\<block\>:\<end\s\+block\>,'.
47+ \ s:notend.'\<function\>:\<end\s\+function\>,'.
48+ \ s:notend.'\<entity\>:\<end\s\+entity\>,'.
49+ \ s:notend.'\<component\>:\<end\s\+component\>,'.
50+ \ s:notend.'\<architecture\>:\<end\s\+architecture\>,'.
51+ \ s:notend.'\<package\>:\<end\s\+package\>,'.
52+ \ s:notend.'\<procedure\>:\<end\s\+procedure\>,'.
53+ \ s:notend.'\<configuration\>:\<end\s\+configuration\>'
4154 endif
55+
56+" count repeat
57+function! <SID>CountWrapper(cmd)
58+ let i = v:count1
59+ if a:cmd[0] == ":"
60+ while i > 0
61+ execute a:cmd
62+ let i = i - 1
63+ endwhile
64+ else
65+ execute "normal! gv\<Esc>"
66+ execute "normal ".i.a:cmd
67+ let curcol = col(".")
68+ let curline = line(".")
69+ normal! gv
70+ call cursor(curline, curcol)
71+ endif
72+endfunction
73+
74+" explore motion
75+" keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
76+let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)'
77+noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
78+noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
79+noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
80+noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
81+vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR>
82+vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR>
83+vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR>
84+vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR>
diff -r f892bda292a8 -r 83a006f81bac runtime/syntax/colortest.vim
--- a/runtime/syntax/colortest.vim Wed Feb 15 22:18:42 2006 +0000
+++ b/runtime/syntax/colortest.vim Thu Feb 16 22:11:02 2006 +0000
@@ -1,7 +1,7 @@
11 " Vim script for testing colors
22 " Maintainer: Bram Moolenaar <Bram@vim.org>
33 " Contributors: Rafael Garcia-Suarez, Charles Campbell
4-" Last Change: 2001 Jul 28
4+" Last Change: 2006 Feb 16
55
66 " edit this file, then do ":source %", and check if the colors match
77
@@ -52,6 +52,15 @@
5252 " lightcyan lightcyan_on_white white_on_lightcyan
5353 " lightcyan_on_black black_on_lightcyan
5454
55+" Open this file in a window if it isn't edited yet.
56+" Use the current window if it's empty.
57+if &mod || line('$') != 1 || getline(1) != ''
58+ new
59+endif
60+if expand('%:p') != expand('<sfile>:p')
61+ exe "edit " . expand('<sfile>')
62+endif
63+
5564 syn clear
5665 8
5766 while search("_on_", "W") < 55
@@ -60,6 +69,5 @@
6069 exec 'hi col_'.col1.'_'.col2.' ctermfg='.col1.' guifg='.col1.' ctermbg='.col2.' guibg='.col2
6170 exec 'syn keyword col_'.col1.'_'.col2.' '.col1.'_on_'.col2
6271 endwhile
63-8,55g/^" \a/exec 'hi col_'.expand("<cword>").' ctermfg='.expand("<cword>").' guifg='.expand("<cword>")|
64- \ exec 'syn keyword col_'.expand("<cword>")." ".expand("<cword>")
72+8,54g/^" \a/exec 'hi col_'.expand("<cword>").' ctermfg='.expand("<cword>").' guifg='.expand("<cword>")| exec 'syn keyword col_'.expand("<cword>")." ".expand("<cword>")
6573 nohlsearch
diff -r f892bda292a8 -r 83a006f81bac runtime/syntax/vim.vim
--- a/runtime/syntax/vim.vim Wed Feb 15 22:18:42 2006 +0000
+++ b/runtime/syntax/vim.vim Thu Feb 16 22:11:02 2006 +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: February 07, 2006
5-" Version: 7.0-25
4+" Last Change: February 15, 2006
5+" Version: 7.0-26
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] caddb[uffer] cad[dexpr] caddf[ile] 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] Explore 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] Hexplore 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] laddb[uffer] lad[dexpr] laddf[ile] lan[guage] la[st] lb[uffer] lc[d] lch[dir] lcl[ose] le[ft] lefta[bove] lex[pr] lf[ile] lfir[st] lg[etfile] lgr[ep] lgrepa[dd] l[ist] ll lla[st] lli[st] lmak[e] lm[ap] lmapc[lear] lnew[er] lne[xt] lN[ext] lnf[ile] lNf[ile] ln[oremap] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lpf[ile] lp[revious] lr[ewind] ls lt[ag] lu[nmap] lv[imgrep] lvimgrepa[dd] lw[indow] 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 NetrwSettings 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] Sexplore 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] startg[replace] 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] Vexplore 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] XMLent XMLns 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] caddb[uffer] cad[dexpr] caddf[ile] 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] Explore 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] Hexplore 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] laddb[uffer] lad[dexpr] laddf[ile] lan[guage] la[st] lb[uffer] lc[d] lch[dir] lcl[ose] le[ft] lefta[bove] lex[pr] lf[ile] lfir[st] lg[etfile] lgr[ep] lgrepa[dd] lh[elpgrep] l[ist] ll lla[st] lli[st] lmak[e] lm[ap] lmapc[lear] lnew[er] lne[xt] lN[ext] lnf[ile] lNf[ile] ln[oremap] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lpf[ile] lp[revious] lr[ewind] ls lt[ag] lu[nmap] lv[imgrep] lvimgrepa[dd] lw[indow] 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 NetrwSettings 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] Sexplore 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] startg[replace] 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] Vexplore 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] XMLent XMLns 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 completeopt confirm consk conskey copyindent cot 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 mkspellmem ml mls mm mmd mmp mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps msm mzq mzquantum nf nrformats nu number numberwidth nuw oft ofu omnifunc operatorfunc opfunc 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
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 completeopt confirm consk conskey copyindent cot 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 fex 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 formatexpr 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 mkspellmem ml mls mm mmd mmp mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps msm mzq mzquantum nf nrformats nu number numberwidth nuw oft ofu omnifunc operatorfunc opfunc 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,7 +44,7 @@
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 MenuPopup QuickFixCmdPost QuickFixCmdPre RemoteReply SessionLoadPost SpellFileMissing StdinReadPost StdinReadPre SwapExists 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 CursorHoldI CursorMoved CursorMovedI 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 SessionLoadPost SpellFileMissing StdinReadPost StdinReadPre SwapExists 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
@@ -55,7 +55,7 @@
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 complete_add complete_check 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 getcmdtype getcwd getfontname getfperm getfsize getftime getftype getline getloclist getqflist getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputlist 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 searchdecl searchpair server2client serverlist setbufvar setcmdpos setline setloclist setqflist setreg setwinvar simplify sort soundfold spellbadword spellsuggest split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tagfiles taglist tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth writefile
58+syn keyword vimFuncName contained add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call char2nr cindent col complete_add complete_check 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 getcmdtype getcwd getfontname getfperm getfsize getftime getftype getline getloclist getqflist getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputlist 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 pumvisible range readfile remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchdecl searchpair searchpairpos searchpos server2client serverlist setbufvar setcmdpos setline setloclist setqflist setreg setwinvar simplify sort soundfold spellbadword spellsuggest split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tagfiles 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 f892bda292a8 -r 83a006f81bac src/auto/configure
--- a/src/auto/configure Wed Feb 15 22:18:42 2006 +0000
+++ b/src/auto/configure Thu Feb 16 22:11:02 2006 +0000
@@ -15088,7 +15088,7 @@
1508815088 DEPEND_CFLAGS_FILTER=
1508915089 if test "$GCC" = yes; then
1509015090 gccmajor=`"$CC" --version | sed -e '2,$d;s/^[^0-9]*\([1-9]\)\.[0-9.]*.*$/\1/g'`
15091- if test "$gccmajor" > "2"; then
15091+ if test "$gccmajor" -gt "2"; then
1509215092 DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
1509315093 fi
1509415094 fi
diff -r f892bda292a8 -r 83a006f81bac src/buffer.c
--- a/src/buffer.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/buffer.c Thu Feb 16 22:11:02 2006 +0000
@@ -1062,21 +1062,7 @@
10621062
10631063 /* Close any other windows on this buffer, then make it empty. */
10641064 #ifdef FEAT_WINDOWS
1065- {
1066- win_T *wp, *nextwp;
1067-
1068- for (wp = firstwin; wp != NULL; wp = nextwp)
1069- {
1070- nextwp = wp->w_next;
1071- if (wp != curwin && wp->w_buffer == buf)
1072- {
1073- /* Start all over, autocommands may change the window
1074- * layout. */
1075- nextwp = firstwin;
1076- win_close(wp, FALSE);
1077- }
1078- }
1079- }
1065+ close_windows(buf, TRUE);
10801066 #endif
10811067 setpcmark();
10821068 retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
@@ -1095,9 +1081,11 @@
10951081 #ifdef FEAT_WINDOWS
10961082 /*
10971083 * If the deleted buffer is the current one, close the current window
1098- * (unless it's the only window).
1084+ * (unless it's the only window). Repeat this so long as we end up in
1085+ * a window with this buffer.
10991086 */
1100- while (buf == curbuf && firstwin != lastwin)
1087+ while (buf == curbuf
1088+ && (firstwin != lastwin || first_tabpage->tp_next != NULL))
11011089 win_close(curwin, FALSE);
11021090 #endif
11031091
@@ -1107,7 +1095,7 @@
11071095 if (buf != curbuf)
11081096 {
11091097 #ifdef FEAT_WINDOWS
1110- close_windows(buf);
1098+ close_windows(buf, FALSE);
11111099 #endif
11121100 if (buf != curbuf && buf_valid(buf) && buf->b_nwindows <= 0)
11131101 close_buffer(NULL, buf, action);
@@ -1317,7 +1305,7 @@
13171305 {
13181306 #ifdef FEAT_WINDOWS
13191307 if (unload)
1320- close_windows(prevbuf);
1308+ close_windows(prevbuf, FALSE);
13211309 #endif
13221310 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
13231311 if (buf_valid(prevbuf) && !aborting())
@@ -4707,6 +4695,7 @@
47074695 buf_T *buf;
47084696 #ifdef FEAT_WINDOWS
47094697 win_T *win;
4698+ tabpage_T *tp;
47104699 #endif
47114700 char_u *line;
47124701 int max_buffers;
@@ -4723,7 +4712,7 @@
47234712 return;
47244713
47254714 #ifdef FEAT_WINDOWS
4726- for (win = firstwin; win != NULL; win = win->w_next)
4715+ FOR_ALL_TAB_WINDOWS(tp, win)
47274716 set_last_cursor(win);
47284717 #else
47294718 set_last_cursor(curwin);
diff -r f892bda292a8 -r 83a006f81bac src/configure.in
--- a/src/configure.in Wed Feb 15 22:18:42 2006 +0000
+++ b/src/configure.in Thu Feb 16 22:11:02 2006 +0000
@@ -2761,7 +2761,7 @@
27612761 DEPEND_CFLAGS_FILTER=
27622762 if test "$GCC" = yes; then
27632763 gccmajor=`"$CC" --version | sed -e '2,$d;s/^[[^0-9]]*\([[1-9]]\)\.[[0-9.]]*.*$/\1/g'`
2764- if test "$gccmajor" > "2"; then
2764+ if test "$gccmajor" -gt "2"; then
27652765 DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
27662766 fi
27672767 fi
diff -r f892bda292a8 -r 83a006f81bac src/diff.c
--- a/src/diff.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/diff.c Thu Feb 16 22:11:02 2006 +0000
@@ -1075,6 +1075,7 @@
10751075
10761076 /*
10771077 * Set options not to show diffs. For the current window or all windows.
1078+ * Only in the current tab page.
10781079 */
10791080 void
10801081 ex_diffoff(eap)
diff -r f892bda292a8 -r 83a006f81bac src/eval.c
--- a/src/eval.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/eval.c Thu Feb 16 22:11:02 2006 +0000
@@ -15509,11 +15509,13 @@
1550915509 pos.col = 0;
1551015510 if (name[1] == '0') /* "w0": first visible line */
1551115511 {
15512+ update_topline();
1551215513 pos.lnum = curwin->w_topline;
1551315514 return &pos;
1551415515 }
1551515516 else if (name[1] == '$') /* "w$": last visible line */
1551615517 {
15518+ validate_botline();
1551715519 pos.lnum = curwin->w_botline - 1;
1551815520 return &pos;
1551915521 }
diff -r f892bda292a8 -r 83a006f81bac src/ex_cmds2.c
--- a/src/ex_cmds2.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/ex_cmds2.c Thu Feb 16 22:11:02 2006 +0000
@@ -1761,8 +1761,9 @@
17611761 {
17621762 #ifdef FEAT_WINDOWS
17631763 win_T *win;
1764-
1765- for (win = firstwin; win != NULL; win = win->w_next)
1764+ tabpage_T *tp;
1765+
1766+ FOR_ALL_TAB_WINDOWS(tp, win)
17661767 if (win->w_alist == curwin->w_alist)
17671768 check_arg_idx(win);
17681769 #else
diff -r f892bda292a8 -r 83a006f81bac src/ex_docmd.c
--- a/src/ex_docmd.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/ex_docmd.c Thu Feb 16 22:11:02 2006 +0000
@@ -148,7 +148,7 @@
148148 static void ex_quit_all __ARGS((exarg_T *eap));
149149 #ifdef FEAT_WINDOWS
150150 static void ex_close __ARGS((exarg_T *eap));
151-static void ex_win_close __ARGS((int forceit, win_T *win));
151+static void ex_win_close __ARGS((int forceit, win_T *win, tabpage_T *tp));
152152 static void ex_only __ARGS((exarg_T *eap));
153153 static void ex_all __ARGS((exarg_T *eap));
154154 static void ex_resize __ARGS((exarg_T *eap));
@@ -6144,7 +6144,7 @@
61446144 else
61456145 # endif
61466146 if (!text_locked())
6147- ex_win_close(eap->forceit, curwin);
6147+ ex_win_close(eap->forceit, curwin, NULL);
61486148 }
61496149
61506150 #ifdef FEAT_QUICKFIX
@@ -6160,16 +6160,21 @@
61606160 for (win = firstwin; win != NULL; win = win->w_next)
61616161 if (win->w_p_pvw)
61626162 {
6163- ex_win_close(eap->forceit, win);
6163+ ex_win_close(eap->forceit, win, NULL);
61646164 break;
61656165 }
61666166 }
61676167 #endif
61686168
6169- static void
6170-ex_win_close(forceit, win)
6169+/*
6170+ * Close window "win" and take care of handling closing the last window for a
6171+ * modified buffer.
6172+ */
6173+ static void
6174+ex_win_close(forceit, win, tp)
61716175 int forceit;
61726176 win_T *win;
6177+ tabpage_T *tp; /* NULL or the tab page "win" is in */
61736178 {
61746179 int need_hide;
61756180 buf_T *buf = win->w_buffer;
@@ -6196,36 +6201,90 @@
61966201 #ifdef FEAT_GUI
61976202 need_mouse_correct = TRUE;
61986203 #endif
6204+
61996205 /* free buffer when not hiding it or when it's a scratch buffer */
6200- win_close(win, !need_hide && !P_HID(buf));
6201-}
6202-
6203-/*
6204- * ":tabclose": close current tab page, unless it is the last one
6206+ if (tp == NULL)
6207+ win_close(win, !need_hide && !P_HID(buf));
6208+ else
6209+ win_close_othertab(win, !need_hide && !P_HID(buf), tp);
6210+}
6211+
6212+/*
6213+ * ":tabclose": close current tab page, unless it is the last one.
6214+ * ":tabclose N": close tab page N.
62056215 */
62066216 static void
62076217 ex_tabclose(eap)
62086218 exarg_T *eap;
62096219 {
6220+ tabpage_T *tp;
6221+
62106222 # ifdef FEAT_CMDWIN
62116223 if (cmdwin_type != 0)
62126224 cmdwin_result = K_IGNORE;
62136225 else
62146226 # endif
6215- if (!text_locked())
6216- {
6217- if (first_tabpage->tp_next == NULL)
6218- EMSG(_("E999: Cannot close last tab page"));
6219- else
6220- {
6221- /* First close all the windows but the current one. If that
6222- * worked then close the last window in this tab, that will
6223- * close it. */
6224- ex_only(eap);
6225- if (lastwin == firstwin)
6226- ex_win_close(eap->forceit, curwin);
6227- }
6228- }
6227+ if (first_tabpage->tp_next == NULL)
6228+ EMSG(_("E999: Cannot close last tab page"));
6229+ else
6230+ {
6231+ if (eap->addr_count > 0)
6232+ {
6233+ tp = find_tabpage((int)eap->line2);
6234+ if (tp == NULL)
6235+ {
6236+ beep_flush();
6237+ return;
6238+ }
6239+ if (tp->tp_topframe != topframe)
6240+ {
6241+ tabpage_close_other(tp, eap->forceit);
6242+ return;
6243+ }
6244+ }
6245+ if (!text_locked())
6246+ tabpage_close(eap->forceit);
6247+ }
6248+}
6249+
6250+/*
6251+ * Close the current tab page.
6252+ */
6253+ void
6254+tabpage_close(forceit)
6255+ int forceit;
6256+{
6257+ /* First close all the windows but the current one. If that worked then
6258+ * close the last window in this tab, that will close it. */
6259+ close_others(TRUE, forceit);
6260+ if (lastwin == firstwin)
6261+ ex_win_close(forceit, curwin, NULL);
6262+# ifdef FEAT_GUI
6263+ need_mouse_correct = TRUE;
6264+# endif
6265+}
6266+
6267+/*
6268+ * Close tab page "tp", which is not the current tab page.
6269+ * Note that autocommands may make "tp" invalid.
6270+ */
6271+ void
6272+tabpage_close_other(tp, forceit)
6273+ tabpage_T *tp;
6274+ int forceit;
6275+{
6276+ int done = 0;
6277+
6278+ /* Limit to 1000 windows, autocommands may add a window while we close
6279+ * one. OK, so I'm paranoid... */
6280+ while (++done < 1000)
6281+ {
6282+ ex_win_close(forceit, tp->tp_firstwin, tp);
6283+
6284+ /* Autocommands may delete the tab page under our fingers. */
6285+ if (!valid_tabpage(tp))
6286+ break;
6287+ }
62296288 }
62306289
62316290 /*
@@ -6689,13 +6748,14 @@
66896748 int i;
66906749 # ifdef FEAT_WINDOWS
66916750 win_T *wp;
6751+ tabpage_T *tp;
66926752 # endif
66936753
66946754 for (i = 0; i < GARGCOUNT; ++i)
66956755 if (GARGLIST[i].ae_fname != NULL)
66966756 slash_adjust(GARGLIST[i].ae_fname);
66976757 # ifdef FEAT_WINDOWS
6698- for (wp = firstwin; wp != NULL; wp = wp->w_next)
6758+ FOR_ALL_TAB_WINDOWS(tp, wp)
66996759 if (wp->w_alist != &global_alist)
67006760 for (i = 0; i < WARGCOUNT(wp); ++i)
67016761 if (WARGLIST(wp)[i].ae_fname != NULL)
@@ -6925,7 +6985,8 @@
69256985 # ifdef FEAT_SCROLLBIND
69266986 curwin->w_p_scb = FALSE;
69276987 # endif
6928- do_exedit(eap, NULL);
6988+ if (*eap->arg != NUL)
6989+ do_exedit(eap, NULL);
69296990 }
69306991
69316992 # ifdef FEAT_BROWSE
diff -r f892bda292a8 -r 83a006f81bac src/globals.h
--- a/src/globals.h Wed Feb 15 22:18:42 2006 +0000
+++ b/src/globals.h Thu Feb 16 22:11:02 2006 +0000
@@ -42,7 +42,7 @@
4242 EXTERN schar_T *ScreenLines INIT(= NULL);
4343 EXTERN sattr_T *ScreenAttrs INIT(= NULL);
4444 EXTERN unsigned *LineOffset INIT(= NULL);
45-EXTERN char_u *LineWraps INIT(= NULL);
45+EXTERN char_u *LineWraps INIT(= NULL); /* line wraps to next line */
4646
4747 #ifdef FEAT_MBYTE
4848 /*
@@ -61,6 +61,10 @@
6161 EXTERN schar_T *ScreenLines2 INIT(= NULL);
6262 #endif
6363
64+#ifdef FEAT_WINDOWS
65+EXTERN char_u *TabPageIdxs INIT(= NULL); /* indexes for tab page line */
66+#endif
67+
6468 EXTERN int screen_Rows INIT(= 0); /* actual size of ScreenLines[] */
6569 EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */
6670
@@ -482,6 +486,10 @@
482486 EXTERN win_T *prevwin INIT(= NULL); /* previous window */
483487 # define W_NEXT(wp) ((wp)->w_next)
484488 # define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next)
489+#define FOR_ALL_TAB_WINDOWS(tp, wp) \
490+ for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
491+ for ((wp) = ((tp)->tp_topframe == topframe) \
492+ ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
485493 #else
486494 # define firstwin curwin
487495 # define lastwin curwin
diff -r f892bda292a8 -r 83a006f81bac src/if_mzsch.c
--- a/src/if_mzsch.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/if_mzsch.c Thu Feb 16 22:11:02 2006 +0000
@@ -1423,7 +1423,8 @@
14231423 win_T *w;
14241424 int n = 0;
14251425
1426- for (w = firstwin; w; w = w->w_next) ++n;
1426+ for (w = firstwin; w != NULL; w = w->w_next)
1427+ ++n;
14271428 return scheme_make_integer(n);
14281429 }
14291430
@@ -1439,7 +1440,7 @@
14391440 buf = get_buffer_arg(prim->name, 0, argc, argv);
14401441 list = scheme_null;
14411442
1442- for (w = firstwin; w; w = w->w_next)
1443+ for (w = firstwin; w != NULL; w = w->w_next)
14431444 if (w->w_buffer == buf->buf)
14441445 list = scheme_make_pair(window_new(w), list);
14451446
@@ -1500,7 +1501,7 @@
15001501 if (fnum < 1)
15011502 scheme_signal_error(_("window index is out of range"));
15021503
1503- for (win = firstwin; win; win = win->w_next, --fnum)
1504+ for (win = firstwin; win != NULL; win = win->w_next, --fnum)
15041505 if (fnum == 1) /* to be 1-based */
15051506 return window_new(win);
15061507
diff -r f892bda292a8 -r 83a006f81bac src/if_python.c
--- a/src/if_python.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/if_python.c Thu Feb 16 22:11:02 2006 +0000
@@ -2160,7 +2160,7 @@
21602160 win_T *w = firstwin;
21612161 int n = 0;
21622162
2163- while (w)
2163+ while (w != NULL)
21642164 {
21652165 ++n;
21662166 w = W_NEXT(w);
@@ -2175,7 +2175,7 @@
21752175 {
21762176 win_T *w;
21772177
2178- for (w = firstwin; w; w = W_NEXT(w), --n)
2178+ for (w = firstwin; w != NULL; w = W_NEXT(w), --n)
21792179 if (n == 0)
21802180 return WindowNew(w);
21812181
diff -r f892bda292a8 -r 83a006f81bac src/if_ruby.c
--- a/src/if_ruby.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/if_ruby.c Thu Feb 16 22:11:02 2006 +0000
@@ -726,7 +726,7 @@
726726 win_T *w;
727727 int n = 0;
728728
729- for (w = firstwin; w; w = w->w_next)
729+ for (w = firstwin; w != NULL; w = w->w_next)
730730 n++;
731731 return INT2NUM(n);
732732 #else
diff -r f892bda292a8 -r 83a006f81bac src/main.c
--- a/src/main.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/main.c Thu Feb 16 22:11:02 2006 +0000
@@ -1133,6 +1133,7 @@
11331133 #ifdef FEAT_AUTOCMD
11341134 buf_T *buf;
11351135 win_T *wp;
1136+ tabpage_T *tp, *next_tp;
11361137 #endif
11371138
11381139 exiting = TRUE;
@@ -1160,23 +1161,28 @@
11601161
11611162 #ifdef FEAT_AUTOCMD
11621163 /* Trigger BufWinLeave for all windows, but only once per buffer. */
1163- for (wp = firstwin; wp != NULL; )
1164+# if defined FEAT_WINDOWS
1165+ for (tp = first_tabpage; tp != NULL; tp = next_tp)
11641166 {
1165- buf = wp->w_buffer;
1166- if (buf->b_changedtick != -1)
1167+ next_tp = tp->tp_next;
1168+ for (wp = (tp->tp_topframe == topframe)
1169+ ? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next)
11671170 {
1168- apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname,
1171+ buf = wp->w_buffer;
1172+ if (buf->b_changedtick != -1)
1173+ {
1174+ apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname,
11691175 FALSE, buf);
1170- buf->b_changedtick = -1; /* note that we did it already */
1171- wp = firstwin; /* restart, window may be closed */
1176+ buf->b_changedtick = -1; /* note that we did it already */
1177+ /* start all over, autocommands may mess up the lists */
1178+ next_tp = first_tabpage;
1179+ break;
1180+ }
11721181 }
1173-# ifdef FEAT_WINDOWS
1174- else
1175- wp = wp->w_next;
1182+ }
11761183 # else
1177- break;
1184+ apply_autocmds(EVENT_BUFWINLEAVE, curbuf, curbuf->b_fname, FALSE, curbuf);
11781185 # endif
1179- }
11801186
11811187 /* Trigger BufUnload for buffers that are loaded */
11821188 for (buf = firstbuf; buf != NULL; buf = buf->b_next)
diff -r f892bda292a8 -r 83a006f81bac src/mark.c
--- a/src/mark.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/mark.c Thu Feb 16 22:11:02 2006 +0000
@@ -1500,11 +1500,12 @@
15001500 int i;
15011501 #ifdef FEAT_WINDOWS
15021502 win_T *win;
1503+ tabpage_T *tp;
15031504
15041505 /*
15051506 * Set b_last_cursor for the all buffers that have a window.
15061507 */
1507- for (win = firstwin; win != NULL; win = win->w_next)
1508+ FOR_ALL_TAB_WINDOWS(tp, win)
15081509 set_last_cursor(win);
15091510 #else
15101511 set_last_cursor(curwin);
diff -r f892bda292a8 -r 83a006f81bac src/misc1.c
--- a/src/misc1.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/misc1.c Thu Feb 16 22:11:02 2006 +0000
@@ -2458,6 +2458,7 @@
24582458 ml_setflags(curbuf);
24592459 #ifdef FEAT_WINDOWS
24602460 check_status(curbuf);
2461+ redraw_tabpage = TRUE;
24612462 #endif
24622463 #ifdef FEAT_TITLE
24632464 need_maketitle = TRUE; /* set window title later */
@@ -2847,6 +2848,7 @@
28472848 save_file_ff(buf);
28482849 #ifdef FEAT_WINDOWS
28492850 check_status(buf);
2851+ redraw_tabpage = TRUE;
28502852 #endif
28512853 #ifdef FEAT_TITLE
28522854 need_maketitle = TRUE; /* set window title later */
diff -r f892bda292a8 -r 83a006f81bac src/misc2.c
--- a/src/misc2.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/misc2.c Thu Feb 16 22:11:02 2006 +0000
@@ -2790,7 +2790,9 @@
27902790 set_string_option_direct((char_u *)"ff", -1, (char_u *)p,
27912791 OPT_FREE | opt_flags);
27922792 #ifdef FEAT_WINDOWS
2793+ /* This may cause the buffer to become (un)modified. */
27932794 check_status(curbuf);
2795+ redraw_tabpage = TRUE;
27942796 #endif
27952797 #ifdef FEAT_TITLE
27962798 need_maketitle = TRUE; /* set window title later */
diff -r f892bda292a8 -r 83a006f81bac src/normal.c
--- a/src/normal.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/normal.c Thu Feb 16 22:11:02 2006 +0000
@@ -2421,6 +2421,37 @@
24212421
24222422 start_visual.lnum = 0;
24232423
2424+#ifdef FEAT_WINDOWS
2425+ /* Check for clicking in the tab page line. */
2426+ if (mouse_row == 0 && firstwin->w_winrow > 0)
2427+ {
2428+ got_click = FALSE; /* ignore mouse-up and drag events */
2429+
2430+ /* click in last column closes the current tab page. */
2431+ if (mouse_col == Columns - 1 && first_tabpage->tp_next != NULL)
2432+ {
2433+ tabpage_close(FALSE);
2434+ return TRUE;
2435+ }
2436+
2437+ /* click in a tab selects that tab page */
2438+ if (is_click
2439+# ifdef FEAT_CMDWIN
2440+ && cmdwin_type == 0
2441+# endif
2442+ && mouse_col < Columns && TabPageIdxs[mouse_col] != 0xff)
2443+ {
2444+ goto_tabpage(TabPageIdxs[mouse_col]);
2445+
2446+ /* It's like clicking on the status line of a window. */
2447+ if (curwin != old_curwin)
2448+ end_visual_mode();
2449+ return TRUE;
2450+ }
2451+ return FALSE;
2452+ }
2453+#endif
2454+
24242455 /*
24252456 * When 'mousemodel' is "popup" or "popup_setpos", translate mouse events:
24262457 * right button up -> pop-up menu
diff -r f892bda292a8 -r 83a006f81bac src/option.c
--- a/src/option.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/option.c Thu Feb 16 22:11:02 2006 +0000
@@ -2653,6 +2653,7 @@
26532653
26542654 static void set_option_default __ARGS((int, int opt_flags, int compatible));
26552655 static void set_options_default __ARGS((int opt_flags));
2656+static char_u *term_bg_default __ARGS((void));
26562657 static void did_set_option __ARGS((int opt_idx, int opt_flags, int new_value));
26572658 static char_u *illegal_char __ARGS((char_u *, int));
26582659 static int string_to_key __ARGS((char_u *arg));
@@ -3200,6 +3201,7 @@
32003201 int i;
32013202 #ifdef FEAT_WINDOWS
32023203 win_T *wp;
3204+ tabpage_T *tp;
32033205 #endif
32043206
32053207 for (i = 0; !istermoption(&options[i]); i++)
@@ -3208,7 +3210,7 @@
32083210
32093211 #ifdef FEAT_WINDOWS
32103212 /* The 'scroll' option must be computed for all windows. */
3211- for (wp = firstwin; wp != NULL; wp = wp->w_next)
3213+ FOR_ALL_TAB_WINDOWS(tp, wp)
32123214 win_comp_scroll(wp);
32133215 #else
32143216 win_comp_scroll(curwin);
@@ -3306,39 +3308,20 @@
33063308 p_window = Rows - 1;
33073309 set_number_default("window", Rows - 1);
33083310
3311+ /* For DOS console the default is always black. */
33093312 #if !((defined(MSDOS) || defined(OS2) || defined(WIN3264)) && !defined(FEAT_GUI))
3310- {
3311- char_u *p;
3312-
3313- /*
3314- * If 'background' wasn't set by the user, try guessing the value,
3315- * depending on the terminal name. Only need to check for terminals
3316- * with a dark background, that can handle color. Recognized are:
3317- * "linux" Linux console
3318- * "screen.linux" Linux console with screen
3319- * "cygwin" Cygwin shell
3320- * "putty" Putty program
3321- * We also check the COLORFGBG environment variable, which is set by
3322- * rxvt and derivatives. This variable contains either two or three
3323- * values separated by semicolons; we want the last value in either
3324- * case. If this value is 0-6 or 8, our background is dark.
3325- */
3326- idx = findoption((char_u *)"bg");
3327- if (!(options[idx].flags & P_WAS_SET)
3328- && (STRCMP(T_NAME, "linux") == 0
3329- || STRCMP(T_NAME, "screen.linux") == 0
3330- || STRCMP(T_NAME, "cygwin") == 0
3331- || STRCMP(T_NAME, "putty") == 0
3332- || ((p = mch_getenv((char_u *)"COLORFGBG")) != NULL
3333- && (p = vim_strrchr(p, ';')) != NULL
3334- && ((p[1] >= '0' && p[1] <= '6') || p[1] == '8')
3335- && p[2] == NUL)))
3336- {
3337- set_string_option_direct(NULL, idx, (char_u *)"dark", OPT_FREE);
3338- /* don't mark it as set, when starting the GUI it may be
3339- * changed again */
3340- options[idx].flags &= ~P_WAS_SET;
3341- }
3313+ /*
3314+ * If 'background' wasn't set by the user, try guessing the value,
3315+ * depending on the terminal name. Only need to check for terminals
3316+ * with a dark background, that can handle color.
3317+ */
3318+ idx = findoption((char_u *)"bg");
3319+ if (!(options[idx].flags & P_WAS_SET) && *term_bg_default() == 'd')
3320+ {
3321+ set_string_option_direct(NULL, idx, (char_u *)"dark", OPT_FREE);
3322+ /* don't mark it as set, when starting the GUI it may be
3323+ * changed again */
3324+ options[idx].flags &= ~P_WAS_SET;
33423325 }
33433326 #endif
33443327
@@ -3354,6 +3337,40 @@
33543337 }
33553338
33563339 /*
3340+ * Return "dark" or "light" depending on the kind of terminal.
3341+ * This is just guessing! Recognized are:
3342+ * "linux" Linux console
3343+ * "screen.linux" Linux console with screen
3344+ * "cygwin" Cygwin shell
3345+ * "putty" Putty program
3346+ * We also check the COLORFGBG environment variable, which is set by
3347+ * rxvt and derivatives. This variable contains either two or three
3348+ * values separated by semicolons; we want the last value in either
3349+ * case. If this value is 0-6 or 8, our background is dark.
3350+ */
3351+ static char_u *
3352+term_bg_default()
3353+{
3354+ char_u *p;
3355+
3356+#if defined(MSDOS) || defined(OS2) || defined(WIN3264)
3357+ /* DOS console nearly always black */
3358+ return (char_u *)"dark";
3359+#else
3360+ if (STRCMP(T_NAME, "linux") == 0
3361+ || STRCMP(T_NAME, "screen.linux") == 0
3362+ || STRCMP(T_NAME, "cygwin") == 0
3363+ || STRCMP(T_NAME, "putty") == 0
3364+ || ((p = mch_getenv((char_u *)"COLORFGBG")) != NULL
3365+ && (p = vim_strrchr(p, ';')) != NULL
3366+ && ((p[1] >= '0' && p[1] <= '6') || p[1] == '8')
3367+ && p[2] == NUL))
3368+ return (char_u *)"dark";
3369+ return (char_u *)"light";
3370+#endif
3371+}
3372+
3373+/*
33573374 * Initialize the options, part three: After reading the .vimrc
33583375 */
33593376 void
@@ -4071,8 +4088,7 @@
40714088 newval = gui_bg_default();
40724089 else
40734090 #endif
4074- if (STRCMP(T_NAME, "linux") == 0)
4075- newval = (char_u *)"dark";
4091+ newval = term_bg_default();
40764092 }
40774093
40784094 /* expand environment variables and ~ (since the
diff -r f892bda292a8 -r 83a006f81bac src/proto/ex_docmd.pro
--- a/src/proto/ex_docmd.pro Wed Feb 15 22:18:42 2006 +0000
+++ b/src/proto/ex_docmd.pro Thu Feb 16 22:11:02 2006 +0000
@@ -23,6 +23,8 @@
2323 char_u *get_user_cmd_complete __ARGS((expand_T *xp, int idx));
2424 int parse_compl_arg __ARGS((char_u *value, int vallen, int *complp, long *argt, char_u **compl_arg));
2525 void not_exiting __ARGS((void));
26+void tabpage_close __ARGS((int forceit));
27+void tabpage_close_other __ARGS((tabpage_T *tp, int forceit));
2628 void handle_drop __ARGS((int filec, char_u **filev, int split));
2729 void alist_clear __ARGS((alist_T *al));
2830 void alist_init __ARGS((alist_T *al));
diff -r f892bda292a8 -r 83a006f81bac src/proto/window.pro
--- a/src/proto/window.pro Wed Feb 15 22:18:42 2006 +0000
+++ b/src/proto/window.pro Thu Feb 16 22:11:02 2006 +0000
@@ -6,15 +6,18 @@
66 int make_windows __ARGS((int count, int vertical));
77 void win_move_after __ARGS((win_T *win1, win_T *win2));
88 void win_equal __ARGS((win_T *next_curwin, int current, int dir));
9-void close_windows __ARGS((buf_T *buf));
9+void close_windows __ARGS((buf_T *buf, int keep_curwin));
1010 int last_window __ARGS((void));
1111 void win_close __ARGS((win_T *win, int free_buf));
12+void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
1213 void win_free_all __ARGS((void));
1314 void close_others __ARGS((int message, int forceit));
1415 void win_init __ARGS((win_T *wp));
1516 int win_alloc_first __ARGS((void));
1617 void win_init_size __ARGS((void));
1718 int win_new_tabpage __ARGS((void));
19+int valid_tabpage __ARGS((tabpage_T *tpc));
20+tabpage_T *find_tabpage __ARGS((int n));
1821 void goto_tabpage __ARGS((int n));
1922 void win_goto __ARGS((win_T *wp));
2023 win_T *win_find_nr __ARGS((int winnr));
diff -r f892bda292a8 -r 83a006f81bac src/screen.c
--- a/src/screen.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/screen.c Thu Feb 16 22:11:02 2006 +0000
@@ -6742,6 +6742,10 @@
67426742 sattr_T *new_ScreenAttrs;
67436743 unsigned *new_LineOffset;
67446744 char_u *new_LineWraps;
6745+#ifdef FEAT_WINDOWS
6746+ char_u *new_TabPageIdxs;
6747+ tabpage_T *tp;
6748+#endif
67456749 static int entered = FALSE; /* avoid recursiveness */
67466750 static int did_outofmem_msg = FALSE; /* did outofmem message */
67476751
@@ -6788,10 +6792,10 @@
67886792 * size is wrong.
67896793 */
67906794 #ifdef FEAT_WINDOWS
6791- for (wp = firstwin; wp; wp = wp->w_next)
6795+ FOR_ALL_TAB_WINDOWS(tp, wp)
67926796 win_free_lsize(wp);
67936797 #else
6794- win_free_lsize(curwin);
6798+ win_free_lsize(curwin);
67956799 #endif
67966800
67976801 new_ScreenLines = (schar_T *)lalloc((long_u)(
@@ -6815,6 +6819,9 @@
68156819 new_LineOffset = (unsigned *)lalloc((long_u)(
68166820 Rows * sizeof(unsigned)), FALSE);
68176821 new_LineWraps = (char_u *)lalloc((long_u)(Rows * sizeof(char_u)), FALSE);
6822+#ifdef FEAT_WINDOWS
6823+ new_TabPageIdxs = (char_u *)lalloc((long_u)(Columns * sizeof(char_u)), FALSE);
6824+#endif
68186825
68196826 FOR_ALL_WINDOWS(wp)
68206827 {
@@ -6836,6 +6843,9 @@
68366843 || new_ScreenAttrs == NULL
68376844 || new_LineOffset == NULL
68386845 || new_LineWraps == NULL
6846+#ifdef FEAT_WINDOWS
6847+ || new_TabPageIdxs == NULL
6848+#endif
68396849 || outofmem)
68406850 {
68416851 if (ScreenLines != NULL || !did_outofmem_msg)
@@ -6865,6 +6875,10 @@
68656875 new_LineOffset = NULL;
68666876 vim_free(new_LineWraps);
68676877 new_LineWraps = NULL;
6878+#ifdef FEAT_WINDOWS
6879+ vim_free(new_TabPageIdxs);
6880+ new_TabPageIdxs = NULL;
6881+#endif
68686882 }
68696883 else
68706884 {
@@ -6956,6 +6970,9 @@
69566970 ScreenAttrs = new_ScreenAttrs;
69576971 LineOffset = new_LineOffset;
69586972 LineWraps = new_LineWraps;
6973+#ifdef FEAT_WINDOWS
6974+ TabPageIdxs = new_TabPageIdxs;
6975+#endif
69596976
69606977 /* It's important that screen_Rows and screen_Columns reflect the actual
69616978 * size of ScreenLines[]. Set them before calling anything. */
@@ -7005,6 +7022,9 @@
70057022 vim_free(ScreenAttrs);
70067023 vim_free(LineOffset);
70077024 vim_free(LineWraps);
7025+#ifdef FEAT_WINDOWS
7026+ vim_free(TabPageIdxs);
7027+#endif
70087028 }
70097029
70107030 void
@@ -8443,9 +8463,13 @@
84438463 tabpage_T *tp;
84448464 int tabwidth;
84458465 int col = 0;
8466+ int scol;
84468467 int had_current = FALSE;
84478468 int attr;
84488469 win_T *wp;
8470+ win_T *cwp;
8471+ int wincount;
8472+ int modified;
84498473 int c;
84508474 int len;
84518475 int attr_sel = hl_attr(HLF_TPS);
@@ -8460,13 +8484,16 @@
84608484 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
84618485 ++tabcount;
84628486
8463- tabwidth = Columns / tabcount;
8487+ tabwidth = (Columns - 1 + tabcount / 2) / tabcount;
84648488 if (tabwidth < 6)
84658489 tabwidth = 6;
84668490
84678491 attr = attr_nosel;
8468- for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
8469- {
8492+ tabcount = 0;
8493+ for (tp = first_tabpage; tp != NULL && col < Columns; tp = tp->tp_next)
8494+ {
8495+ scol = col;
8496+
84708497 if (tp->tp_topframe == topframe)
84718498 {
84728499 c = '/';
@@ -8486,21 +8513,55 @@
84868513 screen_putchar(' ', 0, col++, attr);
84878514
84888515 if (tp->tp_topframe == topframe)
8489- wp = curwin;
8516+ {
8517+ cwp = curwin;
8518+ wp = firstwin;
8519+ }
84908520 else
8491- wp = tp->tp_curwin;
8492- if (buf_spname(wp->w_buffer) != NULL)
8493- STRCPY(NameBuff, buf_spname(wp->w_buffer));
8521+ {
8522+ cwp = tp->tp_curwin;
8523+ wp = tp->tp_firstwin;
8524+ }
8525+
8526+ modified = FALSE;
8527+ for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount)
8528+ if (bufIsChanged(wp->w_buffer))
8529+ modified = TRUE;
8530+ if (modified || wincount > 1)
8531+ {
8532+ if (wincount > 1)
8533+ {
8534+ vim_snprintf((char *)NameBuff, MAXPATHL, "#%d", wincount);
8535+ len = STRLEN(NameBuff);
8536+ screen_puts_len(NameBuff, len, 0, col, attr);
8537+ col += len;
8538+ }
8539+ if (modified)
8540+ screen_puts_len((char_u *)"+", 2, 0, col++, attr);
8541+ screen_putchar(' ', 0, col++, attr);
8542+ }
8543+
8544+ if (buf_spname(cwp->w_buffer) != NULL)
8545+ STRCPY(NameBuff, buf_spname(cwp->w_buffer));
84948546 else
8495- home_replace(wp->w_buffer, wp->w_buffer->b_fname, NameBuff,
8547+ home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff,
84968548 MAXPATHL, TRUE);
84978549 trans_characters(NameBuff, MAXPATHL);
84988550 len = STRLEN(NameBuff);
8499- if (len > tabwidth) /* TODO: multi-byte chars */
8500- len = tabwidth;
8501- screen_puts_len(NameBuff, len, 0, col, attr);
8502- col += len;
8551+ if (len > scol - col + tabwidth - 1) /* TODO: multi-byte chars */
8552+ len = scol - col + tabwidth - 1;
8553+ if (len > 0)
8554+ {
8555+ screen_puts_len(NameBuff, len, 0, col, attr);
8556+ col += len;
8557+ }
85038558 screen_putchar(' ', 0, col++, attr);
8559+
8560+ /* Store the tab page number in TabPageIdxs[], so that jump_to_mouse()
8561+ * knows where each one is. */
8562+ ++tabcount;
8563+ while (scol < col)
8564+ TabPageIdxs[scol++] = tabcount;
85048565 }
85058566
85068567 if (t_colors < 8)
@@ -8511,6 +8572,14 @@
85118572 else
85128573 c = ' ';
85138574 screen_fill(0, 1, col, (int)Columns, c, c, attr_fill);
8575+
8576+ /* Put an "X" for closing the current tab if there are several. */
8577+ if (first_tabpage->tp_next != NULL)
8578+ screen_putchar('X', 0, (int)Columns - 1, attr_nosel);
8579+
8580+ /* Clicking outside of tabs has no effect. */
8581+ while (scol < Columns)
8582+ TabPageIdxs[scol++] = 0xff;
85148583 }
85158584 #endif
85168585
diff -r f892bda292a8 -r 83a006f81bac src/structs.h
--- a/src/structs.h Wed Feb 15 22:18:42 2006 +0000
+++ b/src/structs.h Thu Feb 16 22:11:02 2006 +0000
@@ -1558,6 +1558,7 @@
15581558 tabpage_T *tp_next; /* next tabpage or NULL */
15591559 frame_T *tp_topframe; /* topframe for the windows */
15601560 win_T *tp_curwin; /* current window in this Tab page */
1561+ win_T *tp_prevwin; /* previous window in this Tab page */
15611562 win_T *tp_firstwin; /* first window in this Tab page */
15621563 win_T *tp_lastwin; /* last window in this Tab page */
15631564 long tp_old_Rows; /* Rows when Tab page was left */
diff -r f892bda292a8 -r 83a006f81bac src/version.h
--- a/src/version.h Wed Feb 15 22:18:42 2006 +0000
+++ b/src/version.h Thu Feb 16 22:11:02 2006 +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 (2006 Feb 15)"
40-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 15, compiled "
39+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 16)"
40+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 16, compiled "
diff -r f892bda292a8 -r 83a006f81bac src/window.c
--- a/src/window.c Wed Feb 15 22:18:42 2006 +0000
+++ b/src/window.c Thu Feb 16 22:11:02 2006 +0000
@@ -25,9 +25,9 @@
2525 static void win_rotate __ARGS((int, int));
2626 static void win_totop __ARGS((int size, int flags));
2727 static void win_equal_rec __ARGS((win_T *next_curwin, int current, frame_T *topfr, int dir, int col, int row, int width, int height));
28-static win_T *win_free_mem __ARGS((win_T *win, int *dirp));
29-static win_T *winframe_remove __ARGS((win_T *win, int *dirp));
30-static frame_T *win_altframe __ARGS((win_T *win));
28+static win_T *win_free_mem __ARGS((win_T *win, int *dirp, tabpage_T *tp));
29+static win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp));
30+static frame_T *win_altframe __ARGS((win_T *win, tabpage_T *tp));
3131 static tabpage_T *alt_tabpage __ARGS((void));
3232 static win_T *frame2win __ARGS((frame_T *frp));
3333 static int frame_has_win __ARGS((frame_T *frp, win_T *wp));
@@ -49,9 +49,9 @@
4949 static void frame_fix_height __ARGS((win_T *wp));
5050 static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin));
5151 static void win_enter_ext __ARGS((win_T *wp, int undo_sync, int no_curwin));
52-static void win_free __ARGS((win_T *wp));
52+static void win_free __ARGS((win_T *wp, tabpage_T *tp));
5353 static void win_append __ARGS((win_T *, win_T *));
54-static void win_remove __ARGS((win_T *));
54+static void win_remove __ARGS((win_T *, tabpage_T *tp));
5555 static void frame_append __ARGS((frame_T *after, frame_T *frp));
5656 static void frame_insert __ARGS((frame_T *before, frame_T *frp));
5757 static void frame_remove __ARGS((frame_T *frp));
@@ -1262,14 +1262,14 @@
12621262 frp2 = curwin->w_frame->fr_prev;
12631263 if (wp->w_prev != curwin)
12641264 {
1265- win_remove(curwin);
1265+ win_remove(curwin, NULL);
12661266 frame_remove(curwin->w_frame);
12671267 win_append(wp->w_prev, curwin);
12681268 frame_insert(frp, curwin->w_frame);
12691269 }
12701270 if (wp != wp2)
12711271 {
1272- win_remove(wp);
1272+ win_remove(wp, NULL);
12731273 frame_remove(wp->w_frame);
12741274 win_append(wp2, wp);
12751275 if (frp2 == NULL)
@@ -1353,7 +1353,7 @@
13531353 /* remove first window/frame from the list */
13541354 frp = curwin->w_frame->fr_parent->fr_child;
13551355 wp1 = frp->fr_win;
1356- win_remove(wp1);
1356+ win_remove(wp1, NULL);
13571357 frame_remove(frp);
13581358
13591359 /* find last frame and append removed window/frame after it */
@@ -1372,7 +1372,7 @@
13721372 ;
13731373 wp1 = frp->fr_win;
13741374 wp2 = wp1->w_prev; /* will become last window */
1375- win_remove(wp1);
1375+ win_remove(wp1, NULL);
13761376 frame_remove(frp);
13771377
13781378 /* append the removed window/frame before the first in the list */
@@ -1419,8 +1419,8 @@
14191419 }
14201420
14211421 /* Remove the window and frame from the tree of frames. */
1422- (void)winframe_remove(curwin, &dir);
1423- win_remove(curwin);
1422+ (void)winframe_remove(curwin, &dir, NULL);
1423+ win_remove(curwin, NULL);
14241424 last_status(FALSE); /* may need to remove last status line */
14251425 (void)win_comp_pos(); /* recompute window positions */
14261426
@@ -1486,7 +1486,7 @@
14861486 win1->w_vsep_width = 0;
14871487 #endif
14881488 }
1489- win_remove(win1);
1489+ win_remove(win1, NULL);
14901490 frame_remove(win1->w_frame);
14911491 win_append(win2, win1);
14921492 frame_append(win2->w_frame, win1->w_frame);
@@ -1797,23 +1797,50 @@
17971797 * close all windows for buffer 'buf'
17981798 */
17991799 void
1800-close_windows(buf)
1800+close_windows(buf, keep_curwin)
18011801 buf_T *buf;
1802+ int keep_curwin; /* don't close "curwin" */
18021803 {
1803- win_T *win;
1804+ win_T *wp;
1805+ tabpage_T *tp, *nexttp;
1806+ int h = tabpageline_height();
18041807
18051808 ++RedrawingDisabled;
1806- for (win = firstwin; win != NULL && lastwin != firstwin; )
1809+
1810+ for (wp = firstwin; wp != NULL && lastwin != firstwin; )
18071811 {
1808- if (win->w_buffer == buf)
1812+ if (wp->w_buffer == buf && (!keep_curwin || wp != curwin))
18091813 {
1810- win_close(win, FALSE);
1811- win = firstwin; /* go back to the start */
1814+ win_close(wp, FALSE);
1815+
1816+ /* Start all over, autocommands may change the window layout. */
1817+ wp = firstwin;
18121818 }
18131819 else
1814- win = win->w_next;
1820+ wp = wp->w_next;
18151821 }
1822+
1823+ /* Also check windows in other tab pages. */
1824+ for (tp = first_tabpage; tp != NULL; tp = nexttp)
1825+ {
1826+ nexttp = tp->tp_next;
1827+ if (tp->tp_topframe != topframe)
1828+ for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
1829+ if (wp->w_buffer == buf)
1830+ {
1831+ win_close_othertab(wp, FALSE, tp);
1832+
1833+ /* Start all over, the tab page may be closed and
1834+ * autocommands may change the window layout. */
1835+ nexttp = first_tabpage;
1836+ break;
1837+ }
1838+ }
1839+
18161840 --RedrawingDisabled;
1841+
1842+ if (h != tabpageline_height())
1843+ shell_new_rows();
18171844 }
18181845
18191846 /*
@@ -1827,7 +1854,7 @@
18271854 }
18281855
18291856 /*
1830- * close window "win"
1857+ * Close window "win".
18311858 * If "free_buf" is TRUE related buffer may be unloaded.
18321859 *
18331860 * called by :quit, :close, :xit, :wq and findtag()
@@ -1866,7 +1893,7 @@
18661893 * Guess which window is going to be the new current window.
18671894 * This may change because of the autocommands (sigh).
18681895 */
1869- wp = frame2win(win_altframe(win));
1896+ wp = frame2win(win_altframe(win, NULL));
18701897
18711898 /*
18721899 * Be careful: If autocommands delete the window, return now.
@@ -1899,7 +1926,7 @@
18991926 return;
19001927
19011928 /* Free the memory used for the window. */
1902- wp = win_free_mem(win, &dir);
1929+ wp = win_free_mem(win, &dir, NULL);
19031930
19041931 /* When closing the last window in a tab page go to another tab page. */
19051932 if (wp == NULL)
@@ -2004,13 +2031,70 @@
20042031 }
20052032
20062033 /*
2034+ * Close window "win" in tab page "tp", which is not the current tab page.
2035+ * This may be the last window ih that tab page and result in closing the tab,
2036+ * thus "tp" may become invalid!
2037+ * Called must check if buffer is hidden.
2038+ */
2039+ void
2040+win_close_othertab(win, free_buf, tp)
2041+ win_T *win;
2042+ int free_buf;
2043+ tabpage_T *tp;
2044+{
2045+ win_T *wp;
2046+ int dir;
2047+ tabpage_T *ptp = NULL;
2048+
2049+ /* Close the link to the buffer. */
2050+ close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
2051+
2052+ /* Careful: Autocommands may have closed the tab page or made it the
2053+ * current tab page. */
2054+ for (ptp = first_tabpage; ptp != NULL && ptp != tp; ptp = ptp->tp_next)
2055+ ;
2056+ if (ptp == NULL || tp->tp_topframe == topframe)
2057+ return;
2058+
2059+ /* Autocommands may have closed the window already. */
2060+ for (wp = tp->tp_firstwin; wp != NULL && wp != win; wp = wp->w_next)
2061+ ;
2062+ if (wp == NULL)
2063+ return;
2064+
2065+ /* Free the memory used for the window. */
2066+ wp = win_free_mem(win, &dir, tp);
2067+
2068+ /* When closing the last window in a tab page remove the tab page. */
2069+ if (wp == NULL)
2070+ {
2071+ if (tp == first_tabpage)
2072+ first_tabpage = tp->tp_next;
2073+ else
2074+ {
2075+ for (ptp = first_tabpage; ptp != NULL && ptp->tp_next != tp;
2076+ ptp = ptp->tp_next)
2077+ ;
2078+ if (ptp == NULL)
2079+ {
2080+ EMSG2(_(e_intern2), "win_close_othertab()");
2081+ return;
2082+ }
2083+ ptp->tp_next = tp->tp_next;
2084+ }
2085+ vim_free(tp);
2086+ }
2087+}
2088+
2089+/*
20072090 * Free the memory used for a window.
20082091 * Returns a pointer to the window that got the freed up space.
20092092 */
20102093 static win_T *
2011-win_free_mem(win, dirp)
2094+win_free_mem(win, dirp, tp)
20122095 win_T *win;
20132096 int *dirp; /* set to 'v' or 'h' for direction if 'ea' */
2097+ tabpage_T *tp; /* tab page "win" is in, NULL for current */
20142098 {
20152099 frame_T *frp;
20162100 win_T *wp;
@@ -2024,13 +2108,9 @@
20242108
20252109 /* Remove the window and its frame from the tree of frames. */
20262110 frp = win->w_frame;
2027- if (firstwin == lastwin)
2028- /* Last window in a tab page. */
2029- wp = NULL;
2030- else
2031- wp = winframe_remove(win, dirp);
2111+ wp = winframe_remove(win, dirp, tp);
20322112 vim_free(frp);
2033- win_free(win);
2113+ win_free(win, tp);
20342114
20352115 return wp;
20362116 }
@@ -2041,8 +2121,13 @@
20412121 {
20422122 int dummy;
20432123
2124+# ifdef FEAT_WINDOWS
2125+ while (first_tabpage->tp_next != NULL)
2126+ tabpage_close(TRUE);
2127+# endif
2128+
20442129 while (firstwin != NULL)
2045- (void)win_free_mem(firstwin, &dummy);
2130+ (void)win_free_mem(firstwin, &dummy, NULL);
20462131 }
20472132 #endif
20482133
@@ -2052,9 +2137,10 @@
20522137 */
20532138 /*ARGSUSED*/
20542139 static win_T *
2055-winframe_remove(win, dirp)
2140+winframe_remove(win, dirp, tp)
20562141 win_T *win;
20572142 int *dirp; /* set to 'v' or 'h' for direction if 'ea' */
2143+ tabpage_T *tp; /* tab page "win" is in, NULL for current */
20582144 {
20592145 frame_T *frp, *frp2, *frp3;
20602146 frame_T *frp_close = win->w_frame;
@@ -2062,12 +2148,15 @@
20622148 int old_height = 0;
20632149
20642150 /*
2151+ * If there is only one window there is nothing to remove.
2152+ */
2153+ if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == tp->tp_lastwin)
2154+ return NULL;
2155+
2156+ /*
20652157 * Remove the window from its frame.
20662158 */
2067- frp2 = win_altframe(win);
2068- if (frp2 == NULL)
2069- return NULL; /* deleted the last frame */
2070-
2159+ frp2 = win_altframe(win, tp);
20712160 wp = frame2win(frp2);
20722161
20732162 /* Remove this frame from the list of frames. */
@@ -2160,13 +2249,14 @@
21602249 * layout.
21612250 */
21622251 static frame_T *
2163-win_altframe(win)
2252+win_altframe(win, tp)
21642253 win_T *win;
2254+ tabpage_T *tp; /* tab page "win" is in, NULL for current */
21652255 {
21662256 frame_T *frp;
21672257 int b;
21682258
2169- if (firstwin == lastwin)
2259+ if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == tp->tp_lastwin)
21702260 /* Last window in this tab page, will go to next tab page. */
21712261 return alt_tabpage()->tp_curwin->w_frame;
21722262
@@ -2861,6 +2951,7 @@
28612951 firstwin->w_winrow = tabpageline_height();
28622952
28632953 newtp->tp_topframe = topframe;
2954+ last_status(FALSE);
28642955 redraw_all_later(CLEAR);
28652956 return OK;
28662957 }
@@ -2868,6 +2959,7 @@
28682959 /* Failed, get back the previous Tab page */
28692960 topframe = tp->tp_topframe;
28702961 curwin = tp->tp_curwin;
2962+ prevwin = tp->tp_prevwin;
28712963 firstwin = tp->tp_firstwin;
28722964 lastwin = tp->tp_lastwin;
28732965 return FAIL;
@@ -2890,6 +2982,36 @@
28902982 }
28912983
28922984 /*
2985+ * Return TRUE when "tpc" points to a valid tab page.
2986+ */
2987+ int
2988+valid_tabpage(tpc)
2989+ tabpage_T *tpc;
2990+{
2991+ tabpage_T *tp;
2992+
2993+ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
2994+ if (tp == tpc)
2995+ return TRUE;
2996+ return FALSE;
2997+}
2998+
2999+/*
3000+ * Find tab page "n" (first one is 1). Returns NULL when not found.
3001+ */
3002+ tabpage_T *
3003+find_tabpage(n)
3004+ int n;
3005+{
3006+ tabpage_T *tp;
3007+ int i = 1;
3008+
3009+ for (tp = first_tabpage; tp != NULL && i != n; tp = tp->tp_next)
3010+ ++i;
3011+ return tp;
3012+}
3013+
3014+/*
28933015 * Prepare for leaving the current tab page "tp".
28943016 */
28953017 static void
@@ -2902,6 +3024,7 @@
29023024 gui_remove_scrollbars();
29033025 #endif
29043026 tp->tp_curwin = curwin;
3027+ tp->tp_prevwin = prevwin;
29053028 tp->tp_firstwin = firstwin;
29063029 tp->tp_lastwin = lastwin;
29073030 tp->tp_old_Rows = Rows;
@@ -2925,6 +3048,7 @@
29253048 lastwin = tp->tp_lastwin;
29263049 topframe = tp->tp_topframe;
29273050 win_enter_ext(tp->tp_curwin, FALSE, TRUE);
3051+ prevwin = tp->tp_prevwin;
29283052
29293053 #ifdef FEAT_AUTOCMD
29303054 if (old_curbuf != curbuf)
@@ -2985,12 +3109,13 @@
29853109 {
29863110 /* Go to tab page "n". */
29873111 i = 0;
2988- for (tp = first_tabpage; ++i != n; tp = tp->tp_next)
2989- if (tp == NULL)
2990- {
2991- beep_flush();
2992- return;
2993- }
3112+ for (tp = first_tabpage; ++i != n && tp != NULL; tp = tp->tp_next)
3113+ ;
3114+ if (tp == NULL)
3115+ {
3116+ beep_flush();
3117+ return;
3118+ }
29943119 }
29953120
29963121 leave_tabpage(otp);
@@ -3418,8 +3543,9 @@
34183543 * remove window 'wp' from the window list and free the structure
34193544 */
34203545 static void
3421-win_free(wp)
3546+win_free(wp, tp)
34223547 win_T *wp;
3548+ tabpage_T *tp; /* tab page "win" is in, NULL for current */
34233549 {
34243550 int i;
34253551
@@ -3478,7 +3604,7 @@
34783604 }
34793605 #endif /* FEAT_GUI */
34803606
3481- win_remove(wp);
3607+ win_remove(wp, tp);
34823608 vim_free(wp);
34833609 }
34843610
@@ -3512,17 +3638,22 @@
35123638 * Remove a window from the window list.
35133639 */
35143640 static void
3515-win_remove(wp)
3641+win_remove(wp, tp)
35163642 win_T *wp;
3643+ tabpage_T *tp; /* tab page "win" is in, NULL for current */
35173644 {
35183645 if (wp->w_prev != NULL)
35193646 wp->w_prev->w_next = wp->w_next;
3647+ else if (tp == NULL)
3648+ firstwin = wp->w_next;
35203649 else
3521- firstwin = wp->w_next;
3650+ tp->tp_firstwin = wp->w_next;
35223651 if (wp->w_next != NULL)
35233652 wp->w_next->w_prev = wp->w_prev;
3653+ else if (tp == NULL)
3654+ lastwin = wp->w_prev;
35243655 else
3525- lastwin = wp->w_prev;
3656+ tp->tp_lastwin = wp->w_prev;
35263657 }
35273658
35283659 /*
@@ -3600,6 +3731,7 @@
36003731
36013732 /*
36023733 * Called from win_new_shellsize() after Rows changed.
3734+ * This only does the current tab page, others must be done when made active.
36033735 */
36043736 void
36053737 shell_new_rows()
@@ -5115,16 +5247,27 @@
51155247 min_rows()
51165248 {
51175249 int total;
5250+#ifdef FEAT_WINDOWS
5251+ tabpage_T *tp;
5252+ int n;
5253+#endif
51185254
51195255 if (firstwin == NULL) /* not initialized yet */
51205256 return MIN_LINES;
51215257
5122- total = 1; /* count the room for the command line */
51235258 #ifdef FEAT_WINDOWS
5124- total += frame_minheight(topframe, NULL);
5259+ total = 0;
5260+ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
5261+ {
5262+ n = frame_minheight(tp->tp_topframe, NULL);
5263+ if (total < n)
5264+ total = n;
5265+ }
5266+ total += tabpageline_height();
51255267 #else
5126- total += 1; /* at least one window should have a line! */
5268+ total = 1; /* at least one window should have a line! */
51275269 #endif
5270+ total += 1; /* count the room for the command line */
51285271 return total;
51295272 }
51305273
@@ -5169,7 +5312,9 @@
51695312 win_T *wp;
51705313
51715314 #ifdef FEAT_WINDOWS
5172- for (wp = firstwin; wp != NULL; wp = wp->w_next)
5315+ tabpage_T *tp;
5316+
5317+ FOR_ALL_TAB_WINDOWS(tp, wp)
51735318 if ((do_curwin || wp != curwin) && wp->w_buffer == curbuf)
51745319 #else
51755320 wp = curwin;
Show on old repository browser