Indenting wrapped text that contains tabs (bug in demo?)

I’ve posted a bug to the issue tracker already, but no reply so far, and so I thought I’d hop on the forum to see if anyone has dealt with this before.

There’s more details in the bug report, but the quick summary is that the indentwrap demo has trouble with tab characters. Try adding some spaces to the start of the line in this demo:

https://jsbin.com/fosudaqone/edit?html,output

Here’s what happens for me:

Mainly I’m wondering if anyone has any clues about how I might debug this, or ideas about how solvable it is? Marijn mention in the original issue (where the indentwrap demo was born) that it was a bit of a “hacky” solution, so I’m wondering if this is related to the hackiness, or some deeper problem with CodeMirror.

As mentioned in the bug report, I’ve tried versions of CodeMirror going back to 4.0.3, so this doesn’t seem to be a result of a recently-introduced bug in the library. I’m guessing the indentwrap demo has always had this bug/behavior.

Any idea what’s going on here?

Thanks!