diff src/memline.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 86b6432aa1d8
children 78ebb50d6fcb
line wrap: on
line diff
--- a/src/memline.c
+++ b/src/memline.c
@@ -1482,7 +1482,7 @@ ml_recover(int checkext)
 	set_fileformat(b0_ff - 1, OPT_LOCAL);
     if (b0_fenc != NULL)
     {
-	set_option_value((char_u *)"fenc", 0L, b0_fenc, OPT_LOCAL);
+	set_option_value_give_err((char_u *)"fenc", 0L, b0_fenc, OPT_LOCAL);
 	vim_free(b0_fenc);
     }
     unchanged(curbuf, TRUE, TRUE);
@@ -1759,7 +1759,7 @@ ml_recover(int checkext)
     if (*buf->b_p_key != NUL && STRCMP(curbuf->b_p_key, buf->b_p_key) != 0)
     {
 	msg_puts(_("Using crypt key from swap file for the text file.\n"));
-	set_option_value((char_u *)"key", 0L, buf->b_p_key, OPT_LOCAL);
+	set_option_value_give_err((char_u *)"key", 0L, buf->b_p_key, OPT_LOCAL);
     }
 #endif
     redraw_curbuf_later(NOT_VALID);