Today when programming at work I wanted to do some refactoring. The task I wanted to do was copying constants and expressions from if statements into a data structure, like this
if BLA == 10:
retval = an_class(BLA,
12,
13)
into
d = {BLA: an_object(BLA, 12, 13)}
Around 20 such copying, pasting, editing, a mundane task indeed, I thought I could do better by utilizing macro recording. I did this. I marked BLA with the mouse and copied it, marked an_object(BLA, 12, 13) and copied it. Moved the cursor to where the data structure should be located and started macro recording CTRL-X (
choose showing clipboards CTRL-Shift V
one step down and enter to paste BLA
type " : "
CTRL-Shift V and one step down and enter to paste an_object(BLA,
12,
13)
and then select join-lines two times, then stopping macro recording with CTRL-X )
Now I thought I hade a macro so that I "only" needed to copy two things and then place the cursor to quickly paste and reformat. It didn't work. It seems Slickedit cannot handle selecting from history of clipboard, and it cannot use join-lines in a macro. How would you have recorded this, if possible?