diff options
| author | Matěj Cepl <mcepl@cepl.eu> | 2024-09-18 17:07:54 +0200 |
|---|---|---|
| committer | Matěj Cepl <mcepl@cepl.eu> | 2024-09-18 17:07:54 +0200 |
| commit | c349451d309c96c773c5fb3e04369aef940a8a96 (patch) | |
| tree | e124aee6ed73d1217445e1772814b9a87915af9b /init.lua | |
| download | vis-open-extend-c349451d309c96c773c5fb3e04369aef940a8a96.tar.gz vis-open-extend-c349451d309c96c773c5fb3e04369aef940a8a96.zip | |
feat: initial commit
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..ccc84cf --- /dev/null +++ b/init.lua @@ -0,0 +1,11 @@ +vis.events.subscribe(vis.events.WIN_OPEN, function(win) + if win.file == nil or win.file.path == nil then return end + local ref = win.file.path + local _, _, path, line = string.find(ref, "^(.+):(%d+)$") + if path == nil or line == nil or line == 0 or not file_exists(path) then + return + end + win:close() + vis:command("e "..path) + vis:command("+"..line-1) +end) |
