       'cursor-history:clear',
     ]
     shouldSaveLocation = (type, target) ->
-      if (':' in type) and (editor = target.getModel?()) and editor.getURI?()
-        true
-      else
-        false
+      (':' in type) and target.getModel?()?.getURI?()?
 
     locationStack = []
     saveLocation = _.debounce (type, target) ->

  jump: (direction, withinEditor=false) ->
    return unless editor = atom.workspace.getActiveTextEditor()
    forURI = if withinEditor then editor.getURI() else null
    needToSave = direction is 'prev' and @history.isIndexAtHead()
    unless entry = @history.get(direction, URI: forURI)
      return


      saveLocation(type, target)

    @subscriptions.add atom.commands.onDidDispatch ({type, target}) =>
      return if type in ignoreCommands
      return if locationStack.length is 0
      return unless shouldSaveLocation(type, target)
      # debug "DidDispatch: #{type}"
      delay 100, =>
