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

use-selection workflow is disruptive, unwieldy #332

Closed
clhynfield opened this issue Dec 19, 2014 · 17 comments
Closed

use-selection workflow is disruptive, unwieldy #332

clhynfield opened this issue Dec 19, 2014 · 17 comments

Comments

@clhynfield
Copy link

Using keyboard shortcuts in other editors to set Find pattern, select next/all, and replace is smooth and efficient — select text, ⌘E, ⌘⌃G, and type to replace:

sublime-use-selection

In Atom, use-selection-as-find-pattern brings up the find panel, requiring the user to dismiss it or switch focus back to the editor before using select-next or select-all keyboard shortcuts:

atom-use-selection

Showing the panel is right for ⌘F, and grabbing the current selection as the find pattern on show is a handy default action, but for a sleek use-selection and select next/all workflow, there's got to be a smoother way.

clhynfield added a commit to clhynfield/find-and-replace that referenced this issue Dec 19, 2014
use-selection-as-find-pattern still does what it says on the tin, but much
more efficiently for keyboard users. Fixes atom#332.
@izuzak
Copy link
Contributor

izuzak commented Feb 12, 2015

@clhynfield I'm able to do this without showing the panel. Here's a gif:

select

Does that help?

clhynfield added a commit to clhynfield/find-and-replace that referenced this issue Feb 15, 2015
use-selection-as-find-pattern still does what it says on the tin, but much
more efficiently for keyboard users. Fixes atom#332.
@clhynfield
Copy link
Author

Thanks, @izuzak, that does help a bit—I didn't know you could find all occurrences without setting the find pattern. Still, that doesn't work for find-next or find-previous, nor does it add to the find history.

Compare OS X's behavior, in which ⌘E pulls selected text into the global find pattern, without bringing up a find view, and a subsequent ⌘G, even in a different app, will find the next occurrence of that find pattern.

@izuzak
Copy link
Contributor

izuzak commented Feb 22, 2015

@clhynfield You're right. I was just pointing out that there's a better way to do what you did in the GIFs you recorded.

Also, clarifying what exactly is possible and what exactly isn't possible or how exactly it could be improved is always helpful in pushing issues forward. Some users reading the issue don't have the same context as you do and might not know what you said about OS X or other editors in your recent comment. Sharing as many details as possible in the original issue and doing so in a clear way is always helpful. 💙

@schmurfy
Copy link

this is really annoying, I am used to the behavior @clhynfield demonstrated and I find the actual atom behavior really disturbing, the example was maybe not the best but here is what I use cmd+e for:

  • quickly replace a word in multiple lines (cmd+e, cmd+d, type new text)
  • replace all (cmd+e, ctrl+cmd+g, type text)
  • quickly look for all occurences (cmd+e, cmd+g, cmd+g, ...)

With Atom currently this becomes: cmd+e,escape,cmd+g, type text.
What was the idea behind the current behavior ? is there actually someone who finds it ok ?

Edit: fixed shortcut

@d13r
Copy link

d13r commented Nov 6, 2015

I'm looking for the same thing. In Sublime Text I often used ctrl+e, ctrl+g to find the next occurrence - e.g. to skip from a function call to it's definition and back. In Atom I'm finding I always have to press escape to close the find dialog - whereas I've never needed to modify the find pattern at that point, so I don't really need it open. I was hoping for a way to remap ctrl+e to set the find pattern without opening the find dialog, but I can't see that option. (It doesn't have to be the default behaviour, but an option to remap it would be nice.) Thanks!

@benogle
Copy link
Contributor

benogle commented Nov 6, 2015

@davejamesmiller are you commenting on the right issue? You should be able to just hit cmd-g and focus the next occurrence in the editor.

@d13r
Copy link

d13r commented Nov 6, 2015

@benogle I believe I am. I don't have a Mac, but it looks like cmd-g that you refer to is just find-and-replace:find-next (F3 on Windows) that jumps to the next occurrence of the current find pattern. I want to set the find pattern to the text under the cursor with ctrl-e and then jump to the next occurrence (F3). Currently it goes ctrl-e, escape, F3 (or ctrl-e, F3, escape works too). I believe that's the same issue...

@benogle
Copy link
Contributor

benogle commented Nov 6, 2015

So the issue is just that the find panel is open then? The editor is focused after hitting F3, right? So you are hitting escape to get the panel out of the visual field, not because you need to in order to focus the editor, correct?

@d13r
Copy link

d13r commented Nov 7, 2015

Yes, that's correct.

@schmurfy
Copy link

so... any chance we can get an option to set the behavior we want ? I don't care which is the default just please let us choose.

@holzenburg
Copy link

A year has passed and this is still an issue – and one that makes me thinking of switching back daily. It hurts my flow badly. @clhynfield's fix looks simple enough, and wrapping that into an option is a good idea. Please consider this again.

@schmurfy
Copy link

for me I just stay with sublime text 2 for now, I have atom installed aside but almost does not use it.

@schmurfy
Copy link

schmurfy commented Jul 4, 2016

since this issue is not going anywhere I tried another strategy but failed: how can I run my own fork of a core atom package ? I tried apm develop find-and-replace, after a reload the package shows in development package but changing anything in it does not change the behavior, it looks like atom still use its own version...
Also if I disable the core package it disables the development one too, it seems to consider them as the same :(

@frantic
Copy link

frantic commented Jul 4, 2016

@schmurfy have you tried launching atom with --dev flag?

@schmurfy
Copy link

schmurfy commented Jul 5, 2016

I would prefer a way which does not require using dev mode.

vjeux added a commit to vjeux/find-and-replace that referenced this issue Oct 15, 2016
There's a long standing issue where cmd-e shows the find panel where it shouldn't: atom#332

This pull request prevents the find panel from showing.

Test Plan:

1) Click on `new`
2) Press `cmd-e`, note that there is no visual feedback
3) Press `cmd-g` multiple times to go through occurrences

See the behavior in Sublime:
![](http://g.recordit.co/Iwt3rimsQM.gif)

In Atom with this pull request:
![](http://g.recordit.co/HMtN1TiJGr.gif)

It even works the same way in Chrome!
![](http://g.recordit.co/teDy4kCMYi.gif)
@vjeux
Copy link
Contributor

vjeux commented Oct 15, 2016

Just submitted a pull request to fix it: #796

@schmurfy
Copy link

@vjeux thanks ! I hope it gets merge, it is still an eveyday annoyance for me...
I tried to fix it but failed.

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

Successfully merging a pull request may close this issue.

9 participants