atom / find-and-replace

Find and replace in a single buffer and in the project
MIT License
242 stars 197 forks source link

Find and replace only in open tabs #241

Open ghost opened 10 years ago

ghost commented 10 years ago

How to Find and replace only in open tabs?

izuzak commented 10 years ago

Not possible at the moment, I believe, but sounds like a neat idea for an enhancement.

ghost commented 10 years ago

@izuzak thanks.

brentonstrine commented 9 years ago

This would be really helpful, and is a make-or-break feature for a serious code editor.

Sometimes you want to do a search/replace on a set of files that can't be identified only by directory or file extension. Right now my workaround is to move all the files I want to modify into a directory, then do the search/replace in that directory, then move them back to their original locations. Obviously this is not a good solution!

slowpoison commented 8 years ago

@izuzak any update on this? Does the API not allow this?

vitorhsb commented 8 years ago

This would be a great enhancement. Sublime Text has built-in Open files search via '' and/or '' file/directory pattern.

ercmcd commented 8 years ago

Any information on what it would take to start working on this as an enhancement to the existing find feature?

tati commented 8 years ago

:+1: this would be super helpful

jamesalley commented 8 years ago

Yes please. I'm missing this feature.

skoshy commented 8 years ago

Looks like this package for Atom incorporates Finding in Open Files, but it's tailored for TODO items. Maybe the code might be useful? https://github.com/mrodalgaard/atom-todo-show

ocssor commented 8 years ago

Any update on this? Would be extremely useful.

hjess commented 8 years ago

+1 (+1 +1 +1 ) This is one of my most-used features on Sublime, and most-missed in my switchover to Atom.

brentonstrine commented 8 years ago

@hjess this single feature (find&replace across multiple files--be it open tabs or whatnot) has been responsible for me switching from Atom to Sublime. I've been waiting since 2014 and haven't seen any action to prioritize this or even respond to comments asking for updates. Seems indicative of a larger problem with the software development if a hugely important feature that's regularly commented on gets completely ignored for years.

winstliu commented 8 years ago

@brentonstrine There have been no updates on this, so we haven't provided any.

In addition, "hugely important" is very subjective here - you may use it often, but I haven't ever had the need for this feature yet.

As always though, PRs are always welcome. Sorry I can't comment more on what's needed to implement this, but I don't have much experience with the find-and-replace code (@benogle might know more).

brentonstrine commented 8 years ago

It would be interesting to do a poll of current users asking what missing features they think are most important. I'd bet find/replace across multiple files would be near the top. Maybe I'm wrong.

nskaggs commented 8 years ago

I hate to chime in and provide anecdotals, but Find/Replace is a bit lacking overall in atom. I expected to be able to find/replace in my current file, and all open tabs. Find/replace across project is cool and interesting too, but not something I expected to be provided.

The other oddity was the lack of a Find All; that is to say a buffer containing inline previews of every match. I see there's already #568 and #569 for that, so it's noted as well.

lee-dohm commented 8 years ago

@brentonstrine The most common feedback we get from people is that Atom's performance is what they would like to see fixed the most. Because of this feedback performance has been a huge priority for the team.

echantigny commented 8 years ago

I'm adding my voice to ask for this feature. I'm in need of it right now and is really missing. I need to update a term in a certain batch of files, but not all of them. Being able to do it in all opened files would be greatly appreciated since it is a feature in most, if not all, other code software I've used.

I think it's the only one missing. Search in Project and Directory/Folder are already present.

almadsen commented 8 years ago

Not just to keep the "thread" alive, I'm also one for have been using this before the switch from sublime and it's sourly missed.

And guess I don't have to explain why, just agree with above writers.

jijojv commented 8 years ago

bummer this is such a critical feature that i need to switch from sublime.

jefferyyuan commented 8 years ago

Please implement this - it's a simple task that can benefit a lot of people. So why not just implement it?

winstliu commented 8 years ago

Please implement this - it's a simple task that can benefit a lot of people. So why not just implement it?

No one from the Atom team has had time to yet. But that's where the community comes in! If this is indeed a "simple task" to implement, please feel free to do so and send a PR! I'll be labeling this issue as help-wanted.

menocomp commented 8 years ago

that would be really nice if this option is added.

ghost commented 8 years ago

Should we do this like ST3 where the filter is in with the file pattern? e.g. *.js, <open files>

Or does anyone have a better suggestion? If the above is acceptable, does anyone have an icon suggestion? :)

ghost commented 8 years ago

Mock, thoughts? I'll take this if we can agree on a direction :)

image

echantigny commented 8 years ago

So, if I understand this correctly, pushing the "Open files" button would activate the search through all open files. Is it a "toggle" button?

If it is, that sounds great to me!

ghost commented 8 years ago

A switch button would be great : "project" or "opened buffers" near [.*] [Aa] [Whole word] which keeps its state

fractalbrain commented 8 years ago

I'm joining the "want find in open files" train :-). I use that rather heavily in my workflow.

trevdor commented 8 years ago
openfilessearch

I have this working on my local Atom, but I've run into a problem I'd like your feedback on:

Open files that aren't in the current project break my implementation. Since "Project Find" is powered by atom.workspace.scan, files outside the current workspace can't be searched. (Right now having one of these files open breaks my "open files" search entirely, but I should be able to address that.)

Do I...

  1. Try to add these files to the workspace for the duration of the search?
  2. Ignore these files and warn the user that some open files can't be searched? (That seems like a huge disappointment, at least for how I'd use this feature.)
  3. Use some path-based whole-filesystem search Atom has that I'm unaware of?

Any suggestions are welcome, even if just about my icon choice or placement.

neromaki commented 8 years ago

Did this make any progress @trevdor?

Would really like this feature!

trevdor commented 8 years ago

@neromaki, I got it demoable for our hack week at work, but I don't like a few of my implementation details nor some edge case behaviors. And naturally, I haven't written tests yet. :)

I'll tidy up my work and post a PR so I can get some feedback from folks who know the project better than I do.

:EDIT: Time to work on this is tight. Better to get feedback, THEN tidy. PR is up. I tried to explain all the known issues I can think of.

danchoe commented 7 years ago

++ this feature

Overload119 commented 7 years ago

++1

billwritescode commented 7 years ago

This feature would be great!

marcelodavanzo commented 7 years ago

+1 this would be amazing!

seansmyth commented 7 years ago

+1

dsturm commented 7 years ago

+1

nathere commented 7 years ago

+1.

coluccini commented 7 years ago

+1

davidlt commented 7 years ago

+1, missed this feature from Sublime Text 3

AStupidBear commented 7 years ago

+1

lee-dohm commented 7 years ago

Thanks everyone for the feedback. We agree that this is would be a great feature to have. Unfortunately, there are higher priorities than this no matter how many people add +1 comments. This is why we've added the help-wanted label. If people want this feature, we would be very happy to take a look at a well-designed pull request. You're welcome to add reactions but any further +1 comments will be deleted and if we continue to receive +1 comments after that, the issue will have to be locked.

trevdor commented 7 years ago

@lee-dohm Could I get someone who knows the project to comment on https://github.com/trevdor/find-and-replace/pull/1, please? I would love to submit a well-designed pull request that's more ready to merge, but I could really use some feedback on my general direction. Happy to change course entirely if that's best.

shikkaba commented 7 years ago

+1 please.

Being able to search for more than one line without regex would be awesome as well.

kingofkosmos commented 7 years ago

You're welcome to add reactions but any further +1 comments will be deleted and if we continue to receive +1 comments after that, the issue will have to be locked.

That was just 8 comments above yours. C'mon man.

trevdor commented 7 years ago

Apologies for the commit spam above. Didn't realize it does that.

I've got a branch that adds this feature, but it's been languishing a bit so I'd appreciate some help to get it ready to PR. I can open a for-review-only PR if that's the easiest way to comment on my changes.

TODO:

Questions for the maintainers:

winstliu commented 7 years ago

I can open a for-review-only PR if that's the easiest way to comment on my changes.

Yes please!

Is it ok that "Find in Open Files" shares "Project Find"'s results view?

I think this is fine until support is added for separate result views.

Which shortcut keys should this feature use?

None. We're trying to avoid new keybindings, and anyone who uses this feature frequently can always create their own keybindings.

trevdor commented 7 years ago

Took the keybindings out and posted a PR for review, @50Wliu. Thanks for looking.

d-packs commented 6 years ago

hi Trevdor, any update? i guess i'll just hit wine+notepad++ for this feature for the cases where i need it, but having it finally in Atom would be awesome.

trevdor commented 6 years ago

No changes since October. If anyone can help me troubleshoot what's wrong with the setup for my tests (borrowed from project-find-view.spec.js), I have (nearly?) all the functionality working but still have 34 failing tests. See the PR above.

My hunch is I'm not opening buffers properly in the test setup. project-find-view didn't need more than one open tab but open-files-find-view is pretty useless without a couple.

winstliu commented 6 years ago

@trevdor I'm pretty busy right now but when I can I'll try to take a look.