summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-02-21 22:12:05 +0000
committerBram Moolenaar <Bram@vim.org>2006-02-21 22:12:05 +0000
commit238a564935abe36832b267f32b5487556c640d00 (patch)
tree7ee3f4d9279f73945f1069e7f6a9b1b059658b27 /src
parent8f7fd65b249e9680866dab628622fe093ac2abc9 (diff)
downloadvim-git-238a564935abe36832b267f32b5487556c640d00.tar.gz
updated for version 7.0203v7.0203
Diffstat (limited to 'src')
-rw-r--r--src/eval.c2
-rw-r--r--src/ex_cmds.c10
-rw-r--r--src/globals.h5
-rw-r--r--src/gui_beval.c6
-rw-r--r--src/main.c3
-rw-r--r--src/memline.c6
-rw-r--r--src/misc1.c3
-rw-r--r--src/misc2.c2
-rw-r--r--src/option.c2
-rw-r--r--src/option.h5
-rw-r--r--src/screen.c222
-rw-r--r--src/structs.h2
-rw-r--r--src/term.c5
-rw-r--r--src/version.h4
14 files changed, 166 insertions, 111 deletions
diff --git a/src/eval.c b/src/eval.c
index f857b8fc9..506cfa5bb 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -14895,7 +14895,7 @@ f_tabpagebuflist(argvars, rettv)
{
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 5e4d59840..15b695a4b 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1212,11 +1212,8 @@ do_filter(line1, line2, eap, cmd, do_in, do_out)
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 @@ do_sub_msg(count_only)
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 23fdd6673..5162b78c8 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -488,7 +488,7 @@ EXTERN win_T *prevwin INIT(= NULL); /* previous window */
# 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_invexprmsg[] INIT(= N_("E449: Invalid expression received"));
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 6c628cda6..a8eac10a3 100644
--- a/src/gui_beval.c
+++ b/src/gui_beval.c
@@ -103,7 +103,11 @@ general_beval_cb(beval, state)
# 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 3dc72e15d..755f74ef2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1059,6 +1059,7 @@ main_loop(cmdwin, noexmode)
/* 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 @@ getout(exitval)
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 c87a955ad..451ace35a 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -2740,10 +2740,8 @@ ml_delete_int(buf, lnum, message)
&& !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 97e41964f..a3b2d3ce3 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3241,8 +3241,7 @@ msgmore(n)
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 680202f1c..79a5174ab 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1026,7 +1026,7 @@ free_all_mem()
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 601a97aa2..bc53237eb 100644
--- a/src/option.c
+++ b/src/option.c
@@ -6524,7 +6524,7 @@ check_stl_option(s)
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 4dac4cc33..57da84222 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 d6b9b7d55..33037cfa7 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -146,6 +146,9 @@ static void screen_line __ARGS((int row, int coloff, int endcol, int clear_width
#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 @@ win_redr_status(wp)
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 @@ win_redr_status(wp)
#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 @@ win_redr_custom(wp, draw_ruler)
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 @@ screen_start_highlight(attr)
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 @@ draw_tabline()
/* 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;
- for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
- ++tabcount;
-
- tabwidth = (Columns - 1 + tabcount / 2) / tabcount;
- if (tabwidth < 6)
- tabwidth = 6;
+ 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;
+ attr = attr_nosel;
+ tabcount = 0;
+ for (tp = first_tabpage; tp != NULL && col < Columns; tp = tp->tp_next)
+ {
+ scol = col;
- 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_sel;
+ if (use_sep_chars && col > 0)
+ screen_putchar('|', 0, col++, attr);
- if (tp->tp_topframe != topframe)
- attr = attr_nosel;
+ if (tp->tp_topframe != topframe)
+ attr = attr_nosel;
- screen_putchar(' ', 0, col++, attr);
+ screen_putchar(' ', 0, col++, attr);
- if (tp->tp_topframe == topframe)
- {
- cwp = curwin;
- wp = firstwin;
- }
- else
- {
- cwp = tp->tp_curwin;
- wp = tp->tp_firstwin;
- }
+ if (tp == curtab)
+ {
+ 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)
+ modified = FALSE;
+ for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount)
+ if (bufIsChanged(wp->w_buffer))
+ modified = TRUE;
+ if (modified || wincount > 1)
{
- vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount);
- len = STRLEN(NameBuff);
- screen_puts_len(NameBuff, len, 0, col,
+ 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;
+ );
+ col += len;
+ }
+ if (modified)
+ screen_puts_len((char_u *)"+", 1, 0, col++, attr);
+ screen_putchar(' ', 0, col++, attr);
}
- 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;
+ 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)
+ if (has_mbyte)
+ while (len > room)
+ {
+ len -= ptr2cells(p);
+ mb_ptr_adv(p);
+ }
+ else
+#endif
+ if (len > room)
{
- len -= ptr2cells(p);
- mb_ptr_adv(p);
+ p += len - room;
+ len = room;
}
- 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);
- screen_puts_len(p, STRLEN(p), 0, col, attr);
- col += len;
+ /* Store the tab page number in TabPageIdxs[], so that
+ * jump_to_mouse() knows where each one is. */
+ ++tabcount;
+ while (scol < col)
+ TabPageIdxs[scol++] = tabcount;
}
- 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 @@ showruler(always)
#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 @@ win_redr_ruler(wp, always)
#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 e5f59f236..98d7ea912 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -919,7 +919,7 @@ struct mapblock
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 37b84c74f..94125a8fe 100644
--- a/src/term.c
+++ b/src/term.c
@@ -5401,7 +5401,10 @@ got_code_from_term(code, len)
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 94588104b..9e8fe2dbb 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 "