Cannot find the "Buffer"


#1

Use Case:
Open a file in Atom.
Search the open file for a string.

I have seen software that has a find function for this.

In Atom, the find feature has a relationship to something called “Buffer

I just want to look in the open file, not the buffer.

Also, what is the buffer?


#2

The buffer contains the text of the open file.


#3

Sorry for the brevity of my previous answer. I believe I was short on time. I should have added that, if you want to take a look at how Atom implements the TextBuffer object, which is its internal implementation of a buffer to hold the file in memory (which is the proper computer sciencey term for an open text document), by opening the developer tools (View -> Developer -> Toggle developer tools), going to Console, and entering atom.workspace.getActiveTextEditor().buffer. That will produce a representation of all the properties of the TextBuffer object, and you can browse around in it and see where your text is stored.