From bda63d5b97dfb333de6f4bd757dbb978906062a2 Mon Sep 17 00:00:00 2001 From: bfredl Date: Tue, 25 Jun 2024 15:33:47 +0200 Subject: refactor(typval)!: remove distinction of binary and nonbinary strings This is a breaking change which will make refactor of typval and shada code a lot easier. In particular, code that would use or check for v:msgpack_types.binary in the wild would be broken. This appears to be rarely used in existing plugins. Also some cases where v:msgpack_type.string would be used to represent a binary string of "string" type, we use a BLOB instead, which is vimscripts native type for binary blobs, and already was used for BIN formats when necessary. msgpackdump(msgpackparse(data)) no longer preserves the distinction of BIN and STR strings. This is very common behavior for language-specific msgpack bindings. Nvim uses msgpack as a tool to serialize its data. Nvim is not a tool to bit-perfectly manipulate arbitrary msgpack data out in the wild. The changed tests should indicate how behavior changes in various edge cases. --- runtime/doc/builtin.txt | 7 +------ runtime/doc/news.txt | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 1e0df1918b..180d308ef5 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -5152,12 +5152,7 @@ msgpackparse({data}) *msgpackparse()* C parser does not support such values. float |Float|. This value cannot possibly appear in |msgpackparse()| output. - string |readfile()|-style list of strings. This value will - appear in |msgpackparse()| output if string contains - zero byte or if string is a mapping key and mapping is - being represented as special dictionary for other - reasons. - binary |String|, or |Blob| if binary string contains zero + string |String|, or |Blob| if binary string contains zero byte. This value cannot appear in |msgpackparse()| output since blobs were introduced. array |List|. This value cannot appear in |msgpackparse()| diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 38be234b00..f1c241a951 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -50,6 +50,12 @@ EDITOR • |hl-CurSearch| now behaves the same as Vim and no longer updates on every cursor movement. +VIM SCRIPT + +• |v:msgpack_types| has the type "binary" removed. |msgpackparse()| no longer + treats BIN, STR and FIXSTR as separate types. Any of these is returned as a + string if possible, or a |blob| if the value contained embedded NUL:s. + EVENTS • TODO -- cgit