   setPrompt: (text='') ->
     if @editor.getLastBufferRow() is 0
       text += "\n"
-
-    range = null
-    @withIgnoreChange =>
-      range = @editor.setTextInBufferRange(@getPromptRange(0), text)
+    range = @editor.setTextInBufferRange(@getPromptRange(0), text)
     range
 
   setSyncToEditor: (editor) ->


  syncToEditor: (editor) ->
    return if @preventSyncToEditor
    return if @isActive() # Prevent UI cursor from being moved while UI is active.
    if item = @findClosestItemForEditor(editor)
      @selectItem(item)
      @moveToSelectedItem() unless @isActive()

          # Destroy cursors on prompt to protect query from mutation on 'find-and-replace:select-all'( cmd-alt-g ).
          for selection in @editor.getSelections() when onPrompt(selection.getBufferRange())
            selection.destroy()
          @withIgnoreChange =>
            @setPrompt(@lastNarrowQuery) # Recover query
        else
          @refresh().then =>
            if @autoPreviewOnQueryChange and @isActive()
