I have an org file where the majority of the text in the buffer at any one time is folded. I would like to be able to perform a search and replace on only the unfolded lines. For example, I have a file that looks like the below, where Sections A1 through A4 are parent headings to other content, which is currently folded and therefore invisible.
* Section A ** Section A1... ** Section A2... ** Section A3... ** Section A4...
I want to be able to select, say, sections A2 and A3 and append some text to just those lines, not any of the child content of those nodes.
After operation (text expanded for illustration only)
* Section A ** Section A1... ** Section A2 <appended text> *** Foo ** Section A3 <appended text> *** Foo ** Section A4...
All the search and replaces methods I have tried so far also apply the replacement on the child content (the Foo lines here), which is not the behaviour I desire.