marijnh/CodeMirror — pull request #1666 by twiss (2013-07-10 20:06:05+00:00)
Title: Fix selecting the start of a bidi line

Hi Marijn,
To reproduce this bug, go to http://codemirror.net/demo/bidi.html and create a selection starting or ending on the left of a bidi line (e.g. from Pos(5, 8) to Pos(10, 0)). drawForLine throws an error because iterateBidiSections is never called, because the selection on that line is empty. Additionally, if the first selection you make triggers this (start on the left), the selected text is removed by readInput, because resetInput & selectInput never got called.