#7639

Yutaka Emura
Keymaster

dw7832 wrote:
I’m currently struggling to set the properties of the active configuration of a file in a macro:

// toggle show spaces
if (document.Config.Mark.ShowSpaces) {
document.Config.Mark.ShowSpaces = false;
} else {
document.Config.Mark.ShowSpaces = true;
}

and

with (document.Config.Indent) {
TabColumns = 4;
InsertSpaces = true;
WrapIndent = true; }
document.Config.Save();

Neither of these give an error message but when alert()-ing the properties they are not changed nor does EmEditor act like they’ve changed. Can anybody shed any light?

Thank you in advance.

Please try this way:


cfg = document.Config;
if (cfg.Mark.ShowSpaces) {
cfg.Mark.ShowSpaces = false;
} else {
cfg.Mark.ShowSpaces = true;
}
cfg.Save();