aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-05-09 19:19:07 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-05-09 19:19:21 +0800
commitdb506d991d80eb12016564eb62b5f636e7c8c836 (patch)
tree7678419391e69208de255f1f5b28e8140c4c6a19 /src/nvim/option.c
parent41ce7b07e2946bdde0061d7af5b4446efafa5089 (diff)
downloadrneovim-db506d991d80eb12016564eb62b5f636e7c8c836.tar.gz
rneovim-db506d991d80eb12016564eb62b5f636e7c8c836.tar.bz2
rneovim-db506d991d80eb12016564eb62b5f636e7c8c836.zip
vim-patch:8.2.4924: maparg() may return a string that cannot be reused
Problem: maparg() may return a string that cannot be reused. Solution: use msg_outtrans_special() instead of str2special(). (closes vim/vim#10384) https://github.com/vim/vim/commit/0519ce00394474055bd58c089ea90a19986443eb
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index ff742ea10a..e738c6c3b9 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -4980,7 +4980,11 @@ int get_option_value(const char *name, long *numval, char **stringval, int opt_f
return -2;
}
if (stringval != NULL) {
- *stringval = xstrdup(*(char **)varp);
+ if ((char_u **)varp == &p_pt) { // 'pastetoggle'
+ *stringval = str2special_save(*(char **)(varp), false, false);
+ } else {
+ *stringval = xstrdup(*(char **)(varp));
+ }
}
return 0;
}