comparison src/optionstr.c @ 26336:a2e6da79274d v8.2.3699

patch 8.2.3699: the +title feature adds a lot of #ifdef but little code Commit: https://github.com/vim/vim/commit/651fca85c71a4c5807f8f828f9ded30fbd754325 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 29 20:39:38 2021 +0000 patch 8.2.3699: the +title feature adds a lot of #ifdef but little code Problem: The +title feature adds a lot of #ifdef but little code. Solution: Graduate the +title feature.
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Nov 2021 21:45:04 +0100
parents 3aa48d4e3dc8
children 8aba638e91eb
comparison
equal deleted inserted replaced
26335:c12a888d1f63 26336:a2e6da79274d
977 // No comma allowed in 'fileencoding'; catches confusing it 977 // No comma allowed in 'fileencoding'; catches confusing it
978 // with 'fileencodings'. 978 // with 'fileencodings'.
979 errmsg = e_invarg; 979 errmsg = e_invarg;
980 else 980 else
981 { 981 {
982 #ifdef FEAT_TITLE
983 // May show a "+" in the title now. 982 // May show a "+" in the title now.
984 redraw_titles(); 983 redraw_titles();
985 #endif
986 // Add 'fileencoding' to the swap file. 984 // Add 'fileencoding' to the swap file.
987 ml_setflags(curbuf); 985 ml_setflags(curbuf);
988 } 986 }
989 } 987 }
990 if (errmsg == NULL) 988 if (errmsg == NULL)
997 *varp = p; 995 *varp = p;
998 } 996 }
999 if (varp == &p_enc) 997 if (varp == &p_enc)
1000 { 998 {
1001 errmsg = mb_init(); 999 errmsg = mb_init();
1002 #ifdef FEAT_TITLE
1003 redraw_titles(); 1000 redraw_titles();
1004 #endif
1005 } 1001 }
1006 } 1002 }
1007 1003
1008 #if defined(FEAT_GUI_GTK) 1004 #if defined(FEAT_GUI_GTK)
1009 if (errmsg == NULL && varp == &p_tenc && gui.in_use) 1005 if (errmsg == NULL && varp == &p_tenc && gui.in_use)
1139 // may also change 'textmode' 1135 // may also change 'textmode'
1140 if (get_fileformat(curbuf) == EOL_DOS) 1136 if (get_fileformat(curbuf) == EOL_DOS)
1141 curbuf->b_p_tx = TRUE; 1137 curbuf->b_p_tx = TRUE;
1142 else 1138 else
1143 curbuf->b_p_tx = FALSE; 1139 curbuf->b_p_tx = FALSE;
1144 #ifdef FEAT_TITLE
1145 redraw_titles(); 1140 redraw_titles();
1146 #endif
1147 // update flag in swap file 1141 // update flag in swap file
1148 ml_setflags(curbuf); 1142 ml_setflags(curbuf);
1149 // Redraw needed when switching to/from "mac": a CR in the text 1143 // Redraw needed when switching to/from "mac": a CR in the text
1150 // will be displayed differently. 1144 // will be displayed differently.
1151 if (get_fileformat(curbuf) == EOL_MAC || *oldval == 'm') 1145 if (get_fileformat(curbuf) == EOL_MAC || *oldval == 'm')
1601 // 'breakat' 1595 // 'breakat'
1602 else if (varp == &p_breakat) 1596 else if (varp == &p_breakat)
1603 fill_breakat_flags(); 1597 fill_breakat_flags();
1604 #endif 1598 #endif
1605 1599
1606 #ifdef FEAT_TITLE
1607 // 'titlestring' and 'iconstring' 1600 // 'titlestring' and 'iconstring'
1608 else if (varp == &p_titlestring || varp == &p_iconstring) 1601 else if (varp == &p_titlestring || varp == &p_iconstring)
1609 { 1602 {
1610 # ifdef FEAT_STL_OPT 1603 #ifdef FEAT_STL_OPT
1611 int flagval = (varp == &p_titlestring) ? STL_IN_TITLE : STL_IN_ICON; 1604 int flagval = (varp == &p_titlestring) ? STL_IN_TITLE : STL_IN_ICON;
1612 1605
1613 // NULL => statusline syntax 1606 // NULL => statusline syntax
1614 if (vim_strchr(*varp, '%') && check_stl_option(*varp) == NULL) 1607 if (vim_strchr(*varp, '%') && check_stl_option(*varp) == NULL)
1615 stl_syntax |= flagval; 1608 stl_syntax |= flagval;
1616 else 1609 else
1617 stl_syntax &= ~flagval; 1610 stl_syntax &= ~flagval;
1618 # endif 1611 #endif
1619 did_set_title(); 1612 did_set_title();
1620 } 1613 }
1621 #endif
1622 1614
1623 #ifdef FEAT_GUI 1615 #ifdef FEAT_GUI
1624 // 'guioptions' 1616 // 'guioptions'
1625 else if (varp == &p_go) 1617 else if (varp == &p_go)
1626 { 1618 {
1803 { 1795 {
1804 curwin->w_redr_status = TRUE; 1796 curwin->w_redr_status = TRUE;
1805 redraw_later(VALID); 1797 redraw_later(VALID);
1806 } 1798 }
1807 curbuf->b_help = (curbuf->b_p_bt[0] == 'h'); 1799 curbuf->b_help = (curbuf->b_p_bt[0] == 'h');
1808 #ifdef FEAT_TITLE
1809 redraw_titles(); 1800 redraw_titles();
1810 #endif
1811 } 1801 }
1812 } 1802 }
1813 1803
1814 #ifdef FEAT_STL_OPT 1804 #ifdef FEAT_STL_OPT
1815 // 'statusline' or 'rulerformat' 1805 // 'statusline' or 'rulerformat'