Mercurial > vim
comparison src/option.c @ 12477:68d7bc045dbe v8.0.1118
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
commit https://github.com/vim/vim/commit/4033c55eca575777718c0701e26635a0cc47d907
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 16 20:54:51 2017 +0200
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
Problem: FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
enabled and only adds 7% to the binary size of the tiny build.
Solution: Graduate FEAT_WINDOWS.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 16 Sep 2017 21:00:06 +0200 |
parents | 61d910f0999d |
children | b390f5003e2f |
comparison
equal
deleted
inserted
replaced
12476:2516383741e6 | 12477:68d7bc045dbe |
---|---|
220 #define PV_NU OPT_WIN(WV_NU) | 220 #define PV_NU OPT_WIN(WV_NU) |
221 #define PV_RNU OPT_WIN(WV_RNU) | 221 #define PV_RNU OPT_WIN(WV_RNU) |
222 #ifdef FEAT_LINEBREAK | 222 #ifdef FEAT_LINEBREAK |
223 # define PV_NUW OPT_WIN(WV_NUW) | 223 # define PV_NUW OPT_WIN(WV_NUW) |
224 #endif | 224 #endif |
225 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 225 #if defined(FEAT_QUICKFIX) |
226 # define PV_PVW OPT_WIN(WV_PVW) | 226 # define PV_PVW OPT_WIN(WV_PVW) |
227 #endif | 227 #endif |
228 #ifdef FEAT_RIGHTLEFT | 228 #ifdef FEAT_RIGHTLEFT |
229 # define PV_RL OPT_WIN(WV_RL) | 229 # define PV_RL OPT_WIN(WV_RL) |
230 # define PV_RLC OPT_WIN(WV_RLC) | 230 # define PV_RLC OPT_WIN(WV_RLC) |
243 #endif | 243 #endif |
244 #ifdef FEAT_STL_OPT | 244 #ifdef FEAT_STL_OPT |
245 # define PV_STL OPT_BOTH(OPT_WIN(WV_STL)) | 245 # define PV_STL OPT_BOTH(OPT_WIN(WV_STL)) |
246 #endif | 246 #endif |
247 #define PV_UL OPT_BOTH(OPT_BUF(BV_UL)) | 247 #define PV_UL OPT_BOTH(OPT_BUF(BV_UL)) |
248 #ifdef FEAT_WINDOWS | |
249 # define PV_WFH OPT_WIN(WV_WFH) | 248 # define PV_WFH OPT_WIN(WV_WFH) |
250 # define PV_WFW OPT_WIN(WV_WFW) | 249 # define PV_WFW OPT_WIN(WV_WFW) |
251 #endif | |
252 #define PV_WRAP OPT_WIN(WV_WRAP) | 250 #define PV_WRAP OPT_WIN(WV_WRAP) |
253 #ifdef FEAT_CURSORBIND | 251 #ifdef FEAT_CURSORBIND |
254 # define PV_CRBIND OPT_WIN(WV_CRBIND) | 252 # define PV_CRBIND OPT_WIN(WV_CRBIND) |
255 #endif | 253 #endif |
256 #ifdef FEAT_CONCEAL | 254 #ifdef FEAT_CONCEAL |
473 # define ISP_LATIN1 (char_u *)"@,~-255" | 471 # define ISP_LATIN1 (char_u *)"@,~-255" |
474 #else | 472 #else |
475 # define ISP_LATIN1 (char_u *)"@,161-255" | 473 # define ISP_LATIN1 (char_u *)"@,161-255" |
476 #endif | 474 #endif |
477 | 475 |
478 /* Make the string as short as possible when compiling with few features. */ | |
479 #if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \ | |
480 || defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \ | |
481 || defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) \ | |
482 || defined(FEAT_CONCEAL) || defined(FEAT_QUICKFIX) \ | |
483 || defined(FEAT_TERMINAL) | |
484 # define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC" | 476 # define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC" |
485 #else | |
486 # define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill" | |
487 #endif | |
488 | 477 |
489 /* Default python version for pyx* commands */ | 478 /* Default python version for pyx* commands */ |
490 #if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3) | 479 #if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3) |
491 # define DEFAULT_PYTHON_VER 0 | 480 # define DEFAULT_PYTHON_VER 0 |
492 #elif defined(FEAT_PYTHON3) | 481 #elif defined(FEAT_PYTHON3) |
1067 {(char_u *)DFLT_DIR, (char_u *)0L} SCRIPTID_INIT}, | 1056 {(char_u *)DFLT_DIR, (char_u *)0L} SCRIPTID_INIT}, |
1068 {"display", "dy", P_STRING|P_VI_DEF|P_ONECOMMA|P_RALL|P_NODUP, | 1057 {"display", "dy", P_STRING|P_VI_DEF|P_ONECOMMA|P_RALL|P_NODUP, |
1069 (char_u *)&p_dy, PV_NONE, | 1058 (char_u *)&p_dy, PV_NONE, |
1070 {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, | 1059 {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, |
1071 {"eadirection", "ead", P_STRING|P_VI_DEF, | 1060 {"eadirection", "ead", P_STRING|P_VI_DEF, |
1072 #ifdef FEAT_WINDOWS | |
1073 (char_u *)&p_ead, PV_NONE, | 1061 (char_u *)&p_ead, PV_NONE, |
1074 {(char_u *)"both", (char_u *)0L} | 1062 {(char_u *)"both", (char_u *)0L} |
1075 #else | |
1076 (char_u *)NULL, PV_NONE, | |
1077 {(char_u *)NULL, (char_u *)0L} | |
1078 #endif | |
1079 SCRIPTID_INIT}, | 1063 SCRIPTID_INIT}, |
1080 {"edcompatible","ed", P_BOOL|P_VI_DEF, | 1064 {"edcompatible","ed", P_BOOL|P_VI_DEF, |
1081 (char_u *)&p_ed, PV_NONE, | 1065 (char_u *)&p_ed, PV_NONE, |
1082 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, | 1066 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
1083 {"emoji", "emo", P_BOOL|P_VI_DEF|P_RCLR, | 1067 {"emoji", "emo", P_BOOL|P_VI_DEF|P_RCLR, |
1188 (char_u *)NULL, PV_NONE, | 1172 (char_u *)NULL, PV_NONE, |
1189 {(char_u *)0L, (char_u *)0L} | 1173 {(char_u *)0L, (char_u *)0L} |
1190 #endif | 1174 #endif |
1191 SCRIPTID_INIT}, | 1175 SCRIPTID_INIT}, |
1192 {"fillchars", "fcs", P_STRING|P_VI_DEF|P_RALL|P_ONECOMMA|P_NODUP, | 1176 {"fillchars", "fcs", P_STRING|P_VI_DEF|P_RALL|P_ONECOMMA|P_NODUP, |
1193 #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING) | |
1194 (char_u *)&p_fcs, PV_NONE, | 1177 (char_u *)&p_fcs, PV_NONE, |
1195 {(char_u *)"vert:|,fold:-", (char_u *)0L} | 1178 {(char_u *)"vert:|,fold:-", (char_u *)0L} |
1196 #else | |
1197 (char_u *)NULL, PV_NONE, | |
1198 {(char_u *)"", (char_u *)0L} | |
1199 #endif | |
1200 SCRIPTID_INIT}, | 1179 SCRIPTID_INIT}, |
1201 {"fixendofline", "fixeol", P_BOOL|P_VI_DEF|P_RSTAT, | 1180 {"fixendofline", "fixeol", P_BOOL|P_VI_DEF|P_RSTAT, |
1202 (char_u *)&p_fixeol, PV_FIXEOL, | 1181 (char_u *)&p_fixeol, PV_FIXEOL, |
1203 {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, | 1182 {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, |
1204 {"fkmap", "fk", P_BOOL|P_VI_DEF, | 1183 {"fkmap", "fk", P_BOOL|P_VI_DEF, |
1493 {"helpfile", "hf", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, | 1472 {"helpfile", "hf", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, |
1494 (char_u *)&p_hf, PV_NONE, | 1473 (char_u *)&p_hf, PV_NONE, |
1495 {(char_u *)DFLT_HELPFILE, (char_u *)0L} | 1474 {(char_u *)DFLT_HELPFILE, (char_u *)0L} |
1496 SCRIPTID_INIT}, | 1475 SCRIPTID_INIT}, |
1497 {"helpheight", "hh", P_NUM|P_VI_DEF, | 1476 {"helpheight", "hh", P_NUM|P_VI_DEF, |
1498 #ifdef FEAT_WINDOWS | |
1499 (char_u *)&p_hh, PV_NONE, | 1477 (char_u *)&p_hh, PV_NONE, |
1500 #else | |
1501 (char_u *)NULL, PV_NONE, | |
1502 #endif | |
1503 {(char_u *)20L, (char_u *)0L} SCRIPTID_INIT}, | 1478 {(char_u *)20L, (char_u *)0L} SCRIPTID_INIT}, |
1504 {"helplang", "hlg", P_STRING|P_VI_DEF|P_ONECOMMA, | 1479 {"helplang", "hlg", P_STRING|P_VI_DEF|P_ONECOMMA, |
1505 #ifdef FEAT_MULTI_LANG | 1480 #ifdef FEAT_MULTI_LANG |
1506 (char_u *)&p_hlg, PV_NONE, | 1481 (char_u *)&p_hlg, PV_NONE, |
1507 {(char_u *)"", (char_u *)0L} | 1482 {(char_u *)"", (char_u *)0L} |
1804 #else | 1779 #else |
1805 (char_u *)NULL, PV_NONE, | 1780 (char_u *)NULL, PV_NONE, |
1806 #endif | 1781 #endif |
1807 {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, | 1782 {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, |
1808 {"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL, | 1783 {"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL, |
1809 #ifdef FEAT_WINDOWS | |
1810 (char_u *)&p_ls, PV_NONE, | 1784 (char_u *)&p_ls, PV_NONE, |
1811 #else | |
1812 (char_u *)NULL, PV_NONE, | |
1813 #endif | |
1814 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, | 1785 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, |
1815 {"lazyredraw", "lz", P_BOOL|P_VI_DEF, | 1786 {"lazyredraw", "lz", P_BOOL|P_VI_DEF, |
1816 (char_u *)&p_lz, PV_NONE, | 1787 (char_u *)&p_lz, PV_NONE, |
1817 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, | 1788 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
1818 {"linebreak", "lbr", P_BOOL|P_VI_DEF|P_RWIN, | 1789 {"linebreak", "lbr", P_BOOL|P_VI_DEF|P_RWIN, |
2137 SCRIPTID_INIT}, | 2108 SCRIPTID_INIT}, |
2138 {"preserveindent", "pi", P_BOOL|P_VI_DEF|P_VIM, | 2109 {"preserveindent", "pi", P_BOOL|P_VI_DEF|P_VIM, |
2139 (char_u *)&p_pi, PV_PI, | 2110 (char_u *)&p_pi, PV_PI, |
2140 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, | 2111 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
2141 {"previewheight", "pvh", P_NUM|P_VI_DEF, | 2112 {"previewheight", "pvh", P_NUM|P_VI_DEF, |
2142 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 2113 #if defined(FEAT_QUICKFIX) |
2143 (char_u *)&p_pvh, PV_NONE, | 2114 (char_u *)&p_pvh, PV_NONE, |
2144 #else | 2115 #else |
2145 (char_u *)NULL, PV_NONE, | 2116 (char_u *)NULL, PV_NONE, |
2146 #endif | 2117 #endif |
2147 {(char_u *)12L, (char_u *)0L} SCRIPTID_INIT}, | 2118 {(char_u *)12L, (char_u *)0L} SCRIPTID_INIT}, |
2148 {"previewwindow", "pvw", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB, | 2119 {"previewwindow", "pvw", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB, |
2149 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 2120 #if defined(FEAT_QUICKFIX) |
2150 (char_u *)VAR_WIN, PV_PVW, | 2121 (char_u *)VAR_WIN, PV_PVW, |
2151 #else | 2122 #else |
2152 (char_u *)NULL, PV_NONE, | 2123 (char_u *)NULL, PV_NONE, |
2153 #endif | 2124 #endif |
2154 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, | 2125 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
2537 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, | 2508 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
2538 {"showmode", "smd", P_BOOL|P_VIM, | 2509 {"showmode", "smd", P_BOOL|P_VIM, |
2539 (char_u *)&p_smd, PV_NONE, | 2510 (char_u *)&p_smd, PV_NONE, |
2540 {(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT}, | 2511 {(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT}, |
2541 {"showtabline", "stal", P_NUM|P_VI_DEF|P_RALL, | 2512 {"showtabline", "stal", P_NUM|P_VI_DEF|P_RALL, |
2542 #ifdef FEAT_WINDOWS | |
2543 (char_u *)&p_stal, PV_NONE, | 2513 (char_u *)&p_stal, PV_NONE, |
2544 #else | |
2545 (char_u *)NULL, PV_NONE, | |
2546 #endif | |
2547 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, | 2514 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, |
2548 {"sidescroll", "ss", P_NUM|P_VI_DEF, | 2515 {"sidescroll", "ss", P_NUM|P_VI_DEF, |
2549 (char_u *)&p_ss, PV_NONE, | 2516 (char_u *)&p_ss, PV_NONE, |
2550 {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, | 2517 {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, |
2551 {"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF, | 2518 {"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF, |
2626 (char_u *)NULL, PV_NONE, | 2593 (char_u *)NULL, PV_NONE, |
2627 {(char_u *)0L, (char_u *)0L} | 2594 {(char_u *)0L, (char_u *)0L} |
2628 #endif | 2595 #endif |
2629 SCRIPTID_INIT}, | 2596 SCRIPTID_INIT}, |
2630 {"splitbelow", "sb", P_BOOL|P_VI_DEF, | 2597 {"splitbelow", "sb", P_BOOL|P_VI_DEF, |
2631 #ifdef FEAT_WINDOWS | |
2632 (char_u *)&p_sb, PV_NONE, | 2598 (char_u *)&p_sb, PV_NONE, |
2633 #else | |
2634 (char_u *)NULL, PV_NONE, | |
2635 #endif | |
2636 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, | 2599 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
2637 {"splitright", "spr", P_BOOL|P_VI_DEF, | 2600 {"splitright", "spr", P_BOOL|P_VI_DEF, |
2638 #ifdef FEAT_WINDOWS | |
2639 (char_u *)&p_spr, PV_NONE, | 2601 (char_u *)&p_spr, PV_NONE, |
2640 #else | |
2641 (char_u *)NULL, PV_NONE, | |
2642 #endif | |
2643 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, | 2602 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
2644 {"startofline", "sol", P_BOOL|P_VI_DEF|P_VIM, | 2603 {"startofline", "sol", P_BOOL|P_VI_DEF|P_VIM, |
2645 (char_u *)&p_sol, PV_NONE, | 2604 (char_u *)&p_sol, PV_NONE, |
2646 {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, | 2605 {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, |
2647 {"statusline" ,"stl", P_STRING|P_VI_DEF|P_ALLOCED|P_RSTAT, | 2606 {"statusline" ,"stl", P_STRING|P_VI_DEF|P_ALLOCED|P_RSTAT, |
2697 #else | 2656 #else |
2698 (char_u *)NULL, PV_NONE, | 2657 (char_u *)NULL, PV_NONE, |
2699 #endif | 2658 #endif |
2700 {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, | 2659 {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, |
2701 {"tabpagemax", "tpm", P_NUM|P_VI_DEF, | 2660 {"tabpagemax", "tpm", P_NUM|P_VI_DEF, |
2702 #ifdef FEAT_WINDOWS | |
2703 (char_u *)&p_tpm, PV_NONE, | 2661 (char_u *)&p_tpm, PV_NONE, |
2704 #else | |
2705 (char_u *)NULL, PV_NONE, | |
2706 #endif | |
2707 {(char_u *)10L, (char_u *)0L} SCRIPTID_INIT}, | 2662 {(char_u *)10L, (char_u *)0L} SCRIPTID_INIT}, |
2708 {"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF, | 2663 {"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF, |
2709 (char_u *)&p_ts, PV_TS, | 2664 (char_u *)&p_ts, PV_TS, |
2710 {(char_u *)8L, (char_u *)0L} SCRIPTID_INIT}, | 2665 {(char_u *)8L, (char_u *)0L} SCRIPTID_INIT}, |
2711 {"tagbsearch", "tbs", P_BOOL|P_VI_DEF, | 2666 {"tagbsearch", "tbs", P_BOOL|P_VI_DEF, |
3065 SCRIPTID_INIT}, | 3020 SCRIPTID_INIT}, |
3066 {"window", "wi", P_NUM|P_VI_DEF, | 3021 {"window", "wi", P_NUM|P_VI_DEF, |
3067 (char_u *)&p_window, PV_NONE, | 3022 (char_u *)&p_window, PV_NONE, |
3068 {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, | 3023 {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, |
3069 {"winheight", "wh", P_NUM|P_VI_DEF, | 3024 {"winheight", "wh", P_NUM|P_VI_DEF, |
3070 #ifdef FEAT_WINDOWS | |
3071 (char_u *)&p_wh, PV_NONE, | 3025 (char_u *)&p_wh, PV_NONE, |
3072 #else | |
3073 (char_u *)NULL, PV_NONE, | |
3074 #endif | |
3075 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, | 3026 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, |
3076 {"winfixheight", "wfh", P_BOOL|P_VI_DEF|P_RSTAT, | 3027 {"winfixheight", "wfh", P_BOOL|P_VI_DEF|P_RSTAT, |
3077 #ifdef FEAT_WINDOWS | |
3078 (char_u *)VAR_WIN, PV_WFH, | 3028 (char_u *)VAR_WIN, PV_WFH, |
3079 #else | |
3080 (char_u *)NULL, PV_NONE, | |
3081 #endif | |
3082 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, | 3029 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
3083 {"winfixwidth", "wfw", P_BOOL|P_VI_DEF|P_RSTAT, | 3030 {"winfixwidth", "wfw", P_BOOL|P_VI_DEF|P_RSTAT, |
3084 #ifdef FEAT_WINDOWS | |
3085 (char_u *)VAR_WIN, PV_WFW, | 3031 (char_u *)VAR_WIN, PV_WFW, |
3086 #else | |
3087 (char_u *)NULL, PV_NONE, | |
3088 #endif | |
3089 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, | 3032 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, |
3090 {"winminheight", "wmh", P_NUM|P_VI_DEF, | 3033 {"winminheight", "wmh", P_NUM|P_VI_DEF, |
3091 #ifdef FEAT_WINDOWS | |
3092 (char_u *)&p_wmh, PV_NONE, | 3034 (char_u *)&p_wmh, PV_NONE, |
3093 #else | |
3094 (char_u *)NULL, PV_NONE, | |
3095 #endif | |
3096 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, | 3035 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, |
3097 {"winminwidth", "wmw", P_NUM|P_VI_DEF, | 3036 {"winminwidth", "wmw", P_NUM|P_VI_DEF, |
3098 #ifdef FEAT_WINDOWS | |
3099 (char_u *)&p_wmw, PV_NONE, | 3037 (char_u *)&p_wmw, PV_NONE, |
3100 #else | |
3101 (char_u *)NULL, PV_NONE, | |
3102 #endif | |
3103 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, | 3038 {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, |
3104 {"winptydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, | 3039 {"winptydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, |
3105 #if defined(WIN3264) && defined(FEAT_TERMINAL) | 3040 #if defined(WIN3264) && defined(FEAT_TERMINAL) |
3106 (char_u *)&p_winptydll, PV_NONE, { | 3041 (char_u *)&p_winptydll, PV_NONE, { |
3107 # ifdef _WIN64 | 3042 # ifdef _WIN64 |
3114 (char_u *)NULL, PV_NONE, | 3049 (char_u *)NULL, PV_NONE, |
3115 {(char_u *)0L, (char_u *)0L} | 3050 {(char_u *)0L, (char_u *)0L} |
3116 #endif | 3051 #endif |
3117 SCRIPTID_INIT}, | 3052 SCRIPTID_INIT}, |
3118 {"winwidth", "wiw", P_NUM|P_VI_DEF, | 3053 {"winwidth", "wiw", P_NUM|P_VI_DEF, |
3119 #ifdef FEAT_WINDOWS | |
3120 (char_u *)&p_wiw, PV_NONE, | 3054 (char_u *)&p_wiw, PV_NONE, |
3121 #else | |
3122 (char_u *)NULL, PV_NONE, | |
3123 #endif | |
3124 {(char_u *)20L, (char_u *)0L} SCRIPTID_INIT}, | 3055 {(char_u *)20L, (char_u *)0L} SCRIPTID_INIT}, |
3125 {"wrap", NULL, P_BOOL|P_VI_DEF|P_RWIN, | 3056 {"wrap", NULL, P_BOOL|P_VI_DEF|P_RWIN, |
3126 (char_u *)VAR_WIN, PV_WRAP, | 3057 (char_u *)VAR_WIN, PV_WRAP, |
3127 {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, | 3058 {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, |
3128 {"wrapmargin", "wm", P_NUM|P_VI_DEF, | 3059 {"wrapmargin", "wm", P_NUM|P_VI_DEF, |
3169 p_term("t_Ce", T_UCE) | 3100 p_term("t_Ce", T_UCE) |
3170 p_term("t_Co", T_CCO) | 3101 p_term("t_Co", T_CCO) |
3171 p_term("t_CS", T_CCS) | 3102 p_term("t_CS", T_CCS) |
3172 p_term("t_Cs", T_UCS) | 3103 p_term("t_Cs", T_UCS) |
3173 p_term("t_cs", T_CS) | 3104 p_term("t_cs", T_CS) |
3174 #ifdef FEAT_WINDOWS | |
3175 p_term("t_CV", T_CSV) | 3105 p_term("t_CV", T_CSV) |
3176 #endif | |
3177 p_term("t_da", T_DA) | 3106 p_term("t_da", T_DA) |
3178 p_term("t_db", T_DB) | 3107 p_term("t_db", T_DB) |
3179 p_term("t_DL", T_CDL) | 3108 p_term("t_DL", T_CDL) |
3180 p_term("t_dl", T_DL) | 3109 p_term("t_dl", T_DL) |
3181 p_term("t_EC", T_CEC) | 3110 p_term("t_EC", T_CEC) |
3263 #endif | 3192 #endif |
3264 #ifdef FEAT_SCROLLBIND | 3193 #ifdef FEAT_SCROLLBIND |
3265 static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL}; | 3194 static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL}; |
3266 #endif | 3195 #endif |
3267 static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL}; | 3196 static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL}; |
3268 #ifdef FEAT_WINDOWS | |
3269 static char *(p_ead_values[]) = {"both", "ver", "hor", NULL}; | 3197 static char *(p_ead_values[]) = {"both", "ver", "hor", NULL}; |
3270 #endif | |
3271 #ifdef FEAT_AUTOCMD | 3198 #ifdef FEAT_AUTOCMD |
3272 static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", "acwrite", NULL}; | 3199 static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", "acwrite", NULL}; |
3273 #else | 3200 #else |
3274 static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", NULL}; | 3201 static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", NULL}; |
3275 #endif | 3202 #endif |
3853 static void | 3780 static void |
3854 set_options_default( | 3781 set_options_default( |
3855 int opt_flags) /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */ | 3782 int opt_flags) /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */ |
3856 { | 3783 { |
3857 int i; | 3784 int i; |
3858 #ifdef FEAT_WINDOWS | |
3859 win_T *wp; | 3785 win_T *wp; |
3860 tabpage_T *tp; | 3786 tabpage_T *tp; |
3861 #endif | |
3862 | 3787 |
3863 for (i = 0; !istermoption(&options[i]); i++) | 3788 for (i = 0; !istermoption(&options[i]); i++) |
3864 if (!(options[i].flags & P_NODEFAULT) | 3789 if (!(options[i].flags & P_NODEFAULT) |
3865 #if defined(FEAT_MBYTE) || defined(FEAT_CRYPT) | 3790 #if defined(FEAT_MBYTE) || defined(FEAT_CRYPT) |
3866 && (opt_flags == 0 | 3791 && (opt_flags == 0 |
3875 )) | 3800 )) |
3876 #endif | 3801 #endif |
3877 ) | 3802 ) |
3878 set_option_default(i, opt_flags, p_cp); | 3803 set_option_default(i, opt_flags, p_cp); |
3879 | 3804 |
3880 #ifdef FEAT_WINDOWS | |
3881 /* The 'scroll' option must be computed for all windows. */ | 3805 /* The 'scroll' option must be computed for all windows. */ |
3882 FOR_ALL_TAB_WINDOWS(tp, wp) | 3806 FOR_ALL_TAB_WINDOWS(tp, wp) |
3883 win_comp_scroll(wp); | 3807 win_comp_scroll(wp); |
3884 #else | |
3885 win_comp_scroll(curwin); | |
3886 #endif | |
3887 #ifdef FEAT_CINDENT | 3808 #ifdef FEAT_CINDENT |
3888 parse_cino(curbuf); | 3809 parse_cino(curbuf); |
3889 #endif | 3810 #endif |
3890 } | 3811 } |
3891 | 3812 |
5631 | 5552 |
5632 /* Parse default for 'wildmode' */ | 5553 /* Parse default for 'wildmode' */ |
5633 check_opt_wim(); | 5554 check_opt_wim(); |
5634 | 5555 |
5635 (void)set_chars_option(&p_lcs); | 5556 (void)set_chars_option(&p_lcs); |
5636 #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING) | |
5637 /* Parse default for 'fillchars'. */ | 5557 /* Parse default for 'fillchars'. */ |
5638 (void)set_chars_option(&p_fcs); | 5558 (void)set_chars_option(&p_fcs); |
5639 #endif | |
5640 | 5559 |
5641 #ifdef FEAT_CLIPBOARD | 5560 #ifdef FEAT_CLIPBOARD |
5642 /* Parse default for 'clipboard' */ | 5561 /* Parse default for 'clipboard' */ |
5643 (void)check_clipboard_option(); | 5562 (void)check_clipboard_option(); |
5644 #endif | 5563 #endif |
5873 * Redraw the window title and/or tab page text later. | 5792 * Redraw the window title and/or tab page text later. |
5874 */ | 5793 */ |
5875 static void redraw_titles(void) | 5794 static void redraw_titles(void) |
5876 { | 5795 { |
5877 need_maketitle = TRUE; | 5796 need_maketitle = TRUE; |
5878 # ifdef FEAT_WINDOWS | |
5879 redraw_tabline = TRUE; | 5797 redraw_tabline = TRUE; |
5880 # endif | |
5881 } | 5798 } |
5882 #endif | 5799 #endif |
5883 | 5800 |
5884 /* | 5801 /* |
5885 * Set a string option to a new value (without checking the effect). | 5802 * Set a string option to a new value (without checking the effect). |
6278 { | 6195 { |
6279 if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK) | 6196 if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK) |
6280 errmsg = e_invarg; | 6197 errmsg = e_invarg; |
6281 else if (set_chars_option(&p_lcs) != NULL) | 6198 else if (set_chars_option(&p_lcs) != NULL) |
6282 errmsg = (char_u *)_("E834: Conflicts with value of 'listchars'"); | 6199 errmsg = (char_u *)_("E834: Conflicts with value of 'listchars'"); |
6283 # if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING) | |
6284 else if (set_chars_option(&p_fcs) != NULL) | 6200 else if (set_chars_option(&p_fcs) != NULL) |
6285 errmsg = (char_u *)_("E835: Conflicts with value of 'fillchars'"); | 6201 errmsg = (char_u *)_("E835: Conflicts with value of 'fillchars'"); |
6286 # endif | |
6287 } | 6202 } |
6288 #endif | 6203 #endif |
6289 | 6204 |
6290 /* 'background' */ | 6205 /* 'background' */ |
6291 else if (varp == &p_bg) | 6206 else if (varp == &p_bg) |
6501 if ((opt_flags & OPT_LOCAL) == 0) | 6416 if ((opt_flags & OPT_LOCAL) == 0) |
6502 { | 6417 { |
6503 set_iminsert_global(); | 6418 set_iminsert_global(); |
6504 set_imsearch_global(); | 6419 set_imsearch_global(); |
6505 } | 6420 } |
6506 # ifdef FEAT_WINDOWS | |
6507 status_redraw_curbuf(); | 6421 status_redraw_curbuf(); |
6508 # endif | |
6509 } | 6422 } |
6510 } | 6423 } |
6511 #endif | 6424 #endif |
6512 | 6425 |
6513 /* 'fileformat' */ | 6426 /* 'fileformat' */ |
6706 else if (varp == &p_lcs) | 6619 else if (varp == &p_lcs) |
6707 { | 6620 { |
6708 errmsg = set_chars_option(varp); | 6621 errmsg = set_chars_option(varp); |
6709 } | 6622 } |
6710 | 6623 |
6711 #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING) | |
6712 /* 'fillchars' */ | 6624 /* 'fillchars' */ |
6713 else if (varp == &p_fcs) | 6625 else if (varp == &p_fcs) |
6714 { | 6626 { |
6715 errmsg = set_chars_option(varp); | 6627 errmsg = set_chars_option(varp); |
6716 } | 6628 } |
6717 #endif | |
6718 | 6629 |
6719 #ifdef FEAT_CMDWIN | 6630 #ifdef FEAT_CMDWIN |
6720 /* 'cedit' */ | 6631 /* 'cedit' */ |
6721 else if (varp == &p_cedit) | 6632 else if (varp == &p_cedit) |
6722 { | 6633 { |
7086 else | 6997 else |
7087 (void)init_chartab(); | 6998 (void)init_chartab(); |
7088 | 6999 |
7089 } | 7000 } |
7090 | 7001 |
7091 #ifdef FEAT_WINDOWS | |
7092 /* 'eadirection' */ | 7002 /* 'eadirection' */ |
7093 else if (varp == &p_ead) | 7003 else if (varp == &p_ead) |
7094 { | 7004 { |
7095 if (check_opt_strings(p_ead, p_ead_values, FALSE) != OK) | 7005 if (check_opt_strings(p_ead, p_ead_values, FALSE) != OK) |
7096 errmsg = e_invarg; | 7006 errmsg = e_invarg; |
7097 } | 7007 } |
7098 #endif | |
7099 | 7008 |
7100 #ifdef FEAT_CLIPBOARD | 7009 #ifdef FEAT_CLIPBOARD |
7101 /* 'clipboard' */ | 7010 /* 'clipboard' */ |
7102 else if (varp == &p_cb) | 7011 else if (varp == &p_cb) |
7103 errmsg = check_clipboard_option(); | 7012 errmsg = check_clipboard_option(); |
7142 { | 7051 { |
7143 if (check_opt_strings(curbuf->b_p_bt, p_buftype_values, FALSE) != OK) | 7052 if (check_opt_strings(curbuf->b_p_bt, p_buftype_values, FALSE) != OK) |
7144 errmsg = e_invarg; | 7053 errmsg = e_invarg; |
7145 else | 7054 else |
7146 { | 7055 { |
7147 #ifdef FEAT_WINDOWS | |
7148 if (curwin->w_status_height) | 7056 if (curwin->w_status_height) |
7149 { | 7057 { |
7150 curwin->w_redr_status = TRUE; | 7058 curwin->w_redr_status = TRUE; |
7151 redraw_later(VALID); | 7059 redraw_later(VALID); |
7152 } | 7060 } |
7153 #endif | |
7154 curbuf->b_help = (curbuf->b_p_bt[0] == 'h'); | 7061 curbuf->b_help = (curbuf->b_p_bt[0] == 'h'); |
7155 #ifdef FEAT_TITLE | 7062 #ifdef FEAT_TITLE |
7156 redraw_titles(); | 7063 redraw_titles(); |
7157 #endif | 7064 #endif |
7158 } | 7065 } |
7771 struct charstab | 7678 struct charstab |
7772 { | 7679 { |
7773 int *cp; | 7680 int *cp; |
7774 char *name; | 7681 char *name; |
7775 }; | 7682 }; |
7776 #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING) | |
7777 static struct charstab filltab[] = | 7683 static struct charstab filltab[] = |
7778 { | 7684 { |
7779 {&fill_stl, "stl"}, | 7685 {&fill_stl, "stl"}, |
7780 {&fill_stlnc, "stlnc"}, | 7686 {&fill_stlnc, "stlnc"}, |
7781 {&fill_vert, "vert"}, | 7687 {&fill_vert, "vert"}, |
7782 {&fill_fold, "fold"}, | 7688 {&fill_fold, "fold"}, |
7783 {&fill_diff, "diff"}, | 7689 {&fill_diff, "diff"}, |
7784 }; | 7690 }; |
7785 #endif | |
7786 static struct charstab lcstab[] = | 7691 static struct charstab lcstab[] = |
7787 { | 7692 { |
7788 {&lcs_eol, "eol"}, | 7693 {&lcs_eol, "eol"}, |
7789 {&lcs_ext, "extends"}, | 7694 {&lcs_ext, "extends"}, |
7790 {&lcs_nbsp, "nbsp"}, | 7695 {&lcs_nbsp, "nbsp"}, |
7798 {NULL, "conceal"}, | 7703 {NULL, "conceal"}, |
7799 #endif | 7704 #endif |
7800 }; | 7705 }; |
7801 struct charstab *tab; | 7706 struct charstab *tab; |
7802 | 7707 |
7803 #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING) | |
7804 if (varp == &p_lcs) | 7708 if (varp == &p_lcs) |
7805 #endif | |
7806 { | 7709 { |
7807 tab = lcstab; | 7710 tab = lcstab; |
7808 entries = sizeof(lcstab) / sizeof(struct charstab); | 7711 entries = sizeof(lcstab) / sizeof(struct charstab); |
7809 } | 7712 } |
7810 #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING) | |
7811 else | 7713 else |
7812 { | 7714 { |
7813 tab = filltab; | 7715 tab = filltab; |
7814 entries = sizeof(filltab) / sizeof(struct charstab); | 7716 entries = sizeof(filltab) / sizeof(struct charstab); |
7815 } | 7717 } |
7816 #endif | |
7817 | 7718 |
7818 /* first round: check for valid value, second round: assign values */ | 7719 /* first round: check for valid value, second round: assign values */ |
7819 for (round = 0; round <= 1; ++round) | 7720 for (round = 0; round <= 1; ++round) |
7820 { | 7721 { |
7821 if (round > 0) | 7722 if (round > 0) |
7825 for (i = 0; i < entries; ++i) | 7726 for (i = 0; i < entries; ++i) |
7826 if (tab[i].cp != NULL) | 7727 if (tab[i].cp != NULL) |
7827 *(tab[i].cp) = (varp == &p_lcs ? NUL : ' '); | 7728 *(tab[i].cp) = (varp == &p_lcs ? NUL : ' '); |
7828 if (varp == &p_lcs) | 7729 if (varp == &p_lcs) |
7829 lcs_tab1 = NUL; | 7730 lcs_tab1 = NUL; |
7830 #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING) | |
7831 else | 7731 else |
7832 fill_diff = '-'; | 7732 fill_diff = '-'; |
7833 #endif | |
7834 } | 7733 } |
7835 p = *varp; | 7734 p = *varp; |
7836 while (*p) | 7735 while (*p) |
7837 { | 7736 { |
7838 for (i = 0; i < entries; ++i) | 7737 for (i = 0; i < entries; ++i) |
8075 { | 7974 { |
8076 FOR_ALL_WINDOWS(wp) | 7975 FOR_ALL_WINDOWS(wp) |
8077 if (wp->w_buffer == curbuf && wp->w_p_spell) | 7976 if (wp->w_buffer == curbuf && wp->w_p_spell) |
8078 { | 7977 { |
8079 errmsg = did_set_spelllang(wp); | 7978 errmsg = did_set_spelllang(wp); |
8080 # ifdef FEAT_WINDOWS | |
8081 break; | 7979 break; |
8082 # endif | |
8083 } | 7980 } |
8084 } | 7981 } |
8085 return errmsg; | 7982 return errmsg; |
8086 } | 7983 } |
8087 | 7984 |
8386 curwin->w_scbind_pos = curwin->w_topline; | 8283 curwin->w_scbind_pos = curwin->w_topline; |
8387 } | 8284 } |
8388 } | 8285 } |
8389 #endif | 8286 #endif |
8390 | 8287 |
8391 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | 8288 #if defined(FEAT_QUICKFIX) |
8392 /* There can be only one window with 'previewwindow' set. */ | 8289 /* There can be only one window with 'previewwindow' set. */ |
8393 else if ((int *)varp == &curwin->w_p_pvw) | 8290 else if ((int *)varp == &curwin->w_p_pvw) |
8394 { | 8291 { |
8395 if (curwin->w_p_pvw) | 8292 if (curwin->w_p_pvw) |
8396 { | 8293 { |
8484 { | 8381 { |
8485 if (curwin->w_p_wrap) | 8382 if (curwin->w_p_wrap) |
8486 curwin->w_leftcol = 0; | 8383 curwin->w_leftcol = 0; |
8487 } | 8384 } |
8488 | 8385 |
8489 #ifdef FEAT_WINDOWS | |
8490 else if ((int *)varp == &p_ea) | 8386 else if ((int *)varp == &p_ea) |
8491 { | 8387 { |
8492 if (p_ea && !old_value) | 8388 if (p_ea && !old_value) |
8493 win_equal(curwin, FALSE, 0); | 8389 win_equal(curwin, FALSE, 0); |
8494 } | 8390 } |
8495 #endif | |
8496 | 8391 |
8497 else if ((int *)varp == &p_wiv) | 8392 else if ((int *)varp == &p_wiv) |
8498 { | 8393 { |
8499 /* | 8394 /* |
8500 * When 'weirdinvert' changed, set/reset 't_xs'. | 8395 * When 'weirdinvert' changed, set/reset 't_xs'. |
8801 } | 8696 } |
8802 | 8697 |
8803 /* | 8698 /* |
8804 * Number options that need some action when changed | 8699 * Number options that need some action when changed |
8805 */ | 8700 */ |
8806 #ifdef FEAT_WINDOWS | |
8807 if (pp == &p_wh || pp == &p_hh) | 8701 if (pp == &p_wh || pp == &p_hh) |
8808 { | 8702 { |
8809 if (p_wh < 1) | 8703 if (p_wh < 1) |
8810 { | 8704 { |
8811 errmsg = e_positive; | 8705 errmsg = e_positive; |
8845 errmsg = e_winheight; | 8739 errmsg = e_winheight; |
8846 p_wmh = p_wh; | 8740 p_wmh = p_wh; |
8847 } | 8741 } |
8848 win_setminheight(); | 8742 win_setminheight(); |
8849 } | 8743 } |
8850 | |
8851 # ifdef FEAT_WINDOWS | |
8852 else if (pp == &p_wiw) | 8744 else if (pp == &p_wiw) |
8853 { | 8745 { |
8854 if (p_wiw < 1) | 8746 if (p_wiw < 1) |
8855 { | 8747 { |
8856 errmsg = e_positive; | 8748 errmsg = e_positive; |
8880 errmsg = e_winwidth; | 8772 errmsg = e_winwidth; |
8881 p_wmw = p_wiw; | 8773 p_wmw = p_wiw; |
8882 } | 8774 } |
8883 win_setminheight(); | 8775 win_setminheight(); |
8884 } | 8776 } |
8885 # endif | 8777 |
8886 | |
8887 #endif | |
8888 | |
8889 #ifdef FEAT_WINDOWS | |
8890 /* (re)set last window status line */ | 8778 /* (re)set last window status line */ |
8891 else if (pp == &p_ls) | 8779 else if (pp == &p_ls) |
8892 { | 8780 { |
8893 last_status(FALSE); | 8781 last_status(FALSE); |
8894 } | 8782 } |
8896 /* (re)set tab page line */ | 8784 /* (re)set tab page line */ |
8897 else if (pp == &p_stal) | 8785 else if (pp == &p_stal) |
8898 { | 8786 { |
8899 shell_new_rows(); /* recompute window positions and heights */ | 8787 shell_new_rows(); /* recompute window positions and heights */ |
8900 } | 8788 } |
8901 #endif | |
8902 | 8789 |
8903 #ifdef FEAT_GUI | 8790 #ifdef FEAT_GUI |
8904 else if (pp == &p_linespace) | 8791 else if (pp == &p_linespace) |
8905 { | 8792 { |
8906 /* Recompute gui.char_height and resize the Vim window to keep the | 8793 /* Recompute gui.char_height and resize the Vim window to keep the |
8985 curbuf->b_p_iminsert = B_IMODE_NONE; | 8872 curbuf->b_p_iminsert = B_IMODE_NONE; |
8986 } | 8873 } |
8987 p_iminsert = curbuf->b_p_iminsert; | 8874 p_iminsert = curbuf->b_p_iminsert; |
8988 if (termcap_active) /* don't do this in the alternate screen */ | 8875 if (termcap_active) /* don't do this in the alternate screen */ |
8989 showmode(); | 8876 showmode(); |
8990 #if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP) | 8877 #if defined(FEAT_KEYMAP) |
8991 /* Show/unshow value of 'keymap' in status lines. */ | 8878 /* Show/unshow value of 'keymap' in status lines. */ |
8992 status_redraw_curbuf(); | 8879 status_redraw_curbuf(); |
8993 #endif | 8880 #endif |
8994 } | 8881 } |
8995 | 8882 |
9135 { | 9022 { |
9136 errmsg = e_positive; | 9023 errmsg = e_positive; |
9137 curbuf->b_p_tw = 0; | 9024 curbuf->b_p_tw = 0; |
9138 } | 9025 } |
9139 #ifdef FEAT_SYN_HL | 9026 #ifdef FEAT_SYN_HL |
9140 # ifdef FEAT_WINDOWS | |
9141 { | 9027 { |
9142 win_T *wp; | 9028 win_T *wp; |
9143 tabpage_T *tp; | 9029 tabpage_T *tp; |
9144 | 9030 |
9145 FOR_ALL_TAB_WINDOWS(tp, wp) | 9031 FOR_ALL_TAB_WINDOWS(tp, wp) |
9146 check_colorcolumn(wp); | 9032 check_colorcolumn(wp); |
9147 } | 9033 } |
9148 # else | |
9149 check_colorcolumn(curwin); | |
9150 # endif | |
9151 #endif | 9034 #endif |
9152 } | 9035 } |
9153 | 9036 |
9154 /* | 9037 /* |
9155 * Check the bounds for numeric options here | 9038 * Check the bounds for numeric options here |
9327 { | 9210 { |
9328 /* Careful: P_RCLR and P_RALL are a combination of other P_ flags */ | 9211 /* Careful: P_RCLR and P_RALL are a combination of other P_ flags */ |
9329 int doclear = (flags & P_RCLR) == P_RCLR; | 9212 int doclear = (flags & P_RCLR) == P_RCLR; |
9330 int all = ((flags & P_RALL) == P_RALL || doclear); | 9213 int all = ((flags & P_RALL) == P_RALL || doclear); |
9331 | 9214 |
9332 #ifdef FEAT_WINDOWS | |
9333 if ((flags & P_RSTAT) || all) /* mark all status lines dirty */ | 9215 if ((flags & P_RSTAT) || all) /* mark all status lines dirty */ |
9334 status_redraw_all(); | 9216 status_redraw_all(); |
9335 #endif | |
9336 | 9217 |
9337 if ((flags & P_RBUF) || (flags & P_RWIN) || all) | 9218 if ((flags & P_RBUF) || (flags & P_RWIN) || all) |
9338 changed_window_setting(); | 9219 changed_window_setting(); |
9339 if (flags & P_RBUF) | 9220 if (flags & P_RBUF) |
9340 redraw_curbuf_later(NOT_VALID); | 9221 redraw_curbuf_later(NOT_VALID); |
10418 #define COL_RULER 17 /* columns needed by standard ruler */ | 10299 #define COL_RULER 17 /* columns needed by standard ruler */ |
10419 | 10300 |
10420 void | 10301 void |
10421 comp_col(void) | 10302 comp_col(void) |
10422 { | 10303 { |
10423 #if defined(FEAT_CMDL_INFO) && defined(FEAT_WINDOWS) | 10304 #if defined(FEAT_CMDL_INFO) |
10424 int last_has_status = (p_ls == 2 || (p_ls == 1 && !ONE_WINDOW)); | 10305 int last_has_status = (p_ls == 2 || (p_ls == 1 && !ONE_WINDOW)); |
10425 | 10306 |
10426 sc_col = 0; | 10307 sc_col = 0; |
10427 ru_col = 0; | 10308 ru_col = 0; |
10428 if (p_ru) | 10309 if (p_ru) |
10429 { | 10310 { |
10430 #ifdef FEAT_STL_OPT | 10311 # ifdef FEAT_STL_OPT |
10431 ru_col = (ru_wid ? ru_wid : COL_RULER) + 1; | 10312 ru_col = (ru_wid ? ru_wid : COL_RULER) + 1; |
10432 #else | 10313 # else |
10433 ru_col = COL_RULER + 1; | 10314 ru_col = COL_RULER + 1; |
10434 #endif | 10315 # endif |
10435 /* no last status line, adjust sc_col */ | 10316 /* no last status line, adjust sc_col */ |
10436 if (!last_has_status) | 10317 if (!last_has_status) |
10437 sc_col = ru_col; | 10318 sc_col = ru_col; |
10438 } | 10319 } |
10439 if (p_sc) | 10320 if (p_sc) |
10721 case PV_NU: return (char_u *)&(curwin->w_p_nu); | 10602 case PV_NU: return (char_u *)&(curwin->w_p_nu); |
10722 case PV_RNU: return (char_u *)&(curwin->w_p_rnu); | 10603 case PV_RNU: return (char_u *)&(curwin->w_p_rnu); |
10723 #ifdef FEAT_LINEBREAK | 10604 #ifdef FEAT_LINEBREAK |
10724 case PV_NUW: return (char_u *)&(curwin->w_p_nuw); | 10605 case PV_NUW: return (char_u *)&(curwin->w_p_nuw); |
10725 #endif | 10606 #endif |
10726 #ifdef FEAT_WINDOWS | |
10727 case PV_WFH: return (char_u *)&(curwin->w_p_wfh); | 10607 case PV_WFH: return (char_u *)&(curwin->w_p_wfh); |
10728 case PV_WFW: return (char_u *)&(curwin->w_p_wfw); | 10608 case PV_WFW: return (char_u *)&(curwin->w_p_wfw); |
10729 #endif | 10609 #if defined(FEAT_QUICKFIX) |
10730 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) | |
10731 case PV_PVW: return (char_u *)&(curwin->w_p_pvw); | 10610 case PV_PVW: return (char_u *)&(curwin->w_p_pvw); |
10732 #endif | 10611 #endif |
10733 #ifdef FEAT_RIGHTLEFT | 10612 #ifdef FEAT_RIGHTLEFT |
10734 case PV_RL: return (char_u *)&(curwin->w_p_rl); | 10613 case PV_RL: return (char_u *)&(curwin->w_p_rl); |
10735 case PV_RLC: return (char_u *)&(curwin->w_p_rlc); | 10614 case PV_RLC: return (char_u *)&(curwin->w_p_rlc); |
10877 if (*curbuf->b_p_ep == NUL) | 10756 if (*curbuf->b_p_ep == NUL) |
10878 return p_ep; | 10757 return p_ep; |
10879 return curbuf->b_p_ep; | 10758 return curbuf->b_p_ep; |
10880 } | 10759 } |
10881 | 10760 |
10882 #if defined(FEAT_WINDOWS) || defined(PROTO) | |
10883 /* | 10761 /* |
10884 * Copy options from one window to another. | 10762 * Copy options from one window to another. |
10885 * Used when splitting a window. | 10763 * Used when splitting a window. |
10886 */ | 10764 */ |
10887 void | 10765 void |
10897 # endif | 10775 # endif |
10898 #if defined(FEAT_LINEBREAK) | 10776 #if defined(FEAT_LINEBREAK) |
10899 briopt_check(wp_to); | 10777 briopt_check(wp_to); |
10900 #endif | 10778 #endif |
10901 } | 10779 } |
10902 #endif | |
10903 | 10780 |
10904 /* | 10781 /* |
10905 * Copy the options from one winopt_T to another. | 10782 * Copy the options from one winopt_T to another. |
10906 * Doesn't free the old option values in "to", use clear_winopt() for that. | 10783 * Doesn't free the old option values in "to", use clear_winopt() for that. |
10907 * The 'scroll' option is not copied, because it depends on the window height. | 10784 * The 'scroll' option is not copied, because it depends on the window height. |
12174 | 12051 |
12175 /* set global options */ | 12052 /* set global options */ |
12176 p_sm = 0; /* no showmatch */ | 12053 p_sm = 0; /* no showmatch */ |
12177 p_sta = 0; /* no smarttab */ | 12054 p_sta = 0; /* no smarttab */ |
12178 #ifdef FEAT_CMDL_INFO | 12055 #ifdef FEAT_CMDL_INFO |
12179 # ifdef FEAT_WINDOWS | |
12180 if (p_ru) | 12056 if (p_ru) |
12181 status_redraw_all(); /* redraw to remove the ruler */ | 12057 status_redraw_all(); /* redraw to remove the ruler */ |
12182 # endif | |
12183 p_ru = 0; /* no ruler */ | 12058 p_ru = 0; /* no ruler */ |
12184 #endif | 12059 #endif |
12185 #ifdef FEAT_RIGHTLEFT | 12060 #ifdef FEAT_RIGHTLEFT |
12186 p_ri = 0; /* no reverse insert */ | 12061 p_ri = 0; /* no reverse insert */ |
12187 p_hkmap = 0; /* no Hebrew keyboard */ | 12062 p_hkmap = 0; /* no Hebrew keyboard */ |
12210 | 12085 |
12211 /* restore global options */ | 12086 /* restore global options */ |
12212 p_sm = save_sm; | 12087 p_sm = save_sm; |
12213 p_sta = save_sta; | 12088 p_sta = save_sta; |
12214 #ifdef FEAT_CMDL_INFO | 12089 #ifdef FEAT_CMDL_INFO |
12215 # ifdef FEAT_WINDOWS | |
12216 if (p_ru != save_ru) | 12090 if (p_ru != save_ru) |
12217 status_redraw_all(); /* redraw to draw the ruler */ | 12091 status_redraw_all(); /* redraw to draw the ruler */ |
12218 # endif | |
12219 p_ru = save_ru; | 12092 p_ru = save_ru; |
12220 #endif | 12093 #endif |
12221 #ifdef FEAT_RIGHTLEFT | 12094 #ifdef FEAT_RIGHTLEFT |
12222 p_ri = save_ri; | 12095 p_ri = save_ri; |
12223 p_hkmap = save_hkmap; | 12096 p_hkmap = save_hkmap; |