When the buffer has only one line, pressing 'dd' causes CodeMirror to throw an error "There is no line -1".