Comparison

util/stanza.lua @ 181:d952eae776dc

Don't set cursor inside added child when using add_child()
author Matthew Wild <mwild1@gmail.com>
date Sun, 26 Oct 2008 14:39:52 +0000
parent 180:d8b9a19d70eb
child 209:e9de0803676d
comparison
equal deleted inserted replaced
180:d8b9a19d70eb 181:d952eae776dc
51 t_insert(self, child); 51 t_insert(self, child);
52 end 52 end
53 53
54 function stanza_mt:add_child(child) 54 function stanza_mt:add_child(child)
55 (self.last_add[#self.last_add] or self):add_direct_child(child); 55 (self.last_add[#self.last_add] or self):add_direct_child(child);
56 t_insert(self.last_add, s);
57 return self; 56 return self;
58 end 57 end
59 58
60 function stanza_mt:child_with_name(name) 59 function stanza_mt:child_with_name(name)
61 for _, child in ipairs(self) do 60 for _, child in ipairs(self) do