<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[ViEmu Forums - Macro recursion causes VS to die]]></title>
		<link>http://www.viemu.com/forum/viewtopic.php?id=1625</link>
		<description><![CDATA[The most recent posts in Macro recursion causes VS to die.]]></description>
		<lastBuildDate>Mon, 08 Nov 2010 01:38:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Macro recursion causes VS to die]]></title>
			<link>http://www.viemu.com/forum/viewtopic.php?pid=6199#p6199</link>
			<description><![CDATA[<p>Any ETA on when the Ctrl-C to stop a running macro will be added ... I did the same thing as davydm</p>]]></description>
			<author><![CDATA[dummy@example.com (TaffyDownUnder)]]></author>
			<pubDate>Mon, 08 Nov 2010 01:38:18 +0000</pubDate>
			<guid>http://www.viemu.com/forum/viewtopic.php?pid=6199#p6199</guid>
		</item>
		<item>
			<title><![CDATA[Re: Macro recursion causes VS to die]]></title>
			<link>http://www.viemu.com/forum/viewtopic.php?pid=5424#p5424</link>
			<description><![CDATA[<p>Davyd, indeed, this is in the TO-DO list, and I plan to do all of protecting from the infinite recursion, forcing breaking-out when reaching end of file, and allowing Ctrl-C to stop such a repetition. Will post here when it&#039;s ready in a future version.</p>]]></description>
			<author><![CDATA[dummy@example.com (Jon_Symnum)]]></author>
			<pubDate>Mon, 27 Sep 2010 14:25:29 +0000</pubDate>
			<guid>http://www.viemu.com/forum/viewtopic.php?pid=5424#p5424</guid>
		</item>
		<item>
			<title><![CDATA[Re: Macro recursion causes VS to die]]></title>
			<link>http://www.viemu.com/forum/viewtopic.php?pid=3977#p3977</link>
			<description><![CDATA[<p>Ok, so I know this is my fault for it coming up -- but it was by accident, honest! (:</p><p>Whilst recording a macro (named &#039;a&#039;), I accidentally included the keystrokes &#039;@a&#039;. So when I had finally pressed &#039;q&#039; and then tried to play the macro, VS consumed 100% cpu, locked up. Had to kill it and lose what I hadn&#039;t saved (not much, since I&#039;m a nervous saver!).</p><p>Now, I notice that I can do the same in VIM -- the only difference being that ctrl-c in VIM stops the macro execution. I can&#039;t get out of the tight loop in ViEmu. Whilst the recursion was an error on my part, I can see where it might be useful to have some kind of recursion -- for example, doing something a large number of times where the user hasn&#039;t figured out exactly how many times to do it, but will rather just watch until it is done. Of course, this requirement would imply a requirement for a break key.</p><p>So, there are 3 strategies that I can see to cope with this:<br />1) Don&#039;t allow calling macros from within macros -- not ideal and probably inconvenient for someone<br />2) Don&#039;t allow a macro to call itself -- probably not that inconvenient, but how to you guard against macro a which calls b which calls c which calls a? You&#039;d need to maintain some kind of call stack and traverse upwards at every macro call to check for circular references. Ouch.<br />3) Simpler, but introduces (perhaps) a slowdown in chained macros: accept a break key (something like a ctrl-C) and check for the break key having been pressed before entering any macro. This would also imply not taking over the event loop from VS -- I&#039;m not sure how close ViEmu is tied into that.</p>]]></description>
			<author><![CDATA[dummy@example.com (davydm)]]></author>
			<pubDate>Tue, 25 May 2010 06:39:34 +0000</pubDate>
			<guid>http://www.viemu.com/forum/viewtopic.php?pid=3977#p3977</guid>
		</item>
	</channel>
</rss>
