#6971
zhouzh2
Participant

Hi,
Emeditor has “tabs to spaces” function.
just for fun, I write a macro for a smart del feature:

//SmartTab4python by zhouzh2
document.selection.CharLeft(true,1);
document.selection.CharLeft(true,1);
document.selection.CharLeft(true,1);
document.selection.CharLeft(true,1);
if (document.selection.Text == " ")
{
document.selection.Delete(1);
}
else
{
document.selection.CharRight(false,1);
document.selection.DeleteLeft(1);
}

assign “backspace” to this macro in Python configuration will do what you want.
note this macro works only when a tab means 4 spaces. If not, you can change this macro accordingly.
P.S. It works a little slow, so i think a plug-in should be a better choose.