diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-05-02 21:04:26 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2024-05-02 23:22:11 +0200 |
| commit | 8ef3a1e0393b632c1ccda93a601c6f3eacb42f3e (patch) | |
| tree | 3686637ee9914047493e48c5b95063a435290029 | |
| parent | e4747c38c8554462184e11c9a8b6dadc6878b587 (diff) | |
| download | vis-lockfiles-8ef3a1e0393b632c1ccda93a601c6f3eacb42f3e.tar.gz vis-lockfiles-8ef3a1e0393b632c1ccda93a601c6f3eacb42f3e.zip | |
return early if no file is opened
Reported-By: Matěj Cepl <mcepl@cepl.eu>
Tested-By: Alin Mr <almr.oss@outlook.com>
| -rw-r--r-- | init.lua | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -109,6 +109,7 @@ local function delete_lock_file(lfile_path) end vis.events.subscribe(vis.events.FILE_OPEN, function(file) + if not file.path then return end local lfile_path = lock_file_path(file.path) if not create_lock_file(lfile_path) and not confirm(lfile_path) then os.exit(1) @@ -116,6 +117,7 @@ vis.events.subscribe(vis.events.FILE_OPEN, function(file) end) vis.events.subscribe(vis.events.FILE_CLOSE, function(file) + if not file.path then return end local lfile_path = lock_file_path(file.path) if created_locks[lfile_path] then delete_lock_file(lfile_path) |
