aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlend Lind Madsen <erlendf80@gmail.com>2021-10-03 04:07:10 +0200
committerErlend Lind Madsen <erlendf80@gmail.com>2021-10-03 04:09:25 +0200
commite87b328148f6bd4411fd78175b12eddf33defef6 (patch)
treed7155cdc4e9b05c8f830d511d264589e370fa47c
parentb24affe78aa2b731428f473d666deab2e49e4534 (diff)
downloadvis-cursors-e87b328148f6bd4411fd78175b12eddf33defef6.tar.gz
read cursors file before setting cusors pos on close
this makes sure we are up-to-date in case other vis processes edited files. thanks to @leorosa for noticing this
-rw-r--r--init.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index a70df60..9494575 100644
--- a/init.lua
+++ b/init.lua
@@ -91,6 +91,9 @@ local set_cursor_pos = function(win)
if not file_exists(win.file.path) then
return
end
+ -- read cursors file in case other vis processes edited files
+ read_cursors()
+ -- set cursor pos for current file path
cursors[win.file.path] = win.selection.pos
end