updated for version 7.0f04

This commit is contained in:
Bram Moolenaar
2006-04-28 22:41:43 +00:00
parent 84c632670b
commit 8ea9123258
4 changed files with 125 additions and 114 deletions

View File

@ -1,4 +1,4 @@
*filetype.txt* For Vim version 7.0f. Last change: 2006 Mar 24 *filetype.txt* For Vim version 7.0f. Last change: 2006 Apr 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -551,8 +551,11 @@ then this determined the file type: plaintex (for plain TeX), context (for
ConTeXt), or tex (for LaTeX). Otherwise, the file is searched for keywords to ConTeXt), or tex (for LaTeX). Otherwise, the file is searched for keywords to
choose context or tex. If no keywords are found, it defaults to plaintex. choose context or tex. If no keywords are found, it defaults to plaintex.
You can change the default by defining the variable g:tex_flavor to the format You can change the default by defining the variable g:tex_flavor to the format
(not the file type) you use most: plain or context or latex. (Currently no (not the file type) you use most. Use one of these: >
other formats are recognized.) let g:tex_flavor = "plain"
let g:tex_flavor = "context"
let g:tex_flavor = "latex"
Currently no other formats are recognized.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0f. Last change: 2006 Apr 27 *todo.txt* For Vim version 7.0f. Last change: 2006 Apr 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,11 +30,6 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
GTK: tooltips make menu actions use wrong tab page. Yegappan will look into
it.
Add more tests for all new functionality in Vim 7. Especially new functions.
Darren Hiebert is including the patch for omni completion in ctags. A new Darren Hiebert is including the patch for omni completion in ctags. A new
version still isn't available for download. version still isn't available for download.

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0f. Last change: 2006 Apr 27 *version7.txt* For Vim version 7.0f. Last change: 2006 Apr 28
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -6,7 +6,7 @@
Welcome to Vim 7! A large number of features has been added. This file Welcome to Vim 7! A large number of features has been added. This file
mentions all the new items, changes to existing features and bug fixes mentions all the new items, changes to existing features and bug fixes
compared to Vim 6.x. Use this command to see the version you are using: > since Vim 6.x. Use this command to see the version you are using: >
:version :version
See |vi_diff.txt| for an overview of differences between Vi and Vim 7.0. See |vi_diff.txt| for an overview of differences between Vi and Vim 7.0.
@ -64,9 +64,9 @@ In an argument list double quotes could be used to include spaces in a file
name. This caused a difference between ":edit" and ":next" for escaping name. This caused a difference between ":edit" and ":next" for escaping
double quotes and it is incompatible with some versions of Vi. double quotes and it is incompatible with some versions of Vi.
Command Vim 6.x file name Vim 7.x file name ~ Command Vim 6.x file name Vim 7.x file name ~
:edit foo\"888 'foo"888' 'foo"888' :edit foo\"888 foo"888 foo"888
:next foo\"888 'foo888' 'foo"888' :next foo\"888 foo888 foo"888
:next a\"b c\"d 'ab cd' 'a"b' and 'c"d' :next a\"b c\"d ab cd a"b and c"d
In a |literal-string| a single quote can be doubled to get one. In a |literal-string| a single quote can be doubled to get one.
":echo 'a''b'" would result in "a b", but now that two quotes stand for one it ":echo 'a''b'" would result in "a b", but now that two quotes stand for one it
@ -83,8 +83,8 @@ Files ending in .tex now have 'filetype' set to "context", "plaintex", or
Minor incompatibilities: Minor incompatibilities:
For filetype detection: For many types, instead of ~/.dir/filename use For filetype detection: For many types, use */.dir/filename instead of
*/.dir/filename, so that it also works for other user's files. ~/.dir/filename, so that it also works for other user's files.
For quite a few filetypes the indent settings have been moved from the For quite a few filetypes the indent settings have been moved from the
filetype plugin to the indent plugin. If you used: > filetype plugin to the indent plugin. If you used: >
@ -106,7 +106,7 @@ The "2html.vim" script now converts closed folds to HTML. This means the HTML
looks like its displayed, with the same folds open and closed. Use "zR", or looks like its displayed, with the same folds open and closed. Use "zR", or
"let html_ignore_folding=1", if no folds should appear in the HTML. (partly by "let html_ignore_folding=1", if no folds should appear in the HTML. (partly by
Carl Osterwisch) Carl Osterwisch)
Diff mode now is also converted as it is displayed. Diff mode now is also converted to HTML as it is displayed.
Win32: The effect of the <F10> key depended on 'winaltkeys'. Now it depends Win32: The effect of the <F10> key depended on 'winaltkeys'. Now it depends
on whether <F10> has been mapped or not. This allows mapping <F10> without on whether <F10> has been mapped or not. This allows mapping <F10> without
@ -160,7 +160,11 @@ as <line1>. The items can no longer be abbreviated.
When executing a FileChangedRO autocommand it is no longer allowed to switch When executing a FileChangedRO autocommand it is no longer allowed to switch
to another buffer or edit another file. This is to prevent crashes (the event to another buffer or edit another file. This is to prevent crashes (the event
is triggered deep down in the code where changing buffers is not anticipated). is triggered deep down in the code where changing buffers is not anticipated).
It is possible to reload the buffer. It is still possible to reload the buffer.
At the |more-prompt| and the |hit-enter-prompt|, when the 'more' option is
set, the 'k', 'u', 'g' and 'b' keys are now used to scroll back to previous
messages. Thus they are no longer used as typeahead.
============================================================================== ==============================================================================
NEW FEATURES *new-7* NEW FEATURES *new-7*
@ -170,9 +174,9 @@ Vim script enhancements *new-vim-script*
In Vim scripts the following types have been added: In Vim scripts the following types have been added:
List ordered list of items |List| |List| ordered list of items
Dictionary associative array of items |Dictionary| |Dictionary| associative array of items
Funcref reference to a function |Funcref| |Funcref| reference to a function
Many functions and commands have been added to support the new types. Many functions and commands have been added to support the new types.
@ -180,11 +184,13 @@ The |string()| function can be used to get a string representation of a
variable. Works for Numbers, Strings and composites of them. Then |eval()| variable. Works for Numbers, Strings and composites of them. Then |eval()|
can be used to turn the string back into the variable value. can be used to turn the string back into the variable value.
The |:let| command can now use "+=". ":let var += expr" works like The |:let| command can now use "+=", "-=" and ".=": >
":let var = var + expr". "-=" and ".=" work in a similar way. :let var += expr " works like :let var = var + expr
:let var -= expr " works like :let var = var - expr
:let var .= string " works like :let var = var . string
With the |:profile| command you can find out where your function or script With the |:profile| command you can find out where your function or script
wastes its time. is wasting time.
In the Python interface vim.eval() also handles Dictionaries and Lists. In the Python interface vim.eval() also handles Dictionaries and Lists.
|python-eval| (G. Sumner Hayes) |python-eval| (G. Sumner Hayes)
@ -203,15 +209,15 @@ Spell checking *new-spell*
Spell checking has been integrated in Vim. There were a few implementations Spell checking has been integrated in Vim. There were a few implementations
with scripts, but they were slow and/or required an external program. with scripts, but they were slow and/or required an external program.
The 'spell' option is used to switch spell checking on or off. The 'spell' option is used to switch spell checking on or off
The 'spelllang' option is used to specify the languages that are accepted. The 'spelllang' option is used to specify the accepted language(s)
The 'spellfile' option specifies where new words are added. The 'spellfile' option specifies where new words are added
The 'spellsuggest' option specifies the methods used for making suggestions The 'spellsuggest' option specifies the methods used for making suggestions
The |[s| and |]s| commands can be used to move to the next or previous error. The |[s| and |]s| commands can be used to move to the next or previous error
The |zg| and |zw| commands can be used to add good and wrong words. The |zg| and |zw| commands can be used to add good and wrong words
The |z=| command can be used to correct the word. The |z=| command can be used to list suggestions and correct the word
The |:mkspell| command is used to generate a Vim spell file from word lists. The |:mkspell| command is used to generate a Vim spell file from word lists
The "undercurl" highlighting attribute was added to nicely point out spelling The "undercurl" highlighting attribute was added to nicely point out spelling
mistakes in the GUI (based on patch from Marcin Dalecki). mistakes in the GUI (based on patch from Marcin Dalecki).
@ -220,13 +226,13 @@ background.
The number of possible different highlight attributes was raised from about The number of possible different highlight attributes was raised from about
220 to over 30000. This allows for the attributes of spelling to be combined 220 to over 30000. This allows for the attributes of spelling to be combined
with syntax highlighting attributes. This is also used for syntax with syntax highlighting attributes. This is also used for syntax
highlighting. highlighting and marking the Visual area.
Much more info here: |spell|. Much more info here: |spell|.
Omni completion *new-omni-completion* Omni completion *new-omni-completion*
----------------- ---------------
This could also be called "intellisense", but that is a trademark. It is a This could also be called "intellisense", but that is a trademark. It is a
smart kind of completion. The text in front of the cursor is inspected to smart kind of completion. The text in front of the cursor is inspected to
@ -242,27 +248,36 @@ Currently supported languages:
C |ft-c-omni| C |ft-c-omni|
(X)HTML with CSS |ft-html-omni| (X)HTML with CSS |ft-html-omni|
JavaScript |ft-javascript-omni| JavaScript |ft-javascript-omni|
PHP |ft-php-omni|
Python Python
Ruby |ft-ruby-omni| Ruby |ft-ruby-omni|
SQL |ft-sql-omni|
XML |ft-xml-omni| XML |ft-xml-omni|
any language wih syntax highligting |ft-syntax-omni| any language wih syntax highligting |ft-syntax-omni|
You can add your own omni completion scripts.
When the 'completeopt' option contains "menu" then matches for Insert mode When the 'completeopt' option contains "menu" then matches for Insert mode
completion are displayed in a popup menu. completion are displayed in a (rather primitive) popup menu.
MzScheme interface *new-MzScheme* MzScheme interface *new-MzScheme*
------------------ ------------------
The MzScheme interpreter is supported. |MzScheme| The MzScheme interpreter is supported. |MzScheme|
The |:mzscheme| command can be used to execute MzScheme commands.
The |:mzfile| command can be used to execute an MzScheme script file. The |:mzscheme| command can be used to execute MzScheme commands
The |:mzfile| command can be used to execute an MzScheme script file
This depends on Vim being compiled with the |+mzscheme| feature.
Printing multi-byte text *new-print-multi-byte* Printing multi-byte text *new-print-multi-byte*
------------------ ------------------------
The |:hardcopy| command now supports printing multi-byte characters when using
PostScript.
The |:hardcopy| command now supports printing multi-byte characters.
The 'printmbcharset' and 'printmbfont' options are used for this. The 'printmbcharset' and 'printmbfont' options are used for this.
Also see |postscript-cjk-printing|. (Mike Williams) Also see |postscript-cjk-printing|. (Mike Williams)
@ -278,14 +293,14 @@ way to work with many windows.
To start Vim with each file argument in a separate tab page use the |-p| To start Vim with each file argument in a separate tab page use the |-p|
argument. The maximum number of pages can be set with 'tabpagemax'. argument. The maximum number of pages can be set with 'tabpagemax'.
The line with tab labels is either made with plain text an highlighting or The line with tab labels is either made with plain text and highlighting or
with a GUI mechanism. The GUI labels look better but are only available on a with a GUI mechanism. The GUI labels look better but are only available on a
few systems. The line can be customized with 'tabline', 'guitablabel' and few systems. The line can be customized with 'tabline', 'guitablabel' and
'guitabtooltip'. Whether it is displayed is set with 'showtabline'. Whether 'guitabtooltip'. Whether it is displayed is set with 'showtabline'. Whether
to use the GUI labels is set with the "e" flag in 'guioptions'. to use the GUI labels is set with the "e" flag in 'guioptions'.
The |:tab| command modifier can be used to have most commands that open a new The |:tab| command modifier can be used to have most commands that open a new
window open a new tab instead. window open a new tab page instead.
The |--remote-tab| argument can be used to edit a file in a new tab page in an The |--remote-tab| argument can be used to edit a file in a new tab page in an
already running Vim server. already running Vim server.
@ -293,7 +308,7 @@ already running Vim server.
Variables starting with "t:" are local to a tab page. Variables starting with "t:" are local to a tab page.
More info here: |tabpage| More info here: |tabpage|
The Win32 GUI tabs were implemented by Yegappan Lakshmanan. Most of the GUI stuff was implemented by Yegappan Lakshmanan.
Undo branches *new-undo-branches* Undo branches *new-undo-branches*
@ -305,7 +320,7 @@ could lead to accidentally losing work.
Vim now makes an undo branch in this situation. Thus you can go back to the Vim now makes an undo branch in this situation. Thus you can go back to the
text after any change, even if they were undone. So long as you do not run text after any change, even if they were undone. So long as you do not run
into 'undolevels', undo information is freed up to limit the memory used. into 'undolevels', when undo information is freed up to limit the memory used.
To be able to navigate the undo branches each change is numbered sequentially. To be able to navigate the undo branches each change is numbered sequentially.
The commands |g-| and |:earlier| go back in time, to older changes. The The commands |g-| and |:earlier| go back in time, to older changes. The
@ -334,7 +349,7 @@ still 2.
Previously only 16 bit Unicode characters were supported for displaying. Now Previously only 16 bit Unicode characters were supported for displaying. Now
the full 32 bit character set can be used. Unless manually disabled at the full 32 bit character set can be used. Unless manually disabled at
compile time. compile time to save a bit of memory.
For pattern matching it is now possible to search for individual composing For pattern matching it is now possible to search for individual composing
characters. |patterns-composing| characters. |patterns-composing|
@ -345,7 +360,7 @@ The |8g8| command searches for an illegal UTF-8 byte sequence.
More highlighting *new-more-highlighting* More highlighting *new-more-highlighting*
----------------- -----------------
Highlighting matching parens Highlighting matching parens:
When moving the cursor through the text and it is on a paren, then the When moving the cursor through the text and it is on a paren, then the
matching paren can be highlighted. This uses the new |CursorMoved| matching paren can be highlighted. This uses the new |CursorMoved|
@ -361,13 +376,19 @@ The plugin uses the |:match| command. It now supports three match patterns.
The plugin uses the third one. The first one is for the user and the second The plugin uses the third one. The first one is for the user and the second
one can be used by another plugin. one can be used by another plugin.
Highlighting the cursor line and column Highlighting the cursor line and column:
The 'cursorline' and 'cursorcolumn' options have been added. These highlight The 'cursorline' and 'cursorcolumn' options have been added. These highlight
the screen line and screen column of the cursor. This makes the cursor the screen line and screen column of the cursor. This makes the cursor
position easier to spot. 'cursorcolumn' is also useful to align text. The position easier to spot. 'cursorcolumn' is also useful to align text. This
CursorColumn and CursorLine highlighting allow changing the colors used. may make screen updating quite slow. The CursorColumn and CursorLine
|hl-CursorColumn| |hl-CursorLine| highlight groups allow changing the colors used. |hl-CursorColumn|
|hl-CursorLine|
The number of possible different highlight attributes was raised from about
220 to over 30000. This allows for the attributes of spelling to be combined
with syntax highlighting attributes. This is also used for syntax
highlighting, marking the Visual area, CursorColumn, etc.
Translated manual pages *new-manpage-trans* Translated manual pages *new-manpage-trans*
@ -403,17 +424,17 @@ patterns, this also allows grepping in compressed and remote files.
If you want to use the search results in a script you can use the If you want to use the search results in a script you can use the
|getqflist()| function. |getqflist()| function.
To search in files in various directories the "**" pattern can be used. It To grep files in various directories the "**" pattern can be used. It expands
expands into an arbitrary depth of directories. "**" can be used in all into an arbitrary depth of directories. "**" can be used in all places where
places where file names are expanded, thus also with |:next| and |:args|. file names are expanded, thus also with |:next| and |:args|.
Scroll back in messages *new-scroll-back* Scroll back in messages *new-scroll-back*
----------------------- -----------------------
When displaying messages, at the |more-prompt| and the |hit-enter-prompt|, The When displaying messages, at the |more-prompt| and the |hit-enter-prompt|, The
'k', 'u' and 'b' keys can be used to scroll back to previous messages. This 'k', 'u', 'g' and 'b' keys can be used to scroll back to previous messages.
is especially useful for commands such as ":syntax", ":autocommand" and This is especially useful for commands such as ":syntax", ":autocommand" and
":highlight". This is implemented in a generic way thus it works for all ":highlight". This is implemented in a generic way thus it works for all
commands and highlighting is kept. Only works when the 'more' option is set. commands and highlighting is kept. Only works when the 'more' option is set.
Previously it only partly worked for ":clist". Previously it only partly worked for ":clist".
@ -526,7 +547,7 @@ resulting characters can depend on the context. Example: >
:inoremap <expr> . InsertDot() :inoremap <expr> . InsertDot()
Here the dot will be mapped to whatever InsertDot() returns. Here the dot will be mapped to whatever InsertDot() returns.
Also works for abbreviations. See |:map-<expr>| for the details. This also works for abbreviations. See |:map-<expr>| for the details.
Visual and Select mode mappings *new-map-select* Visual and Select mode mappings *new-map-select*
@ -548,7 +569,7 @@ Location list *new-location-list*
The support for a per-window quickfix list (location list) is added. The The support for a per-window quickfix list (location list) is added. The
location list can be displayed in a location window (similar to the quickfix location list can be displayed in a location window (similar to the quickfix
window). You can open more than one location list window. A set of commands window). You can open more than one location list window. A set of commands
similar to the quickfix commands are added to browse the location list. similar to the quickfix commands are added to browse the location list.
(Yegappan Lakshmanan) (Yegappan Lakshmanan)
@ -1679,7 +1700,7 @@ GTK setting and do select the menu when <F10> isn't mapped. (David Necas)
After "Y" '[ and '] were not at start/end of the yanked text. After "Y" '[ and '] were not at start/end of the yanked text.
When a telnet connection is dropped Vim preserves files and exits. While When a telnet connection is dropped Vim preserves files and exits. While
doing that a SIGHUP may arrive and disturbe us, thus ignore it. (Scott doing that a SIGHUP may arrive and disturb us, thus ignore it. (Scott
Anderson) Also postpone SIGHUP, SIGQUIT and SIGTERM until it's safe to Anderson) Also postpone SIGHUP, SIGQUIT and SIGTERM until it's safe to
handle. Added handle_signal(). handle. Added handle_signal().
@ -1708,7 +1729,7 @@ message for the next buffer. Temporarily clear 'shortmess' to avoid that.
Win32: Cannot edit a file starting with # with --remote. Do escape % and # Win32: Cannot edit a file starting with # with --remote. Do escape % and #
when building the ":drop" command. when building the ":drop" command.
A comment or | just after a expresion-backtick argument was not recognized. A comment or | just after a expression-backtick argument was not recognized.
E.g. in :e `="foo"`"comment. E.g. in :e `="foo"`"comment.
"(" does not stop at an empty sentence (single dot and white space) while ")" "(" does not stop at an empty sentence (single dot and white space) while ")"
@ -2677,5 +2698,13 @@ reported no matching tag. Clear the cached tag name.
In Insert mode the matchparen plugin highlighted the wrong paren when there is In Insert mode the matchparen plugin highlighted the wrong paren when there is
a string just next to a paren. a string just next to a paren.
GTK: After opening a new tab page the text was sometimes not drawn correctly.
Flush output and catch up with events when updating the tab page labels.
Using CTRL-W q to close the last window of a tab page could cause a crash in
the GUI.
GTK: The tab pages line menu was not converted from 'encoding' to utf-8.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -3138,36 +3138,35 @@ tabline_menu_handler(GtkMenuItem *item, gpointer user_data)
gtk_main_quit(); gtk_main_quit();
} }
static void
add_tabline_menu_item(GtkWidget *menu, char_u *text, int resp)
{
GtkWidget *item;
char_u *utf_text;
utf_text = CONVERT_TO_UTF8(text);
item = gtk_menu_item_new_with_label((const char *)utf_text);
gtk_widget_show(item);
CONVERT_TO_UTF8_FREE(utf_text);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_signal_connect(GTK_OBJECT(item), "activate",
GTK_SIGNAL_FUNC(tabline_menu_handler),
(gpointer)resp);
}
/* /*
* Create a menu for the tab line. * Create a menu for the tab line.
*/ */
static GtkWidget * static GtkWidget *
create_tabline_menu(void) create_tabline_menu(void)
{ {
GtkWidget *menu, *item; GtkWidget *menu;
menu = gtk_menu_new(); menu = gtk_menu_new();
add_tabline_menu_item(menu, (char_u *)_("Close"), TABLINE_MENU_CLOSE);
item = gtk_menu_item_new_with_label(_("Close")); add_tabline_menu_item(menu, (char_u *)_("New tab"), TABLINE_MENU_NEW);
gtk_widget_show(item); add_tabline_menu_item(menu, (char_u *)_("Open Tab..."), TABLINE_MENU_OPEN);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_signal_connect(GTK_OBJECT(item), "activate",
GTK_SIGNAL_FUNC(tabline_menu_handler),
(gpointer)TABLINE_MENU_CLOSE);
item = gtk_menu_item_new_with_label(_("New tab"));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_signal_connect(GTK_OBJECT(item), "activate",
GTK_SIGNAL_FUNC(tabline_menu_handler),
(gpointer)TABLINE_MENU_NEW);
item = gtk_menu_item_new_with_label(_("Open Tab..."));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
gtk_signal_connect(GTK_OBJECT(item), "activate",
GTK_SIGNAL_FUNC(tabline_menu_handler),
(gpointer)TABLINE_MENU_OPEN);
return menu; return menu;
} }
@ -3180,8 +3179,9 @@ on_tabline_menu(GtkWidget *widget, GdkEvent *event)
{ {
GdkEventButton *bevent = (GdkEventButton *)event; GdkEventButton *bevent = (GdkEventButton *)event;
int x = bevent->x; int x = bevent->x;
GtkWidget *page; int y = bevent->y;
GtkWidget *label; GtkWidget *tabwidget;
GdkWindow *tabwin;
/* When ignoring events return TRUE so that the selected page doesn't /* When ignoring events return TRUE so that the selected page doesn't
* change. */ * change. */
@ -3192,25 +3192,10 @@ on_tabline_menu(GtkWidget *widget, GdkEvent *event)
) )
return TRUE; return TRUE;
/* Find out where the click was. */ tabwin = gdk_window_at_pointer(&x, &y);
for (clicked_page = 1; ; ++clicked_page) gdk_window_get_user_data(tabwin, (gpointer)&tabwidget);
{ clicked_page = (int)(long)gtk_object_get_user_data(
page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(gui.tabline), GTK_OBJECT(tabwidget));
clicked_page - 1);
if (page == NULL)
{
/* Past all the labels, return zero. */
clicked_page = 0;
break;
}
label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(gui.tabline), page);
/* The label size apparently doesn't include the spacing, estimate
* it by the page position. */
if (page->allocation.x * 2 + label->allocation.x
+ label->allocation.width + 1 >= x)
break;
}
/* If the event was generated for 3rd button popup the menu. */ /* If the event was generated for 3rd button popup the menu. */
if (bevent->button == 3) if (bevent->button == 3)
@ -3306,6 +3291,7 @@ gui_mch_update_tabline(void)
GtkWidget *label; GtkWidget *label;
tabpage_T *tp; tabpage_T *tp;
int nr = 0; int nr = 0;
int tab_num;
int curtabidx = 0; int curtabidx = 0;
char_u *labeltext; char_u *labeltext;
@ -3320,6 +3306,8 @@ gui_mch_update_tabline(void)
if (tp == curtab) if (tp == curtab)
curtabidx = nr; curtabidx = nr;
tab_num = nr + 1;
page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(gui.tabline), nr); page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(gui.tabline), nr);
if (page == NULL) if (page == NULL)
{ {
@ -3329,11 +3317,8 @@ gui_mch_update_tabline(void)
event_box = gtk_event_box_new(); event_box = gtk_event_box_new();
gtk_widget_show(event_box); gtk_widget_show(event_box);
label = gtk_label_new("-Empty-"); label = gtk_label_new("-Empty-");
#ifdef TABLINE_TOOLTIP gtk_misc_set_padding(GTK_MISC(label), 2, 2);
gtk_container_add(GTK_CONTAINER(event_box), label); gtk_container_add(GTK_CONTAINER(event_box), label);
#else
event_box = label;
#endif
gtk_widget_show(label); gtk_widget_show(label);
gtk_notebook_insert_page(GTK_NOTEBOOK(gui.tabline), gtk_notebook_insert_page(GTK_NOTEBOOK(gui.tabline),
page, page,
@ -3342,23 +3327,18 @@ gui_mch_update_tabline(void)
} }
event_box = gtk_notebook_get_tab_label(GTK_NOTEBOOK(gui.tabline), page); event_box = gtk_notebook_get_tab_label(GTK_NOTEBOOK(gui.tabline), page);
#ifdef TABLINE_TOOLTIP gtk_object_set_user_data(GTK_OBJECT(event_box), (gpointer)tab_num);
label = GTK_BIN(event_box)->child; label = GTK_BIN(event_box)->child;
#else
label = event_box;
#endif
get_tabline_label(tp, FALSE); get_tabline_label(tp, FALSE);
labeltext = CONVERT_TO_UTF8(NameBuff); labeltext = CONVERT_TO_UTF8(NameBuff);
gtk_label_set_text(GTK_LABEL(label), (const char *)labeltext); gtk_label_set_text(GTK_LABEL(label), (const char *)labeltext);
CONVERT_TO_UTF8_FREE(labeltext); CONVERT_TO_UTF8_FREE(labeltext);
#ifdef TABLINE_TOOLTIP
get_tabline_label(tp, TRUE); get_tabline_label(tp, TRUE);
labeltext = CONVERT_TO_UTF8(NameBuff); labeltext = CONVERT_TO_UTF8(NameBuff);
gtk_tooltips_set_tip(GTK_TOOLTIPS(tabline_tooltip), event_box, gtk_tooltips_set_tip(GTK_TOOLTIPS(tabline_tooltip), event_box,
(const char *)labeltext, NULL); (const char *)labeltext, NULL);
CONVERT_TO_UTF8_FREE(labeltext); CONVERT_TO_UTF8_FREE(labeltext);
#endif
} }
/* Remove any old labels. */ /* Remove any old labels. */
@ -3368,6 +3348,9 @@ gui_mch_update_tabline(void)
if (gtk_notebook_current_page(GTK_NOTEBOOK(gui.tabline)) != curtabidx) if (gtk_notebook_current_page(GTK_NOTEBOOK(gui.tabline)) != curtabidx)
gtk_notebook_set_page(GTK_NOTEBOOK(gui.tabline), curtabidx); gtk_notebook_set_page(GTK_NOTEBOOK(gui.tabline), curtabidx);
/* Make sure everything is in place before drawing text. */
gui_mch_update();
ignore_tabline_evt = FALSE; ignore_tabline_evt = FALSE;
} }
@ -3685,6 +3668,9 @@ gui_mch_init(void)
gtk_notebook_set_show_border(GTK_NOTEBOOK(gui.tabline), FALSE); gtk_notebook_set_show_border(GTK_NOTEBOOK(gui.tabline), FALSE);
gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gui.tabline), FALSE); gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gui.tabline), FALSE);
gtk_notebook_set_scrollable(GTK_NOTEBOOK(gui.tabline), TRUE); gtk_notebook_set_scrollable(GTK_NOTEBOOK(gui.tabline), TRUE);
# ifdef HAVE_GTK2
g_object_set(GTK_OBJECT(gui.tabline), "tab-border", 0, NULL);
# endif
tabline_tooltip = gtk_tooltips_new(); tabline_tooltip = gtk_tooltips_new();
gtk_tooltips_enable(GTK_TOOLTIPS(tabline_tooltip)); gtk_tooltips_enable(GTK_TOOLTIPS(tabline_tooltip));
@ -3698,13 +3684,11 @@ gui_mch_init(void)
gtk_container_add(GTK_CONTAINER(gui.tabline), page); gtk_container_add(GTK_CONTAINER(gui.tabline), page);
label = gtk_label_new("-Empty-"); label = gtk_label_new("-Empty-");
gtk_widget_show(label); gtk_widget_show(label);
#ifdef TABLINE_TOOLTIP
event_box = gtk_event_box_new(); event_box = gtk_event_box_new();
gtk_widget_show(event_box); gtk_widget_show(event_box);
gtk_object_set_user_data(GTK_OBJECT(event_box), (gpointer)1);
gtk_misc_set_padding(GTK_MISC(label), 2, 2);
gtk_container_add(GTK_CONTAINER(event_box), label); gtk_container_add(GTK_CONTAINER(event_box), label);
#else
event_box = label;
#endif
gtk_notebook_set_tab_label(GTK_NOTEBOOK(gui.tabline), page, event_box); gtk_notebook_set_tab_label(GTK_NOTEBOOK(gui.tabline), page, event_box);
} }
gtk_signal_connect(GTK_OBJECT(gui.tabline), "switch_page", gtk_signal_connect(GTK_OBJECT(gui.tabline), "switch_page",