diff options
author | Erlend Fagerheim <erlendf80@gmail.com> | 2020-02-07 23:32:39 +0100 |
---|---|---|
committer | Erlend Fagerheim <erlendf80@gmail.com> | 2020-02-07 23:32:39 +0100 |
commit | e543236a0e3e9ef954406a111f66054a441f3caf (patch) | |
tree | 39cbd8c942fbeb5b25a9c46f56510f3a3b38f52f | |
parent | a8c2918cceb5b2029fe16397fb4d58efd4c5f515 (diff) | |
download | vis-cursors-e543236a0e3e9ef954406a111f66054a441f3caf.tar.gz |
rename cursors to init
-rw-r--r-- | init.lua (renamed from cursors.lua) | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,6 +1,6 @@ -local module = {} +local M = {} local cursors = {} -module.path = os.getenv('HOME') .. '/.cursors' +M.path = os.getenv('HOME') .. '/.cursors' function apply_cursor_pos(win) if win.file == nil or win.file.path == nil then return end @@ -19,7 +19,7 @@ end function read_cursors() cursors = {} - local f = io.open(module.path) + local f = io.open(M.path) if f == nil then return end for line in f:lines() do for k, v in string.gmatch(line, '(.+)%s(%d+)') do @@ -33,7 +33,7 @@ function read_cursors() end function write_cursors() - local f = io.open(module.path, 'w+') + local f = io.open(M.path, 'w+') if f == nil then return end local a = {} for k in pairs(cursors) do table.insert(a, k) end @@ -55,4 +55,4 @@ vis.events.subscribe(vis.events.WIN_OPEN, apply_cursor_pos) vis.events.subscribe(vis.events.WIN_CLOSE, set_cursor_pos) vis.events.subscribe(vis.events.QUIT, write_cursors) -return module +return M |