     {range: found, whichIsHead: 'end'}
 
   getRange: (selection) ->
-    unless pattern = @globalState.get('lastSearchPattern')
-      return null
+    pattern = @globalState.get('lastSearchPattern')
+    return unless pattern?
 
     fromPoint = selection.getHeadBufferPosition()
     {range, whichIsHead} = @findMatch(fromPoint, pattern)


  getPointToSearchFrom: (selection, searchFrom) ->
    switch searchFrom
      when 'head' then swrap(selection).getNormalizedBufferPosition()
      when 'start' then swrap(selection).getBufferPositionFor('start')

  # Allow override @allowForwarding by 2nd argument.


  stopSelection: ->
    @canSelect = false

  getNormalizedHeadBufferPosition: (selection) ->
    head = selection.getHeadBufferPosition()
