aboutsummaryrefslogtreecommitdiff
path: root/src/cjson/lua_cjson.c
diff options
context:
space:
mode:
authorjade <jadel@mercury.com>2025-07-10 19:07:56 -0700
committerGitHub <noreply@github.com>2025-07-10 19:07:56 -0700
commit7a69fefdb95daba355aa1b05ebfdf4d0b0d51ec2 (patch)
treea6f20ce315fdba5500ca7779e95b8123638e66f6 /src/cjson/lua_cjson.c
parent00f8f94d5b06e5d464a4d5548dc6a91bd2dfdd64 (diff)
downloadrneovim-7a69fefdb95daba355aa1b05ebfdf4d0b0d51ec2.tar.gz
rneovim-7a69fefdb95daba355aa1b05ebfdf4d0b0d51ec2.tar.bz2
rneovim-7a69fefdb95daba355aa1b05ebfdf4d0b0d51ec2.zip
fix(vim.json): loss of precision on integers >14 digits #34876
Problem: multiple DAP servers keep assuming they can have internal IDs up to 2**52, which get corrupted by the Neovim JSON encoder. Solution: change (1) constant and add a test so nobody breaks it while updating the library. Fixes: https://github.com/neovim/neovim/issues/24532 Fixes: https://github.com/mfussenegger/nvim-dap/issues/1534 Fixes: https://github.com/facebook/buck2/issues/1032
Diffstat (limited to 'src/cjson/lua_cjson.c')
-rw-r--r--src/cjson/lua_cjson.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cjson/lua_cjson.c b/src/cjson/lua_cjson.c
index 3119ffc2d7..0acdfab2e3 100644
--- a/src/cjson/lua_cjson.c
+++ b/src/cjson/lua_cjson.c
@@ -82,7 +82,7 @@
#define DEFAULT_ENCODE_INVALID_NUMBERS 0
#define DEFAULT_DECODE_INVALID_NUMBERS 1
#define DEFAULT_ENCODE_KEEP_BUFFER 1
-#define DEFAULT_ENCODE_NUMBER_PRECISION 14
+#define DEFAULT_ENCODE_NUMBER_PRECISION 16
#define DEFAULT_ENCODE_EMPTY_TABLE_AS_OBJECT 0
#define DEFAULT_DECODE_ARRAY_WITH_ARRAY_MT 0
#define DEFAULT_ENCODE_ESCAPE_FORWARD_SLASH 1