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

Selection doesn't update when only in selection is enabled and Find is clicked again #677

Closed
lee-dohm opened this issue Mar 9, 2016 · 11 comments · Fixed by #982
Closed
Labels

Comments

@lee-dohm
Copy link
Contributor

lee-dohm commented Mar 9, 2016

Repro Steps

  1. Launch Atom

  2. Open a new file using Cmd+N

  3. Enter the text:

    apple, banana,
    apple, banana,
    apple, banana
    
  4. Select the first instance of apple with the mouse

  5. Open the find-and-replace panel with Cmd+F

  6. Ensure "Only in Selection" is enabled

  7. Click the "Find" button

  8. Ensure that 1 result found for 'apple' is shown above the find text box

  9. Select all text using the mouse

  10. Click the "Find" button

Expected: New search is executed with the updated selection

Actual: Continues to display 1 result found for 'apple'

Reproduced using Atom v1.7.0-dev-b08e293 on Mac OS X 10.11.3.

@halicki
Copy link

halicki commented May 24, 2016

Is anyone is working on this issue? It affects my workflow heavily.

@aprice
Copy link

aprice commented Sep 5, 2016

Find in selection is badly broken, and has been for years, going back to pre-1.0 versions of Atom. #298 was opened for multiple serious issues with find in selection, and it was closed after one small part was fixed, but the feature remains unreliable to the point of being nearly unusable. Various issues are open for find in selection, and there are comments stating that it's "not a high priority for the core team". It's not clear what their priorities are, though.

@halicki
Copy link

halicki commented Sep 5, 2016

I find "find in selection" one of main features of a text editor. I don't know what other issues can be more important than being able to edit a text file.

@50Wliu
Copy link
Contributor

50Wliu commented Sep 5, 2016

It's not clear what their priorities are, though.

Since I'm the one who both opened and closed #298, here's my take on this:
I closed that issue so that more specific ones could be opened in its place, which seems to have happened for the most part. Some of the Atom team's priorities right now are improving performance and fixing regressions (I can't really comment on exactly what they are, since I'm only a volunteer).

@halicki Issues where Atom crashes on opening large text files (just a random example) are arguably more important than this one. That being said, PRs are always welcome.

@Spiderman5000
Copy link

I too ran into this problem using Atom version 1.12.7.

Steps:

  1. Create several lines of text with duplicate words
    apple, banana, cherry
    apple, banana, cherry
    apple, banana, cherry
  2. Select first line
  3. Find and replace all "banana" with "plantain_banana", "Only in Selection"
  4. Select third line
  5. Find and replace all "banana" with "plantain_banana", "Only in Selection"
  6. Notice that the third line is unchanged, yet the first line is now changed to:
    apple, plantain_banana_banana, cherry

Please fix this bug as "Find and Replace" is a very common function, especially in selection mode.

Thank you for a great product!

@kolbma
Copy link

kolbma commented Apr 6, 2017

  • The selection (searched on) gets only updated when disabling and re-enabling the "only in selection" option.
  • or you change the search string

Should also work if you change the selected text in buffer without changing search string or changing search options.

@philgyford
Copy link

The selection (searched on) gets only updated when disabling and re-enabling the "only in selection" option.

The selection does get updated then, but gets updated to a single line, rather than the original selection. Infuriating. (v 1.17.2)

@Josh-West-Bose
Copy link

This is still an issue with 1.23.1

@chbk
Copy link

chbk commented Dec 16, 2017

Please fix this 🙏

Also, could the selected code not be unselected when enabling "Only In Selection"? Or at least keep the line numbers highlighted? Personally it always makes me second guess if the search is actually being conducted in my selection and I have to double check before clicking "Replace All".

@50Wliu
Copy link
Contributor

50Wliu commented Dec 16, 2017

@chbk please file a new issue for that.

@PotatoPope
Copy link

PotatoPope commented Apr 9, 2018

I've had similar issues with find and replace in selection, atom would only replace one of the found instances of a word. This was fixed for me, on atom version 1.25.1 by installing this package: https://atom.io/packages/find-and-replace-fix

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

Successfully merging a pull request may close this issue.

10 participants