comparison src/option.c @ 13845:f22db93bd887 v8.0.1794

patch 8.0.1794: duplicate term options after renaming commit https://github.com/vim/vim/commit/b833c1ef7be1ed216a967dd7262473ec97084fa2 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 5 16:36:06 2018 +0200 patch 8.0.1794: duplicate term options after renaming Problem: Duplicate term options after renaming. Solution: Remove the old names 'termkey', 'termsize' and 'terminalscroll'.
author Christian Brabandt <cb@256bit.org>
date Sat, 05 May 2018 16:45:05 +0200
parents d0d8125ba692
children dc67449d648c
comparison
equal deleted inserted replaced
13844:11e433673c49 13845:f22db93bd887
373 static long p_wm; 373 static long p_wm;
374 #ifdef FEAT_KEYMAP 374 #ifdef FEAT_KEYMAP
375 static char_u *p_keymap; 375 static char_u *p_keymap;
376 #endif 376 #endif
377 #ifdef FEAT_TERMINAL 377 #ifdef FEAT_TERMINAL
378 static long p_twsl; 378 static long p_twsl; /* 'termwinscroll' */
379 #endif 379 #endif
380 380
381 /* Saved values for when 'bin' is set. */ 381 /* Saved values for when 'bin' is set. */
382 static int p_et_nobin; 382 static int p_et_nobin;
383 static int p_ml_nobin; 383 static int p_ml_nobin;
2750 (char_u *)&p_tgc, PV_NONE, 2750 (char_u *)&p_tgc, PV_NONE,
2751 {(char_u *)FALSE, (char_u *)FALSE} 2751 {(char_u *)FALSE, (char_u *)FALSE}
2752 #else 2752 #else
2753 (char_u*)NULL, PV_NONE, 2753 (char_u*)NULL, PV_NONE,
2754 {(char_u *)FALSE, (char_u *)FALSE} 2754 {(char_u *)FALSE, (char_u *)FALSE}
2755 #endif
2756 SCRIPTID_INIT},
2757 /* TODO: remove this deprecated entry */
2758 {"terminalscroll", "tlsl", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
2759 #ifdef FEAT_TERMINAL
2760 (char_u *)&p_twsl, PV_TWSL,
2761 {(char_u *)10000L, (char_u *)10000L}
2762 #else
2763 (char_u *)NULL, PV_NONE,
2764 {(char_u *)NULL, (char_u *)0L}
2765 #endif
2766 SCRIPTID_INIT},
2767 /* TODO: remove this deprecated entry */
2768 {"termkey", "tk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
2769 #ifdef FEAT_TERMINAL
2770 (char_u *)VAR_WIN, PV_TWK,
2771 {(char_u *)"", (char_u *)NULL}
2772 #else
2773 (char_u *)NULL, PV_NONE,
2774 {(char_u *)NULL, (char_u *)0L}
2775 #endif
2776 SCRIPTID_INIT},
2777 /* TODO: remove this deprecated entry */
2778 {"termsize", "tms", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
2779 #ifdef FEAT_TERMINAL
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 2755 #endif
2786 SCRIPTID_INIT}, 2756 SCRIPTID_INIT},
2787 {"termwinkey", "twk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF, 2757 {"termwinkey", "twk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
2788 #ifdef FEAT_TERMINAL 2758 #ifdef FEAT_TERMINAL
2789 (char_u *)VAR_WIN, PV_TWK, 2759 (char_u *)VAR_WIN, PV_TWK,
3803 if (varp != NULL) /* skip hidden option, nothing to do for it */ 3773 if (varp != NULL) /* skip hidden option, nothing to do for it */
3804 { 3774 {
3805 dvi = ((flags & P_VI_DEF) || compatible) ? VI_DEFAULT : VIM_DEFAULT; 3775 dvi = ((flags & P_VI_DEF) || compatible) ? VI_DEFAULT : VIM_DEFAULT;
3806 if (flags & P_STRING) 3776 if (flags & P_STRING)
3807 { 3777 {
3808 /* skip 'termkey' and 'termsize, they are duplicates of 3778 /* Use set_string_option_direct() for local options to handle
3809 * 'termwinkey' and 'termwinsize' */ 3779 * freeing and allocating the value. */
3810 if (STRCMP(options[opt_idx].fullname, "termkey") != 0 3780 if (options[opt_idx].indir != PV_NONE)
3811 && STRCMP(options[opt_idx].fullname, "termsize") != 0) 3781 set_string_option_direct(NULL, opt_idx,
3782 options[opt_idx].def_val[dvi], opt_flags, 0);
3783 else
3812 { 3784 {
3813 /* Use set_string_option_direct() for local options to handle 3785 if ((opt_flags & OPT_FREE) && (flags & P_ALLOCED))
3814 * freeing and allocating the value. */ 3786 free_string_option(*(char_u **)(varp));
3815 if (options[opt_idx].indir != PV_NONE) 3787 *(char_u **)varp = options[opt_idx].def_val[dvi];
3816 set_string_option_direct(NULL, opt_idx, 3788 options[opt_idx].flags &= ~P_ALLOCED;
3817 options[opt_idx].def_val[dvi], opt_flags, 0);
3818 else
3819 {
3820 if ((opt_flags & OPT_FREE) && (flags & P_ALLOCED))
3821 free_string_option(*(char_u **)(varp));
3822 *(char_u **)varp = options[opt_idx].def_val[dvi];
3823 options[opt_idx].flags &= ~P_ALLOCED;
3824 }
3825 } 3789 }
3826 } 3790 }
3827 else if (flags & P_NUM) 3791 else if (flags & P_NUM)
3828 { 3792 {
3829 if (options[opt_idx].indir == PV_SCROLL) 3793 if (options[opt_idx].indir == PV_SCROLL)