I’m trying to change an Atom setting via code, but I can’t seem to figure it out. I’m trying to change the Preferred Line Length setting. Here’s the code I’m currently running.
let editor = atom.workspace.getActiveTextEditor()
editor.preferredLineLength = 80;
console.log (editor.preferredLineLength);
Now, the console outputs the value 80 (even if the setting wasn’t set to 80 before), so it seems as if it is changing the value, however, nothing in the editor actually changes. When I check the settings page, the Preferred Line Length hasn’t changed. I’m not sure what I’m doing incorrectly.
Any help is much appreciated.