comparison src/optionstr.c @ 29391:73fb9c6efc6d v9.0.0038

patch 9.0.0038: 'listchars' test fails Commit: https://github.com/vim/vim/commit/5ed26faace574f6b36744f9e17075d7e806aa877 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 4 18:05:51 2022 +0100 patch 9.0.0038: 'listchars' test fails Problem: 'listchars' test fails. Solution: Use window-local value after setting the global value
author Bram Moolenaar <Bram@vim.org>
date Mon, 04 Jul 2022 19:15:03 +0200
parents 9dce192d1ac2
children caaf5b270018
comparison
equal deleted inserted replaced
29390:f85fcaede57f 29391:73fb9c6efc6d
1311 if (errmsg == NULL) 1311 if (errmsg == NULL)
1312 { 1312 {
1313 tabpage_T *tp; 1313 tabpage_T *tp;
1314 win_T *wp; 1314 win_T *wp;
1315 1315
1316 // The current window is set to use the global 'listchars' value. 1316 // If the current window is set to use the global 'listchars'
1317 // So clear the window-local value. 1317 // value, clear the window-local value.
1318 if (!(opt_flags & OPT_GLOBAL)) 1318 if (!(opt_flags & OPT_GLOBAL))
1319 clear_string_option(&curwin->w_p_lcs); 1319 clear_string_option(&curwin->w_p_lcs);
1320 FOR_ALL_TAB_WINDOWS(tp, wp) 1320 FOR_ALL_TAB_WINDOWS(tp, wp)
1321 // If the current window has a local value need to apply it
1322 // again, it was changed when setting the global value.
1321 // If no error was returned above, we don't expect an error 1323 // If no error was returned above, we don't expect an error
1322 // here, so ignore the return value. 1324 // here, so ignore the return value.
1323 if (*wp->w_p_lcs == NUL) 1325 (void)set_chars_option(wp, &wp->w_p_lcs);
1324 (void)set_chars_option(wp, &wp->w_p_lcs);
1325 1326
1326 redraw_all_later(NOT_VALID); 1327 redraw_all_later(NOT_VALID);
1327 } 1328 }
1328 } 1329 }
1329 // local 'listchars' 1330 // local 'listchars'
1337 if (errmsg == NULL) 1338 if (errmsg == NULL)
1338 { 1339 {
1339 tabpage_T *tp; 1340 tabpage_T *tp;
1340 win_T *wp; 1341 win_T *wp;
1341 1342
1342 // The current window is set to use the global 'fillchars' value. 1343 // If the current window is set to use the global 'fillchars'
1343 // So clear the window-local value. 1344 // value clear the window-local value.
1344 if (!(opt_flags & OPT_GLOBAL)) 1345 if (!(opt_flags & OPT_GLOBAL))
1345 clear_string_option(&curwin->w_p_fcs); 1346 clear_string_option(&curwin->w_p_fcs);
1346 FOR_ALL_TAB_WINDOWS(tp, wp) 1347 FOR_ALL_TAB_WINDOWS(tp, wp)
1348 // If the current window has a local value need to apply it
1349 // again, it was changed when setting the global value.
1347 // If no error was returned above, we don't expect an error 1350 // If no error was returned above, we don't expect an error
1348 // here, so ignore the return value. 1351 // here, so ignore the return value.
1349 if (*wp->w_p_fcs == NUL) 1352 (void)set_chars_option(wp, &wp->w_p_fcs);
1350 (void)set_chars_option(wp, &wp->w_p_fcs);
1351 1353
1352 redraw_all_later(NOT_VALID); 1354 redraw_all_later(NOT_VALID);
1353 } 1355 }
1354 } 1356 }
1355 // local 'fillchars' 1357 // local 'fillchars'