Mirror of the Vim source from https://github.com/vim/vim
リビジョン | 5b101ff9d4c43c566e7adfb0a7c0978d2150d741 (tree) |
---|---|
日時 | 2006-02-22 07:12:05 |
作者 | vimboss |
コミッター | vimboss |
updated for version 7.0203
@@ -1,4 +1,4 @@ | ||
1 | -*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 | |
1 | +*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 21 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -6002,6 +6002,14 @@ | ||
6002 | 6002 | All fields except the {item} is optional. A single percent sign can |
6003 | 6003 | be given as "%%". Up to 80 items can be specified. |
6004 | 6004 | |
6005 | + When the option starts with "%!" then it is used as an expression, | |
6006 | + evaluated and the result is used as the option value. Example: > | |
6007 | + :set statusline=%!MyStatusLine() | |
6008 | +< The result can contain %{} items that will be evaluated too. | |
6009 | + | |
6010 | + When there is error while evaluating the option then it will be made | |
6011 | + empty to avoid further errors. Otherwise screen updating would loop. | |
6012 | + | |
6005 | 6013 | Note that the only effect of 'ruler' when this option is set (and |
6006 | 6014 | 'laststatus' is 2) is controlling the output of |CTRL-G|. |
6007 | 6015 |
@@ -6060,7 +6068,7 @@ | ||
6060 | 6068 | percentage described for 'ruler'. Always 3 in length. |
6061 | 6069 | a S Argument list status as in default title. ({current} of {max}) |
6062 | 6070 | Empty if the argument file count is zero or one. |
6063 | - { NF Evaluate expression between '{' and '}' and substitute result. | |
6071 | + { NF Evaluate expression between '%{' and '}' and substitute result. | |
6064 | 6072 | Note that there is no '%' before the closing '}'. |
6065 | 6073 | ( - Start of item group. Can be used for setting the width and |
6066 | 6074 | alignment of a section. Must be followed by %) somewhere. |
@@ -6069,6 +6077,10 @@ | ||
6069 | 6077 | No width fields allowed. |
6070 | 6078 | = - Separation point between left and right aligned items. |
6071 | 6079 | No width fields allowed. |
6080 | + # - Set highlight group. The name must follow and then a # again. | |
6081 | + Thus use %#HLname# for highlight group HLname. The same | |
6082 | + highlighting is used, also for the statusline of non-current | |
6083 | + windows. | |
6072 | 6084 | * - Set highlight group to User{N}, where {N} is taken from the |
6073 | 6085 | minwid field, e.g. %1*. Restore normal highlight with %* or %0*. |
6074 | 6086 | The difference between User{N} and StatusLine will be applied |
@@ -6264,7 +6276,7 @@ | ||
6264 | 6276 | |
6265 | 6277 | The value is evaluated like with 'statusline'. You can use |
6266 | 6278 | |tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out |
6267 | - the text to be displayed. | |
6279 | + the text to be displayed. See |setting-tabline| for more info. | |
6268 | 6280 | |
6269 | 6281 | Keep in mind that only one of the tab pages is the current one, others |
6270 | 6282 | are invisible and you can't jump to their windows. |
@@ -6582,6 +6582,7 @@ | ||
6582 | 6582 | setqflist() eval.txt /*setqflist()* |
6583 | 6583 | setreg() eval.txt /*setreg()* |
6584 | 6584 | setting-guifont gui.txt /*setting-guifont* |
6585 | +setting-tabline tabpage.txt /*setting-tabline* | |
6585 | 6586 | setwinvar() eval.txt /*setwinvar()* |
6586 | 6587 | sftp pi_netrw.txt /*sftp* |
6587 | 6588 | sgml.vim syntax.txt /*sgml.vim* |
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 20 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 21 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -30,7 +30,10 @@ | ||
30 | 30 | *known-bugs* |
31 | 31 | -------------------- Known bugs and current work ----------------------- |
32 | 32 | |
33 | -'tabline' documentation with an example; esp for the highlighting | |
33 | +Remove resetting "bold" from screen_start_highlight()? | |
34 | + | |
35 | +Using 'tabline' breaks using mouse to select a tab. How to do that? | |
36 | +See suggestion from Tony Mechelynck. | |
34 | 37 | |
35 | 38 | P_INSECURE should be remembered for local option values separately. |
36 | 39 |
@@ -63,6 +66,7 @@ | ||
63 | 66 | ":tab!" to open it at the end, ":0tab" to open at the start. |
64 | 67 | ":tab split" opens tab with window same as current window. |
65 | 68 | ":tpsplit" would split the tab with all its windows. |
69 | +In GUI: right click can popup menu to close a specific tab. | |
66 | 70 | Option to put tab line at the left or right? Need an option to specify its |
67 | 71 | witdh. It's like a separate window with ":tabs" output. |
68 | 72 | :tabdo ":tabdo windo cmd" should also work |
@@ -85,6 +89,8 @@ | ||
85 | 89 | |
86 | 90 | Crash with X command server (Ciaran McCreesh). |
87 | 91 | |
92 | +"dip" in end empty lines at end of file leaves one line. (Matt Mzyzik) | |
93 | + | |
88 | 94 | Ctags still hasn't included the patch. Darren is looking for someone to do |
89 | 95 | maintanance. |
90 | 96 |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 18 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 21 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -654,6 +654,8 @@ | ||
654 | 654 | |
655 | 655 | Sinhala (Sri Lanka) (Harshula Jayasuriya) |
656 | 656 | |
657 | +Tamil in TSCII encoding (Yegappan Lakshmanan) | |
658 | + | |
657 | 659 | |
658 | 660 | New message translations: ~ |
659 | 661 |
@@ -1016,6 +1018,12 @@ | ||
1016 | 1018 | The colortest.vim script can now be invoked directly with ":source" or |
1017 | 1019 | ":runtime". |
1018 | 1020 | |
1021 | +The 'statusline' option and other options that support the same format can now | |
1022 | +use these new features: | |
1023 | +- When it starts with "%!" the value is first evaluated as an expression | |
1024 | + before parsing the value. | |
1025 | +- "%#HLname#" can be used to start highlighting with HLname. | |
1026 | + | |
1019 | 1027 | ============================================================================== |
1020 | 1028 | COMPILE TIME CHANGES *compile-changes-7* |
1021 | 1029 |
@@ -1710,4 +1718,8 @@ | ||
1710 | 1718 | Motif: In diff mode dragging one scrollbar didn't update the scrollbar of the |
1711 | 1719 | other diff'ed window. |
1712 | 1720 | |
1721 | +When editing in an xterm with a different number of colors than expected the | |
1722 | +screen would be cleared and redrawn, causing the message about the edited file | |
1723 | +to be cleared. Now set "keep_msg" to redraw the last message. | |
1724 | + | |
1713 | 1725 | vim:tw=78:ts=8:ft=help:norl: |
@@ -0,0 +1,128 @@ | ||
1 | +" Vim syntax file | |
2 | +" Language: MGL | |
3 | +" Version: 1.0 | |
4 | +" Last Change: 2006 Feb 21 | |
5 | +" Maintainer: Gero Kuhlmann <gero@gkminix.han.de> | |
6 | +" | |
7 | +" $Id$ | |
8 | +" | |
9 | +if version < 600 | |
10 | + syntax clear | |
11 | +elseif exists("b:current_syntax") | |
12 | + finish | |
13 | +endif | |
14 | + | |
15 | + | |
16 | +syn sync lines=250 | |
17 | + | |
18 | +syn keyword mglBoolean true false | |
19 | +syn keyword mglConditional if else then | |
20 | +syn keyword mglConstant nil | |
21 | +syn keyword mglPredefined maxint | |
22 | +syn keyword mglLabel case goto label | |
23 | +syn keyword mglOperator to downto in of with | |
24 | +syn keyword mglOperator and not or xor div mod | |
25 | +syn keyword mglRepeat do for repeat while to until | |
26 | +syn keyword mglStatement procedure function break continue return restart | |
27 | +syn keyword mglStatement program begin end const var type | |
28 | +syn keyword mglStruct record | |
29 | +syn keyword mglType integer string char boolean char ipaddr array | |
30 | + | |
31 | + | |
32 | +" String | |
33 | +if !exists("mgl_one_line_string") | |
34 | + syn region mglString matchgroup=mglString start=+'+ end=+'+ contains=mglStringEscape | |
35 | + syn region mglString matchgroup=mglString start=+"+ end=+"+ contains=mglStringEscapeGPC | |
36 | +else | |
37 | + "wrong strings | |
38 | + syn region mglStringError matchgroup=mglStringError start=+'+ end=+'+ end=+$+ contains=mglStringEscape | |
39 | + syn region mglStringError matchgroup=mglStringError start=+"+ end=+"+ end=+$+ contains=mglStringEscapeGPC | |
40 | + "right strings | |
41 | + syn region mglString matchgroup=mglString start=+'+ end=+'+ oneline contains=mglStringEscape | |
42 | + syn region mglString matchgroup=mglString start=+"+ end=+"+ oneline contains=mglStringEscapeGPC | |
43 | +end | |
44 | +syn match mglStringEscape contained "''" | |
45 | +syn match mglStringEscapeGPC contained '""' | |
46 | + | |
47 | + | |
48 | +if exists("mgl_symbol_operator") | |
49 | + syn match mglSymbolOperator "[+\-/*=\%]" | |
50 | + syn match mglSymbolOperator "[<>]=\=" | |
51 | + syn match mglSymbolOperator "<>" | |
52 | + syn match mglSymbolOperator ":=" | |
53 | + syn match mglSymbolOperator "[()]" | |
54 | + syn match mglSymbolOperator "\.\." | |
55 | + syn match mglMatrixDelimiter "(." | |
56 | + syn match mglMatrixDelimiter ".)" | |
57 | + syn match mglMatrixDelimiter "[][]" | |
58 | +endif | |
59 | + | |
60 | +syn match mglNumber "-\=\<\d\+\>" | |
61 | +syn match mglHexNumber "\$[0-9a-fA-F]\+\>" | |
62 | +syn match mglCharacter "\#[0-9]\+\>" | |
63 | +syn match mglIpAddr "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\>" | |
64 | + | |
65 | +syn region mglComment start="(\*" end="\*)" | |
66 | +syn region mglComment start="{" end="}" | |
67 | +syn region mglComment start="//" end="$" | |
68 | + | |
69 | +if !exists("mgl_no_functions") | |
70 | + syn keyword mglFunction dispose new | |
71 | + syn keyword mglFunction get load print select | |
72 | + syn keyword mglFunction odd pred succ | |
73 | + syn keyword mglFunction chr ord abs sqr | |
74 | + syn keyword mglFunction exit | |
75 | + syn keyword mglOperator at timeout | |
76 | +endif | |
77 | + | |
78 | + | |
79 | +syn region mglPreProc start="(\*\$" end="\*)" | |
80 | +syn region mglPreProc start="{\$" end="}" | |
81 | + | |
82 | +syn keyword mglException try except raise | |
83 | +syn keyword mglPredefined exception | |
84 | + | |
85 | + | |
86 | +" Define the default highlighting. | |
87 | +" For version 5.7 and earlier: only when not done already | |
88 | +" For version 5.8 and later: only when an item doesn't have highlighting yet | |
89 | +if version >= 508 || !exists("did_mgl_syn_inits") | |
90 | + if version < 508 | |
91 | + let did_mgl_syn_inits = 1 | |
92 | + command -nargs=+ HiLink hi link <args> | |
93 | + else | |
94 | + command -nargs=+ HiLink hi def link <args> | |
95 | + endif | |
96 | + | |
97 | + HiLink mglBoolean Boolean | |
98 | + HiLink mglComment Comment | |
99 | + HiLink mglConditional Conditional | |
100 | + HiLink mglConstant Constant | |
101 | + HiLink mglException Exception | |
102 | + HiLink mglFunction Function | |
103 | + HiLink mglLabel Label | |
104 | + HiLink mglMatrixDelimiter Identifier | |
105 | + HiLink mglNumber Number | |
106 | + HiLink mglHexNumber Number | |
107 | + HiLink mglCharacter Number | |
108 | + HiLink mglIpAddr Number | |
109 | + HiLink mglOperator Operator | |
110 | + HiLink mglPredefined mglFunction | |
111 | + HiLink mglPreProc PreProc | |
112 | + HiLink mglRepeat Repeat | |
113 | + HiLink mglStatement Statement | |
114 | + HiLink mglString String | |
115 | + HiLink mglStringEscape Special | |
116 | + HiLink mglStringEscapeGPC Special | |
117 | + HiLink mglStringError Error | |
118 | + HiLink mglStruct mglStatement | |
119 | + HiLink mglSymbolOperator mglOperator | |
120 | + HiLink mglType Type | |
121 | + | |
122 | + delcommand HiLink | |
123 | +endif | |
124 | + | |
125 | + | |
126 | +let b:current_syntax = "mgl" | |
127 | + | |
128 | +" vim: ts=8 sw=2 |
@@ -14895,7 +14895,7 @@ | ||
14895 | 14895 | { |
14896 | 14896 | tp = find_tabpage((int)get_tv_number(&argvars[0])); |
14897 | 14897 | if (tp != NULL) |
14898 | - wp = tp->tp_firstwin; | |
14898 | + wp = (tp == curtab) ? firstwin : tp->tp_firstwin; | |
14899 | 14899 | } |
14900 | 14900 | if (wp == NULL) |
14901 | 14901 | rettv->vval.v_number = 0; |
@@ -1212,11 +1212,8 @@ | ||
1212 | 1212 | vim_snprintf((char *)msg_buf, sizeof(msg_buf), |
1213 | 1213 | _("%ld lines filtered"), (long)linecount); |
1214 | 1214 | if (msg(msg_buf) && !msg_scroll) |
1215 | - { | |
1216 | 1215 | /* save message to display it after redraw */ |
1217 | - set_keep_msg(msg_buf); | |
1218 | - keep_msg_attr = 0; | |
1219 | - } | |
1216 | + set_keep_msg(msg_buf, 0); | |
1220 | 1217 | } |
1221 | 1218 | else |
1222 | 1219 | msgmore((long)linecount); |
@@ -4910,11 +4907,8 @@ | ||
4910 | 4907 | vim_snprintf((char *)msg_buf + len, sizeof(msg_buf) - len, |
4911 | 4908 | _(" on %ld lines"), (long)sub_nlines); |
4912 | 4909 | if (msg(msg_buf)) |
4913 | - { | |
4914 | 4910 | /* save message to display it after redraw */ |
4915 | - set_keep_msg(msg_buf); | |
4916 | - keep_msg_attr = 0; | |
4917 | - } | |
4911 | + set_keep_msg(msg_buf, 0); | |
4918 | 4912 | return TRUE; |
4919 | 4913 | } |
4920 | 4914 | if (got_int) |
@@ -488,7 +488,7 @@ | ||
488 | 488 | # define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next) |
489 | 489 | #define FOR_ALL_TAB_WINDOWS(tp, wp) \ |
490 | 490 | for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \ |
491 | - for ((wp) = ((tp)->tp_topframe == topframe) \ | |
491 | + for ((wp) = ((tp) == curtab) \ | |
492 | 492 | ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next) |
493 | 493 | #else |
494 | 494 | # define firstwin curwin |
@@ -1446,7 +1446,10 @@ | ||
1446 | 1446 | EXTERN char_u e_guarded[] INIT(= N_("E463: Region is guarded, cannot modify")); |
1447 | 1447 | EXTERN char_u e_nbreadonly[] INIT(= N_("E744: NetBeans does not allow changes in read-only files")); |
1448 | 1448 | #endif |
1449 | +#if defined(FEAT_INS_EXPAND) || defined(FEAT_EVAL) || defined(FEAT_SYN_HL) \ | |
1450 | + || defined(FEAT_WINDOWS) | |
1449 | 1451 | EXTERN char_u e_intern2[] INIT(= N_("E685: Internal error: %s")); |
1452 | +#endif | |
1450 | 1453 | EXTERN char_u e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxmempattern'")); |
1451 | 1454 | EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer")); |
1452 | 1455 |
@@ -103,7 +103,11 @@ | ||
103 | 103 | # else |
104 | 104 | /* Assume Athena */ |
105 | 105 | # include <X11/Shell.h> |
106 | -# include <X11/Xaw/Label.h> | |
106 | +# ifdef FEAT_GUI_NEXTAW | |
107 | +# include <X11/neXtaw/Label.h> | |
108 | +# else | |
109 | +# include <X11/Xaw/Label.h> | |
110 | +# endif | |
107 | 111 | # endif |
108 | 112 | #endif |
109 | 113 |
@@ -1059,6 +1059,7 @@ | ||
1059 | 1059 | /* msg_attr_keep() will set keep_msg to NULL, must free the |
1060 | 1060 | * string here. */ |
1061 | 1061 | p = keep_msg; |
1062 | + keep_msg = NULL; | |
1062 | 1063 | msg_attr(p, keep_msg_attr); |
1063 | 1064 | vim_free(p); |
1064 | 1065 | } |
@@ -1169,7 +1170,7 @@ | ||
1169 | 1170 | for (tp = first_tabpage; tp != NULL; tp = next_tp) |
1170 | 1171 | { |
1171 | 1172 | next_tp = tp->tp_next; |
1172 | - for (wp = (tp->tp_topframe == topframe) | |
1173 | + for (wp = (tp == curtab) | |
1173 | 1174 | ? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next) |
1174 | 1175 | { |
1175 | 1176 | buf = wp->w_buffer; |
@@ -2740,10 +2740,8 @@ | ||
2740 | 2740 | && !netbeansSuppressNoLines |
2741 | 2741 | #endif |
2742 | 2742 | ) |
2743 | - { | |
2744 | - set_keep_msg((char_u *)_(no_lines_msg)); | |
2745 | - keep_msg_attr = 0; | |
2746 | - } | |
2743 | + set_keep_msg((char_u *)_(no_lines_msg), 0); | |
2744 | + | |
2747 | 2745 | /* FEAT_BYTEOFF already handled in there, dont worry 'bout it below */ |
2748 | 2746 | i = ml_replace((linenr_T)1, (char_u *)"", TRUE); |
2749 | 2747 | buf->b_ml.ml_flags |= ML_EMPTY; |
@@ -3241,8 +3241,7 @@ | ||
3241 | 3241 | STRCAT(msg_buf, _(" (Interrupted)")); |
3242 | 3242 | if (msg(msg_buf)) |
3243 | 3243 | { |
3244 | - set_keep_msg(msg_buf); | |
3245 | - keep_msg_attr = 0; | |
3244 | + set_keep_msg(msg_buf, 0); | |
3246 | 3245 | keep_msg_more = TRUE; |
3247 | 3246 | } |
3248 | 3247 | } |
@@ -1026,7 +1026,7 @@ | ||
1026 | 1026 | vim_free(clip_exclude_prog); |
1027 | 1027 | vim_free(last_cmdline); |
1028 | 1028 | vim_free(new_last_cmdline); |
1029 | - set_keep_msg(NULL); | |
1029 | + set_keep_msg(NULL, 0); | |
1030 | 1030 | vim_free(ff_expand_buffer); |
1031 | 1031 | |
1032 | 1032 | /* Clear cmdline history. */ |
@@ -6524,7 +6524,7 @@ | ||
6524 | 6524 | s++; |
6525 | 6525 | while (VIM_ISDIGIT(*s)) |
6526 | 6526 | s++; |
6527 | - if (*s == STL_HIGHLIGHT) | |
6527 | + if (*s == STL_USER_HL) | |
6528 | 6528 | continue; |
6529 | 6529 | if (*s == '.') |
6530 | 6530 | { |
@@ -286,8 +286,9 @@ | ||
286 | 286 | #define STL_VIM_EXPR '{' /* start of expression to substitute */ |
287 | 287 | #define STL_MIDDLEMARK '=' /* separation between left and right */ |
288 | 288 | #define STL_TRUNCMARK '<' /* truncation mark if line is too long*/ |
289 | -#define STL_HIGHLIGHT '*' /* highlight from (User)1..9 or 0 */ | |
290 | -#define STL_ALL ((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{") | |
289 | +#define STL_USER_HL '*' /* highlight from (User)1..9 or 0 */ | |
290 | +#define STL_HIGHLIGHT '#' /* highlight name */ | |
291 | +#define STL_ALL ((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{#") | |
291 | 292 | |
292 | 293 | /* flags used for parsed 'wildmode' */ |
293 | 294 | #define WIM_FULL 1 |
@@ -146,6 +146,9 @@ | ||
146 | 146 | #ifdef FEAT_VERTSPLIT |
147 | 147 | static void draw_vsep_win __ARGS((win_T *wp, int row)); |
148 | 148 | #endif |
149 | +#ifdef FEAT_STL_OPT | |
150 | +static void redraw_custum_statusline __ARGS((win_T *wp)); | |
151 | +#endif | |
149 | 152 | #ifdef FEAT_SEARCH_EXTRA |
150 | 153 | static void start_search_hl __ARGS((void)); |
151 | 154 | static void end_search_hl __ARGS((void)); |
@@ -5334,7 +5337,7 @@ | ||
5334 | 5337 | else if (*p_stl != NUL || *wp->w_p_stl != NUL) |
5335 | 5338 | { |
5336 | 5339 | /* redraw custom status line */ |
5337 | - win_redr_custom(wp, FALSE); | |
5340 | + redraw_custum_statusline(wp); | |
5338 | 5341 | } |
5339 | 5342 | #endif |
5340 | 5343 | else |
@@ -5457,6 +5460,27 @@ | ||
5457 | 5460 | #endif |
5458 | 5461 | } |
5459 | 5462 | |
5463 | +#ifdef FEAT_STL_OPT | |
5464 | +/* | |
5465 | + * Redraw the status line according to 'statusline' and take care of any | |
5466 | + * errors encountered. | |
5467 | + */ | |
5468 | + static void | |
5469 | +redraw_custum_statusline(wp) | |
5470 | + win_T *wp; | |
5471 | +{ | |
5472 | + int save_called_emsg = called_emsg; | |
5473 | + | |
5474 | + called_emsg = FALSE; | |
5475 | + win_redr_custom(wp, FALSE); | |
5476 | + if (called_emsg) | |
5477 | + set_string_option_direct((char_u *)"statusline", -1, | |
5478 | + (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL | |
5479 | + ? OPT_LOCAL : OPT_GLOBAL)); | |
5480 | + called_emsg |= save_called_emsg; | |
5481 | +} | |
5482 | +#endif | |
5483 | + | |
5460 | 5484 | # ifdef FEAT_VERTSPLIT |
5461 | 5485 | /* |
5462 | 5486 | * Return TRUE if the status line of window "wp" is connected to the status |
@@ -5669,8 +5693,10 @@ | ||
5669 | 5693 | |
5670 | 5694 | if (hl[n].userhl == 0) |
5671 | 5695 | curattr = attr; |
5696 | + else if (hl[n].userhl < 0) | |
5697 | + curattr = syn_id2attr(-hl[n].userhl); | |
5672 | 5698 | #ifdef FEAT_WINDOWS |
5673 | - else if (wp != curwin && wp->w_status_height != 0) | |
5699 | + else if (wp != NULL && wp != curwin && wp->w_status_height != 0) | |
5674 | 5700 | curattr = highlight_stlnc[hl[n].userhl - 1]; |
5675 | 5701 | #endif |
5676 | 5702 | else |
@@ -6181,7 +6207,14 @@ | ||
6181 | 6207 | if (attr > HL_ALL) /* special HL attr. */ |
6182 | 6208 | { |
6183 | 6209 | if (t_colors > 1) |
6210 | + { | |
6184 | 6211 | aep = syn_cterm_attr2entry(attr); |
6212 | + /* If the Normal FG color has BOLD attribute and the new | |
6213 | + * HL has a FG color defined, clear BOLD. */ | |
6214 | + if (aep != NULL && aep->ae_u.cterm.fg_color | |
6215 | + && cterm_normal_fg_bold) | |
6216 | + out_str(T_ME); | |
6217 | + } | |
6185 | 6218 | else |
6186 | 6219 | aep = syn_term_attr2entry(attr); |
6187 | 6220 | if (aep == NULL) /* did ":syntax clear" */ |
@@ -8523,112 +8556,122 @@ | ||
8523 | 8556 | /* Use the 'tabline' option if it's set. */ |
8524 | 8557 | if (*p_tal != NUL) |
8525 | 8558 | { |
8559 | + int save_called_emsg = called_emsg; | |
8560 | + | |
8561 | + /* Check for an error. If there is one we would loop in redrawing the | |
8562 | + * screen. Avoid that by making 'tabline' empty. */ | |
8563 | + called_emsg = FALSE; | |
8526 | 8564 | win_redr_custom(NULL, FALSE); |
8527 | - return; | |
8528 | - } | |
8529 | -#endif | |
8530 | - | |
8531 | - for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) | |
8532 | - ++tabcount; | |
8533 | - | |
8534 | - tabwidth = (Columns - 1 + tabcount / 2) / tabcount; | |
8535 | - if (tabwidth < 6) | |
8536 | - tabwidth = 6; | |
8537 | - | |
8538 | - attr = attr_nosel; | |
8539 | - tabcount = 0; | |
8540 | - for (tp = first_tabpage; tp != NULL && col < Columns; tp = tp->tp_next) | |
8541 | - { | |
8542 | - scol = col; | |
8543 | - | |
8544 | - if (tp->tp_topframe == topframe) | |
8545 | - attr = attr_sel; | |
8546 | - if (use_sep_chars && col > 0) | |
8547 | - screen_putchar('|', 0, col++, attr); | |
8548 | - | |
8549 | - if (tp->tp_topframe != topframe) | |
8550 | - attr = attr_nosel; | |
8551 | - | |
8552 | - screen_putchar(' ', 0, col++, attr); | |
8553 | - | |
8554 | - if (tp->tp_topframe == topframe) | |
8555 | - { | |
8556 | - cwp = curwin; | |
8557 | - wp = firstwin; | |
8558 | - } | |
8559 | - else | |
8560 | - { | |
8561 | - cwp = tp->tp_curwin; | |
8562 | - wp = tp->tp_firstwin; | |
8563 | - } | |
8564 | - | |
8565 | - modified = FALSE; | |
8566 | - for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount) | |
8567 | - if (bufIsChanged(wp->w_buffer)) | |
8568 | - modified = TRUE; | |
8569 | - if (modified || wincount > 1) | |
8570 | - { | |
8571 | - if (wincount > 1) | |
8572 | - { | |
8573 | - vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount); | |
8574 | - len = STRLEN(NameBuff); | |
8575 | - screen_puts_len(NameBuff, len, 0, col, | |
8565 | + if (called_emsg) | |
8566 | + set_string_option_direct((char_u *)"tabline", -1, | |
8567 | + (char_u *)"", OPT_FREE); | |
8568 | + called_emsg |= save_called_emsg; | |
8569 | + } | |
8570 | + else | |
8571 | +#endif | |
8572 | + { | |
8573 | + for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) | |
8574 | + ++tabcount; | |
8575 | + | |
8576 | + tabwidth = (Columns - 1 + tabcount / 2) / tabcount; | |
8577 | + if (tabwidth < 6) | |
8578 | + tabwidth = 6; | |
8579 | + | |
8580 | + attr = attr_nosel; | |
8581 | + tabcount = 0; | |
8582 | + for (tp = first_tabpage; tp != NULL && col < Columns; tp = tp->tp_next) | |
8583 | + { | |
8584 | + scol = col; | |
8585 | + | |
8586 | + if (tp->tp_topframe == topframe) | |
8587 | + attr = attr_sel; | |
8588 | + if (use_sep_chars && col > 0) | |
8589 | + screen_putchar('|', 0, col++, attr); | |
8590 | + | |
8591 | + if (tp->tp_topframe != topframe) | |
8592 | + attr = attr_nosel; | |
8593 | + | |
8594 | + screen_putchar(' ', 0, col++, attr); | |
8595 | + | |
8596 | + if (tp == curtab) | |
8597 | + { | |
8598 | + cwp = curwin; | |
8599 | + wp = firstwin; | |
8600 | + } | |
8601 | + else | |
8602 | + { | |
8603 | + cwp = tp->tp_curwin; | |
8604 | + wp = tp->tp_firstwin; | |
8605 | + } | |
8606 | + | |
8607 | + modified = FALSE; | |
8608 | + for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount) | |
8609 | + if (bufIsChanged(wp->w_buffer)) | |
8610 | + modified = TRUE; | |
8611 | + if (modified || wincount > 1) | |
8612 | + { | |
8613 | + if (wincount > 1) | |
8614 | + { | |
8615 | + vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount); | |
8616 | + len = STRLEN(NameBuff); | |
8617 | + screen_puts_len(NameBuff, len, 0, col, | |
8576 | 8618 | #if defined(FEAT_SYN_HL) |
8577 | - hl_combine_attr(attr, hl_attr(HLF_T)) | |
8619 | + hl_combine_attr(attr, hl_attr(HLF_T)) | |
8578 | 8620 | #else |
8579 | - attr | |
8580 | -#endif | |
8581 | - ); | |
8582 | - col += len; | |
8583 | - } | |
8584 | - if (modified) | |
8585 | - screen_puts_len((char_u *)"+", 1, 0, col++, attr); | |
8586 | - screen_putchar(' ', 0, col++, attr); | |
8587 | - } | |
8588 | - | |
8589 | - room = scol - col + tabwidth - 1; | |
8590 | - if (room > 0) | |
8591 | - { | |
8592 | - if (buf_spname(cwp->w_buffer) != NULL) | |
8593 | - STRCPY(NameBuff, buf_spname(cwp->w_buffer)); | |
8594 | - else | |
8595 | - home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff, | |
8596 | - MAXPATHL, TRUE); | |
8597 | - trans_characters(NameBuff, MAXPATHL); | |
8598 | - len = vim_strsize(NameBuff); | |
8599 | - p = NameBuff; | |
8621 | + attr | |
8622 | +#endif | |
8623 | + ); | |
8624 | + col += len; | |
8625 | + } | |
8626 | + if (modified) | |
8627 | + screen_puts_len((char_u *)"+", 1, 0, col++, attr); | |
8628 | + screen_putchar(' ', 0, col++, attr); | |
8629 | + } | |
8630 | + | |
8631 | + room = scol - col + tabwidth - 1; | |
8632 | + if (room > 0) | |
8633 | + { | |
8634 | + if (buf_spname(cwp->w_buffer) != NULL) | |
8635 | + STRCPY(NameBuff, buf_spname(cwp->w_buffer)); | |
8636 | + else | |
8637 | + home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff, | |
8638 | + MAXPATHL, TRUE); | |
8639 | + trans_characters(NameBuff, MAXPATHL); | |
8640 | + len = vim_strsize(NameBuff); | |
8641 | + p = NameBuff; | |
8600 | 8642 | #ifdef FEAT_MBYTE |
8601 | - if (has_mbyte) | |
8602 | - while (len > room) | |
8643 | + if (has_mbyte) | |
8644 | + while (len > room) | |
8645 | + { | |
8646 | + len -= ptr2cells(p); | |
8647 | + mb_ptr_adv(p); | |
8648 | + } | |
8649 | + else | |
8650 | +#endif | |
8651 | + if (len > room) | |
8603 | 8652 | { |
8604 | - len -= ptr2cells(p); | |
8605 | - mb_ptr_adv(p); | |
8653 | + p += len - room; | |
8654 | + len = room; | |
8606 | 8655 | } |
8607 | - else | |
8608 | -#endif | |
8609 | - if (len > room) | |
8610 | - { | |
8611 | - p += len - room; | |
8612 | - len = room; | |
8613 | - } | |
8614 | - | |
8615 | - screen_puts_len(p, STRLEN(p), 0, col, attr); | |
8616 | - col += len; | |
8617 | - } | |
8618 | - screen_putchar(' ', 0, col++, attr); | |
8619 | - | |
8620 | - /* Store the tab page number in TabPageIdxs[], so that jump_to_mouse() | |
8621 | - * knows where each one is. */ | |
8622 | - ++tabcount; | |
8623 | - while (scol < col) | |
8624 | - TabPageIdxs[scol++] = tabcount; | |
8625 | - } | |
8626 | - | |
8627 | - if (use_sep_chars) | |
8628 | - c = '_'; | |
8629 | - else | |
8630 | - c = ' '; | |
8631 | - screen_fill(0, 1, col, (int)Columns, c, c, attr_fill); | |
8656 | + | |
8657 | + screen_puts_len(p, STRLEN(p), 0, col, attr); | |
8658 | + col += len; | |
8659 | + } | |
8660 | + screen_putchar(' ', 0, col++, attr); | |
8661 | + | |
8662 | + /* Store the tab page number in TabPageIdxs[], so that | |
8663 | + * jump_to_mouse() knows where each one is. */ | |
8664 | + ++tabcount; | |
8665 | + while (scol < col) | |
8666 | + TabPageIdxs[scol++] = tabcount; | |
8667 | + } | |
8668 | + | |
8669 | + if (use_sep_chars) | |
8670 | + c = '_'; | |
8671 | + else | |
8672 | + c = ' '; | |
8673 | + screen_fill(0, 1, col, (int)Columns, c, c, attr_fill); | |
8674 | + } | |
8632 | 8675 | |
8633 | 8676 | /* Put an "X" for closing the current tab if there are several. */ |
8634 | 8677 | if (first_tabpage->tp_next != NULL) |
@@ -8731,7 +8774,9 @@ | ||
8731 | 8774 | #endif |
8732 | 8775 | #if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS) |
8733 | 8776 | if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height) |
8734 | - win_redr_custom(curwin, FALSE); | |
8777 | + { | |
8778 | + redraw_custum_statusline(curwin); | |
8779 | + } | |
8735 | 8780 | else |
8736 | 8781 | #endif |
8737 | 8782 | #ifdef FEAT_CMDL_INFO |
@@ -8802,7 +8847,14 @@ | ||
8802 | 8847 | #ifdef FEAT_STL_OPT |
8803 | 8848 | if (*p_ruf) |
8804 | 8849 | { |
8850 | + int save_called_emsg = called_emsg; | |
8851 | + | |
8852 | + called_emsg = FALSE; | |
8805 | 8853 | win_redr_custom(wp, TRUE); |
8854 | + if (called_emsg) | |
8855 | + set_string_option_direct((char_u *)"rulerformat", -1, | |
8856 | + (char_u *)"", OPT_FREE); | |
8857 | + called_emsg |= save_called_emsg; | |
8806 | 8858 | return; |
8807 | 8859 | } |
8808 | 8860 | #endif |
@@ -919,7 +919,7 @@ | ||
919 | 919 | struct stl_hlrec |
920 | 920 | { |
921 | 921 | char_u *start; |
922 | - int userhl; | |
922 | + int userhl; /* 0: no HL, 1-9: User HL, < 0 for syn ID */ | |
923 | 923 | }; |
924 | 924 | |
925 | 925 | /* Item for a hashtable. "hi_key" can be one of three values: |
@@ -5401,7 +5401,10 @@ | ||
5401 | 5401 | if (i != t_colors) |
5402 | 5402 | { |
5403 | 5403 | /* Nr of colors changed, initialize highlighting and |
5404 | - * redraw everything. */ | |
5404 | + * redraw everything. This causes a redraw, which usually | |
5405 | + * clears the message. Try keeping the message if it | |
5406 | + * might work. */ | |
5407 | + set_keep_msg_from_hist(); | |
5405 | 5408 | set_color_count(i); |
5406 | 5409 | init_highlight(TRUE, FALSE); |
5407 | 5410 | redraw_later(CLEAR); |
@@ -36,5 +36,5 @@ | ||
36 | 36 | #define VIM_VERSION_NODOT "vim70aa" |
37 | 37 | #define VIM_VERSION_SHORT "7.0aa" |
38 | 38 | #define VIM_VERSION_MEDIUM "7.0aa ALPHA" |
39 | -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20)" | |
40 | -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20, compiled " | |
39 | +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 21)" | |
40 | +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 21, compiled " |