summaryrefslogtreecommitdiff
path: root/dalos-hexview.lua
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-12-21 21:22:38 +0100
committerPixel <pixel@nobis-crew.org>2009-12-21 21:22:38 +0100
commite294e63159e9596dd23bdb33e6ac3c574c32289f (patch)
tree3bd3839241ad617937c94a9d5e5d6478fd190372 /dalos-hexview.lua
parent85d327879aafffcf0f3c811195cbdd07aa6eda7b (diff)
Various fixes.
Diffstat (limited to 'dalos-hexview.lua')
-rw-r--r--dalos-hexview.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/dalos-hexview.lua b/dalos-hexview.lua
index a302d39..ee9412e 100644
--- a/dalos-hexview.lua
+++ b/dalos-hexview.lua
@@ -52,12 +52,16 @@ dalosp.hexview = {
output_change = function (self, ind)
self.watchees[ind] = self.outputs[ind] and true or false
+ self:set_houtput(nil, ind)
+ self.oldcursors[ind] = -1
+ self:dalos_hv_cb(self.extra.hv)
end,
update_houtput = function (self, ind, cursor)
local h = self:get_linked_input(1)
- local maxsixe = h and h:getsize() or -1
- if h and self.watchees[ind] then
+ local maxsize = h and h:getsize() or -1
+ cursor = cursor + 0
+ if cursor >= 0 and h and self.watchees[ind] then
if cursor < maxsize then
self:set_houtput(nil, ind)
end
@@ -72,7 +76,7 @@ dalosp.hexview = {
do_seek = function (self)
self.h:seek(self.offset + self.origin)
end,
- do_read = function (self, userdata, count)
+ do_read = function (self, count, userdata)
return self.h:read(count, userdata)
end,
}
@@ -84,20 +88,20 @@ dalosp.hexview = {
local m
for i = 1, 10 do
m = hv.markers[i]
- if self.oldcursors[i] ~= m then
+ if m and self.oldcursors[i] ~= m then
self:update_houtput(i, m)
self.oldcursors[i] = m
end
end
m = hv.kcursor
- if self.oldcursors[11] ~= m then
+ if m and self.oldcursors[11] ~= m then
self:update_houtput(11, m)
self.oldcursors[11] = m
end
m = hv.mcursor
- if self.oldcursors[12] ~= m then
+ if m and self.oldcursors[12] ~= m then
self:update_houtput(12, m)
self.oldcursors[12] = m
end
@@ -146,6 +150,7 @@ dalosp.hexview = {
end
hv:registercb(dalosp.hexview.dalos_hv_cb, obj)
+ obj.dalos_hv_cb = dalosp.hexview.dalos_hv_cb
return obj
end,