aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsewn <sewn@disroot.org>2023-11-15 12:21:03 +0300
committersewn <sewn@disroot.org>2023-11-15 12:21:03 +0300
commite8d1ccef3d03779e35cfd64d73e968b2d0de39bd (patch)
treeb98a59f078eb48aebdd03b60522e93e969d1eca0
parentc19a2ceb71607aea6c34491fa325a1de2da8dfaf (diff)
downloadvis-cursors-e8d1ccef3d03779e35cfd64d73e968b2d0de39bd.tar.gz
ignore files with default cursor position
-rw-r--r--init.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 5797a8d..f59b27b 100644
--- a/init.lua
+++ b/init.lua
@@ -80,6 +80,12 @@ local on_win_close = function(win)
end
end
+ -- ignore files with cursor at the beginning
+ if win.selection.pos == 0 then
+ return
+ end
+
+
-- insert current path to top of files
table.insert(files, 1, win.file.path)