   cm.dyalogCommands =
     ED: -> emit 'Edit', win: id, text: cm.getValue(), pos: cm.indexFromPos cm.getCursor(); return
     QT: -> emit 'CloseWindow', win: id; return
-    BK: -> (if opts.debugger then emit 'TraceBackward', win: id else cm.execCommand 'undo'); return # Backward or Undo
-    FD: -> (if opts.debugger then emit 'TraceForward', win: id else cm.execCommand 'redo'); return # Forward or Redo
+    BK: -> (if isDebugger then emit 'TraceBackward', win: id else cm.execCommand 'undo'); return # Backward or Undo
+    FD: -> (if isDebugger then emit 'TraceForward', win: id else cm.execCommand 'redo'); return # Forward or Redo
     SC: -> $tb.find('.tb-search:visible').focus(); return # Search
     EP: -> # Exit (and save changes)
       v = cm.getValue()

    return

  setDebugger = (x) ->
    opts.debugger = x; $('.debugger-toolbar', $e).toggle x; $('.editor-toolbar', $e).toggle !x
    cm.setOption 'readOnly', x; $('.CodeMirror', $e).toggleClass 'debugger', x; highlight null
    ln = !!if opts.debugger then prefs.lineNumbersInDebugger() else prefs.lineNumbersInEditor()
    cm.setOption 'lineNumbers', ln; $tb.find('.tb-LN:visible').toggleClass 'pressed', ln; return
  setDebugger !!opts.debugger

  scrollCursorIntoProminentView = -> # approximately to 1/3 of editor height; this might not work near the top or bottom
    h = $e.height(); {left, top} = cm.cursorCoords true, 'local'

          cm.replaceRange s, {line: l, ch: 0}, {line: l, ch: cm.getLine(l).length}, 'D'
      return
    LN: -> # Toggle Line Numbers
      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
