I guess this method should be synchronized, or at least the call to `new StyleRange`. Otherwise, a different thread might change offset or length behind the scenes, resulting in inconsistent styling.