C0D312 wrote:Jon, I just spent the past 20 minutes trying to figure out why the regions I added to the view using view.add_regions where not staying in the same order I added them. Then I realized that Sublime Text is sorting them. Is this necessary? I would like to keep them in the same order I add them in.
Thanks.
The only real way to accomplish what you want is to give regions individual ordered names and keep track of your count. Then you can track them. Issues arise thought when you start doing "undo/redo" operations. If you toggle to readonly mode you are safe, but then you cannot edit things. Depending on the plugin, this might be sufficient if you right before editing the plugin toggles you back into edit mode and then back into readonly mode. After you are done dealing with regions, you can go back to edit mode. But if you want to be able to allow editing and track individual regions, this becomes difficult because "undo/redo" can bring back deleted and forgotten regions.