title: CodeMirror - Check if cursor is at end of line
body: <p>I set readonly lines in my editor this way:</p>
  
  <pre><code>editor.on('beforeChange', function(cm, change) {
      if (~readOnlyLines.indexOf(change.from.line)) {
          change.cancel();
      }
  }
  </code></pre>
  
  <p>Where readOnlyLines is an array containing numbers of the lines to be readonly.</p>
  
  <p>The problem is that when I am on an editable row with a readonly one below, if I press "Del" the readonly row comes upside and I can edit it.</p>
  
  <p>The same doesn't work if I have a readonly row above and I press "BackSpace".</p>
  
  <p>I think I should add an if that checks if at the same time:</p>
  
  <ol>
  <li>Del is pressed (I used a catch event)</li>
  <li>The line below is readonly (I did it the same way I did with the if in the code above)</li>
  <li><strong>The cursor is at the end of line</strong> (Does a specific function exist?)</li>
  </ol>