Quantcast
Channel: Jason Andrews Blog
Viewing all articles
Browse latest Browse all 33813

RE: bindkey to toggle between leHiMarkNet() and leHiUnmarkNet()

$
0
0
The code works for me, although it probably makes more sense to be: procedure(CCFtoggleMarkNet() if(hiGetCurrentWindow()~>markedNets then hiGetCurrentWindow()~>markedNets = nil printf("MARK NET FLAG=%L\n" hiGetCurrentWindow()~>markedNets) leHiUnmarkNetAll() else hiGetCurrentWindow()~>markedNets = t printf("MARK NET FLAG=%L\n" hiGetCurrentWindow()~>markedNets) leHiMarkNet() ) ) (i.e. the mark and unmark net swapped around) because otherwise it starts in the wrong state. The markedNets property on the window is being set correctly - I can't really see how it would not do that because this kind of thing works all the time. See what the above outputs for me: CCFtoggleMarkNet() MARK NET FLAG=nil CCFtoggleMarkNet() MARK NET FLAG=t CCFtoggleMarkNet() MARK NET FLAG=nil CCFtoggleMarkNet() MARK NET FLAG=t CCFtoggleMarkNet() MARK NET FLAG=nil You asked before about getting the "previous cmd used" - well there isn't really such a concept. You can find the current command using hiGetCurrentCmd() - useful if you need to find the active command in various places, but knowing what has been run before isn't supported - you'd have to wrap the function in something that recorded which was last used. That's effectively what this flag approach is being used for in the code above. Regards, Andrew.

Viewing all articles
Browse latest Browse all 33813

Trending Articles