Mercurial > vim
comparison src/option.c @ 13742:a34b1323286c v8.0.1743
patch 8.0.1743: terminal window options are named inconsistently
commit https://github.com/vim/vim/commit/6d150f783d5d3820fe69734dda1e79b8276a84d2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 21 20:03:20 2018 +0200
patch 8.0.1743: terminal window options are named inconsistently
Problem: Terminal window options are named inconsistently.
Solution: prefix terminal window options with "termwin". Keep the old names
for now as an alias.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 21 Apr 2018 20:15:07 +0200 |
parents | b28d679b1843 |
children | d43718b4e232 |
comparison
equal
deleted
inserted
replaced
13741:ef2ae120f25c | 13742:a34b1323286c |
---|---|
248 #ifdef FEAT_CONCEAL | 248 #ifdef FEAT_CONCEAL |
249 # define PV_COCU OPT_WIN(WV_COCU) | 249 # define PV_COCU OPT_WIN(WV_COCU) |
250 # define PV_COLE OPT_WIN(WV_COLE) | 250 # define PV_COLE OPT_WIN(WV_COLE) |
251 #endif | 251 #endif |
252 #ifdef FEAT_TERMINAL | 252 #ifdef FEAT_TERMINAL |
253 # define PV_TK OPT_WIN(WV_TK) | 253 # define PV_TWK OPT_WIN(WV_TWK) |
254 # define PV_TMS OPT_WIN(WV_TMS) | 254 # define PV_TWS OPT_WIN(WV_TWS) |
255 # define PV_TWSL OPT_BUF(BV_TWSL) | |
255 #endif | 256 #endif |
256 #ifdef FEAT_SIGNS | 257 #ifdef FEAT_SIGNS |
257 # define PV_SCL OPT_WIN(WV_SCL) | 258 # define PV_SCL OPT_WIN(WV_SCL) |
258 #endif | 259 #endif |
259 | 260 |
370 static int p_udf; | 371 static int p_udf; |
371 #endif | 372 #endif |
372 static long p_wm; | 373 static long p_wm; |
373 #ifdef FEAT_KEYMAP | 374 #ifdef FEAT_KEYMAP |
374 static char_u *p_keymap; | 375 static char_u *p_keymap; |
376 #endif | |
377 #ifdef FEAT_TERMINAL | |
378 static long p_twsl; | |
375 #endif | 379 #endif |
376 | 380 |
377 /* Saved values for when 'bin' is set. */ | 381 /* Saved values for when 'bin' is set. */ |
378 static int p_et_nobin; | 382 static int p_et_nobin; |
379 static int p_ml_nobin; | 383 static int p_ml_nobin; |
2748 #else | 2752 #else |
2749 (char_u*)NULL, PV_NONE, | 2753 (char_u*)NULL, PV_NONE, |
2750 {(char_u *)FALSE, (char_u *)FALSE} | 2754 {(char_u *)FALSE, (char_u *)FALSE} |
2751 #endif | 2755 #endif |
2752 SCRIPTID_INIT}, | 2756 SCRIPTID_INIT}, |
2757 /* TODO: remove this deprecated entry */ | |
2753 {"terminalscroll", "tlsl", P_NUM|P_VI_DEF|P_VIM|P_RBUF, | 2758 {"terminalscroll", "tlsl", P_NUM|P_VI_DEF|P_VIM|P_RBUF, |
2754 #ifdef FEAT_TERMINAL | 2759 #ifdef FEAT_TERMINAL |
2755 (char_u *)&p_tlsl, PV_NONE, | 2760 (char_u *)&p_twsl, PV_TWSL, |
2756 {(char_u *)10000L, (char_u *)10000L} | 2761 {(char_u *)10000L, (char_u *)10000L} |
2757 #else | 2762 #else |
2758 (char_u *)NULL, PV_NONE, | 2763 (char_u *)NULL, PV_NONE, |
2759 {(char_u *)NULL, (char_u *)0L} | 2764 {(char_u *)NULL, (char_u *)0L} |
2760 #endif | 2765 #endif |
2761 SCRIPTID_INIT}, | 2766 SCRIPTID_INIT}, |
2762 {"termkey", "tk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, | 2767 /* TODO: remove this deprecated entry */ |
2768 {"termkey", "tk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, | |
2763 #ifdef FEAT_TERMINAL | 2769 #ifdef FEAT_TERMINAL |
2764 (char_u *)VAR_WIN, PV_TK, | 2770 (char_u *)VAR_WIN, PV_TWK, |
2765 {(char_u *)"", (char_u *)NULL} | 2771 {(char_u *)"", (char_u *)NULL} |
2766 #else | 2772 #else |
2767 (char_u *)NULL, PV_NONE, | 2773 (char_u *)NULL, PV_NONE, |
2768 {(char_u *)NULL, (char_u *)0L} | 2774 {(char_u *)NULL, (char_u *)0L} |
2769 #endif | 2775 #endif |
2770 SCRIPTID_INIT}, | 2776 SCRIPTID_INIT}, |
2777 /* TODO: remove this deprecated entry */ | |
2771 {"termsize", "tms", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, | 2778 {"termsize", "tms", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, |
2772 #ifdef FEAT_TERMINAL | 2779 #ifdef FEAT_TERMINAL |
2773 (char_u *)VAR_WIN, PV_TMS, | 2780 (char_u *)VAR_WIN, PV_TWS, |
2781 {(char_u *)"", (char_u *)NULL} | |
2782 #else | |
2783 (char_u *)NULL, PV_NONE, | |
2784 {(char_u *)NULL, (char_u *)0L} | |
2785 #endif | |
2786 SCRIPTID_INIT}, | |
2787 {"termwinkey", "twk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, | |
2788 #ifdef FEAT_TERMINAL | |
2789 (char_u *)VAR_WIN, PV_TWK, | |
2790 {(char_u *)"", (char_u *)NULL} | |
2791 #else | |
2792 (char_u *)NULL, PV_NONE, | |
2793 {(char_u *)NULL, (char_u *)0L} | |
2794 #endif | |
2795 SCRIPTID_INIT}, | |
2796 {"termwinscroll", "twsl", P_NUM|P_VI_DEF|P_VIM|P_RBUF, | |
2797 #ifdef FEAT_TERMINAL | |
2798 (char_u *)&p_twsl, PV_TWSL, | |
2799 {(char_u *)10000L, (char_u *)10000L} | |
2800 #else | |
2801 (char_u *)NULL, PV_NONE, | |
2802 {(char_u *)NULL, (char_u *)0L} | |
2803 #endif | |
2804 SCRIPTID_INIT}, | |
2805 {"termwinsize", "tws", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, | |
2806 #ifdef FEAT_TERMINAL | |
2807 (char_u *)VAR_WIN, PV_TWS, | |
2774 {(char_u *)"", (char_u *)NULL} | 2808 {(char_u *)"", (char_u *)NULL} |
2775 #else | 2809 #else |
2776 (char_u *)NULL, PV_NONE, | 2810 (char_u *)NULL, PV_NONE, |
2777 {(char_u *)NULL, (char_u *)0L} | 2811 {(char_u *)NULL, (char_u *)0L} |
2778 #endif | 2812 #endif |
7450 errmsg = e_invarg; | 7484 errmsg = e_invarg; |
7451 } | 7485 } |
7452 #endif | 7486 #endif |
7453 | 7487 |
7454 #ifdef FEAT_TERMINAL | 7488 #ifdef FEAT_TERMINAL |
7455 /* 'termkey' */ | 7489 /* 'termwinkey' */ |
7456 else if (varp == &curwin->w_p_tk) | 7490 else if (varp == &curwin->w_p_twk) |
7457 { | 7491 { |
7458 if (*curwin->w_p_tk != NUL && string_to_key(curwin->w_p_tk, TRUE) == 0) | 7492 if (*curwin->w_p_twk != NUL |
7493 && string_to_key(curwin->w_p_twk, TRUE) == 0) | |
7459 errmsg = e_invarg; | 7494 errmsg = e_invarg; |
7460 } | 7495 } |
7461 /* 'termsize' */ | 7496 /* 'termwinsize' */ |
7462 else if (varp == &curwin->w_p_tms) | 7497 else if (varp == &curwin->w_p_tws) |
7463 { | 7498 { |
7464 if (*curwin->w_p_tms != NUL) | 7499 if (*curwin->w_p_tws != NUL) |
7465 { | 7500 { |
7466 p = skipdigits(curwin->w_p_tms); | 7501 p = skipdigits(curwin->w_p_tws); |
7467 if (p == curwin->w_p_tms | 7502 if (p == curwin->w_p_tws |
7468 || (*p != 'x' && *p != '*') | 7503 || (*p != 'x' && *p != '*') |
7469 || *skipdigits(p + 1) != NUL) | 7504 || *skipdigits(p + 1) != NUL) |
7470 errmsg = e_invarg; | 7505 errmsg = e_invarg; |
7471 } | 7506 } |
7472 } | 7507 } |
10685 #ifdef FEAT_CONCEAL | 10720 #ifdef FEAT_CONCEAL |
10686 case PV_COCU: return (char_u *)&(curwin->w_p_cocu); | 10721 case PV_COCU: return (char_u *)&(curwin->w_p_cocu); |
10687 case PV_COLE: return (char_u *)&(curwin->w_p_cole); | 10722 case PV_COLE: return (char_u *)&(curwin->w_p_cole); |
10688 #endif | 10723 #endif |
10689 #ifdef FEAT_TERMINAL | 10724 #ifdef FEAT_TERMINAL |
10690 case PV_TK: return (char_u *)&(curwin->w_p_tk); | 10725 case PV_TWK: return (char_u *)&(curwin->w_p_twk); |
10691 case PV_TMS: return (char_u *)&(curwin->w_p_tms); | 10726 case PV_TWS: return (char_u *)&(curwin->w_p_tws); |
10727 case PV_TWSL: return (char_u *)&(curbuf->b_p_twsl); | |
10692 #endif | 10728 #endif |
10693 | 10729 |
10694 case PV_AI: return (char_u *)&(curbuf->b_p_ai); | 10730 case PV_AI: return (char_u *)&(curbuf->b_p_ai); |
10695 case PV_BIN: return (char_u *)&(curbuf->b_p_bin); | 10731 case PV_BIN: return (char_u *)&(curbuf->b_p_bin); |
10696 #ifdef FEAT_MBYTE | 10732 #ifdef FEAT_MBYTE |
10885 #ifdef FEAT_CONCEAL | 10921 #ifdef FEAT_CONCEAL |
10886 to->wo_cocu = vim_strsave(from->wo_cocu); | 10922 to->wo_cocu = vim_strsave(from->wo_cocu); |
10887 to->wo_cole = from->wo_cole; | 10923 to->wo_cole = from->wo_cole; |
10888 #endif | 10924 #endif |
10889 #ifdef FEAT_TERMINAL | 10925 #ifdef FEAT_TERMINAL |
10890 to->wo_tk = vim_strsave(from->wo_tk); | 10926 to->wo_twk = vim_strsave(from->wo_twk); |
10891 to->wo_tms = vim_strsave(from->wo_tms); | 10927 to->wo_tws = vim_strsave(from->wo_tws); |
10892 #endif | 10928 #endif |
10893 #ifdef FEAT_FOLDING | 10929 #ifdef FEAT_FOLDING |
10894 to->wo_fdc = from->wo_fdc; | 10930 to->wo_fdc = from->wo_fdc; |
10895 to->wo_fdc_save = from->wo_fdc_save; | 10931 to->wo_fdc_save = from->wo_fdc_save; |
10896 to->wo_fen = from->wo_fen; | 10932 to->wo_fen = from->wo_fen; |
10955 #endif | 10991 #endif |
10956 #ifdef FEAT_CONCEAL | 10992 #ifdef FEAT_CONCEAL |
10957 check_string_option(&wop->wo_cocu); | 10993 check_string_option(&wop->wo_cocu); |
10958 #endif | 10994 #endif |
10959 #ifdef FEAT_TERMINAL | 10995 #ifdef FEAT_TERMINAL |
10960 check_string_option(&wop->wo_tk); | 10996 check_string_option(&wop->wo_twk); |
10961 check_string_option(&wop->wo_tms); | 10997 check_string_option(&wop->wo_tws); |
10962 #endif | 10998 #endif |
10963 #ifdef FEAT_LINEBREAK | 10999 #ifdef FEAT_LINEBREAK |
10964 check_string_option(&wop->wo_briopt); | 11000 check_string_option(&wop->wo_briopt); |
10965 #endif | 11001 #endif |
10966 } | 11002 } |
10998 #endif | 11034 #endif |
10999 #ifdef FEAT_CONCEAL | 11035 #ifdef FEAT_CONCEAL |
11000 clear_string_option(&wop->wo_cocu); | 11036 clear_string_option(&wop->wo_cocu); |
11001 #endif | 11037 #endif |
11002 #ifdef FEAT_TERMINAL | 11038 #ifdef FEAT_TERMINAL |
11003 clear_string_option(&wop->wo_tk); | 11039 clear_string_option(&wop->wo_twk); |
11004 clear_string_option(&wop->wo_tms); | 11040 clear_string_option(&wop->wo_tws); |
11005 #endif | 11041 #endif |
11006 } | 11042 } |
11007 | 11043 |
11008 /* | 11044 /* |
11009 * Copy global option values to local options for one buffer. | 11045 * Copy global option values to local options for one buffer. |
11175 buf->b_p_sua = vim_strsave(p_sua); | 11211 buf->b_p_sua = vim_strsave(p_sua); |
11176 #endif | 11212 #endif |
11177 #ifdef FEAT_KEYMAP | 11213 #ifdef FEAT_KEYMAP |
11178 buf->b_p_keymap = vim_strsave(p_keymap); | 11214 buf->b_p_keymap = vim_strsave(p_keymap); |
11179 buf->b_kmap_state |= KEYMAP_INIT; | 11215 buf->b_kmap_state |= KEYMAP_INIT; |
11216 #endif | |
11217 #ifdef FEAT_TERMINAL | |
11218 buf->b_p_twsl = p_twsl; | |
11180 #endif | 11219 #endif |
11181 /* This isn't really an option, but copying the langmap and IME | 11220 /* This isn't really an option, but copying the langmap and IME |
11182 * state from the current buffer is better than resetting it. */ | 11221 * state from the current buffer is better than resetting it. */ |
11183 buf->b_p_iminsert = p_iminsert; | 11222 buf->b_p_iminsert = p_iminsert; |
11184 buf->b_p_imsearch = p_imsearch; | 11223 buf->b_p_imsearch = p_imsearch; |