         if elt.length > 0
             elt.show()
             cm = e.data('cm')
+            currently_focused_editor = cm
             cm.focus()
             e.addClass('webapp-task-editing-desc')
             # apply any changes

        e = task.element
        if not e?
            return
        if e.hasClass('webapp-task-editing-desc') and e.data('cm')?
            e.data('cm').focus()
            return
        e.find(".webapp-task-desc").addClass('webapp-task-desc-editing')
        e.find(".webapp-task-toggle-icons").hide()

        # (unless there are incoming sync updates to process).
        cm.on 'changes', underscore.debounce(sync_desc, 2000)

        # NOTE: calling cm.focus() does NOT cause this 'focus' below to get called always, at least
        # not on ipad.  So... that's why we explicitly set currently_focused_editor in various
        # places above too.
        cm.on 'focus', () ->
            currently_focused_editor = cm
            $(cm.getWrapperElement()).addClass('webapp-new-task-cm-editor-focus')

        cm.on 'blur', () ->
            $(cm.getWrapperElement()).removeClass('webapp-new-task-cm-editor-focus')
            if currently_focused_editor?.task_id == task.task_id
                currently_focused_editor = undefined

        cm.focus()
        if cursor_at_end
