From: Christian W. <cwa...@gm...> - 2008-10-22 09:29:57
|
Andrea Viarengo wrote: > When I start the project, I enter in node > > first/second: Ok > > But now if I press "ESC", I get the error: > > Error loading lua file "first/0/node.lua": file not found. Good catch - this is fixed in r210, thanks. > If I have this structure: > > 1) ...first/node.lua > 2) ...first/second/node.lua > 3) ...second/node.lua > > a) pipmak.gotonode("first") --now I am in (1) > b) pipmak.gotonode("second") --now I an in (3) not in (2) > c) pipmak.gotonode("first/second") --now I an in (2) > > Is it correct this behaviour? Because it's different from > navigate into filesystem (I am expect to go into (2) with (b) This is correct. This behavior is necessary for backwards compatibility with projects that assume the old "flat" project structure. Or can you think of a way of retaining backwards compatibility without this exception (or worse exceptions)? Is the note about this in the manual not clear enough? Or did you just not read the manual (for which I wouldn't blame you, it's normal that people don't read the manual, and if we can somehow be fault-tolerant in this respect, all the better)? Besides, apart from the fundamental disadvantage of being an exception in the first place, I think this exception actually makes things easier in the case that many (or all) nodes are in the same folder, which I assume will be the usual case: it allows you to write pipmak.gotonode("othernode") instead of pipmak.gotonode("../othernode"). > d) pipmak.gotonode("../") -- should it be possible? (doesn't work) > Error loading lua file "node.lua": file not found. This should be possible (for the sake of completeness, if nothing else - I'm not sure if it makes any real sense to have the root of the project be a node itself). By "doesn't work", do you mean that there's a bug here, in your opinion? In my opinion, this error message is correct, you can't go to a node that doesn't have a node.lua (i.e. by definition isn't a node). > Now we put a node.lua in the same folder of main.lua > > e) pipmak.gotonode("/") --it's works! > if I press "n" I get "We're at node" (without anymore) OK, that last part is confusing. I added quotation marks around the node name in r210, so even an empty node name comes out recognizably. > Now, delete node.lua in the same folder of main.lua > (I use command line to run lua) > h) pipmak.gotonode("/first/second") --ok > i) pipmak.gotonode("../") --error (not found) > press "n" --> We are at node -11 > l) pipmak.gotonode("/second") > Now I get: > error running text editor handler: > -11/node.lua:76 calling selection on bad self....... Whew. What happens is that after the failed loading of node "/", there's no background node anymore because the old node has been left already, so the Lua command line overlay drops down into the background node slot. Therefore, when you call gotonode(), that node is left, and since the Lua command line code isn't prepared for having its node taken away from under it, you get the error message in the end. This is clearly not good. In r211, I've changed the node loading sequence so that the old node is only left after the new node has been loaded successfully (entering the new node still only happens afterward). When there are errors loading the new node, the old node is not left but stays, avoiding the overlay-becoming-background. Hope this works better. Thanks for the meticulous testing! -Christian |