comparison src/ex_cmds2.c @ 28457:4dcccb2673fe v8.2.4753

patch 8.2.4753: error from setting an option is silently ignored Commit: https://github.com/vim/vim/commit/31e5c60a682840959cae6273ccadd9aae48c928d Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 15 13:53:33 2022 +0100 patch 8.2.4753: error from setting an option is silently ignored Problem: Error from setting an option is silently ignored. Solution: Handle option value errors better. Fix uses of N_().
author Bram Moolenaar <Bram@vim.org>
date Fri, 15 Apr 2022 15:00:04 +0200
parents ac75c145f0a9
children 6c7eddcce52c
comparison
equal deleted inserted replaced
28456:6353f897ac82 28457:4dcccb2673fe
561 if (curwin->w_arg_idx != i || !editing_arg_idx(curwin)) 561 if (curwin->w_arg_idx != i || !editing_arg_idx(curwin))
562 { 562 {
563 // Clear 'shm' to avoid that the file message overwrites 563 // Clear 'shm' to avoid that the file message overwrites
564 // any output from the command. 564 // any output from the command.
565 p_shm_save = vim_strsave(p_shm); 565 p_shm_save = vim_strsave(p_shm);
566 set_option_value((char_u *)"shm", 0L, (char_u *)"", 0); 566 set_option_value_give_err((char_u *)"shm",
567 0L, (char_u *)"", 0);
567 do_argfile(eap, i); 568 do_argfile(eap, i);
568 set_option_value((char_u *)"shm", 0L, p_shm_save, 0); 569 set_option_value_give_err((char_u *)"shm",
570 0L, p_shm_save, 0);
569 vim_free(p_shm_save); 571 vim_free(p_shm_save);
570 } 572 }
571 if (curwin->w_arg_idx != i) 573 if (curwin->w_arg_idx != i)
572 break; 574 break;
573 } 575 }
621 break; 623 break;
622 624
623 // Go to the next buffer. Clear 'shm' to avoid that the file 625 // Go to the next buffer. Clear 'shm' to avoid that the file
624 // message overwrites any output from the command. 626 // message overwrites any output from the command.
625 p_shm_save = vim_strsave(p_shm); 627 p_shm_save = vim_strsave(p_shm);
626 set_option_value((char_u *)"shm", 0L, (char_u *)"", 0); 628 set_option_value_give_err((char_u *)"shm", 0L, (char_u *)"", 0);
627 goto_buffer(eap, DOBUF_FIRST, FORWARD, next_fnum); 629 goto_buffer(eap, DOBUF_FIRST, FORWARD, next_fnum);
628 set_option_value((char_u *)"shm", 0L, p_shm_save, 0); 630 set_option_value_give_err((char_u *)"shm", 0L, p_shm_save, 0);
629 vim_free(p_shm_save); 631 vim_free(p_shm_save);
630 632
631 // If autocommands took us elsewhere, quit here. 633 // If autocommands took us elsewhere, quit here.
632 if (curbuf->b_fnum != next_fnum) 634 if (curbuf->b_fnum != next_fnum)
633 break; 635 break;
643 qf_idx = qf_get_cur_idx(eap); 645 qf_idx = qf_get_cur_idx(eap);
644 646
645 // Clear 'shm' to avoid that the file message overwrites 647 // Clear 'shm' to avoid that the file message overwrites
646 // any output from the command. 648 // any output from the command.
647 p_shm_save = vim_strsave(p_shm); 649 p_shm_save = vim_strsave(p_shm);
648 set_option_value((char_u *)"shm", 0L, (char_u *)"", 0); 650 set_option_value_give_err((char_u *)"shm", 0L, (char_u *)"", 0);
649 ex_cnext(eap); 651 ex_cnext(eap);
650 set_option_value((char_u *)"shm", 0L, p_shm_save, 0); 652 set_option_value_give_err((char_u *)"shm", 0L, p_shm_save, 0);
651 vim_free(p_shm_save); 653 vim_free(p_shm_save);
652 654
653 // If jumping to the next quickfix entry fails, quit here 655 // If jumping to the next quickfix entry fails, quit here
654 if (qf_get_cur_idx(eap) == qf_idx) 656 if (qf_get_cur_idx(eap) == qf_idx)
655 break; 657 break;