From 9dd7fd5bde86e631d8b40326efd487eb97a644d4 Mon Sep 17 00:00:00 2001 From: Denzel <> Date: Mon, 11 Aug 2025 18:43:43 +0200 Subject: [PATCH] fix: convert session data build_target to table if needed PR #332 introduced handling for multiple targets. Yet, old session data still has the build_target stored as string resulting in an error when trying to unpack the string when forming the --target arg. This PR fixes this issue by converting old session data to the new format, if needed --- lua/cmake-tools/session.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/cmake-tools/session.lua b/lua/cmake-tools/session.lua index 21eb98c9..fdf2e2f7 100644 --- a/lua/cmake-tools/session.lua +++ b/lua/cmake-tools/session.lua @@ -74,6 +74,9 @@ function session.update(config, old_config) end if old_config.build_target then config.build_target = old_config.build_target + if type(config.build_target) ~= "table" then -- Backwards compatibility (could be removed after a grace period) see PR!332 + config.build_target = { config.build_target } + end end if old_config.launch_target then config.launch_target = old_config.launch_target