From 7f80551cc6dc74fe6cc2af1b6b107fc88d9ab5dc Mon Sep 17 00:00:00 2001 From: Pixel Date: Sat, 19 Dec 2009 20:45:08 -0800 Subject: Disabling hexview's output if cursor is past filesize. --- dalos-hexview.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dalos-hexview.lua') diff --git a/dalos-hexview.lua b/dalos-hexview.lua index b085f12..f14e1e0 100644 --- a/dalos-hexview.lua +++ b/dalos-hexview.lua @@ -40,14 +40,18 @@ dalosp.hexview = { update_houtput = function (self, ind, cursor) local h = self:get_linked_input(1) + local maxsixe = h:getsize() if h and self.watchees[ind] then + if cursor < maxsize then + self:set_houtput(nil, ind) + end local obj = { h = h, hvo = self, ind = ind, origin = cursor, offset = 0, - size = h:getsize() - cursor, + size = maxsize - cursor, canread = function (self) return true end, canwrite = function (self) return false end, canseek = function (self) return true end, -- cgit v1.2.3