From 9cd4194528b2d73d83abd1364fecd9b334793444 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 4 May 2024 11:40:50 +0200 Subject: stop further WIN_OPEN event handling if we aborted Closing the window invalidates the handle passed to further event handlers probably causing them to crash. --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index f73e13a..723e046 100644 --- a/init.lua +++ b/init.lua @@ -72,7 +72,10 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) if lockfiles.vis_pid == lock_pid then created_locks[file.path] = lfile_path else - prompt(file.path, lfile_path, lock_pid) + if not prompt(file.path, lfile_path, lock_pid) then + -- return ~= nil to stop further event handling since we closed the window + return true + end end end) -- cgit v1.2.3