Issues with find an replace automatically searching

Hello all,

I’ve started using Atom on Windows, coming from Notepad++.

I’ve noticed that find and replace always automatically searches any file I switch to using the last entered search patter.

real world example :

I search for (-+.*? ) in order to replace with \n$1. This works fine on the current file that has 10 lines
I then switch to another file with 1k+ lines and I get hit by a lag. The find and replace window shows a new number of “matches”, indicated that it searched the file again, without me hitting find, F3, Alt+Enter etc.

Is there any way around this behavior? Note that I’m not talking about how many characters are needed to be entered before it starts highlighting, which I’ve switched to 50 to force it to stop.

What you are complaining about is very valid - in my view.
Consider making a formal request at the Github project.
(https://github.com/atom/find-and-replace)

May I interest you in is a hack?
Add the code below into your init.coffee file.
(https://flight-manual.atom.io/hacking-atom/sections/the-init-file/)

# ****************************************************
#   CLEAR SEARCH FIELD WHEN EDITOR CHANGES
# ****************************************************
atom.workspace.onDidChangeActiveTextEditor =>
  return unless panels = atom.workspace.getBottomPanels()
  for panel in panels
    if (panel.getItem().constructor.name == "FindView")
      panel.hide()
      panel.getItem().findBuffer.setText("")

The code is executed when you change between editor views. The find-and-replace is closed and the previous search text is deleted.

Be warned - this is a HACK using references that is suppose to be private. (I am expecting & hoping guys will chime in to give pros-and-cons.) Though I have to also say that I consider leaving this in my own init-file.

Hey snoop,

Thanks for the hack, I’ll give it a try though I’d rather not lose my search.
The weird thing is that I was looking into similar issues and went through a couple of “fixed” bug reports from 2015, where users were also complaining about this “feature”.

I’m unfortunately finding that Atom, while pretty, breaks my workflow a bit too much.

The script can be customized to only suit big files. Whitelist or blacklist as you want.

At some point I had a Python extension on my Notepad++ to expand functionalities of the text editor. Customizing behaviours on Atom is much better than that.

I still use Notepad++ for some tasks. For one the PERL way of handling regular expressions makes find-replace a potent tool. These are tools. Your choice what works best. My work-flow relies on more than one tool (even includes spreadsheets!) and I am okay with that.

Think about experimenting with Atom and see what you can do better there, without thinking of replacing Notepad++. You may want to create a GUI button on the interface or context menu item that starts some of those replace tasks you talk about. No need for going through the find-and-replace.

Have a look at https://github.com/morassman/process-palette for another idea on making regular tasks from a push of a button.

Hey snoop,

Thanks for the helpful info.

It’s pretty obvious that Atom was built with easy extensibility in mind, I’ve already hunted down some plugins to emulate functionality of Notepad++, like find-list, and I really like that.

Work-flow habit is not always a good thing, sometimes you learn and get used to the wrong way and then find the proper way breaking, so I am trying to give Atom a fair chance.