Mirror of the Vim source from https://github.com/vim/vim
Révision | 4b8583e82cb8875d14ff928db281aea8145d0b0d (tree) |
---|---|
l'heure | 2006-02-19 07:14:51 |
Auteur | vimboss |
Commiter | vimboss |
updated for version 7.0201
@@ -1,7 +1,7 @@ | ||
1 | 1 | " Vim completion script |
2 | 2 | " Language: XHTML 1.0 Strict |
3 | 3 | " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) |
4 | -" Last Change: 2006 Feb 6 | |
4 | +" Last Change: 2006 Feb 18 | |
5 | 5 | |
6 | 6 | function! htmlcomplete#CompleteTags(findstart, base) |
7 | 7 | if a:findstart |
@@ -540,24 +540,26 @@ | ||
540 | 540 | let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack") |
541 | 541 | return [opentag.">"] |
542 | 542 | endif |
543 | + " Load data {{{ | |
544 | + if !exists("g:xmldata_xhtml10s") | |
545 | + runtime! autoload/xml/xhtml10s.vim | |
546 | + endif | |
547 | + " }}} | |
548 | + " Tag completion {{{ | |
543 | 549 | " Deal with tag completion. |
544 | 550 | let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack") |
545 | 551 | if opentag == '' |
546 | 552 | " Hack for sometimes failing GetLastOpenTag. |
547 | 553 | " As far as I tested fail isn't GLOT fault but problem |
548 | 554 | " of invalid document - not properly closed tags and other mish-mash. |
549 | - " If returns empty string assume <body>. Safe bet. | |
550 | - let opentag = 'body' | |
555 | + " Also when document is empty. Return list of *all* tags. | |
556 | + let tags = keys(g:xmldata_xhtml10s) | |
557 | + call filter(tags, 'v:val !~ "^vimxml"') | |
558 | + else | |
559 | + let tags = g:xmldata_xhtml10s[opentag][0] | |
551 | 560 | endif |
552 | 561 | " }}} |
553 | - " Load data {{{ | |
554 | - if !exists("g:xmldata_xhtml10s") | |
555 | - runtime! autoload/xml/xhtml10s.vim | |
556 | - endif | |
557 | - " }}} | |
558 | - " Tag completion {{{ | |
559 | 562 | |
560 | - let tags = g:xmldata_xhtml10s[opentag][0] | |
561 | 563 | |
562 | 564 | for m in sort(tags) |
563 | 565 | if m =~ '^'.context |
@@ -1,7 +1,7 @@ | ||
1 | 1 | " Vim completion script |
2 | 2 | " Language: XML |
3 | 3 | " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) |
4 | -" Last Change: 2006 Feb 6 | |
4 | +" Last Change: 2006 Feb 18 | |
5 | 5 | |
6 | 6 | " This function will create Dictionary with users namespace strings and values |
7 | 7 | " canonical (system) names of data files. Names should be lowercase, |
@@ -319,10 +319,13 @@ | ||
319 | 319 | let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack") |
320 | 320 | let opentag = substitute(opentag, '^\k*:', '', '') |
321 | 321 | if opentag == '' |
322 | - return [] | |
322 | + "return [] | |
323 | + let tags = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}) | |
324 | + call filter(tags, 'v:val !~ "^vimxml"') | |
325 | + else | |
326 | + let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0] | |
323 | 327 | endif |
324 | 328 | |
325 | - let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0] | |
326 | 329 | let context = substitute(context, '^\k*:', '', '') |
327 | 330 | |
328 | 331 | for m in tags |
@@ -89,6 +89,7 @@ | ||
89 | 89 | starting.txt \ |
90 | 90 | spell.txt \ |
91 | 91 | syntax.txt \ |
92 | + tabpage.txt \ | |
92 | 93 | tagsrch.txt \ |
93 | 94 | term.txt \ |
94 | 95 | tips.txt \ |
@@ -211,6 +212,7 @@ | ||
211 | 212 | starting.html \ |
212 | 213 | spell.html \ |
213 | 214 | syntax.html \ |
215 | + tabpage.html \ | |
214 | 216 | tagsrch.html \ |
215 | 217 | tags.html \ |
216 | 218 | term.html \ |
@@ -1,4 +1,4 @@ | ||
1 | -*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 13 | |
1 | +*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -284,6 +284,8 @@ | ||
284 | 284 | |
285 | 285 | |WinEnter| after entering another window |
286 | 286 | |WinLeave| before leaving a window |
287 | +|TabEnterPost| after entering another tab page | |
288 | +|TabLeavePre| before leaving a tab page | |
287 | 289 | |CmdwinEnter| after entering the command-line window |
288 | 290 | |CmdwinLeave| before leaving the command-line window |
289 | 291 |
@@ -704,6 +706,14 @@ | ||
704 | 706 | where this option was set, and <amatch> for |
705 | 707 | the new value of 'syntax'. |
706 | 708 | See |:syn-on|. |
709 | + *TabEnterPost* | |
710 | +TabEnterPost Just after entering a tab page. |tab-page| | |
711 | + Before triggering the WinEnter and BufEnter | |
712 | + events. | |
713 | + *TabLeavePre* | |
714 | +TabLeavePre Just before leaving a tab page. |tab-page| | |
715 | + BufLeave and WinLeave events will have been | |
716 | + triggered first. | |
707 | 717 | *TermChanged* |
708 | 718 | TermChanged After the value of 'term' has changed. Useful |
709 | 719 | for re-loading the syntax file to update the |
@@ -1,4 +1,4 @@ | ||
1 | -*diff.txt* For Vim version 7.0aa. Last change: 2006 Jan 22 | |
1 | +*diff.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -41,6 +41,10 @@ | ||
41 | 41 | |
42 | 42 | This only works when a standard "diff" command is available. See 'diffexpr'. |
43 | 43 | |
44 | +Diffs are local to the current tab page |tab-page|. You can't see diffs with | |
45 | +a window in another tab page. This does make it possible to have several | |
46 | +diffs at the same time, each in their own tab page. | |
47 | + | |
44 | 48 | What happens is that Vim opens a window for each of the files. This is like |
45 | 49 | using the |-O| argument. This uses vertical splits. If you prefer horizontal |
46 | 50 | splits add the |-o| argument: > |
@@ -113,7 +117,7 @@ | ||
113 | 117 | *:diffo* *:diffoff* |
114 | 118 | :diffoff Switch off diff mode for the current window. |
115 | 119 | |
116 | -:diffoff! Switch off diff mode for all windows. | |
120 | +:diffoff! Switch off diff mode for all windows in the current tab page. | |
117 | 121 | |
118 | 122 | The ":diffoff" command resets the relevant options to their default value. |
119 | 123 | This may be different from what the values were before diff mode was started, |
@@ -1,4 +1,4 @@ | ||
1 | -*editing.txt* For Vim version 7.0aa. Last change: 2006 Jan 20 | |
1 | +*editing.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1014,6 +1014,9 @@ | ||
1014 | 1014 | Vim refuses to |abandon| the current buffer, and when |
1015 | 1015 | the last file in the argument list has not been |
1016 | 1016 | edited. |
1017 | + If there are other tab pages and quitting the last | |
1018 | + window in the current tab page the current tab page is | |
1019 | + closed |tab-page|. | |
1017 | 1020 | |
1018 | 1021 | :conf[irm] q[uit] Quit, but give prompt when changes have been made, or |
1019 | 1022 | the last file in the argument list has not been |
@@ -1,4 +1,4 @@ | ||
1 | -*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 14 | |
1 | +*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1690,6 +1690,7 @@ | ||
1690 | 1690 | String attribute {what} of syntax ID {synID} |
1691 | 1691 | synIDtrans( {synID}) Number translated syntax ID of {synID} |
1692 | 1692 | system( {expr} [, {input}]) String output of shell command/filter {expr} |
1693 | +tabpage( [{expr}]) Number number of current tab page | |
1693 | 1694 | taglist( {expr}) List list of tags matching {expr} |
1694 | 1695 | tagfiles() List tags files used |
1695 | 1696 | tempname() String name for a temporary file |
@@ -1705,7 +1706,7 @@ | ||
1705 | 1706 | wincol() Number window column of the cursor |
1706 | 1707 | winheight( {nr}) Number height of window {nr} |
1707 | 1708 | winline() Number window line of the cursor |
1708 | -winnr() Number number of current window | |
1709 | +winnr( [{expr}]) Number number of current window | |
1709 | 1710 | winrestcmd() String returns command to restore window sizes |
1710 | 1711 | winwidth( {nr}) Number width of window {nr} |
1711 | 1712 | writefile({list}, {fname} [, {binary}]) |
@@ -4447,6 +4448,14 @@ | ||
4447 | 4448 | Use |:checktime| to force a check. |
4448 | 4449 | |
4449 | 4450 | |
4451 | +tabpagenr([{arg}]) *tabpagenr()* | |
4452 | + The result is a Number, which is the number of the current | |
4453 | + tab page. The first tab page has number 1. | |
4454 | + When the optional argument is "$", the number of the last tab | |
4455 | + page is returned (the tab page count). | |
4456 | + The number can be used with the |:tab| command. | |
4457 | + | |
4458 | + | |
4450 | 4459 | taglist({expr}) *taglist()* |
4451 | 4460 | Returns a list of tags matching the regular expression {expr}. |
4452 | 4461 | Each list item is a dictionary with at least the following |
@@ -4618,7 +4627,7 @@ | ||
4618 | 4627 | winnr([{arg}]) The result is a Number, which is the number of the current |
4619 | 4628 | window. The top window has number 1. |
4620 | 4629 | When the optional argument is "$", the number of the |
4621 | - last window is returnd (the window count). | |
4630 | + last window is returned (the window count). | |
4622 | 4631 | When the optional argument is "#", the number of the last |
4623 | 4632 | accessed window is returned (where |CTRL-W_p| goes to). |
4624 | 4633 | If there is no previous window 0 is returned. |
@@ -1,4 +1,4 @@ | ||
1 | -*help.txt* For Vim version 7.0aa. Last change: 2005 Nov 30 | |
1 | +*help.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | VIM - main help file |
4 | 4 | k |
@@ -122,6 +122,7 @@ | ||
122 | 122 | |tagsrch.txt| tags and special searches |
123 | 123 | |quickfix.txt| commands for a quick edit-compile-fix cycle |
124 | 124 | |windows.txt| commands for using multiple windows and buffers |
125 | +|tabpage.txt| commands for using multiple tab pages | |
125 | 126 | |syntax.txt| syntax highlighting |
126 | 127 | |spell.txt| spell checking |
127 | 128 | |diff.txt| working with two or three versions of the same file |
@@ -1,4 +1,4 @@ | ||
1 | -*index.txt* For Vim version 7.0aa. Last change: 2006 Jan 26 | |
1 | +*index.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1305,7 +1305,7 @@ | ||
1305 | 1305 | |:omap| :om[ap] like ":map" but for Operator-pending mode |
1306 | 1306 | |:omapclear| :omapc[lear] remove all mappings for Operator-pending mode |
1307 | 1307 | |:omenu| :ome[nu] add menu for Operator-pending mode |
1308 | -|:only| :on[ly] close all windows except current one | |
1308 | +|:only| :on[ly] close all windows except the current one | |
1309 | 1309 | |:onoremap| :ono[remap] like ":noremap" but for Operator-pending mode |
1310 | 1310 | |:onoremenu| :onoreme[nu] like ":noremenu" but for Operator-pending mode |
1311 | 1311 | |:options| :opt[ions] open the options-window |
@@ -1436,6 +1436,13 @@ | ||
1436 | 1436 | |:syncbind| :sync[bind] sync scroll binding |
1437 | 1437 | |:t| :t same as ":copy" |
1438 | 1438 | |:tNext| :tN[ext] jump to previous matching tag |
1439 | +|:tabclose| :tabc[lose] close current tab page | |
1440 | +|:tabedit| :tabe[dit] edit a file in a new tab page | |
1441 | +|:tabfind| :tabf[ind] find file in 'path', edit it in a new tab page | |
1442 | +|:tabnew| :tabn[ew] edit a file in a new tab page | |
1443 | +|:tabonly| :tabo[nly] close all tab pages except the current one | |
1444 | +|:tabs| :tabs list the tab pages and what they contain | |
1445 | +|:tab| :tab jump to another tab page | |
1439 | 1446 | |:tag| :ta[g] jump to tag |
1440 | 1447 | |:tags| :tags show the contents of the tag stack |
1441 | 1448 | |:tcl| :tc[l] execute Tcl command |
@@ -1,4 +1,4 @@ | ||
1 | -*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 14 | |
1 | +*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -5336,6 +5336,8 @@ | ||
5336 | 5336 | winsize window sizes |
5337 | 5337 | |
5338 | 5338 | Don't include both "curdir" and "sesdir". |
5339 | + There is no option to include tab pages yet, only the current tab page | |
5340 | + is stored in the session. |tab-page| | |
5339 | 5341 | When "curdir" nor "sesdir" is included, file names are stored with |
5340 | 5342 | absolute paths. |
5341 | 5343 | "slash" and "unix" are useful on Windows when sharing session files |
@@ -6232,6 +6234,19 @@ | ||
6232 | 6234 | 'S' flag in 'cpoptions'. |
6233 | 6235 | Only normal file name characters can be used, "/\*?[|<>" are illegal. |
6234 | 6236 | |
6237 | + *'tabline'* *'tal'* | |
6238 | +'tabline' 'tal' number (default 1) | |
6239 | + global | |
6240 | + {not in Vi} | |
6241 | + {not available when compiled without the +windows | |
6242 | + feature} | |
6243 | + The value of this option specifies when the line with tab page labels | |
6244 | + will be displayed: | |
6245 | + 0: never | |
6246 | + 1: only if there are at least two tab pages | |
6247 | + 2: always | |
6248 | + |tab-page| | |
6249 | + | |
6235 | 6250 | *'tabstop'* *'ts'* |
6236 | 6251 | 'tabstop' 'ts' number (default 8) |
6237 | 6252 | local to buffer |
@@ -1,4 +1,4 @@ | ||
1 | -*starting.txt* For Vim version 7.0aa. Last change: 2006 Feb 14 | |
1 | +*starting.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -374,6 +374,13 @@ | ||
374 | 374 | the command line determines how the windows will be split. |
375 | 375 | {not in Vi} |
376 | 376 | |
377 | + *-p* | |
378 | +-p[N] Open N tab pages. If [N] is not given, one tab page is opened | |
379 | + for every file given as argument. The maximum is 10 tab | |
380 | + pages. If there are more tab pages than arguments, the last | |
381 | + few tab pages will be editing an empty file. | |
382 | + {not in Vi} | |
383 | + | |
377 | 384 | *-T* |
378 | 385 | -T {terminal} Set the terminal type to "terminal". This influences the |
379 | 386 | codes that Vim will send to your terminal. This is normally |
@@ -831,6 +838,8 @@ | ||
831 | 838 | 11. Open all windows |
832 | 839 | When the |-o| flag was given, windows will be opened (but not |
833 | 840 | displayed yet). |
841 | + When the |-p| flag was given, tab pages will be created (but not | |
842 | + displayed yet). | |
834 | 843 | When switching screens, it happens now. Redrawing starts. |
835 | 844 | If the "-q" flag was given to Vim, the first error is jumped to. |
836 | 845 | Buffers for all windows will be loaded. |
@@ -1203,6 +1212,9 @@ | ||
1203 | 1212 | :nmap <F2> :wa<Bar>exe "mksession! " . v:this_session<CR>:so ~/sessions/ |
1204 | 1213 | This saves the current Session, and starts off the command to load another. |
1205 | 1214 | |
1215 | +A session only includes the current tab page. There currently is no option to | |
1216 | +store all tab pages. |tab-page| | |
1217 | + | |
1206 | 1218 | The |SessionLoadPost| autocmd event is triggered after a session file is |
1207 | 1219 | loaded/sourced. |
1208 | 1220 | *SessionLoad-variable* |
@@ -0,0 +1,125 @@ | ||
1 | +*tabpage.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | + | |
3 | + | |
4 | + VIM REFERENCE MANUAL by Bram Moolenaar | |
5 | + | |
6 | + | |
7 | +Editing with windows in multuple tab pages. *tab-page* *tabpage* | |
8 | + | |
9 | +The commands which have been added to use multiple tab pages are explained | |
10 | +here. Additionally, there are explanations for commands that work differently | |
11 | +when used in combination with more than one tab page. | |
12 | + | |
13 | +1. Introduction |tab-page-intro| | |
14 | +2. Commands |tab-page-commands| | |
15 | +3. Other items |tab-page-other| | |
16 | + | |
17 | +{Vi does not have any of these commands} | |
18 | +{not able to use multiple tab pages when the |+windows| feature was disabled | |
19 | +at compile time} | |
20 | + | |
21 | +============================================================================== | |
22 | +1. Introduction *tab-page-intro* | |
23 | + | |
24 | +A tab page holds one or more windows. You can easily switch between tab | |
25 | +pages, so that you have several collections of windows to work on different | |
26 | +things. | |
27 | + | |
28 | +Usually you will see a list of labels at the top of the Vim window, one for | |
29 | +each tab page. With the mouse you can click on the label to jump to that tab | |
30 | +page. There are other ways to move between tab pages, see below. | |
31 | + | |
32 | +Most commands work only in the current tab page. That includes the |CTRL-W| | |
33 | +commands, |:windo|, |:all| and |:ball|. The commands that are aware of | |
34 | +other tab pages than the current one are mentioned below. | |
35 | + | |
36 | +Tabs are also a nice way to edit a buffer temporarily without changing the | |
37 | +current window layout. Open a new tab page, do whatever you want to do and | |
38 | +close the tab page. | |
39 | + | |
40 | +============================================================================== | |
41 | +2. Commands *tab-page-commands* | |
42 | + | |
43 | +OPENING A NEW TAB PAGE: | |
44 | + | |
45 | +When starting Vim "vim -p filename ..." opens each file argument in a separate | |
46 | +tab page (up to 10). |-p| | |
47 | + | |
48 | +:tabe[dit] *:tabe* *:tabedit* | |
49 | +:tabn[ew] Open a new tab page with an empty window. | |
50 | + | |
51 | +:tabe[dit] [++opt] [+cmd] {file} | |
52 | +:tabn[ew] [++opt] [+cmd] {file} | |
53 | + Open a new tab page and edit {file}, like with |:edit|. | |
54 | + | |
55 | +:tabf[ind] [++opt] [+cmd] {file} | |
56 | + Open a new tab page and edit {file} in 'path', like with | |
57 | + |:find|. | |
58 | + {not available when the |+file_in_path| feature was disabled | |
59 | + at compile time} | |
60 | + | |
61 | + | |
62 | +CLOSING A TAB PAGE: | |
63 | + | |
64 | +Using |:close| in the last window of a tab page closes it. | |
65 | + | |
66 | +Using the mouse: If the tab page line is displayed you can click in the "X" at | |
67 | +the top right to close the current tab page. |'tabline'| | |
68 | + | |
69 | + *:tabc* *:tabclose* | |
70 | +:tabc[lose][!] Close current tab page. | |
71 | + This command fails when: | |
72 | + - There is only one tab page on the screen. *E784* | |
73 | + - When 'hidden' is not set, [!] is not used, a buffer has | |
74 | + changes, and there is no other window on this buffer. | |
75 | + Changes to the buffer are not written and won't get lost, so | |
76 | + this is a "safe" command. | |
77 | + | |
78 | +:tabc[lose][!] {count} | |
79 | + Close tab page {count}. Fails in the same way as ':tabclose" | |
80 | + above. | |
81 | + | |
82 | + *:tabo* *:tabonly* | |
83 | +:tabo[nly][!] Close all other tab pages. | |
84 | + When the 'hidden' option is set, all buffers in closed windows | |
85 | + become hidden. | |
86 | + When 'hidden' is not set, and the 'autowrite' option is set, | |
87 | + modified buffers are written. Otherwise, windows that have | |
88 | + buffers that are modified are not removed, unless the [!] is | |
89 | + given, then they become hidden. But modified buffers are | |
90 | + never abandoned, so changes cannot get lost. | |
91 | + | |
92 | + | |
93 | +SWITCHING TO ANOTHER TAB PAGE: | |
94 | + | |
95 | +Using the mouse: If the tab page line is displayed you can click in a tab page | |
96 | +label to switch to that tab page. |'tabline'| | |
97 | + | |
98 | +:tab *:tab* *gt* | |
99 | +gt Go to the next tab page. Wraps around from the last to the | |
100 | + first one. | |
101 | + | |
102 | +:tab {count} | |
103 | +{count}gt Go to tab page {count}. The first tab page has number one. | |
104 | + | |
105 | + | |
106 | +Other commands: | |
107 | + *:tabs* | |
108 | +:tabs List the tab pages and the windows they contain. Shows a "+" | |
109 | + for modified buffers. | |
110 | + | |
111 | +============================================================================== | |
112 | +3. Other items *tab-page-other* | |
113 | + | |
114 | +You can use the 'tabline' option to specify when you want the line with tab | |
115 | +page labels to appear: never, when there is more than one tab page or always. | |
116 | + | |
117 | +Diff mode works per tab page. You can see the diffs between several files | |
118 | +within one tab page. Other tab pages can show differences between other | |
119 | +files. | |
120 | + | |
121 | +The TabLeavePre and TabEnterPost autocommand events can be used to do | |
122 | +something when switching from one tab page to another. | |
123 | + | |
124 | + | |
125 | + vim:tw=78:ts=8:ft=help:norl: |
@@ -892,6 +892,7 @@ | ||
892 | 892 | 't_vs' term.txt /*'t_vs'* |
893 | 893 | 't_xs' term.txt /*'t_xs'* |
894 | 894 | 'ta' options.txt /*'ta'* |
895 | +'tabline' options.txt /*'tabline'* | |
895 | 896 | 'tabstop' options.txt /*'tabstop'* |
896 | 897 | 'tag' options.txt /*'tag'* |
897 | 898 | 'tagbsearch' options.txt /*'tagbsearch'* |
@@ -899,6 +900,7 @@ | ||
899 | 900 | 'tagrelative' options.txt /*'tagrelative'* |
900 | 901 | 'tags' options.txt /*'tags'* |
901 | 902 | 'tagstack' options.txt /*'tagstack'* |
903 | +'tal' options.txt /*'tal'* | |
902 | 904 | 'tb' options.txt /*'tb'* |
903 | 905 | 'tbi' options.txt /*'tbi'* |
904 | 906 | 'tbidi' options.txt /*'tbidi'* |
@@ -1224,6 +1226,7 @@ | ||
1224 | 1226 | -n starting.txt /*-n* |
1225 | 1227 | -nb starting.txt /*-nb* |
1226 | 1228 | -o starting.txt /*-o* |
1229 | +-p starting.txt /*-p* | |
1227 | 1230 | -q starting.txt /*-q* |
1228 | 1231 | -qf starting.txt /*-qf* |
1229 | 1232 | -r starting.txt /*-r* |
@@ -2638,6 +2641,14 @@ | ||
2638 | 2641 | :tN tagsrch.txt /*:tN* |
2639 | 2642 | :tNext tagsrch.txt /*:tNext* |
2640 | 2643 | :ta tagsrch.txt /*:ta* |
2644 | +:tab tabpage.txt /*:tab* | |
2645 | +:tabc tabpage.txt /*:tabc* | |
2646 | +:tabclose tabpage.txt /*:tabclose* | |
2647 | +:tabe tabpage.txt /*:tabe* | |
2648 | +:tabedit tabpage.txt /*:tabedit* | |
2649 | +:tabo tabpage.txt /*:tabo* | |
2650 | +:tabonly tabpage.txt /*:tabonly* | |
2651 | +:tabs tabpage.txt /*:tabs* | |
2641 | 2652 | :tag tagsrch.txt /*:tag* |
2642 | 2653 | :tags tagsrch.txt /*:tags* |
2643 | 2654 | :tc if_tcl.txt /*:tc* |
@@ -3875,6 +3886,7 @@ | ||
3875 | 3886 | E781 spell.txt /*E781* |
3876 | 3887 | E782 spell.txt /*E782* |
3877 | 3888 | E783 spell.txt /*E783* |
3889 | +E784 tabpage.txt /*E784* | |
3878 | 3890 | E79 message.txt /*E79* |
3879 | 3891 | E80 message.txt /*E80* |
3880 | 3892 | E800 arabic.txt /*E800* |
@@ -4086,6 +4098,8 @@ | ||
4086 | 4098 | TERM starting.txt /*TERM* |
4087 | 4099 | TTpro-telnet syntax.txt /*TTpro-telnet* |
4088 | 4100 | Tab intro.txt /*Tab* |
4101 | +TabEnterPost autocmd.txt /*TabEnterPost* | |
4102 | +TabLeavePre autocmd.txt /*TabLeavePre* | |
4089 | 4103 | Tcl if_tcl.txt /*Tcl* |
4090 | 4104 | TermChanged autocmd.txt /*TermChanged* |
4091 | 4105 | TermResponse autocmd.txt /*TermResponse* |
@@ -5340,6 +5354,7 @@ | ||
5340 | 5354 | gs various.txt /*gs* |
5341 | 5355 | gsp.vim syntax.txt /*gsp.vim* |
5342 | 5356 | gstar pattern.txt /*gstar* |
5357 | +gt tabpage.txt /*gt* | |
5343 | 5358 | gtk-tooltip-colors gui_x11.txt /*gtk-tooltip-colors* |
5344 | 5359 | gu change.txt /*gu* |
5345 | 5360 | gugu change.txt /*gugu* |
@@ -5429,6 +5444,7 @@ | ||
5429 | 5444 | hebrew.txt hebrew.txt /*hebrew.txt* |
5430 | 5445 | help various.txt /*help* |
5431 | 5446 | help-context help.txt /*help-context* |
5447 | +help-tags tags 1 | |
5432 | 5448 | help-translated various.txt /*help-translated* |
5433 | 5449 | help-xterm-window various.txt /*help-xterm-window* |
5434 | 5450 | help.txt help.txt /*help.txt* |
@@ -6927,6 +6943,13 @@ | ||
6927 | 6943 | t_vs term.txt /*t_vs* |
6928 | 6944 | t_xs term.txt /*t_xs* |
6929 | 6945 | tab intro.txt /*tab* |
6946 | +tab-page tabpage.txt /*tab-page* | |
6947 | +tab-page-commands tabpage.txt /*tab-page-commands* | |
6948 | +tab-page-intro tabpage.txt /*tab-page-intro* | |
6949 | +tab-page-other tabpage.txt /*tab-page-other* | |
6950 | +tabpage tabpage.txt /*tabpage* | |
6951 | +tabpage.txt tabpage.txt /*tabpage.txt* | |
6952 | +tabpagenr() eval.txt /*tabpagenr()* | |
6930 | 6953 | tag tagsrch.txt /*tag* |
6931 | 6954 | tag-! tagsrch.txt /*tag-!* |
6932 | 6955 | tag-any-white tagsrch.txt /*tag-any-white* |
@@ -1,4 +1,4 @@ | ||
1 | -*tips.txt* For Vim version 7.0aa. Last change: 2006 Feb 16 | |
1 | +*tips.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -450,11 +450,13 @@ | ||
450 | 450 | This example shows the use of a few advanced tricks: |
451 | 451 | - using the |CursorMoved| autocommand event |
452 | 452 | - using |searchpairpos()| to find a matching paren |
453 | +- using |synID()| to detect whether the cursor is in a string or comment | |
453 | 454 | - using |:match| to highlight something |
454 | 455 | - using a |pattern| to match a specific position in the file. |
455 | 456 | |
456 | 457 | This should be put in a Vim script file, since it uses script-local variables. |
457 | -Note that it doesn't recognize strings or comments in the text. | |
458 | +It skips matches in strings or comments, unless the cursor started in string | |
459 | +or comment. This requires syntax highlighting. | |
458 | 460 | > |
459 | 461 | let s:paren_hl_on = 0 |
460 | 462 | function s:Highlight_Matching_Paren() |
@@ -484,8 +486,11 @@ | ||
484 | 486 | let c = '\[' |
485 | 487 | let c2 = '\]' |
486 | 488 | endif |
489 | + let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . | |
490 | + \ '=~? "string\\|comment"' | |
491 | + execute 'if' s_skip '| let s_skip = 0 | endif' | |
487 | 492 | |
488 | - let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags) | |
493 | + let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip) | |
489 | 494 | |
490 | 495 | if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$') |
491 | 496 | exe 'match Search /\(\%' . c_lnum . 'l\%' . c_col . |
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 17 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -32,52 +32,15 @@ | ||
32 | 32 | |
33 | 33 | Support WINDOW TABS. Works like several pages, each with their own split |
34 | 34 | windows. Let's call them "tab pages". |
35 | - - Add tabpage(): returns current tab page number. | |
36 | - - ":tabsplit" makes a copy of the current tab page. | |
37 | - - Add TabLeavePre and TabEnterPost autocommands | |
38 | 35 | - line at top of frame with tabs. |
39 | 36 | Add 'tabtext' option, like 'statusline'. |
40 | - - check for E999 | |
37 | + - Need to be able to search the windows in inactive tabs, e.g. for the | |
38 | + quickfix window? | |
41 | 39 | - docs: |
42 | - General remark: commands that work on windows only work on the windows | |
43 | - in the current tab page. Including :windo. | |
44 | - Session file only contains the current tab page. | |
45 | - :tabedit | |
46 | - :tabfind | |
47 | - :tab N | |
48 | - :tabs | |
49 | - {count}gt | |
50 | - :close may close current tab page if there is one window. | |
51 | - :tabclose | |
52 | - :tabclose N - close tab N | |
53 | - :tabonly - close all other tabs. | |
54 | - :close and :quit (last window in tab) | |
55 | - "gt": Use "1gt" - "99gt" to switch to another tab. "gt" goes to the | |
56 | - next one. Hint in docs: To mess with another buffer, without | |
57 | - changing the window layout, do this in another tab. | |
58 | - 'tabline' values 0/1/2 | |
59 | - mouse click in tabline: | |
60 | - select a tab page | |
61 | - X closes current tab page | |
62 | - :argall and :ball only opens window for buffers that are not in any | |
63 | - window in any tab page | |
64 | - :diffoff only works in the current tab page | |
65 | - diff works per tab page | |
66 | - "vim -p *" opens each file in a separate tab page (up to 10). | |
67 | - - add GUI Tabs for some systems. | |
68 | - Patch for GTK 1.2 passed on by Christian Michon, 2004 Jan 6. | |
69 | - Simple patch for GTK by Luis M (nov 7). | |
70 | - - Need to be able to search the windows in inactive tabs, e.g. for the | |
71 | - quickfix window. | |
72 | -Future enhancements: | |
73 | - tab page local variables? | |
74 | - tab page local options? 'diffopt' could differ between tab pages. | |
75 | - tab page local colors? | |
40 | + Add info to the user manual somewhere. | |
76 | 41 | |
77 | 42 | Crash with X command server (Ciaran McCreesh). |
78 | 43 | |
79 | -Motif: in diff mode dragging one scrollbar doesn't update the other one. | |
80 | - | |
81 | 44 | Ctags still hasn't included the patch. Darren is looking for someone to do |
82 | 45 | maintanance. |
83 | 46 |
@@ -494,6 +457,16 @@ | ||
494 | 457 | Check if file explorer can handle directory names and links with a single |
495 | 458 | quote. (Nieko Maatjes, 2005 Jan 4) |
496 | 459 | |
460 | +Future enhancements for tab pages: | |
461 | + - Add GUI Tabs for all systems. | |
462 | + Patch for GTK 1.2 passed on by Christian Michon, 2004 Jan 6. | |
463 | + Simple patch for GTK by Luis M (nov 7). | |
464 | + - ":tabsplit" makes a copy of the current tab page. | |
465 | + - Add local variables for each tab page? | |
466 | + - Add local options for each tab page? E.g., 'diffopt' could differ | |
467 | + between tab pages. | |
468 | + - Add local highlighting for a tab page? | |
469 | + | |
497 | 470 | |
498 | 471 | Vi incompatibility: |
499 | 472 | 8 With undo/redo only marks in the changed lines should be changed. Other |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 17 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1707,4 +1707,7 @@ | ||
1707 | 1707 | When "umask" is set such that nothing is writable then the viminfo file would |
1708 | 1708 | be written without write permission. (Julian Bridle) |
1709 | 1709 | |
1710 | +Motif: In diff mode dragging one scrollbar didn't update the scrollbar of the | |
1711 | +other diff'ed window. | |
1712 | + | |
1710 | 1713 | vim:tw=78:ts=8:ft=help:norl: |
@@ -1,4 +1,4 @@ | ||
1 | -*windows.txt* For Vim version 7.0aa. Last change: 2006 Jan 27 | |
1 | +*windows.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -68,6 +68,9 @@ | ||
68 | 68 | Note: All CTRL-W commands can also be executed with |:wincmd|, for those |
69 | 69 | places where a Normal mode command can't be used or is inconvenient. |
70 | 70 | |
71 | +The main Vim window can hold several split windows. There are also tab pages | |
72 | +|tab-page|, each of which can hold multiple windows. | |
73 | + | |
71 | 74 | ============================================================================== |
72 | 75 | 2. Starting Vim *windows-starting* |
73 | 76 |
@@ -255,6 +258,9 @@ | ||
255 | 258 | :clo[se][!] Close current window. When the 'hidden' option is set, or |
256 | 259 | when the buffer was changed and the [!] is used, the buffer |
257 | 260 | becomes hidden (unless there is another window editing it). |
261 | + When there is only one window in the current tab page and | |
262 | + there is another tab page, this closes the current tab page. | |
263 | + |tab-page|. | |
258 | 264 | This command fails when: *E444* |
259 | 265 | - There is only one window on the screen. |
260 | 266 | - When 'hidden' is not set, [!] is not used, the buffer has |
@@ -271,6 +277,8 @@ | ||
271 | 277 | :hid[e] Quit current window, unless it is the last window on the |
272 | 278 | screen. The buffer becomes hidden (unless there is another |
273 | 279 | window editing it or 'bufhidden' is "unload" or "delete"). |
280 | + If the window is the last one in the current tab page the tab | |
281 | + page is closed. |tab-page| | |
274 | 282 | The value of 'hidden' is irrelevant for this command. |
275 | 283 | Changes to the buffer are not written and won't get lost, so |
276 | 284 | this is a "safe" command. |
@@ -551,6 +559,7 @@ | ||
551 | 559 | Rearrange the screen to open one window for each argument. |
552 | 560 | All other windows are closed. When a count is given, this is |
553 | 561 | the maximum number of windows to open. |
562 | + Only uses the current tab page |tab-page|. | |
554 | 563 | When the 'hidden' option is set, all buffers in closed windows |
555 | 564 | become hidden. |
556 | 565 | When 'hidden' is not set, and the 'autowrite' option is set, |
@@ -620,7 +629,8 @@ | ||
620 | 629 | CTRL-W w |
621 | 630 | :{cmd} |
622 | 631 | etc. |
623 | -< When an error is detected on one window, further | |
632 | +< This only works in the current tab page. | |
633 | + When an error is detected on one window, further | |
624 | 634 | windows will not be visited. |
625 | 635 | The last window (or where an error occurred) becomes |
626 | 636 | the current window. |
@@ -1073,6 +1083,7 @@ | ||
1073 | 1083 | of windows opened ('winwidth' if |:vertical| was prepended). |
1074 | 1084 | Buf/Win Enter/Leave autocommands are not executed for the new |
1075 | 1085 | windows here, that's only done when they are really entered. |
1086 | + Only uses the current tab page |tab-page|. | |
1076 | 1087 | |
1077 | 1088 | Note: All the commands above that start editing another buffer, keep the |
1078 | 1089 | 'readonly' flag as it was. This differs from the ":edit" command, which sets |
@@ -36,13 +36,16 @@ | ||
36 | 36 | directory. You can move this bundle (the Vim.app directory) anywhere |
37 | 37 | you want, for example, /Applications. |
38 | 38 | |
39 | + You need at least Xcode 1.5 to compile Vim 7.0. | |
40 | + | |
41 | + | |
39 | 42 | 1.2 X-Windows or Plain Text |
40 | 43 | |
41 | 44 | If you do not want the Carbon interface, you must explicitly tell |
42 | 45 | configure to use a different GUI. |
43 | 46 | |
44 | 47 | cd .. |
45 | - ./configure --enable-gui=gtk2 | |
48 | + ./configure --disable-darwin --enable-gui=gtk2 | |
46 | 49 | make; make install |
47 | 50 | |
48 | 51 | NOTE: The following GUI options are supported: |
@@ -1510,6 +1510,8 @@ | ||
1510 | 1510 | $(ALL_GUI_PRO) \ |
1511 | 1511 | $(TCL_PRO) |
1512 | 1512 | |
1513 | +ICON_APP = gui_mac.icns | |
1514 | + | |
1513 | 1515 | PRO_MANUAL = os_amiga.pro os_msdos.pro os_win16.pro os_win32.pro \ |
1514 | 1516 | os_mswin.pro os_beos.pro os_vms.pro os_riscos.pro $(PERL_PRO) |
1515 | 1517 |
@@ -2131,6 +2133,10 @@ | ||
2131 | 2133 | cp config.mk.dist $(SHADOWDIR) |
2132 | 2134 | mkdir $(SHADOWDIR)/xxd |
2133 | 2135 | cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* . |
2136 | + if test -f $(ICON_APP); then \ | |
2137 | + cd $(SHADOWDIR); \ | |
2138 | + ln -s ../$(ICON_APP) ../os_mac.rsr.hqx ../dehqx.py .; \ | |
2139 | + fi | |
2134 | 2140 | mkdir $(SHADOWDIR)/testdir |
2135 | 2141 | cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \ |
2136 | 2142 | ../../testdir/vimrc.unix \ |
@@ -2494,7 +2500,6 @@ | ||
2494 | 2500 | -DAPP_VER=$(VERSION) -DICON_APP=$(ICON_APP) |
2495 | 2501 | |
2496 | 2502 | ### Icons |
2497 | -ICON_APP = gui_mac.icns | |
2498 | 2503 | ICONS = $(RESDIR)/$(ICON_APP) |
2499 | 2504 | |
2500 | 2505 | # If you uncomment the following lines the *.icns in the src directory will be |
@@ -114,7 +114,6 @@ | ||
114 | 114 | static pos_T compl_startpos; |
115 | 115 | static colnr_T compl_col = 0; /* column where the text starts |
116 | 116 | * that is being completed */ |
117 | -static int save_sm = -1; | |
118 | 117 | static char_u *compl_orig_text = NULL; /* text as it was before |
119 | 118 | * completion started */ |
120 | 119 | static int compl_cont_mode = 0; |
@@ -2733,11 +2732,19 @@ | ||
2733 | 2732 | compl_pattern = NULL; |
2734 | 2733 | vim_free(compl_leader); |
2735 | 2734 | compl_leader = NULL; |
2736 | - save_sm = -1; | |
2737 | 2735 | edit_submode_extra = NULL; |
2738 | 2736 | } |
2739 | 2737 | |
2740 | 2738 | /* |
2739 | + * Return TRUE when Insert completion is active. | |
2740 | + */ | |
2741 | + int | |
2742 | +ins_compl_active() | |
2743 | +{ | |
2744 | + return compl_started; | |
2745 | +} | |
2746 | + | |
2747 | +/* | |
2741 | 2748 | * Delete one character before the cursor and show the subset of the matches |
2742 | 2749 | * that match the word that is now before the cursor. |
2743 | 2750 | * Returns TRUE if the work is done and another char to be got from the user. |
@@ -3071,8 +3078,6 @@ | ||
3071 | 3078 | compl_matches = 0; |
3072 | 3079 | msg_clr_cmdline(); /* necessary for "noshowmode" */ |
3073 | 3080 | ctrl_x_mode = 0; |
3074 | - if (save_sm >= 0) | |
3075 | - p_sm = save_sm; | |
3076 | 3081 | if (edit_submode != NULL) |
3077 | 3082 | { |
3078 | 3083 | edit_submode = NULL; |
@@ -3904,10 +3909,6 @@ | ||
3904 | 3909 | { |
3905 | 3910 | /* First time we hit ^N or ^P (in a row, I mean) */ |
3906 | 3911 | |
3907 | - /* Turn off 'sm' so we don't show matches with ^X^L */ | |
3908 | - save_sm = p_sm; | |
3909 | - p_sm = FALSE; | |
3910 | - | |
3911 | 3912 | did_ai = FALSE; |
3912 | 3913 | #ifdef FEAT_SMARTINDENT |
3913 | 3914 | did_si = FALSE; |
@@ -621,6 +621,7 @@ | ||
621 | 621 | static void f_synIDattr __ARGS((typval_T *argvars, typval_T *rettv)); |
622 | 622 | static void f_synIDtrans __ARGS((typval_T *argvars, typval_T *rettv)); |
623 | 623 | static void f_system __ARGS((typval_T *argvars, typval_T *rettv)); |
624 | +static void f_tabpagenr __ARGS((typval_T *argvars, typval_T *rettv)); | |
624 | 625 | static void f_taglist __ARGS((typval_T *argvars, typval_T *rettv)); |
625 | 626 | static void f_tagfiles __ARGS((typval_T *argvars, typval_T *rettv)); |
626 | 627 | static void f_tempname __ARGS((typval_T *argvars, typval_T *rettv)); |
@@ -6983,6 +6984,7 @@ | ||
6983 | 6984 | {"synIDattr", 2, 3, f_synIDattr}, |
6984 | 6985 | {"synIDtrans", 1, 1, f_synIDtrans}, |
6985 | 6986 | {"system", 1, 2, f_system}, |
6987 | + {"tabpagenr", 0, 1, f_tabpagenr}, | |
6986 | 6988 | {"tagfiles", 0, 0, f_tagfiles}, |
6987 | 6989 | {"taglist", 1, 1, f_taglist}, |
6988 | 6990 | {"tempname", 0, 0, f_tempname}, |
@@ -14868,6 +14870,40 @@ | ||
14868 | 14870 | } |
14869 | 14871 | |
14870 | 14872 | /* |
14873 | + * "tabpagenr()" function | |
14874 | + */ | |
14875 | +/* ARGSUSED */ | |
14876 | + static void | |
14877 | +f_tabpagenr(argvars, rettv) | |
14878 | + typval_T *argvars; | |
14879 | + typval_T *rettv; | |
14880 | +{ | |
14881 | + int nr = 1; | |
14882 | +#ifdef FEAT_WINDOWS | |
14883 | + tabpage_T *tp; | |
14884 | + char_u *arg; | |
14885 | + | |
14886 | + if (argvars[0].v_type != VAR_UNKNOWN) | |
14887 | + { | |
14888 | + arg = get_tv_string_chk(&argvars[0]); | |
14889 | + nr = 0; | |
14890 | + if (arg != NULL) | |
14891 | + { | |
14892 | + if (STRCMP(arg, "$") == 0) | |
14893 | + for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) | |
14894 | + ++nr; | |
14895 | + else | |
14896 | + EMSG2(_(e_invexpr2), arg); | |
14897 | + } | |
14898 | + } | |
14899 | + else | |
14900 | + for (tp = first_tabpage; tp != curtab; tp = tp->tp_next) | |
14901 | + ++nr; | |
14902 | +#endif | |
14903 | + rettv->vval.v_number = nr; | |
14904 | +} | |
14905 | + | |
14906 | +/* | |
14871 | 14907 | * "tagfiles()" function |
14872 | 14908 | */ |
14873 | 14909 | /*ARGSUSED*/ |
@@ -884,6 +884,8 @@ | ||
884 | 884 | EX(CMD_tabedit, "tabedit", ex_tabedit, |
885 | 885 | BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR), |
886 | 886 | EX(CMD_tabfind, "tabfind", ex_tabedit, |
887 | + BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|NEEDARG|TRLBAR), | |
888 | +EX(CMD_tabnew, "tabnew", ex_tabedit, | |
887 | 889 | BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR), |
888 | 890 | EX(CMD_tabonly, "tabonly", ex_tabonly, |
889 | 891 | TRLBAR|CMDWIN), |
@@ -6228,7 +6228,7 @@ | ||
6228 | 6228 | else |
6229 | 6229 | # endif |
6230 | 6230 | if (first_tabpage->tp_next == NULL) |
6231 | - EMSG(_("E999: Cannot close last tab page")); | |
6231 | + EMSG(_("E784: Cannot close last tab page")); | |
6232 | 6232 | else |
6233 | 6233 | { |
6234 | 6234 | if (eap->addr_count > 0) |
@@ -6239,7 +6239,7 @@ | ||
6239 | 6239 | beep_flush(); |
6240 | 6240 | return; |
6241 | 6241 | } |
6242 | - if (tp->tp_topframe != topframe) | |
6242 | + if (tp != curtab) | |
6243 | 6243 | { |
6244 | 6244 | tabpage_close_other(tp, eap->forceit); |
6245 | 6245 | return; |
@@ -6975,9 +6975,10 @@ | ||
6975 | 6975 | } |
6976 | 6976 | |
6977 | 6977 | /* |
6978 | - * :tabedit [[+command] file] open new Tab page with empty window | |
6979 | - * :tabedit [[+command] file] open new Tab page and edit "file" | |
6980 | - * :tabfind [[+command] file] open new Tab page and find "file" | |
6978 | + * :tabedit open new Tab page with empty window | |
6979 | + * :tabedit [+command] file open new Tab page and edit "file" | |
6980 | + * :tabnew [[+command] file] just like :tabedit | |
6981 | + * :tabfind [+command] file open new Tab page and find "file" | |
6981 | 6982 | */ |
6982 | 6983 | void |
6983 | 6984 | ex_tabedit(eap) |
@@ -10626,6 +10627,11 @@ | ||
10626 | 10627 | eap->errmsg = e_trailing; |
10627 | 10628 | return; |
10628 | 10629 | } |
10630 | + if (*end != *p) | |
10631 | + { | |
10632 | + EMSG2(_(e_invarg2), p); | |
10633 | + return; | |
10634 | + } | |
10629 | 10635 | |
10630 | 10636 | c = *end; |
10631 | 10637 | *end = NUL; |
@@ -6960,8 +6960,10 @@ | ||
6960 | 6960 | {"SpellFileMissing",EVENT_SPELLFILEMISSING}, |
6961 | 6961 | {"StdinReadPost", EVENT_STDINREADPOST}, |
6962 | 6962 | {"StdinReadPre", EVENT_STDINREADPRE}, |
6963 | + {"SwapExists", EVENT_SWAPEXISTS}, | |
6963 | 6964 | {"Syntax", EVENT_SYNTAX}, |
6964 | - {"SwapExists", EVENT_SWAPEXISTS}, | |
6965 | + {"TabEnterPost", EVENT_TABENTERPOST}, | |
6966 | + {"TabLeavePre", EVENT_TABLEAVEPRE}, | |
6965 | 6967 | {"TermChanged", EVENT_TERMCHANGED}, |
6966 | 6968 | {"TermResponse", EVENT_TERMRESPONSE}, |
6967 | 6969 | {"User", EVENT_USER}, |
@@ -3598,14 +3598,9 @@ | ||
3598 | 3598 | * have both a left and right scrollbar, and we drag one of them, we still |
3599 | 3599 | * need to update the other one. |
3600 | 3600 | */ |
3601 | - if ( (gui.dragged_sb == SBAR_LEFT | |
3602 | - || gui.dragged_sb == SBAR_RIGHT) | |
3603 | - && (!gui.which_scrollbars[SBAR_LEFT] | |
3604 | - || !gui.which_scrollbars[SBAR_RIGHT]) | |
3605 | - && !force) | |
3606 | - return; | |
3607 | - | |
3608 | - if (!force && (gui.dragged_sb == SBAR_LEFT || gui.dragged_sb == SBAR_RIGHT)) | |
3601 | + if (!force && (gui.dragged_sb == SBAR_LEFT || gui.dragged_sb == SBAR_RIGHT) | |
3602 | + && gui.which_scrollbars[SBAR_LEFT] | |
3603 | + && gui.which_scrollbars[SBAR_RIGHT]) | |
3609 | 3604 | { |
3610 | 3605 | /* |
3611 | 3606 | * If we have two scrollbars and one of them is being dragged, just |
@@ -3618,7 +3613,6 @@ | ||
3618 | 3613 | gui.dragged_wp->w_scrollbars[0].value, |
3619 | 3614 | gui.dragged_wp->w_scrollbars[0].size, |
3620 | 3615 | gui.dragged_wp->w_scrollbars[0].max); |
3621 | - return; | |
3622 | 3616 | } |
3623 | 3617 | |
3624 | 3618 | /* avoid that moving components around generates events */ |
@@ -3628,6 +3622,12 @@ | ||
3628 | 3622 | { |
3629 | 3623 | if (wp->w_buffer == NULL) /* just in case */ |
3630 | 3624 | continue; |
3625 | + /* Skip a scrollbar that is being dragged. */ | |
3626 | + if (!force && (gui.dragged_sb == SBAR_LEFT | |
3627 | + || gui.dragged_sb == SBAR_RIGHT) | |
3628 | + && gui.dragged_wp == wp) | |
3629 | + continue; | |
3630 | + | |
3631 | 3631 | #ifdef SCROLL_PAST_END |
3632 | 3632 | max = wp->w_buffer->b_ml.ml_line_count - 1; |
3633 | 3633 | #else |
@@ -3759,11 +3759,12 @@ | ||
3759 | 3759 | #endif |
3760 | 3760 | sb->size = size; |
3761 | 3761 | sb->max = max; |
3762 | - if (gui.which_scrollbars[SBAR_LEFT] && gui.dragged_sb != SBAR_LEFT) | |
3762 | + if (gui.which_scrollbars[SBAR_LEFT] | |
3763 | + && (gui.dragged_sb != SBAR_LEFT || gui.dragged_wp != wp)) | |
3763 | 3764 | gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_LEFT], |
3764 | 3765 | val, size, max); |
3765 | 3766 | if (gui.which_scrollbars[SBAR_RIGHT] |
3766 | - && gui.dragged_sb != SBAR_RIGHT) | |
3767 | + && (gui.dragged_sb != SBAR_RIGHT || gui.dragged_wp != wp)) | |
3767 | 3768 | gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_RIGHT], |
3768 | 3769 | val, size, max); |
3769 | 3770 | } |
@@ -1710,15 +1710,6 @@ | ||
1710 | 1710 | #endif |
1711 | 1711 | break; |
1712 | 1712 | |
1713 | -#ifdef TARGET_API_MAC_OSX | |
1714 | - /* For some reason on MacOS X, an argument like: | |
1715 | - -psn_0_10223617 is passed in when invoke from Finder | |
1716 | - or with the 'open' command */ | |
1717 | - case 'p': | |
1718 | - argv_idx = -1; /* bypass full -psn */ | |
1719 | - main_start_gui(); | |
1720 | - break; | |
1721 | -#endif | |
1722 | 1713 | case 'M': /* "-M" no changes or writing of files */ |
1723 | 1714 | reset_modifiable(); |
1724 | 1715 | /* FALLTHROUGH */ |
@@ -1743,6 +1734,17 @@ | ||
1743 | 1734 | break; |
1744 | 1735 | |
1745 | 1736 | case 'p': /* "-p[N]" open N tab pages */ |
1737 | +#ifdef TARGET_API_MAC_OSX | |
1738 | + /* For some reason on MacOS X, an argument like: | |
1739 | + -psn_0_10223617 is passed in when invoke from Finder | |
1740 | + or with the 'open' command */ | |
1741 | + if (argv[0][argv_idx] == 's') | |
1742 | + { | |
1743 | + argv_idx = -1; /* bypass full -psn */ | |
1744 | + main_start_gui(); | |
1745 | + break; | |
1746 | + } | |
1747 | +#endif | |
1746 | 1748 | #ifdef FEAT_WINDOWS |
1747 | 1749 | /* default is 0: open window for each file */ |
1748 | 1750 | parmp->window_count = get_number_arg((char_u *)argv[0], |
@@ -2034,6 +2034,9 @@ | ||
2034 | 2034 | #ifdef FEAT_MBYTE |
2035 | 2035 | && charlen == 1 |
2036 | 2036 | #endif |
2037 | +#ifdef FEAT_INS_EXPAND | |
2038 | + && !ins_compl_active() | |
2039 | +#endif | |
2037 | 2040 | ) |
2038 | 2041 | showmatch(c); |
2039 | 2042 |
@@ -12,6 +12,7 @@ | ||
12 | 12 | void ins_compl_show_pum __ARGS((void)); |
13 | 13 | char_u *find_word_start __ARGS((char_u *ptr)); |
14 | 14 | char_u *find_word_end __ARGS((char_u *ptr)); |
15 | +int ins_compl_active __ARGS((void)); | |
15 | 16 | void ins_compl_check_keys __ARGS((int frequency)); |
16 | 17 | int get_literal __ARGS((void)); |
17 | 18 | void insertchar __ARGS((int c, int flags, int second_indent)); |
@@ -2516,6 +2516,7 @@ | ||
2516 | 2516 | long v; |
2517 | 2517 | |
2518 | 2518 | int char_attr = 0; /* attributes for next character */ |
2519 | + int attr_pri = FALSE; /* char_attr has priority */ | |
2519 | 2520 | int area_highlighting = FALSE; /* Visual or incsearch highlighting |
2520 | 2521 | in this line */ |
2521 | 2522 | int attr = 0; /* attributes for area highlighting */ |
@@ -2764,7 +2765,7 @@ | ||
2764 | 2765 | } |
2765 | 2766 | |
2766 | 2767 | /* |
2767 | - * handle 'insearch' and ":s///c" highlighting | |
2768 | + * handle 'incsearch' and ":s///c" highlighting | |
2768 | 2769 | */ |
2769 | 2770 | else |
2770 | 2771 | #endif /* FEAT_VISUAL */ |
@@ -3287,14 +3288,7 @@ | ||
3287 | 3288 | else if (area_attr != 0 |
3288 | 3289 | && (vcol == tocol |
3289 | 3290 | || (noinvcur && (colnr_T)vcol == wp->w_virtcol))) |
3290 | -#ifdef LINE_ATTR | |
3291 | - area_attr = line_attr; /* stop highlighting */ | |
3292 | - else if (line_attr && ((fromcol == -10 && tocol == MAXCOL) | |
3293 | - || (vcol < fromcol || vcol > tocol))) | |
3294 | - area_attr = line_attr; | |
3295 | -#else | |
3296 | 3291 | area_attr = 0; /* stop highlighting */ |
3297 | -#endif | |
3298 | 3292 | |
3299 | 3293 | #ifdef FEAT_SEARCH_EXTRA |
3300 | 3294 | if (!n_extra) |
@@ -3370,33 +3364,40 @@ | ||
3370 | 3364 | } |
3371 | 3365 | #endif |
3372 | 3366 | |
3373 | - if (area_attr != 0) | |
3374 | - char_attr = area_attr; | |
3375 | -#ifdef FEAT_SYN_HL | |
3376 | - else if (search_attr == 0 && has_syntax) | |
3377 | - char_attr = syntax_attr; | |
3378 | -#endif | |
3379 | - else | |
3380 | - char_attr = search_attr; | |
3381 | - | |
3382 | 3367 | #ifdef FEAT_DIFF |
3383 | - if (diff_hlf != (hlf_T)0 && n_extra == 0) | |
3368 | + if (diff_hlf != (hlf_T)0) | |
3384 | 3369 | { |
3385 | 3370 | if (diff_hlf == HLF_CHD && ptr - line >= change_start) |
3386 | 3371 | diff_hlf = HLF_TXD; /* changed text */ |
3387 | 3372 | if (diff_hlf == HLF_TXD && ptr - line > change_end) |
3388 | 3373 | diff_hlf = HLF_CHD; /* changed line */ |
3389 | - if (attr == 0 || area_attr != attr) | |
3390 | - area_attr = hl_attr(diff_hlf); | |
3391 | - if (attr == 0 || char_attr != attr) | |
3392 | - { | |
3393 | - if (search_attr != 0) | |
3394 | - char_attr = search_attr; | |
3395 | - else | |
3396 | - char_attr = hl_attr(diff_hlf); | |
3397 | - } | |
3398 | - } | |
3399 | -#endif | |
3374 | + line_attr = hl_attr(diff_hlf); | |
3375 | + } | |
3376 | +#endif | |
3377 | + | |
3378 | + /* Decide which of the highlight attributes to use. */ | |
3379 | + attr_pri = TRUE; | |
3380 | + if (area_attr != 0) | |
3381 | + char_attr = area_attr; | |
3382 | + else if (search_attr != 0) | |
3383 | + char_attr = search_attr; | |
3384 | +#ifdef LINE_ATTR | |
3385 | + /* Use line_attr when not in the Visual or 'incsearch' area | |
3386 | + * (area_attr may be 0 when "noinvcur" is set). */ | |
3387 | + else if (line_attr != 0 && ((fromcol == -10 && tocol == MAXCOL) | |
3388 | + || (vcol < fromcol || vcol >= tocol))) | |
3389 | + char_attr = line_attr; | |
3390 | +#endif | |
3391 | + else | |
3392 | + { | |
3393 | + attr_pri = FALSE; | |
3394 | +#ifdef FEAT_SYN_HL | |
3395 | + if (has_syntax) | |
3396 | + char_attr = syntax_attr; | |
3397 | + else | |
3398 | +#endif | |
3399 | + char_attr = 0; | |
3400 | + } | |
3400 | 3401 | } |
3401 | 3402 | |
3402 | 3403 | /* |
@@ -3727,7 +3728,7 @@ | ||
3727 | 3728 | line = ml_get_buf(wp->w_buffer, lnum, FALSE); |
3728 | 3729 | ptr = line + v; |
3729 | 3730 | |
3730 | - if (area_attr == 0 && search_attr == 0) | |
3731 | + if (!attr_pri) | |
3731 | 3732 | char_attr = syntax_attr; |
3732 | 3733 | else |
3733 | 3734 | char_attr = hl_combine_attr(syntax_attr, char_attr); |
@@ -3740,7 +3741,7 @@ | ||
3740 | 3741 | if (has_spell && v >= word_end && v > cur_checked_col) |
3741 | 3742 | { |
3742 | 3743 | spell_attr = 0; |
3743 | - if (area_attr == 0 && search_attr == 0) | |
3744 | + if (!attr_pri) | |
3744 | 3745 | char_attr = syntax_attr; |
3745 | 3746 | if (c != 0 && (!has_syntax || can_spell)) |
3746 | 3747 | { |
@@ -3813,7 +3814,7 @@ | ||
3813 | 3814 | } |
3814 | 3815 | if (spell_attr != 0) |
3815 | 3816 | { |
3816 | - if (area_attr == 0 && search_attr == 0) | |
3817 | + if (!attr_pri) | |
3817 | 3818 | char_attr = hl_combine_attr(char_attr, spell_attr); |
3818 | 3819 | else |
3819 | 3820 | char_attr = hl_combine_attr(spell_attr, char_attr); |
@@ -3840,7 +3841,7 @@ | ||
3840 | 3841 | if (trailcol != MAXCOL && ptr > line + trailcol && c == ' ') |
3841 | 3842 | { |
3842 | 3843 | c = lcs_trail; |
3843 | - if (area_attr == 0 && search_attr == 0) | |
3844 | + if (!attr_pri) | |
3844 | 3845 | { |
3845 | 3846 | n_attr = 1; |
3846 | 3847 | extra_attr = hl_attr(HLF_8); |
@@ -3953,7 +3954,7 @@ | ||
3953 | 3954 | c = ' '; |
3954 | 3955 | lcs_eol_one = -1; |
3955 | 3956 | --ptr; /* put it back at the NUL */ |
3956 | - if (area_attr == 0 && search_attr == 0) | |
3957 | + if (!attr_pri) | |
3957 | 3958 | { |
3958 | 3959 | extra_attr = hl_attr(HLF_AT); |
3959 | 3960 | n_attr = 1; |
@@ -3979,7 +3980,7 @@ | ||
3979 | 3980 | n_extra = byte2cells(c) - 1; |
3980 | 3981 | c_extra = NUL; |
3981 | 3982 | c = *p_extra++; |
3982 | - if (area_attr == 0 && search_attr == 0) | |
3983 | + if (!attr_pri) | |
3983 | 3984 | { |
3984 | 3985 | n_attr = n_extra + 1; |
3985 | 3986 | extra_attr = hl_attr(HLF_8); |
@@ -4042,8 +4043,7 @@ | ||
4042 | 4043 | /* Don't override visual selection highlighting. */ |
4043 | 4044 | if (n_attr > 0 |
4044 | 4045 | && draw_state == WL_LINE |
4045 | - && (area_attr == 0 || char_attr != area_attr) | |
4046 | - && (search_attr == 0 || char_attr != search_attr)) | |
4046 | + && !attr_pri) | |
4047 | 4047 | char_attr = extra_attr; |
4048 | 4048 | |
4049 | 4049 | #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) |
@@ -4108,8 +4108,7 @@ | ||
4108 | 4108 | else |
4109 | 4109 | mb_utf8 = FALSE; /* don't draw as UTF-8 */ |
4110 | 4110 | #endif |
4111 | - if ((area_attr == 0 || char_attr != area_attr) | |
4112 | - && (search_attr == 0 || char_attr != search_attr)) | |
4111 | + if (!attr_pri) | |
4113 | 4112 | { |
4114 | 4113 | saved_attr3 = char_attr; /* save current attr */ |
4115 | 4114 | char_attr = hl_attr(HLF_AT); /* later copied to char_attr */ |
@@ -36,5 +36,5 @@ | ||
36 | 36 | #define VIM_VERSION_NODOT "vim70aa" |
37 | 37 | #define VIM_VERSION_SHORT "7.0aa" |
38 | 38 | #define VIM_VERSION_MEDIUM "7.0aa ALPHA" |
39 | -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 17)" | |
40 | -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 17, compiled " | |
39 | +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 18)" | |
40 | +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 18, compiled " |
@@ -347,7 +347,7 @@ | ||
347 | 347 | /* |
348 | 348 | * The characters and attributes cached for the screen. |
349 | 349 | */ |
350 | -#define schar_T char_u | |
350 | +typedef char_u schar_T; | |
351 | 351 | #ifdef FEAT_SYN_HL |
352 | 352 | typedef unsigned short sattr_T; |
353 | 353 | # define MAX_TYPENR 65535 |
@@ -1109,6 +1109,8 @@ | ||
1109 | 1109 | EVENT_SPELLFILEMISSING, /* spell file missing */ |
1110 | 1110 | EVENT_CURSORMOVED, /* cursor was moved */ |
1111 | 1111 | EVENT_CURSORMOVEDI, /* cursor was moved in Insert mode */ |
1112 | + EVENT_TABLEAVEPRE, /* before leaving a tab page */ | |
1113 | + EVENT_TABENTERPOST, /* after entering a tab page */ | |
1112 | 1114 | NUM_EVENTS /* MUST be the last one */ |
1113 | 1115 | }; |
1114 | 1116 |
@@ -46,7 +46,7 @@ | ||
46 | 46 | #if defined(FEAT_WINDOWS) || defined(PROTO) |
47 | 47 | static tabpage_T *alloc_tabpage __ARGS((void)); |
48 | 48 | static void free_tabpage __ARGS((tabpage_T *tp)); |
49 | -static void leave_tabpage __ARGS((tabpage_T *tp)); | |
49 | +static int leave_tabpage __ARGS((buf_T *new_curbuf)); | |
50 | 50 | static void enter_tabpage __ARGS((tabpage_T *tp, buf_T *old_curbuf)); |
51 | 51 | static void frame_fix_height __ARGS((win_T *wp)); |
52 | 52 | static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin)); |
@@ -2282,15 +2282,15 @@ | ||
2282 | 2282 | { |
2283 | 2283 | tabpage_T *tp; |
2284 | 2284 | |
2285 | - /* Use the next tab page if it exists. */ | |
2286 | - if (curtab->tp_next != NULL) | |
2285 | + /* Use the next tab page if we are currently at the first one. */ | |
2286 | + if (curtab == first_tabpage) | |
2287 | 2287 | return curtab->tp_next; |
2288 | 2288 | |
2289 | 2289 | /* Find the previous tab page. */ |
2290 | 2290 | for (tp = first_tabpage; tp->tp_next != NULL; tp = tp->tp_next) |
2291 | 2291 | if (tp->tp_next == curtab) |
2292 | - return tp; | |
2293 | - return first_tabpage; | |
2292 | + break; | |
2293 | + return tp; | |
2294 | 2294 | } |
2295 | 2295 | |
2296 | 2296 | /* |
@@ -2963,7 +2963,11 @@ | ||
2963 | 2963 | return FAIL; |
2964 | 2964 | |
2965 | 2965 | /* Remember the current windows in this Tab page. */ |
2966 | - leave_tabpage(curtab); | |
2966 | + if (leave_tabpage(NULL) == FAIL) | |
2967 | + { | |
2968 | + vim_free(newtp); | |
2969 | + return FAIL; | |
2970 | + } | |
2967 | 2971 | curtab = newtp; |
2968 | 2972 | |
2969 | 2973 | /* Create a new empty window. */ |
@@ -2985,12 +2989,7 @@ | ||
2985 | 2989 | } |
2986 | 2990 | |
2987 | 2991 | /* Failed, get back the previous Tab page */ |
2988 | - topframe = tp->tp_topframe; | |
2989 | - curwin = tp->tp_curwin; | |
2990 | - prevwin = tp->tp_prevwin; | |
2991 | - firstwin = tp->tp_firstwin; | |
2992 | - lastwin = tp->tp_lastwin; | |
2993 | - curtab = tp; | |
2992 | + enter_tabpage(curtab, curbuf); | |
2994 | 2993 | return FAIL; |
2995 | 2994 | } |
2996 | 2995 |
@@ -3060,12 +3059,33 @@ | ||
3060 | 3059 | } |
3061 | 3060 | |
3062 | 3061 | /* |
3063 | - * Prepare for leaving the current tab page "tp". | |
3062 | + * Prepare for leaving the current tab page. | |
3063 | + * When autocomands change "curtab" we don't leave the tab page and return | |
3064 | + * FAIL. | |
3065 | + * Careful: When OK is returned need to get a new tab page very very soon! | |
3064 | 3066 | */ |
3065 | - static void | |
3066 | -leave_tabpage(tp) | |
3067 | - tabpage_T *tp; | |
3067 | +/*ARGSUSED*/ | |
3068 | + static int | |
3069 | +leave_tabpage(new_curbuf) | |
3070 | + buf_T *new_curbuf; /* what is going to be the new curbuf, | |
3071 | + NULL if unknown */ | |
3068 | 3072 | { |
3073 | + tabpage_T *tp = curtab; | |
3074 | + | |
3075 | +#ifdef FEAT_AUTOCMD | |
3076 | + if (new_curbuf != curbuf) | |
3077 | + { | |
3078 | + apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf); | |
3079 | + if (curtab != tp) | |
3080 | + return FAIL; | |
3081 | + } | |
3082 | + apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf); | |
3083 | + if (curtab != tp) | |
3084 | + return FAIL; | |
3085 | + apply_autocmds(EVENT_TABLEAVEPRE, NULL, NULL, FALSE, curbuf); | |
3086 | + if (curtab != tp) | |
3087 | + return FAIL; | |
3088 | +#endif | |
3069 | 3089 | #if defined(FEAT_GUI) |
3070 | 3090 | /* Remove the scrollbars. They may be added back later. */ |
3071 | 3091 | if (gui.in_use) |
@@ -3079,6 +3099,7 @@ | ||
3079 | 3099 | tp->tp_old_Columns = Columns; |
3080 | 3100 | firstwin = NULL; |
3081 | 3101 | lastwin = NULL; |
3102 | + return OK; | |
3082 | 3103 | } |
3083 | 3104 | |
3084 | 3105 | /* |
@@ -3100,6 +3121,8 @@ | ||
3100 | 3121 | prevwin = tp->tp_prevwin; |
3101 | 3122 | |
3102 | 3123 | #ifdef FEAT_AUTOCMD |
3124 | + apply_autocmds(EVENT_TABENTERPOST, NULL, NULL, FALSE, curbuf); | |
3125 | + apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); | |
3103 | 3126 | if (old_curbuf != curbuf) |
3104 | 3127 | apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); |
3105 | 3128 | #endif |
@@ -3114,10 +3137,10 @@ | ||
3114 | 3137 | /* The tabpage line may have appeared or disappeared, may need to resize |
3115 | 3138 | * the frames for that. When the Vim window was resized need to update |
3116 | 3139 | * frame sizes too. */ |
3117 | - if (tp->tp_old_Rows != Rows || old_off != firstwin->w_winrow) | |
3140 | + if (curtab->tp_old_Rows != Rows || old_off != firstwin->w_winrow) | |
3118 | 3141 | shell_new_rows(); |
3119 | 3142 | #ifdef FEAT_VERTSPLIT |
3120 | - if (tp->tp_old_Columns != Columns && starting == 0) | |
3143 | + if (curtab->tp_old_Columns != Columns && starting == 0) | |
3121 | 3144 | shell_new_columns(); /* update window widths */ |
3122 | 3145 | #endif |
3123 | 3146 |
@@ -3143,20 +3166,16 @@ | ||
3143 | 3166 | goto_tabpage(n) |
3144 | 3167 | int n; |
3145 | 3168 | { |
3146 | - tabpage_T *otp = curtab; | |
3147 | 3169 | tabpage_T *tp; |
3148 | 3170 | int i; |
3149 | 3171 | |
3150 | - if (otp == NULL) | |
3151 | - return; | |
3152 | - | |
3153 | 3172 | if (n == 0) |
3154 | 3173 | { |
3155 | 3174 | /* No count, go to next tab page, wrap around end. */ |
3156 | - if (otp->tp_next == NULL) | |
3175 | + if (curtab->tp_next == NULL) | |
3157 | 3176 | tp = first_tabpage; |
3158 | 3177 | else |
3159 | - tp = otp->tp_next; | |
3178 | + tp = curtab->tp_next; | |
3160 | 3179 | } |
3161 | 3180 | else |
3162 | 3181 | { |
@@ -3171,8 +3190,13 @@ | ||
3171 | 3190 | } |
3172 | 3191 | } |
3173 | 3192 | |
3174 | - leave_tabpage(otp); | |
3175 | - enter_tabpage(tp, curbuf); | |
3193 | + if (leave_tabpage(tp->tp_curwin->w_buffer) == OK) | |
3194 | + { | |
3195 | + if (valid_tabpage(tp)) | |
3196 | + enter_tabpage(tp, curbuf); | |
3197 | + else | |
3198 | + enter_tabpage(curtab, curbuf); | |
3199 | + } | |
3176 | 3200 | } |
3177 | 3201 | |
3178 | 3202 | /* |