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

Find and replace in project doesn't work when "whole word" option is selected in certain cases #1102

Closed
IanButterworth opened this issue Oct 6, 2019 · 2 comments

Comments

@IanButterworth
Copy link

IanButterworth commented Oct 6, 2019

Description

With “Find in project”, and “whole word” matching selected, a search string like "foo(", with replace string "bar(" results in the search string being used as the replace string, instead if the replace string.

Steps to Reproduce

  1. Add foo(x) to your project
  2. Find in project for foo( with replace string bar(
  3. Ensure "Whole word" is selected.
  4. Click find all
  5. Click replace all

Expected behavior:

foo( is replaced by bar(

Actual behavior:

foo( is replaced by foo(

Reproduces how often:

Every time

Versions

Atom : 1.40.1
Electron: 3.1.10
Chrome : 66.0.3359.181
Node : 10.2.0

apm 2.4.3
npm 6.2.0
node 10.2.1 x64
atom 1.40.1
python 2.7.10
git 2.21.0

MacOS 10.14.8

@IanButterworth IanButterworth changed the title Find and replace in project uses find-string for replace-string Find and replace in project uses find-string for replace-string when "whole word" option is selected Oct 7, 2019
@rsese
Copy link

rsese commented Oct 8, 2019

Thanks for the report! Reproduced with 1.40.1 on macOS 10.14.6 in safe mode - wonder if it's related to the parenthesis in the find text maybe since it's a non-word character? For example, I can reproduce when searching for foo- with the content foo-x- as well.

Just noting that after step 2:

Find in project for foo( with replace string bar(

You do see results from that search so I would expect the replace to work too I think:

find-whole-word-parens

As a side note, please leave the Prerequisites section of the issue template to let us know that you've tried things like reproduction in safe mode, etc.

@rsese rsese added the triaged label Oct 8, 2019
@rsese rsese changed the title Find and replace in project uses find-string for replace-string when "whole word" option is selected Find and replace in project uses find-string for replace-string when "whole word" option is selected in certain cases Oct 8, 2019
@rsese rsese changed the title Find and replace in project uses find-string for replace-string when "whole word" option is selected in certain cases Find and replace in project doesn't work when "whole word" option is selected in certain cases Oct 8, 2019
@darangi darangi self-assigned this Nov 12, 2019
@darangi darangi closed this as completed Nov 19, 2019
@IanButterworth
Copy link
Author

Great, thanks @darangi

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

No branches or pull requests

3 participants