From 386eac2063bdda79279bbdea2fffcd7fc0ff682a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 12 Jul 2017 19:05:03 +0200 Subject: vis-lua: make selection first class primitives in Lua API --- lua/vis-std.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lua/vis-std.lua') diff --git a/lua/vis-std.lua b/lua/vis-std.lua index e762d86..5f41b4d 100644 --- a/lua/vis-std.lua +++ b/lua/vis-std.lua @@ -81,7 +81,7 @@ vis.events.subscribe(vis.events.WIN_STATUS, function(win) local left_parts = {} local right_parts = {} local file = win.file - local cursor = win.cursor + local selection = win.selection local mode = modes[vis.mode] if mode ~= '' and vis.win == win then @@ -91,18 +91,18 @@ vis.events.subscribe(vis.events.WIN_STATUS, function(win) table.insert(left_parts, (file.name or '[No Name]') .. (file.modified and ' [+]' or '') .. (vis.recording and ' @' or '')) - if #win.cursors > 1 then - table.insert(right_parts, cursor.number..'/'..#win.cursors) + if #win.selections > 1 then + table.insert(right_parts, selection.number..'/'..#win.selections) end local size = file.size - local pos = cursor.pos + local pos = selection.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 - table.insert(right_parts, cursor.line..', '..col) + local col = selection.col + table.insert(right_parts, selection.line..', '..col) if size > 33554432 or col > 65536 then win.large = true end -- cgit v1.2.3