Mercurial > vim
comparison src/optionstr.c @ 23952:44be09b25619 v8.2.2518
patch 8.2.2518: 'listchars' should be window-local
Commit: https://github.com/vim/vim/commit/eed9d46293f0842aad0d50ff3a526f9a48b12421
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 15 20:38:25 2021 +0100
patch 8.2.2518: 'listchars' should be window-local
Problem: 'listchars' should be window-local.
Solution: Make 'listchars' global-local. (Yegappan Lakshmanan, Marco Hinz,
closes #5206, closes #7850)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 15 Feb 2021 20:45:04 +0100 |
parents | 8152b7daebad |
children | a9ff8368d35f |
comparison
equal
deleted
inserted
replaced
23951:c58a5a123ca5 | 23952:44be09b25619 |
---|---|
860 // 'ambiwidth' | 860 // 'ambiwidth' |
861 else if (varp == &p_ambw || varp == &p_emoji) | 861 else if (varp == &p_ambw || varp == &p_emoji) |
862 { | 862 { |
863 if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK) | 863 if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK) |
864 errmsg = e_invarg; | 864 errmsg = e_invarg; |
865 else if (set_chars_option(&p_lcs) != NULL) | 865 else if (set_chars_option(curwin, &p_fcs) != NULL) |
866 errmsg = _("E834: Conflicts with value of 'listchars'"); | |
867 else if (set_chars_option(&p_fcs) != NULL) | |
868 errmsg = _("E835: Conflicts with value of 'fillchars'"); | 866 errmsg = _("E835: Conflicts with value of 'fillchars'"); |
867 else | |
868 { | |
869 tabpage_T *tp; | |
870 win_T *wp; | |
871 | |
872 FOR_ALL_TAB_WINDOWS(tp, wp) | |
873 { | |
874 if (set_chars_option(wp, &wp->w_p_lcs) != NULL) | |
875 { | |
876 errmsg = _("E834: Conflicts with value of 'listchars'"); | |
877 goto ambw_end; | |
878 } | |
879 } | |
880 } | |
881 ambw_end: | |
882 {} | |
869 } | 883 } |
870 | 884 |
871 // 'background' | 885 // 'background' |
872 else if (varp == &p_bg) | 886 else if (varp == &p_bg) |
873 { | 887 { |
1290 } | 1304 } |
1291 s = skip_to_option_part(s); | 1305 s = skip_to_option_part(s); |
1292 } | 1306 } |
1293 } | 1307 } |
1294 | 1308 |
1295 // 'listchars' | 1309 // global 'listchars' |
1296 else if (varp == &p_lcs) | 1310 else if (varp == &p_lcs) |
1297 { | 1311 { |
1298 errmsg = set_chars_option(varp); | 1312 errmsg = set_chars_option(curwin, varp); |
1299 } | 1313 if (errmsg == NULL) |
1314 { | |
1315 tabpage_T *tp; | |
1316 win_T *wp; | |
1317 | |
1318 // The current window is set to use the global 'listchars' value. | |
1319 // So clear the window-local value. | |
1320 if (!(opt_flags & OPT_GLOBAL)) | |
1321 clear_string_option(&curwin->w_p_lcs); | |
1322 FOR_ALL_TAB_WINDOWS(tp, wp) | |
1323 { | |
1324 errmsg = set_chars_option(wp, &wp->w_p_lcs); | |
1325 if (errmsg) | |
1326 break; | |
1327 } | |
1328 redraw_all_later(NOT_VALID); | |
1329 } | |
1330 } | |
1331 | |
1332 // local 'listchars' | |
1333 else if (varp == &curwin->w_p_lcs) | |
1334 errmsg = set_chars_option(curwin, varp); | |
1300 | 1335 |
1301 // 'fillchars' | 1336 // 'fillchars' |
1302 else if (varp == &p_fcs) | 1337 else if (varp == &p_fcs) |
1303 { | 1338 { |
1304 errmsg = set_chars_option(varp); | 1339 errmsg = set_chars_option(curwin, varp); |
1305 } | 1340 } |
1306 | 1341 |
1307 #ifdef FEAT_CMDWIN | 1342 #ifdef FEAT_CMDWIN |
1308 // 'cedit' | 1343 // 'cedit' |
1309 else if (varp == &p_cedit) | 1344 else if (varp == &p_cedit) |