updated for version 7.0203
diff --git a/src/eval.c b/src/eval.c
index f857b8f..506cfa5 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -14895,7 +14895,7 @@
{
tp = find_tabpage((int)get_tv_number(&argvars[0]));
if (tp != NULL)
- wp = tp->tp_firstwin;
+ wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
}
if (wp == NULL)
rettv->vval.v_number = 0;
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 5e4d598..15b695a 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1212,11 +1212,8 @@
vim_snprintf((char *)msg_buf, sizeof(msg_buf),
_("%ld lines filtered"), (long)linecount);
if (msg(msg_buf) && !msg_scroll)
- {
/* save message to display it after redraw */
- set_keep_msg(msg_buf);
- keep_msg_attr = 0;
- }
+ set_keep_msg(msg_buf, 0);
}
else
msgmore((long)linecount);
@@ -4910,11 +4907,8 @@
vim_snprintf((char *)msg_buf + len, sizeof(msg_buf) - len,
_(" on %ld lines"), (long)sub_nlines);
if (msg(msg_buf))
- {
/* save message to display it after redraw */
- set_keep_msg(msg_buf);
- keep_msg_attr = 0;
- }
+ set_keep_msg(msg_buf, 0);
return TRUE;
}
if (got_int)
diff --git a/src/globals.h b/src/globals.h
index 23fdd66..5162b78 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -488,7 +488,7 @@
# define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next)
#define FOR_ALL_TAB_WINDOWS(tp, wp) \
for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
- for ((wp) = ((tp)->tp_topframe == topframe) \
+ for ((wp) = ((tp) == curtab) \
? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
#else
# define firstwin curwin
@@ -1446,7 +1446,10 @@
EXTERN char_u e_guarded[] INIT(= N_("E463: Region is guarded, cannot modify"));
EXTERN char_u e_nbreadonly[] INIT(= N_("E744: NetBeans does not allow changes in read-only files"));
#endif
+#if defined(FEAT_INS_EXPAND) || defined(FEAT_EVAL) || defined(FEAT_SYN_HL) \
+ || defined(FEAT_WINDOWS)
EXTERN char_u e_intern2[] INIT(= N_("E685: Internal error: %s"));
+#endif
EXTERN char_u e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer"));
diff --git a/src/gui_beval.c b/src/gui_beval.c
index 6c628cd..a8eac10 100644
--- a/src/gui_beval.c
+++ b/src/gui_beval.c
@@ -103,7 +103,11 @@
# else
/* Assume Athena */
# include <X11/Shell.h>
-# include <X11/Xaw/Label.h>
+# ifdef FEAT_GUI_NEXTAW
+# include <X11/neXtaw/Label.h>
+# else
+# include <X11/Xaw/Label.h>
+# endif
# endif
#endif
diff --git a/src/main.c b/src/main.c
index 3dc72e1..755f74e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1059,6 +1059,7 @@
/* msg_attr_keep() will set keep_msg to NULL, must free the
* string here. */
p = keep_msg;
+ keep_msg = NULL;
msg_attr(p, keep_msg_attr);
vim_free(p);
}
@@ -1169,7 +1170,7 @@
for (tp = first_tabpage; tp != NULL; tp = next_tp)
{
next_tp = tp->tp_next;
- for (wp = (tp->tp_topframe == topframe)
+ for (wp = (tp == curtab)
? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next)
{
buf = wp->w_buffer;
diff --git a/src/memline.c b/src/memline.c
index c87a955..451ace3 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -2740,10 +2740,8 @@
&& !netbeansSuppressNoLines
#endif
)
- {
- set_keep_msg((char_u *)_(no_lines_msg));
- keep_msg_attr = 0;
- }
+ set_keep_msg((char_u *)_(no_lines_msg), 0);
+
/* FEAT_BYTEOFF already handled in there, dont worry 'bout it below */
i = ml_replace((linenr_T)1, (char_u *)"", TRUE);
buf->b_ml.ml_flags |= ML_EMPTY;
diff --git a/src/misc1.c b/src/misc1.c
index 97e4196..a3b2d3c 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3241,8 +3241,7 @@
STRCAT(msg_buf, _(" (Interrupted)"));
if (msg(msg_buf))
{
- set_keep_msg(msg_buf);
- keep_msg_attr = 0;
+ set_keep_msg(msg_buf, 0);
keep_msg_more = TRUE;
}
}
diff --git a/src/misc2.c b/src/misc2.c
index 680202f..79a5174 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1026,7 +1026,7 @@
vim_free(clip_exclude_prog);
vim_free(last_cmdline);
vim_free(new_last_cmdline);
- set_keep_msg(NULL);
+ set_keep_msg(NULL, 0);
vim_free(ff_expand_buffer);
/* Clear cmdline history. */
diff --git a/src/option.c b/src/option.c
index 601a97a..bc53237 100644
--- a/src/option.c
+++ b/src/option.c
@@ -6524,7 +6524,7 @@
s++;
while (VIM_ISDIGIT(*s))
s++;
- if (*s == STL_HIGHLIGHT)
+ if (*s == STL_USER_HL)
continue;
if (*s == '.')
{
diff --git a/src/option.h b/src/option.h
index 4dac4cc..57da842 100644
--- a/src/option.h
+++ b/src/option.h
@@ -286,8 +286,9 @@
#define STL_VIM_EXPR '{' /* start of expression to substitute */
#define STL_MIDDLEMARK '=' /* separation between left and right */
#define STL_TRUNCMARK '<' /* truncation mark if line is too long*/
-#define STL_HIGHLIGHT '*' /* highlight from (User)1..9 or 0 */
-#define STL_ALL ((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{")
+#define STL_USER_HL '*' /* highlight from (User)1..9 or 0 */
+#define STL_HIGHLIGHT '#' /* highlight name */
+#define STL_ALL ((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{#")
/* flags used for parsed 'wildmode' */
#define WIM_FULL 1
diff --git a/src/screen.c b/src/screen.c
index d6b9b7d..33037cf 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -146,6 +146,9 @@
#ifdef FEAT_VERTSPLIT
static void draw_vsep_win __ARGS((win_T *wp, int row));
#endif
+#ifdef FEAT_STL_OPT
+static void redraw_custum_statusline __ARGS((win_T *wp));
+#endif
#ifdef FEAT_SEARCH_EXTRA
static void start_search_hl __ARGS((void));
static void end_search_hl __ARGS((void));
@@ -5334,7 +5337,7 @@
else if (*p_stl != NUL || *wp->w_p_stl != NUL)
{
/* redraw custom status line */
- win_redr_custom(wp, FALSE);
+ redraw_custum_statusline(wp);
}
#endif
else
@@ -5457,6 +5460,27 @@
#endif
}
+#ifdef FEAT_STL_OPT
+/*
+ * Redraw the status line according to 'statusline' and take care of any
+ * errors encountered.
+ */
+ static void
+redraw_custum_statusline(wp)
+ win_T *wp;
+{
+ int save_called_emsg = called_emsg;
+
+ called_emsg = FALSE;
+ win_redr_custom(wp, FALSE);
+ if (called_emsg)
+ set_string_option_direct((char_u *)"statusline", -1,
+ (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL
+ ? OPT_LOCAL : OPT_GLOBAL));
+ called_emsg |= save_called_emsg;
+}
+#endif
+
# ifdef FEAT_VERTSPLIT
/*
* Return TRUE if the status line of window "wp" is connected to the status
@@ -5669,8 +5693,10 @@
if (hl[n].userhl == 0)
curattr = attr;
+ else if (hl[n].userhl < 0)
+ curattr = syn_id2attr(-hl[n].userhl);
#ifdef FEAT_WINDOWS
- else if (wp != curwin && wp->w_status_height != 0)
+ else if (wp != NULL && wp != curwin && wp->w_status_height != 0)
curattr = highlight_stlnc[hl[n].userhl - 1];
#endif
else
@@ -6181,7 +6207,14 @@
if (attr > HL_ALL) /* special HL attr. */
{
if (t_colors > 1)
+ {
aep = syn_cterm_attr2entry(attr);
+ /* If the Normal FG color has BOLD attribute and the new
+ * HL has a FG color defined, clear BOLD. */
+ if (aep != NULL && aep->ae_u.cterm.fg_color
+ && cterm_normal_fg_bold)
+ out_str(T_ME);
+ }
else
aep = syn_term_attr2entry(attr);
if (aep == NULL) /* did ":syntax clear" */
@@ -8523,113 +8556,123 @@
/* Use the 'tabline' option if it's set. */
if (*p_tal != NUL)
{
+ int save_called_emsg = called_emsg;
+
+ /* Check for an error. If there is one we would loop in redrawing the
+ * screen. Avoid that by making 'tabline' empty. */
+ called_emsg = FALSE;
win_redr_custom(NULL, FALSE);
- return;
+ if (called_emsg)
+ set_string_option_direct((char_u *)"tabline", -1,
+ (char_u *)"", OPT_FREE);
+ called_emsg |= save_called_emsg;
}
+ else
#endif
-
- for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
- ++tabcount;
-
- tabwidth = (Columns - 1 + tabcount / 2) / tabcount;
- if (tabwidth < 6)
- tabwidth = 6;
-
- attr = attr_nosel;
- tabcount = 0;
- for (tp = first_tabpage; tp != NULL && col < Columns; tp = tp->tp_next)
{
- scol = col;
+ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+ ++tabcount;
- if (tp->tp_topframe == topframe)
- attr = attr_sel;
- if (use_sep_chars && col > 0)
- screen_putchar('|', 0, col++, attr);
+ tabwidth = (Columns - 1 + tabcount / 2) / tabcount;
+ if (tabwidth < 6)
+ tabwidth = 6;
- if (tp->tp_topframe != topframe)
- attr = attr_nosel;
-
- screen_putchar(' ', 0, col++, attr);
-
- if (tp->tp_topframe == topframe)
+ attr = attr_nosel;
+ tabcount = 0;
+ for (tp = first_tabpage; tp != NULL && col < Columns; tp = tp->tp_next)
{
- cwp = curwin;
- wp = firstwin;
- }
- else
- {
- cwp = tp->tp_curwin;
- wp = tp->tp_firstwin;
- }
+ scol = col;
- modified = FALSE;
- for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount)
- if (bufIsChanged(wp->w_buffer))
- modified = TRUE;
- if (modified || wincount > 1)
- {
- if (wincount > 1)
+ if (tp->tp_topframe == topframe)
+ attr = attr_sel;
+ if (use_sep_chars && col > 0)
+ screen_putchar('|', 0, col++, attr);
+
+ if (tp->tp_topframe != topframe)
+ attr = attr_nosel;
+
+ screen_putchar(' ', 0, col++, attr);
+
+ if (tp == curtab)
{
- vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount);
- len = STRLEN(NameBuff);
- screen_puts_len(NameBuff, len, 0, col,
+ cwp = curwin;
+ wp = firstwin;
+ }
+ else
+ {
+ cwp = tp->tp_curwin;
+ wp = tp->tp_firstwin;
+ }
+
+ modified = FALSE;
+ for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount)
+ if (bufIsChanged(wp->w_buffer))
+ modified = TRUE;
+ if (modified || wincount > 1)
+ {
+ if (wincount > 1)
+ {
+ vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount);
+ len = STRLEN(NameBuff);
+ screen_puts_len(NameBuff, len, 0, col,
#if defined(FEAT_SYN_HL)
- hl_combine_attr(attr, hl_attr(HLF_T))
+ hl_combine_attr(attr, hl_attr(HLF_T))
#else
- attr
+ attr
#endif
- );
+ );
+ col += len;
+ }
+ if (modified)
+ screen_puts_len((char_u *)"+", 1, 0, col++, attr);
+ screen_putchar(' ', 0, col++, attr);
+ }
+
+ room = scol - col + tabwidth - 1;
+ if (room > 0)
+ {
+ if (buf_spname(cwp->w_buffer) != NULL)
+ STRCPY(NameBuff, buf_spname(cwp->w_buffer));
+ else
+ home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff,
+ MAXPATHL, TRUE);
+ trans_characters(NameBuff, MAXPATHL);
+ len = vim_strsize(NameBuff);
+ p = NameBuff;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ while (len > room)
+ {
+ len -= ptr2cells(p);
+ mb_ptr_adv(p);
+ }
+ else
+#endif
+ if (len > room)
+ {
+ p += len - room;
+ len = room;
+ }
+
+ screen_puts_len(p, STRLEN(p), 0, col, attr);
col += len;
}
- if (modified)
- screen_puts_len((char_u *)"+", 1, 0, col++, attr);
screen_putchar(' ', 0, col++, attr);
+
+ /* Store the tab page number in TabPageIdxs[], so that
+ * jump_to_mouse() knows where each one is. */
+ ++tabcount;
+ while (scol < col)
+ TabPageIdxs[scol++] = tabcount;
}
- room = scol - col + tabwidth - 1;
- if (room > 0)
- {
- if (buf_spname(cwp->w_buffer) != NULL)
- STRCPY(NameBuff, buf_spname(cwp->w_buffer));
- else
- home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff,
- MAXPATHL, TRUE);
- trans_characters(NameBuff, MAXPATHL);
- len = vim_strsize(NameBuff);
- p = NameBuff;
-#ifdef FEAT_MBYTE
- if (has_mbyte)
- while (len > room)
- {
- len -= ptr2cells(p);
- mb_ptr_adv(p);
- }
- else
-#endif
- if (len > room)
- {
- p += len - room;
- len = room;
- }
-
- screen_puts_len(p, STRLEN(p), 0, col, attr);
- col += len;
- }
- screen_putchar(' ', 0, col++, attr);
-
- /* Store the tab page number in TabPageIdxs[], so that jump_to_mouse()
- * knows where each one is. */
- ++tabcount;
- while (scol < col)
- TabPageIdxs[scol++] = tabcount;
+ if (use_sep_chars)
+ c = '_';
+ else
+ c = ' ';
+ screen_fill(0, 1, col, (int)Columns, c, c, attr_fill);
}
- if (use_sep_chars)
- c = '_';
- else
- c = ' ';
- screen_fill(0, 1, col, (int)Columns, c, c, attr_fill);
-
/* Put an "X" for closing the current tab if there are several. */
if (first_tabpage->tp_next != NULL)
screen_putchar('X', 0, (int)Columns - 1, attr_nosel);
@@ -8731,7 +8774,9 @@
#endif
#if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS)
if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height)
- win_redr_custom(curwin, FALSE);
+ {
+ redraw_custum_statusline(curwin);
+ }
else
#endif
#ifdef FEAT_CMDL_INFO
@@ -8802,7 +8847,14 @@
#ifdef FEAT_STL_OPT
if (*p_ruf)
{
+ int save_called_emsg = called_emsg;
+
+ called_emsg = FALSE;
win_redr_custom(wp, TRUE);
+ if (called_emsg)
+ set_string_option_direct((char_u *)"rulerformat", -1,
+ (char_u *)"", OPT_FREE);
+ called_emsg |= save_called_emsg;
return;
}
#endif
diff --git a/src/structs.h b/src/structs.h
index e5f59f2..98d7ea9 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -919,7 +919,7 @@
struct stl_hlrec
{
char_u *start;
- int userhl;
+ int userhl; /* 0: no HL, 1-9: User HL, < 0 for syn ID */
};
/* Item for a hashtable. "hi_key" can be one of three values:
diff --git a/src/term.c b/src/term.c
index 37b84c7..94125a8 100644
--- a/src/term.c
+++ b/src/term.c
@@ -5401,7 +5401,10 @@
if (i != t_colors)
{
/* Nr of colors changed, initialize highlighting and
- * redraw everything. */
+ * redraw everything. This causes a redraw, which usually
+ * clears the message. Try keeping the message if it
+ * might work. */
+ set_keep_msg_from_hist();
set_color_count(i);
init_highlight(TRUE, FALSE);
redraw_later(CLEAR);
diff --git a/src/version.h b/src/version.h
index 9458810..9e8fe2d 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20)"
-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20, compiled "
+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 21)"
+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 21, compiled "