From e3e6ac024639feda5ff8743f8a968e5d1eb2fd64 Mon Sep 17 00:00:00 2001 From: Alin Mr Date: Thu, 2 May 2024 19:46:10 +0000 Subject: init.lua: re-expand whenever M.directory changes --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 2481a14..6cc5ebd 100644 --- a/init.lua +++ b/init.lua @@ -14,7 +14,7 @@ -- If not, see . local M = {} M.directory = '${XDG_STATE_HOME:-${HOME}/.local/state}/vis/locks' -M.directory_expanded = false +M.directory_expanded = nil -- Helper to execute a command and capture its output local function capture_cmd(cmd) @@ -29,8 +29,9 @@ local function capture_cmd(cmd) end local function get_lock_dir() - if not M.directory_expanded then + if M.directory_expanded ~= M.directory then M.directory = capture_cmd('printf %s "' .. M.directory .. '"') + M.directory_expanded = M.directory end return M.directory end -- cgit v1.2.3