aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/lua.txt7
-rw-r--r--runtime/doc/news.txt2
2 files changed, 7 insertions, 2 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 48fa595a53..80808abd51 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -811,11 +811,14 @@ vim.json.decode({str}, {opts}) *vim.json.decode()*
Return: ~
(`any`)
-vim.json.encode({obj}) *vim.json.encode()*
+vim.json.encode({obj}, {opts}) *vim.json.encode()*
Encodes (or "packs") Lua object {obj} as JSON in a Lua string.
Parameters: ~
- • {obj} (`any`)
+ • {obj} (`any`)
+ • {opts} (`table<string,any>?`) Options table with keys:
+ • escape_slash: (boolean) (default false) When true, escapes
+ `/` character in JSON strings
Return: ~
(`string`)
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 8b4b396a26..3a3e1a8d64 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -60,6 +60,7 @@ DEFAULTS
current buffer, respectively.
• 'number', 'relativenumber', 'signcolumn', and 'foldcolumn' are disabled in
|terminal| buffers. See |terminal-config| for an example of changing these defaults.
+• |vim.json.encode()| no longer escapes the forward slash symbol by default
DIAGNOSTICS
@@ -169,6 +170,7 @@ The following new features were added.
API
• |nvim__ns_set()| can set properties for a namespace
+• |vim.json.encode()| has an option to enable forward slash escaping
DEFAULTS