After giving up on writing this as a macro, I decided to try doing it with JavaScript. The following works, although it is a bit slow.
Before:
After:
Code: Select all
function getpos()
{
pos = 0;
while (UltraEdit.activeDocument.isColNumGt(pos))
{
pos++;
}
return pos;
}
if (typeof(UltraEdit.columnModeOn) == "function") UltraEdit.columnModeOn();
else if (typeof(UltraEdit.activeDocument.columnModeOn) == "function") UltraEdit.activeDocument.columnModeOn();
var longest = 0;
var pos;
var current;
var padding = "";
UltraEdit.activeDocument.top();
UltraEdit.activeDocument.findReplace.find("=");
while (UltraEdit.activeDocument.isFound())
{
current = getpos();
if (current > longest)
{
longest = current;
}
UltraEdit.activeDocument.key("RIGHT ARROW");
UltraEdit.activeDocument.findReplace.find("=");
}
UltraEdit.activeDocument.top();
UltraEdit.activeDocument.findReplace.find("=");
while (UltraEdit.activeDocument.isFound())
{
current = getpos();
padding = "";
for (var i = current; i < longest; i++)
{
padding += " ";
}
UltraEdit.activeDocument.write(padding+"=");
UltraEdit.activeDocument.key("RIGHT ARROW");
UltraEdit.activeDocument.findReplace.find("=");
}
UltraEdit.activeDocument.bottom();
if (typeof(UltraEdit.columnModeOff) == "function") UltraEdit.columnModeOff();
else if (typeof(UltraEdit.activeDocument.columnModeOff) == "function") UltraEdit.activeDocument.columnModeOff();
Code: Select all
suggestion = "no idea what to write here"
xp = "quite a bit"
beginning = "hard"
asdf = 1233
// comment line
asdf2 = skumhest
Code: Select all
suggestion = "no idea what to write here"
xp = "quite a bit"
beginning = "hard"
asdf = 1233
// comment line
asdf2 = skumhest
Regards from Denmark
Dawk
Dawk