diff options
-rw-r--r-- | runtime/doc/options.txt | 18 | ||||
-rw-r--r-- | runtime/doc/tags | 1 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 10 | ||||
-rw-r--r-- | runtime/doc/version7.txt | 14 | ||||
-rw-r--r-- | runtime/syntax/mgl.vim | 128 | ||||
-rw-r--r-- | src/eval.c | 2 | ||||
-rw-r--r-- | src/ex_cmds.c | 10 | ||||
-rw-r--r-- | src/globals.h | 5 | ||||
-rw-r--r-- | src/gui_beval.c | 6 | ||||
-rw-r--r-- | src/main.c | 3 | ||||
-rw-r--r-- | src/memline.c | 6 | ||||
-rw-r--r-- | src/misc1.c | 3 | ||||
-rw-r--r-- | src/misc2.c | 2 | ||||
-rw-r--r-- | src/option.c | 2 | ||||
-rw-r--r-- | src/option.h | 5 | ||||
-rw-r--r-- | src/screen.c | 222 | ||||
-rw-r--r-- | src/structs.h | 2 | ||||
-rw-r--r-- | src/term.c | 5 | ||||
-rw-r--r-- | src/version.h | 4 |
19 files changed, 331 insertions, 117 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 53b9899a6..53411ad49 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 +*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -6002,6 +6002,14 @@ A jump table for the options with a short description can be found at |Q_op|. All fields except the {item} is optional. A single percent sign can be given as "%%". Up to 80 items can be specified. + When the option starts with "%!" then it is used as an expression, + evaluated and the result is used as the option value. Example: > + :set statusline=%!MyStatusLine() +< The result can contain %{} items that will be evaluated too. + + When there is error while evaluating the option then it will be made + empty to avoid further errors. Otherwise screen updating would loop. + Note that the only effect of 'ruler' when this option is set (and 'laststatus' is 2) is controlling the output of |CTRL-G|. @@ -6060,7 +6068,7 @@ A jump table for the options with a short description can be found at |Q_op|. percentage described for 'ruler'. Always 3 in length. a S Argument list status as in default title. ({current} of {max}) Empty if the argument file count is zero or one. - { NF Evaluate expression between '{' and '}' and substitute result. + { NF Evaluate expression between '%{' and '}' and substitute result. Note that there is no '%' before the closing '}'. ( - Start of item group. Can be used for setting the width and alignment of a section. Must be followed by %) somewhere. @@ -6069,6 +6077,10 @@ A jump table for the options with a short description can be found at |Q_op|. No width fields allowed. = - Separation point between left and right aligned items. No width fields allowed. + # - Set highlight group. The name must follow and then a # again. + Thus use %#HLname# for highlight group HLname. The same + highlighting is used, also for the statusline of non-current + windows. * - Set highlight group to User{N}, where {N} is taken from the minwid field, e.g. %1*. Restore normal highlight with %* or %0*. The difference between User{N} and StatusLine will be applied @@ -6264,7 +6276,7 @@ A jump table for the options with a short description can be found at |Q_op|. The value is evaluated like with 'statusline'. You can use |tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out - the text to be displayed. + the text to be displayed. See |setting-tabline| for more info. Keep in mind that only one of the tab pages is the current one, others are invisible and you can't jump to their windows. diff --git a/runtime/doc/tags b/runtime/doc/tags index 517c4dd76..630e0f880 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -6582,6 +6582,7 @@ setloclist() eval.txt /*setloclist()* setqflist() eval.txt /*setqflist()* setreg() eval.txt /*setreg()* setting-guifont gui.txt /*setting-guifont* +setting-tabline tabpage.txt /*setting-tabline* setwinvar() eval.txt /*setwinvar()* sftp pi_netrw.txt /*sftp* sgml.vim syntax.txt /*sgml.vim* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 94218ec27..230ec6efc 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 +*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,7 +30,10 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -'tabline' documentation with an example; esp for the highlighting +Remove resetting "bold" from screen_start_highlight()? + +Using 'tabline' breaks using mouse to select a tab. How to do that? +See suggestion from Tony Mechelynck. P_INSECURE should be remembered for local option values separately. @@ -63,6 +66,7 @@ Open new tab by double click in tab line. ":tab!" to open it at the end, ":0tab" to open at the start. ":tab split" opens tab with window same as current window. ":tpsplit" would split the tab with all its windows. +In GUI: right click can popup menu to close a specific tab. Option to put tab line at the left or right? Need an option to specify its witdh. It's like a separate window with ":tabs" output. :tabdo ":tabdo windo cmd" should also work @@ -85,6 +89,8 @@ windows. Let's call them "tab pages". Crash with X command server (Ciaran McCreesh). +"dip" in end empty lines at end of file leaves one line. (Matt Mzyzik) + Ctags still hasn't included the patch. Darren is looking for someone to do maintanance. diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 7f93bcfba..4d9fd51c1 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -1,4 +1,4 @@ -*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 +*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -654,6 +654,8 @@ New Keymaps: ~ Sinhala (Sri Lanka) (Harshula Jayasuriya) +Tamil in TSCII encoding (Yegappan Lakshmanan) + New message translations: ~ @@ -1016,6 +1018,12 @@ Insert mode completion for whole lines now also searches unloaded buffers. The colortest.vim script can now be invoked directly with ":source" or ":runtime". +The 'statusline' option and other options that support the same format can now +use these new features: +- When it starts with "%!" the value is first evaluated as an expression + before parsing the value. +- "%#HLname#" can be used to start highlighting with HLname. + ============================================================================== COMPILE TIME CHANGES *compile-changes-7* @@ -1710,4 +1718,8 @@ be written without write permission. (Julian Bridle) Motif: In diff mode dragging one scrollbar didn't update the scrollbar of the other diff'ed window. +When editing in an xterm with a different number of colors than expected the +screen would be cleared and redrawn, causing the message about the edited file +to be cleared. Now set "keep_msg" to redraw the last message. + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/syntax/mgl.vim b/runtime/syntax/mgl.vim new file mode 100644 index 000000000..6049e8a54 --- /dev/null +++ b/runtime/syntax/mgl.vim @@ -0,0 +1,128 @@ +" Vim syntax file +" Language: MGL +" Version: 1.0 +" Last Change: 2006 Feb 21 +" Maintainer: Gero Kuhlmann <gero@gkminix.han.de> +" +" $Id$ +" +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + + +syn sync lines=250 + +syn keyword mglBoolean true false +syn keyword mglConditional if else then +syn keyword mglConstant nil +syn keyword mglPredefined maxint +syn keyword mglLabel case goto label +syn keyword mglOperator to downto in of with +syn keyword mglOperator and not or xor div mod +syn keyword mglRepeat do for repeat while to until +syn keyword mglStatement procedure function break continue return restart +syn keyword mglStatement program begin end const var type +syn keyword mglStruct record +syn keyword mglType integer string char boolean char ipaddr array + + +" String +if !exists("mgl_one_line_string") + syn region mglString matchgroup=mglString start=+'+ end=+'+ contains=mglStringEscape + syn region mglString matchgroup=mglString start=+"+ end=+"+ contains=mglStringEscapeGPC +else + "wrong strings + syn region mglStringError matchgroup=mglStringError start=+'+ end=+'+ end=+$+ contains=mglStringEscape + syn region mglStringError matchgroup=mglStringError start=+"+ end=+"+ end=+$+ contains=mglStringEscapeGPC + "right strings + syn region mglString matchgroup=mglString start=+'+ end=+'+ oneline contains=mglStringEscape + syn region mglString matchgroup=mglString start=+"+ end=+"+ oneline contains=mglStringEscapeGPC +end +syn match mglStringEscape contained "''" +syn match mglStringEscapeGPC contained '""' + + +if exists("mgl_symbol_operator") + syn match mglSymbolOperator "[+\-/*=\%]" + syn match mglSymbolOperator "[<>]=\=" + syn match mglSymbolOperator "<>" + syn match mglSymbolOperator ":=" + syn match mglSymbolOperator "[()]" + syn match mglSymbolOperator "\.\." + syn match mglMatrixDelimiter "(." + syn match mglMatrixDelimiter ".)" + syn match mglMatrixDelimiter "[][]" +endif + +syn match mglNumber "-\=\<\d\+\>" +syn match mglHexNumber "\$[0-9a-fA-F]\+\>" +syn match mglCharacter "\#[0-9]\+\>" +syn match mglIpAddr "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\>" + +syn region mglComment start="(\*" end="\*)" +syn region mglComment start="{" end="}" +syn region mglComment start="//" end="$" + +if !exists("mgl_no_functions") + syn keyword mglFunction dispose new + syn keyword mglFunction get load print select + syn keyword mglFunction odd pred succ + syn keyword mglFunction chr ord abs sqr + syn keyword mglFunction exit + syn keyword mglOperator at timeout +endif + + +syn region mglPreProc start="(\*\$" end="\*)" +syn region mglPreProc start="{\$" end="}" + +syn keyword mglException try except raise +syn keyword mglPredefined exception + + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_mgl_syn_inits") + if version < 508 + let did_mgl_syn_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + HiLink mglBoolean Boolean + HiLink mglComment Comment + HiLink mglConditional Conditional + HiLink mglConstant Constant + HiLink mglException Exception + HiLink mglFunction Function + HiLink mglLabel Label + HiLink mglMatrixDelimiter Identifier + HiLink mglNumber Number + HiLink mglHexNumber Number + HiLink mglCharacter Number + HiLink mglIpAddr Number + HiLink mglOperator Operator + HiLink mglPredefined mglFunction + HiLink mglPreProc PreProc + HiLink mglRepeat Repeat + HiLink mglStatement Statement + HiLink mglString String + HiLink mglStringEscape Special + HiLink mglStringEscapeGPC Special + HiLink mglStringError Error + HiLink mglStruct mglStatement + HiLink mglSymbolOperator mglOperator + HiLink mglType Type + + delcommand HiLink +endif + + +let b:current_syntax = "mgl" + +" vim: ts=8 sw=2 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 " |