From 7662961f51819d6db27ec09cb0845b7060ab4206 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 20 Oct 2019 00:05:48 +0200 Subject: window_layout: Set default `window_positions` table value to `{}` Make the default table value of `window_positions` keys an empty table (`{}`) to fix nil access errors on line 31: window_positions[screen][window:id()] = window:frame() --- window_layout.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'window_layout.lua') diff --git a/window_layout.lua b/window_layout.lua index 408498c..f8d201a 100644 --- a/window_layout.lua +++ b/window_layout.lua @@ -16,6 +16,7 @@ all_window_filter = hs.window.filter.new():setOverrideFilter({ visible = true }) window_positions = {} +setmetatable(window_positions, {__index = function() return {} end}) local function window_positions_save(window, _app_name, event_type) local screen = hs.screen.primaryScreen():id() -- cgit v1.2.3