Subject: preserving indention levels?

From: "James A. Robinson" <[email-masked]>
Date: Wed, 28 Jun 2000 22:33:28 -0500

I've got a question on how to solve an editing problem.
When one has code that is indented at various levels,
and needs to be replaced with multiple-line blocks, how
does one handle preserving the indention?

For example:

	...
	System.err.println("some annoying debugging but in");
	...
		System.err.println("some other annoying debugging but in");
	...

into

	...
	if (Debug.level(Debug.DEBUG))
	{
		Debug.debug(this, "some annoying debugging but in");
	}
	...
	if (Debug.level(Debug.DEBUG))
	{
		Debug.debug(this, "some other annoying debugging but in");
	}
	...

Is using something like s/^([ 	]+).../...\1\n\1/ the only solution?

Jim