           cm.replaceRange s, {line: l, ch: 0}, {line: l, ch: cm.getLine(l).length}, 'D'
       return
     LN: -> # Toggle Line Numbers
-      v = !!if opts.debugger then prefs.lineNumbersInDebugger.toggle() else prefs.lineNumbersInEditor.toggle()
+      v = !!if isDebugger then prefs.lineNumbersInDebugger.toggle() else prefs.lineNumbersInEditor.toggle()
       cm.setOption 'lineNumbers', v; $tb.find('.tb-LN:visible').toggleClass 'pressed', v; return
     PV: -> search true; return # Previous
     NX: -> search(); return # Next

        cm.setCursor line: l, ch: 0
      return
    WI: opts.weakInterrupt
    ER: -> (if opts.debugger then emit 'RunCurrentLine', win: id else cm.execCommand 'newlineAndIndent'); return
    BH: -> emit 'ContinueTrace',  win: id; return # Run to exit (in tracer)
    RM: -> emit 'Continue',       win: id; return # Resume execution (in tracer)
    MA: -> emit 'RestartThreads', win: id; return # Resume all threads (in tracer)

module.exports = (e, opts) -> # opts contains callbacks to ide.coffee
  {id, emit} = opts
  ($e = $ e).html editorHTML
  isDebugger = opts.debugger
  volatileLine = null # the line number of the empty line inserted when cursor is at eof and you press <down>

  cm = CodeMirror $e.find('.cm')[0],
