diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-05-04 11:40:50 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2024-05-04 11:40:50 +0200 |
| commit | 9cd4194528b2d73d83abd1364fecd9b334793444 (patch) | |
| tree | 9e48e6d82d4f3359949f71e9be22f9530c8b0a3b /init.lua | |
| parent | 1c0074fbaa825fcb03bca6876636e6a7abaca7f4 (diff) | |
| download | vis-lockfiles-9cd4194528b2d73d83abd1364fecd9b334793444.tar.gz vis-lockfiles-9cd4194528b2d73d83abd1364fecd9b334793444.zip | |
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.
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |
