1
0
forked from aniani/vim

updated for version 7.0213

This commit is contained in:
Bram Moolenaar
2006-03-03 22:50:42 +00:00
parent a55252087b
commit bfb2d40b6e
8 changed files with 105 additions and 35 deletions

View File

@@ -3633,7 +3633,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t
str = tmp;
break;
case STL_PAGENUM:
#if defined(FEAT_PRINTER) || defined(FEAT_WINDOWS)
#if defined(FEAT_PRINTER) || defined(FEAT_GUI_TABLINE)
num = printer_page_num;
#else
num = 0;
@@ -4448,16 +4448,17 @@ ex_buffer_all(eap)
for (wp = firstwin; wp != NULL; wp = wpnext)
{
wpnext = wp->w_next;
if (wp->w_buffer->b_nwindows > 1
if ((wp->w_buffer->b_nwindows > 1
#ifdef FEAT_VERTSPLIT
|| ((cmdmod.split & WSP_VERT)
? wp->w_height + wp->w_status_height < Rows - p_ch
- tabline_height()
: wp->w_width != Columns)
#endif
#ifdef FEAT_WINDOWS
|| (had_tab > 0 && wp != firstwin)
#endif
)
) && firstwin != lastwin)
{
win_close(wp, FALSE);
#ifdef FEAT_AUTOCMD

View File

@@ -3097,7 +3097,6 @@ gui_init_which_components(oldval)
int using_toolbar = FALSE;
#endif
#ifdef FEAT_GUI_TABLINE
static int prev_has_tabline = FALSE;
int using_tabline;
#endif
#ifdef FEAT_FOOTER
@@ -3199,9 +3198,8 @@ gui_init_which_components(oldval)
/* Update the GUI tab line, it may appear or disappear. This may
* cause the non-GUI tab line to disappear or appear. */
using_tabline = gui_has_tabline();
if (prev_has_tabline != using_tabline)
if (!gui_mch_showing_tabline() != !using_tabline)
{
prev_has_tabline = using_tabline;
gui_update_tabline();
need_set_size = TRUE;
if (using_tabline)
@@ -3369,6 +3367,7 @@ get_tabline_label(tp)
int use_sandbox = FALSE;
int save_called_emsg = called_emsg;
char_u res[MAXPATHL];
tabpage_T *save_curtab;
called_emsg = FALSE;
@@ -3377,12 +3376,31 @@ get_tabline_label(tp)
set_vim_var_nr(VV_LNUM, printer_page_num);
use_sandbox = was_set_insecurely((char_u *)"guitablabel", 0);
# endif
/* It's almost as going to the tabpage, but without autocommands. */
curtab->tp_firstwin = firstwin;
curtab->tp_lastwin = lastwin;
curtab->tp_curwin = curwin;
save_curtab = curtab;
curtab = tp;
topframe = curtab->tp_topframe;
firstwin = curtab->tp_firstwin;
lastwin = curtab->tp_lastwin;
curwin = curtab->tp_curwin;
curbuf = curwin->w_buffer;
/* Can't use NameBuff directly, build_stl_str_hl() uses it. */
build_stl_str_hl(tp == curtab ? curwin : tp->tp_curwin,
res, MAXPATHL, p_gtl, use_sandbox,
0, (int)Columns, NULL, NULL);
build_stl_str_hl(curwin, res, MAXPATHL, p_gtl, use_sandbox,
0, (int)Columns, NULL, NULL);
STRCPY(NameBuff, res);
/* Back to the original curtab. */
curtab = save_curtab;
topframe = curtab->tp_topframe;
firstwin = curtab->tp_firstwin;
lastwin = curtab->tp_lastwin;
curwin = curtab->tp_curwin;
curbuf = curwin->w_buffer;
if (called_emsg)
set_string_option_direct((char_u *)"guitablabel", -1,
(char_u *)"", OPT_FREE, SID_ERROR);

View File

@@ -39,12 +39,26 @@ static void write_one_filemark __ARGS((FILE *fp, xfmark_T *fm, int c1, int c2));
#endif
/*
* Set named mark 'c' at current cursor position.
* Set named mark "c" at current cursor position.
* Returns OK on success, FAIL if bad name given.
*/
int
setmark(c)
int c;
{
return setmark_pos(c, &curwin->w_cursor, curbuf->b_fnum);
}
/*
* Set named mark "c" to position "pos".
* When "c" is upper case use file "fnum".
* Returns OK on success, FAIL if bad name given.
*/
int
setmark_pos(c, pos, fnum)
int c;
pos_T *pos;
int fnum;
{
int i;
@@ -54,9 +68,14 @@ setmark(c)
if (c == '\'' || c == '`')
{
setpcmark();
/* keep it even when the cursor doesn't move */
curwin->w_prev_pcmark = curwin->w_pcmark;
if (pos == &curwin->w_cursor)
{
setpcmark();
/* keep it even when the cursor doesn't move */
curwin->w_prev_pcmark = curwin->w_pcmark;
}
else
curwin->w_pcmark = *pos;
return OK;
}
@@ -64,12 +83,12 @@ setmark(c)
* file. */
if (c == '[')
{
curbuf->b_op_start = curwin->w_cursor;
curbuf->b_op_start = *pos;
return OK;
}
if (c == ']')
{
curbuf->b_op_end = curwin->w_cursor;
curbuf->b_op_end = *pos;
return OK;
}
@@ -81,14 +100,14 @@ setmark(c)
if (islower(c))
{
i = c - 'a';
curbuf->b_namedm[i] = curwin->w_cursor;
curbuf->b_namedm[i] = *pos;
return OK;
}
if (isupper(c))
{
i = c - 'A';
namedfm[i].fmark.mark = curwin->w_cursor;
namedfm[i].fmark.fnum = curbuf->b_fnum;
namedfm[i].fmark.mark = *pos;
namedfm[i].fmark.fnum = fnum;
vim_free(namedfm[i].fname);
namedfm[i].fname = NULL;
return OK;
@@ -267,6 +286,9 @@ movechangelist(count)
/*
* Find mark "c".
* If "changefile" is TRUE it's allowed to edit another file for '0, 'A, etc.
* If "fnum" is not NULL store the fnum there for '0, 'A etc., don't edit
* another file.
* Returns:
* - pointer to pos_T if found. lnum is 0 when mark not set, -1 when mark is
* in another file which can't be gotten. (caller needs to check lnum!)
@@ -276,7 +298,16 @@ movechangelist(count)
pos_T *
getmark(c, changefile)
int c;
int changefile; /* allowed to edit another file */
int changefile;
{
return getmark_fnum(c, changefile, NULL);
}
pos_T *
getmark_fnum(c, changefile, fnum)
int c;
int changefile;
int *fnum;
{
pos_T *posp;
#ifdef FEAT_VISUAL
@@ -382,11 +413,14 @@ getmark(c, changefile)
if (namedfm[c].fmark.fnum == 0)
fname2fnum(&namedfm[c]);
if (namedfm[c].fmark.fnum != curbuf->b_fnum)
if (fnum != NULL)
*fnum = namedfm[c].fmark.fnum;
else if (namedfm[c].fmark.fnum != curbuf->b_fnum)
{
/* mark is in another file */
posp = &pos_copy;
/* mark is in another file */
if (namedfm[c].fmark.mark.lnum != 0
&& changefile && namedfm[c].fmark.fnum)
{

View File

@@ -6,6 +6,7 @@ void gui_mch_stop_blink __ARGS((void));
void gui_mch_start_blink __ARGS((void));
int gui_mch_init_check __ARGS((void));
void gui_mch_show_tabline __ARGS((int showit));
int gui_mch_showing_tabline __ARGS((void));
void gui_mch_update_tabline __ARGS((void));
void gui_mch_set_curtab __ARGS((int nr));
int gui_mch_init __ARGS((void));

View File

@@ -1,10 +1,12 @@
/* mark.c */
int setmark __ARGS((int c));
int setmark_pos __ARGS((int c, pos_T *pos, int fnum));
void setpcmark __ARGS((void));
void checkpcmark __ARGS((void));
pos_T *movemark __ARGS((int count));
pos_T *movechangelist __ARGS((int count));
pos_T *getmark __ARGS((int c, int changefile));
pos_T *getmark_fnum __ARGS((int c, int changefile, int *fnum));
pos_T *getnextmark __ARGS((pos_T *startpos, int dir, int begin_line));
void fmarks_check_names __ARGS((buf_T *buf));
int check_mark __ARGS((pos_T *pos));