From 863903631e676b33e8be2acb17512fdc1b80b4fb Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 27 Sep 2024 09:14:45 +0100 Subject: [PATCH] fix: string.buffer not found Fixes #1126 --- lua/gitsigns/diff_int.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/gitsigns/diff_int.lua b/lua/gitsigns/diff_int.lua index c9d41479c..75b1a3e8c 100644 --- a/lua/gitsigns/diff_int.lua +++ b/lua/gitsigns/diff_int.lua @@ -4,7 +4,7 @@ local create_hunk = require('gitsigns.hunks').create_hunk local config = require('gitsigns.config').config local decode -if jit then +if jit and package.preload['string.buffer'] then decode = require('string.buffer').decode else decode = vim.mpack.decode @@ -65,7 +65,7 @@ local run_diff_xdl_async = async.wrap( end local encode - if jit then + if jit and package.preload['string.buffer'] then encode = require('string.buffer').encode else encode = vim.mpack.encode