       # than once is fine too
       editor = ace.edit('source')
       editor.setTheme 'ace/theme/twilight'
-      ext = args[0]?.split('.')[1]
-      if ext is 'java' or not args[0]?
+      if not args[0]? or args[0].split('.')[1] is 'java'
         JavaMode = require("ace/mode/java").Mode
         editor.getSession().setMode(new JavaMode)
       else

tabComplete = ->
  promptText = controller.promptText()
  args = promptText.split /\s+/
  getCompletions = (args) ->
    if args.length is 1 then commandCompletions args[0]
    else if args[0] is 'time' then getCompletions(args[1..])
    else fileNameCompletions args[0], args
  prefix = longestCommmonPrefix(getCompletions(args))
  return if prefix == ''  # TODO: if we're tab-completing a blank, show all options
  # delete existing text so we can do case correction
  promptText = promptText.substr(0, promptText.length - util.last(args).length)
  controller.promptText(promptText + prefix)

commandCompletions = (cmd) ->
  (name for name, handler of commands when name.substr(0, cmd.length) is cmd)

fileNameCompletions = (cmd, args) ->
  validExtension = (fname) ->

  new ClassData.ReferenceClassData(bytes_array)

onResize = ->
  h = $(window).height() * 0.7
  $('#console').height(h)
  $('#source').height(h)

$(window).resize(onResize)

