aboutsummaryrefslogtreecommitdiff
path: root/lua/vis-std.lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-07-12 19:05:03 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-07-14 11:45:15 +0200
commit386eac2063bdda79279bbdea2fffcd7fc0ff682a (patch)
tree73ef16bc7f07ba8848020b98be3cde123f5b0a36 /lua/vis-std.lua
parent546917d21ca10214c24d3871c92b81265de6958c (diff)
downloadvis-386eac2063bdda79279bbdea2fffcd7fc0ff682a.tar.gz
vis-386eac2063bdda79279bbdea2fffcd7fc0ff682a.tar.xz
vis-lua: make selection first class primitives in Lua API
Diffstat (limited to 'lua/vis-std.lua')
-rw-r--r--lua/vis-std.lua12
1 files changed, 6 insertions, 6 deletions
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