aboutsummaryrefslogtreecommitdiff
path: root/lua/vis-std.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/vis-std.lua')
-rw-r--r--lua/vis-std.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/vis-std.lua b/lua/vis-std.lua
index 5da6020..6499f24 100644
--- a/lua/vis-std.lua
+++ b/lua/vis-std.lua
@@ -108,7 +108,9 @@ vis.events.subscribe(vis.events.WIN_STATUS, function(win)
end
local size = file.size
- table.insert(right_parts, (size == 0 and "0" or math.ceil(cursor.pos/size*100)).."%")
+ local pos = cursor.pos
+ if not pos then pos = 0 end
+ table.insert(right_parts, (size == 0 and "0" or math.ceil(pos/size*100)).."%")
if not win.large then
local col = cursor.col