I received some help in another thread here for setting an Atom editor setting via code, however, I’m experiencing some pretty erratic bugginess now. I’ve been over everything numerous times and can’t seem to find what it could be. I’m not sure of this is my fault (something I’m not doing correctly), or that quickly changing preferences through code on the fly is something Atom can’t handle well. I’m betting on the first. Basically, I’m changing the editors preferred line length. The user is able to set an array of values for their preferred line length and then perform a key command to cycle through the values in the array (they just get set to the editor’s preferred line length setting). The bugginess is eally easy to tell if you are using wrap-guide as a visual. When switching settings through the package, the wrap guide will often flicker between two settings before fully taking on the new setting. Once in a blue moon, it will get endlessly stuck in a state of flickering between two states, and in time with the cursor blink rate (weird!). Other times, atom will ask to restart. I really don’t feel as im writing any dangerous code or asking too much of Atom, but I’m not certain.
Would anyone be kind enough to take a look and see if they spot anything super wrong here? The package is very stripped and only has a tiny bit of code that actually executes (around 10 lines of code in changePreferredLineLength()):
This is a package I’ve been really wanting to make for myself, really hoping to find the culprit to the bugginess of changing editor settings.