adobe/brackets — pull request #1830 by njx (2012-10-13 00:40:12+00:00)
Title: Fix Document unit test by avoiding creation of master editor if focus is...

... in an inline editor when the status bar requests the cursor position.

The problem was that _updateCursorInfo accessed editor.document.getRange() in order to compute the actual visual column where the cursor was. Calling this API forces the creation of the _masterEditor for the document, which violated an assumption in the unit tests that the master editor for a document wouldn't be created immediately on opening an inline editor for that document. The user-visible effect of this change is to make it so that the cost of creating the backing _masterEditor moves to the point where you open the inline editor, rather than waiting until you actually make an edit. Arguably a minor change, but it seemed best not to change the behavior.

The fix is to factor the logic for calculating the column position into Editor, and having that code call _codeMirror directly to get the range text.