aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/converter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/api/private/converter.c')
-rw-r--r--src/nvim/api/private/converter.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nvim/api/private/converter.c b/src/nvim/api/private/converter.c
index 0a4daf1dae..a1c5816a49 100644
--- a/src/nvim/api/private/converter.c
+++ b/src/nvim/api/private/converter.c
@@ -7,7 +7,9 @@
#include "nvim/api/private/converter.h"
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
+#include "nvim/ascii_defs.h"
#include "nvim/assert_defs.h"
+#include "nvim/eval/decode.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
@@ -302,15 +304,11 @@ void object_to_vim_take_luaref(Object *obj, typval_T *tv, bool take_luaref, Erro
tv->vval.v_float = obj->data.floating;
break;
- case kObjectTypeString:
- tv->v_type = VAR_STRING;
- if (obj->data.string.data == NULL) {
- tv->vval.v_string = NULL;
- } else {
- tv->vval.v_string = xmemdupz(obj->data.string.data,
- obj->data.string.size);
- }
+ case kObjectTypeString: {
+ String s = obj->data.string;
+ *tv = decode_string(s.data, s.size, false, false);
break;
+ }
case kObjectTypeArray: {
list_T *const list = tv_list_alloc((ptrdiff_t)obj->data.array.size);