0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

updated for version 7.0203

This commit is contained in:
Bram Moolenaar
2006-02-21 22:02:53 +00:00
parent faa959a870
commit 030f0dfad5
6 changed files with 120 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
*gui.txt* For Vim version 7.0aa. Last change: 2006 Feb 14 *gui.txt* For Vim version 7.0aa. Last change: 2006 Feb 21
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -955,6 +955,9 @@ This section describes other features which are related to the GUI.
endif endif
endif endif
A recommended Japanese font is MS Mincho. You can find info here:
http://www.lexikan.com/mincho.htm
============================================================================== ==============================================================================
7. Shell Commands *gui-shell* 7. Shell Commands *gui-shell*

View File

@@ -1,4 +1,4 @@
*tabpage.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 *tabpage.txt* For Vim version 7.0aa. Last change: 2006 Feb 21
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -10,9 +10,10 @@ The commands which have been added to use multiple tab pages are explained
here. Additionally, there are explanations for commands that work differently here. Additionally, there are explanations for commands that work differently
when used in combination with more than one tab page. when used in combination with more than one tab page.
1. Introduction |tab-page-intro| 1. Introduction |tab-page-intro|
2. Commands |tab-page-commands| 2. Commands |tab-page-commands|
3. Other items |tab-page-other| 3. Other items |tab-page-other|
4. Setting 'tabline' |setting-tabline|
{Vi does not have any of these commands} {Vi does not have any of these commands}
{not able to use multiple tab pages when the |+windows| feature was disabled {not able to use multiple tab pages when the |+windows| feature was disabled
@@ -111,12 +112,6 @@ Other commands:
============================================================================== ==============================================================================
3. Other items *tab-page-other* 3. Other items *tab-page-other*
You can use the 'tabline' option to specify when you want the line with tab
page labels to appear: never, when there is more than one tab page or always.
The highlighting of the tab pages line is set with the groups TabLine
TabLineSel and TabLineFill. |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill|
Diff mode works per tab page. You can see the diffs between several files Diff mode works per tab page. You can see the diffs between several files
within one tab page. Other tab pages can show differences between other within one tab page. Other tab pages can show differences between other
files. files.
@@ -133,7 +128,7 @@ triggers:
BufLeave leave current buffer BufLeave leave current buffer
BufEnter enter new empty buffer BufEnter enter new empty buffer
For switching to another tab page the order is: When switching to another tab page the order is:
BufLeave BufLeave
WinLeave WinLeave
TabLeave TabLeave
@@ -141,5 +136,58 @@ For switching to another tab page the order is:
WinEnter WinEnter
BufEnter BufEnter
==============================================================================
4. Setting 'tabline' *setting-tabline*
You can use the 'showtabline' option to specify when you want the line with
tab page labels to appear: never, when there is more than one tab page or
always.
The highlighting of the tab pages line is set with the groups TabLine
TabLineSel and TabLineFill. |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill|
The 'tabline' option allows you to define your preferred way to tab pages
labels. This isn't easy, thus an example will be given here.
For basics see the 'statusline' option. The same items can be used in the
'tabline' option. Additionally, the |tabpagebuflist()|, |tabpagenr()| and
|tabpagewinnr()| functions are useful.
Since the number of tab labels will vary, you need to use an expresion for the
whole option. Something like: >
:set tabline=%!MyTabLine()
Then define the MyTabLine() function to list all the tab pages labels. A
convenient method is to split it in two parts: First go over all the tab
pages and define labels for them. Then get the label for each tab page. >
function MyTabLine()
let s = ''
for i in range(tabpagenr('$'))
if i + 1 == tabpagenr()
let s .= '%#TabLineSel#'
else
let s .= '%#TabLine#'
endif
let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
endfor
let s .= '%#TabLineFill#'
return s
endfunction
Now the MyTabLabel() function is called for each tab page to get its label. >
function MyTabLabel(n)
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)
return bufname(buflist[winnr - 1])
endfunction
This is just a simplistic example that results in a tab pages line that
resembles the default, but without adding a + for a modified buffer or
trunctating the names. You will want to reduce the width of labels in a
clever way when there is not enough room. Check the 'columns' option for the
space available, keeping in mind that the "X" at the right will take one more
position.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@@ -2947,15 +2947,12 @@ fileinfo(fullname, shorthelp, dont_truncate)
{ {
p = msg_trunc_attr(buffer, FALSE, 0); p = msg_trunc_attr(buffer, FALSE, 0);
if (restart_edit != 0 || (msg_scrolled && !need_wait_return)) if (restart_edit != 0 || (msg_scrolled && !need_wait_return))
{
/* Need to repeat the message after redrawing when: /* Need to repeat the message after redrawing when:
* - When restart_edit is set (otherwise there will be a delay * - When restart_edit is set (otherwise there will be a delay
* before redrawing). * before redrawing).
* - When the screen was scrolled but there is no wait-return * - When the screen was scrolled but there is no wait-return
* prompt. */ * prompt. */
set_keep_msg(p); set_keep_msg(p, 0);
keep_msg_attr = 0;
}
} }
vim_free(buffer); vim_free(buffer);
@@ -3271,6 +3268,20 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
char_u opt; char_u opt;
#define TMPLEN 70 #define TMPLEN 70
char_u tmp[TMPLEN]; char_u tmp[TMPLEN];
char_u *usefmt = fmt;
#ifdef FEAT_EVAL
/*
* When the format starts with "%!" then evaluate it as an expression and
* use the result as the actual format string.
*/
if (fmt[0] == '%' && fmt[1] == '!')
{
usefmt = eval_to_string_safe(fmt + 2, NULL, use_sandbox);
if (usefmt == NULL)
usefmt = (char_u *)"";
}
#endif
if (fillchar == 0) if (fillchar == 0)
fillchar = ' '; fillchar = ' ';
@@ -3286,7 +3297,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
curitem = 0; curitem = 0;
prevchar_isflag = TRUE; prevchar_isflag = TRUE;
prevchar_isitem = FALSE; prevchar_isitem = FALSE;
for (s = fmt; *s;) for (s = usefmt; *s; )
{ {
if (*s != NUL && *s != '%') if (*s != NUL && *s != '%')
prevchar_isflag = prevchar_isitem = FALSE; prevchar_isflag = prevchar_isitem = FALSE;
@@ -3432,7 +3443,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
if (minwid < 0) /* overflow */ if (minwid < 0) /* overflow */
minwid = 0; minwid = 0;
} }
if (*s == STL_HIGHLIGHT) if (*s == STL_USER_HL)
{ {
item[curitem].type = Highlight; item[curitem].type = Highlight;
item[curitem].start = p; item[curitem].start = p;
@@ -3698,6 +3709,20 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
case 7: str = (char_u *)",+-"; break; case 7: str = (char_u *)",+-"; break;
} }
break; break;
case STL_HIGHLIGHT:
t = s;
while (*s != '#' && *s != NUL)
++s;
if (*s == '#')
{
item[curitem].type = Highlight;
item[curitem].start = p;
item[curitem].minwid = -syn_namen2id(t, s - t);
curitem++;
}
++s;
continue;
} }
item[curitem].start = p; item[curitem].start = p;
@@ -3814,6 +3839,11 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
*p = NUL; *p = NUL;
itemcnt = curitem; itemcnt = curitem;
#ifdef FEAT_EVAL
if (usefmt != fmt)
vim_free(usefmt);
#endif
width = vim_strsize(out); width = vim_strsize(out);
if (maxwidth > 0 && width > maxwidth) if (maxwidth > 0 && width > maxwidth)
{ {

View File

@@ -7029,7 +7029,7 @@ ex_tabs(eap)
out_flush(); /* output one line at a time */ out_flush(); /* output one line at a time */
ui_breakcheck(); ui_breakcheck();
if (tp->tp_topframe == topframe) if (tp == curtab)
wp = firstwin; wp = firstwin;
else else
wp = tp->tp_firstwin; wp = tp->tp_firstwin;

View File

@@ -180,10 +180,7 @@ msg_attr_keep(s, attr, keep)
if (keep && retval && vim_strsize(s) < (int)(Rows - cmdline_row - 1) if (keep && retval && vim_strsize(s) < (int)(Rows - cmdline_row - 1)
* Columns + sc_col) * Columns + sc_col)
{ set_keep_msg(s, 0);
set_keep_msg(s);
keep_msg_attr = 0;
}
vim_free(buf); vim_free(buf);
--entered; --entered;
@@ -1077,8 +1074,9 @@ hit_return_msg()
* Set "keep_msg" to "s". Free the old value and check for NULL pointer. * Set "keep_msg" to "s". Free the old value and check for NULL pointer.
*/ */
void void
set_keep_msg(s) set_keep_msg(s, attr)
char_u *s; char_u *s;
int attr;
{ {
vim_free(keep_msg); vim_free(keep_msg);
if (s != NULL && msg_silent == 0) if (s != NULL && msg_silent == 0)
@@ -1086,8 +1084,23 @@ set_keep_msg(s)
else else
keep_msg = NULL; keep_msg = NULL;
keep_msg_more = FALSE; keep_msg_more = FALSE;
keep_msg_attr = attr;
} }
#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
/*
* If there currently is a message being displayed, set "keep_msg" to it, so
* that it will be displayed again after redraw.
*/
void
set_keep_msg_from_hist()
{
if (keep_msg == NULL && last_msg_hist != NULL && msg_scrolled == 0
&& (State & NORMAL))
set_keep_msg(last_msg_hist->msg, last_msg_hist->attr);
}
#endif
/* /*
* Prepare for outputting characters in the command line. * Prepare for outputting characters in the command line.
*/ */
@@ -3161,7 +3174,7 @@ give_warning(message, hl)
else else
keep_msg_attr = 0; keep_msg_attr = 0;
if (msg_attr(message, keep_msg_attr) && msg_scrolled == 0) if (msg_attr(message, keep_msg_attr) && msg_scrolled == 0)
set_keep_msg(message); set_keep_msg(message, keep_msg_attr);
msg_didout = FALSE; /* overwrite this message */ msg_didout = FALSE; /* overwrite this message */
msg_nowait = TRUE; /* don't wait for this message */ msg_nowait = TRUE; /* don't wait for this message */
msg_col = 0; msg_col = 0;

View File

@@ -3442,8 +3442,7 @@ print_save_msg(buf, nchars)
* before redrawing). * before redrawing).
* - When the screen was scrolled but there is no wait-return * - When the screen was scrolled but there is no wait-return
* prompt. */ * prompt. */
set_keep_msg(p); set_keep_msg(p, 0);
keep_msg_attr = 0;
} }
msg_scrolled_ign = FALSE; msg_scrolled_ign = FALSE;
/* add_to_input_buf((char_u *)"\f", 1); */ /* add_to_input_buf((char_u *)"\f", 1); */