marijnh/CodeMirror2 — Issue #308: Marked Text gets "corrupted" when there is a matching bracket
Author: aadsm
Created: 2011-12-30 00:50:47+00:00
State: open

Conditions to reproduce:
- A change in the text while a CodeMirror-matchingbracket is active (e.g.: cursor next to a bracket and then input some spaces).
- A marked text that is going to be affected by this change (e.g.: it's on the same line and after the matching bracket).

Under these conditions the markedText.find().from.ch is no longer updated to point to the same character at the time of creation of the marked text.

Here's a page where the issue can be reproduced: https://gist.github.com/1536976

Steps:
1) Cursor at the beginning of the line (the bracket is highlighted to green)
2) Press a space
3) The marked text is now ("here's a si) instead of the original (here's a sim)
4) Press one or more spaces
5) Press backspace
6) The entire marked text is gone.

If matchBrackets is set to false then the issue is gone.