comparison src/option.c @ 2378:85b7dc8da5eb vim73

Add the 'concealcursor' option to decide when the cursor line is to be concealed or not. Rename 'conc' to 'cole' as the short name for 'conceallevel'.
author Bram Moolenaar <bram@vim.org>
date Fri, 23 Jul 2010 22:10:27 +0200
parents 6cee3bf00495
children b67b0b5a93d3
comparison
equal deleted inserted replaced
2377:878562053ba3 2378:85b7dc8da5eb
246 #define PV_WRAP OPT_WIN(WV_WRAP) 246 #define PV_WRAP OPT_WIN(WV_WRAP)
247 #ifdef FEAT_CURSORBIND 247 #ifdef FEAT_CURSORBIND
248 # define PV_CRBIND OPT_WIN(WV_CRBIND) 248 # define PV_CRBIND OPT_WIN(WV_CRBIND)
249 #endif 249 #endif
250 #ifdef FEAT_CONCEAL 250 #ifdef FEAT_CONCEAL
251 # define PV_CONCEAL OPT_WIN(WV_CONCEAL) 251 # define PV_COCU OPT_WIN(WV_COCU)
252 # define PV_COLE OPT_WIN(WV_COLE)
252 #endif 253 #endif
253 254
254 /* WV_ and BV_ values get typecasted to this for the "indir" field */ 255 /* WV_ and BV_ values get typecasted to this for the "indir" field */
255 typedef enum 256 typedef enum
256 { 257 {
814 #else 815 #else
815 (char_u *)NULL, PV_NONE, 816 (char_u *)NULL, PV_NONE,
816 {(char_u *)0L, (char_u *)0L} 817 {(char_u *)0L, (char_u *)0L}
817 #endif 818 #endif
818 SCRIPTID_INIT}, 819 SCRIPTID_INIT},
819 {"conceallevel","conc", P_NUM|P_RWIN|P_VI_DEF, 820 {"concealcursor","cocu", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
820 #ifdef FEAT_CONCEAL 821 #ifdef FEAT_CONCEAL
821 (char_u *)VAR_WIN, PV_CONCEAL, 822 (char_u *)VAR_WIN, PV_COCU,
823 {(char_u *)"", (char_u *)NULL}
824 #else
825 (char_u *)NULL, PV_NONE,
826 {(char_u *)NULL, (char_u *)0L}
827 #endif
828 SCRIPTID_INIT},
829 {"conceallevel","cole", P_NUM|P_RWIN|P_VI_DEF,
830 #ifdef FEAT_CONCEAL
831 (char_u *)VAR_WIN, PV_COLE,
822 #else 832 #else
823 (char_u *)NULL, PV_NONE, 833 (char_u *)NULL, PV_NONE,
824 #endif 834 #endif
825 {(char_u *)0L, (char_u *)0L} 835 {(char_u *)0L, (char_u *)0L}
826 SCRIPTID_INIT}, 836 SCRIPTID_INIT},
6846 p = (char_u *)SHM_ALL; 6856 p = (char_u *)SHM_ALL;
6847 else if (varp == &(p_cpo)) 6857 else if (varp == &(p_cpo))
6848 p = (char_u *)CPO_ALL; 6858 p = (char_u *)CPO_ALL;
6849 else if (varp == &(curbuf->b_p_fo)) 6859 else if (varp == &(curbuf->b_p_fo))
6850 p = (char_u *)FO_ALL; 6860 p = (char_u *)FO_ALL;
6861 #ifdef FEAT_CONCEAL
6862 else if (varp == &curwin->w_p_cocu)
6863 p = (char_u *)COCU_ALL;
6864 #endif
6851 else if (varp == &p_mouse) 6865 else if (varp == &p_mouse)
6852 { 6866 {
6853 #ifdef FEAT_MOUSE 6867 #ifdef FEAT_MOUSE
6854 p = (char_u *)MOUSE_ALL; 6868 p = (char_u *)MOUSE_ALL;
6855 #else 6869 #else
7503 { 7517 {
7504 # ifdef FEAT_TITLE 7518 # ifdef FEAT_TITLE
7505 redraw_titles(); 7519 redraw_titles();
7506 # endif 7520 # endif
7507 # ifdef FEAT_CONCEAL 7521 # ifdef FEAT_CONCEAL
7508 if (curwin->w_p_conc > 0) 7522 if (curwin->w_p_cole > 0)
7509 update_single_line(curwin, curwin->w_cursor.lnum); 7523 update_single_line(curwin, curwin->w_cursor.lnum);
7510 # endif 7524 # endif
7511 } 7525 }
7512 #endif 7526 #endif
7513 #ifdef FEAT_TITLE 7527 #ifdef FEAT_TITLE
8271 } 8285 }
8272 if (p_uc && !old_value) 8286 if (p_uc && !old_value)
8273 ml_open_files(); 8287 ml_open_files();
8274 } 8288 }
8275 #ifdef FEAT_CONCEAL 8289 #ifdef FEAT_CONCEAL
8276 else if (pp == &curwin->w_p_conc) 8290 else if (pp == &curwin->w_p_cole)
8277 { 8291 {
8278 if (curwin->w_p_conc < 0) 8292 if (curwin->w_p_cole < 0)
8279 { 8293 {
8280 errmsg = e_positive; 8294 errmsg = e_positive;
8281 curwin->w_p_conc = 0; 8295 curwin->w_p_cole = 0;
8282 } 8296 }
8283 else if (curwin->w_p_conc > 3) 8297 else if (curwin->w_p_cole > 3)
8284 { 8298 {
8285 errmsg = e_invarg; 8299 errmsg = e_invarg;
8286 curwin->w_p_conc = 3; 8300 curwin->w_p_cole = 3;
8287 } 8301 }
8288 } 8302 }
8289 #endif 8303 #endif
8290 #ifdef MZSCHEME_GUI_THREADS 8304 #ifdef MZSCHEME_GUI_THREADS
8291 else if (pp == &p_mzq) 8305 else if (pp == &p_mzq)
9552 #endif 9566 #endif
9553 #ifdef FEAT_CURSORBIND 9567 #ifdef FEAT_CURSORBIND
9554 case PV_CRBIND: return (char_u *)&(curwin->w_p_crb); 9568 case PV_CRBIND: return (char_u *)&(curwin->w_p_crb);
9555 #endif 9569 #endif
9556 #ifdef FEAT_CONCEAL 9570 #ifdef FEAT_CONCEAL
9557 case PV_CONCEAL: return (char_u *)&(curwin->w_p_conc); 9571 case PV_COCU: return (char_u *)&(curwin->w_p_cocu);
9572 case PV_COLE: return (char_u *)&(curwin->w_p_cole);
9558 #endif 9573 #endif
9559 9574
9560 case PV_AI: return (char_u *)&(curbuf->b_p_ai); 9575 case PV_AI: return (char_u *)&(curbuf->b_p_ai);
9561 case PV_BIN: return (char_u *)&(curbuf->b_p_bin); 9576 case PV_BIN: return (char_u *)&(curbuf->b_p_bin);
9562 #ifdef FEAT_MBYTE 9577 #ifdef FEAT_MBYTE
9747 to->wo_cc = vim_strsave(from->wo_cc); 9762 to->wo_cc = vim_strsave(from->wo_cc);
9748 #endif 9763 #endif
9749 #ifdef FEAT_DIFF 9764 #ifdef FEAT_DIFF
9750 to->wo_diff = from->wo_diff; 9765 to->wo_diff = from->wo_diff;
9751 #endif 9766 #endif
9767 #ifdef FEAT_CONCEAL
9768 to->wo_cocu = vim_strsave(from->wo_cocu);
9769 #endif
9752 #ifdef FEAT_FOLDING 9770 #ifdef FEAT_FOLDING
9753 to->wo_fdc = from->wo_fdc; 9771 to->wo_fdc = from->wo_fdc;
9754 to->wo_fen = from->wo_fen; 9772 to->wo_fen = from->wo_fen;
9755 to->wo_fdi = vim_strsave(from->wo_fdi); 9773 to->wo_fdi = vim_strsave(from->wo_fdi);
9756 to->wo_fml = from->wo_fml; 9774 to->wo_fml = from->wo_fml;
9800 check_string_option(&wop->wo_stl); 9818 check_string_option(&wop->wo_stl);
9801 #endif 9819 #endif
9802 #ifdef FEAT_SYN_HL 9820 #ifdef FEAT_SYN_HL
9803 check_string_option(&wop->wo_cc); 9821 check_string_option(&wop->wo_cc);
9804 #endif 9822 #endif
9823 #ifdef FEAT_CONCEAL
9824 check_string_option(&wop->wo_cocu);
9825 #endif
9805 } 9826 }
9806 9827
9807 /* 9828 /*
9808 * Free the allocated memory inside a winopt_T. 9829 * Free the allocated memory inside a winopt_T.
9809 */ 9830 */
9826 #ifdef FEAT_STL_OPT 9847 #ifdef FEAT_STL_OPT
9827 clear_string_option(&wop->wo_stl); 9848 clear_string_option(&wop->wo_stl);
9828 #endif 9849 #endif
9829 #ifdef FEAT_SYN_HL 9850 #ifdef FEAT_SYN_HL
9830 clear_string_option(&wop->wo_cc); 9851 clear_string_option(&wop->wo_cc);
9852 #endif
9853 #ifdef FEAT_CONCEAL
9854 clear_string_option(&wop->wo_cocu);
9831 #endif 9855 #endif
9832 } 9856 }
9833 9857
9834 /* 9858 /*
9835 * Copy global option values to local options for one buffer. 9859 * Copy global option values to local options for one buffer.