Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Multi-line find/replace project-wide (guidance) #824

Closed
thinkyhead opened this issue Dec 5, 2016 · 9 comments
Closed

Multi-line find/replace project-wide (guidance) #824

thinkyhead opened this issue Dec 5, 2016 · 9 comments

Comments

@thinkyhead
Copy link

#398 seems to be stalled. I don't know the language used for this plugin or I would patch it myself. Nevertheless I'd like to give it a shot.

What files, functions, and lines should I focus on to fix this longstanding issue?

It would also be useful to expand the find/replace fields when the contents are multi-line. Where should I look to make that kind of change?

I'd also like to make it work more like Sublime Text (or have the option) so that it opens the files with matches, applies the replace, and leaves them open without saving. Where in the code would I implement such a hook?

Thanks for any guidance you can provide! I'm off to learn as much as I can about Coffeescript.

@50Wliu
Copy link
Contributor

50Wliu commented Dec 5, 2016

This is not an actionable issue so I'm going to close this and suggest that you ask on Slack or Discuss, the official Atom and Electron message board instead.

However, to give you some pointers, I believe the core issue is that Scandal does not support multiline searching as it breaks up the file into individual lines: atom/scandal#5.

I thought expanding the mini-editors already worked by itself if you entered a newline.

The replacing appears to occur here.

Again, I highly suggest that you post on either Slack or Discuss. There's a bunch of active members on both that would be more than willing to help.

@50Wliu 50Wliu closed this as completed Dec 5, 2016
@thinkyhead
Copy link
Author

thinkyhead commented Dec 5, 2016

…suggest that you ask on Slack… members … that would be more than willing to help

Thanks, I will seek out the willing. Is Scandal an absolute requirement? I know that many Atom users are running with a full GNU shell environment, and it seems like it would be more-or-less "trivial" to make a thin wrapper for GNU utilities like grep, sed, awk, etc. to make a state-of-the-art find-and-replace.

I thought expanding the mini-editors already worked by itself if you entered a newline.

Not with Command-E, apparently. Just tested, and no. "Newline" initiates Find. The usual shortcuts (shift-Return, Alt-Return) don't insert a newline either.

Anyway, I will see what I can do through Slack, etc. I know there are a great many users who would love to have this solved.

@Ben3eeE
Copy link
Contributor

Ben3eeE commented Dec 5, 2016

Just tested, and no. "Newline" initiates Find. The usual shortcuts (shift-Return, Alt-Return) don't insert a newline either.

What is supported is expanding for multiple lines if you paste multiple lines into the field. We have an open issue for adding newlines with the keyboard here #396.

@thinkyhead
Copy link
Author

thinkyhead commented Dec 6, 2016

paste

Ah, I will have to start using that, thanks!

EDIT: Hmm, that doesn't work either. Maybe I need to download the beta…?

@Ben3eeE
Copy link
Contributor

Ben3eeE commented Dec 6, 2016

This might be depending on the ui theme. I am using one-dark.

@thinkyhead
Copy link
Author

Aha, good point! I will keep messing with Atom. I like it very much. Although writing plugins for it looks kind of scary. 😨

@Ben3eeE
Copy link
Contributor

Ben3eeE commented Dec 6, 2016

It's not scary just join the slack and ask any questions you might have. Did you check out the flight-manual? It has a great section on hacking atom which describes how to write packages.

@thinkyhead
Copy link
Author

I've been reading the flight manual, and it's very helpful, thanks! CoffeeScript looks cool. I'd've probably learned it sooner, but shortly after I got "CodeKit" (so I could get more into things like SASS and Less) I burned out on web development. But I have good Javascript chops so it's good to know I can implement packages in Javascript while I'm getting the hang of CoffeeScript. I'll definitely get on Slack and ask for help as I go along.

You were right about the theme. "Seti" doesn't expand the fields. Of course, soon I should be able to hack it to do whatever I want.

Thanks again!

— Scott out

@marnen
Copy link

marnen commented Dec 22, 2016

@thinkyhead If you're good at JavaScript, CoffeeScript will take you about 10 minutes to learn. :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants