Your comments

So, as I mentioned `auto_indent` — here is an obvious workaround for this bug: wrapping the inserting and erasing characters with

view.settings().set("auto_indent",False)

and

view.settings().set("auto_indent",True)

fixes this bug, however in your plugin you should cache the current state of this settings like this:

current_auto_indent = self.view.settings().get("auto_indent")
self.view.settings().set("auto_indent",False)
# Your code that messing up with the whitespaces
self.view.settings().set("auto_indent",current_auto_indent)

Yeah, I stumbled upon this bug too — when you have a mirrored tabstop with replacement and another tabstop right next to it, then this tabstop won't work. The only solution that I found is to insert something between them, like a space character, but that could be possible for just a few cases.