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

Find and replace all momentarily reports incorrect number of results found #1124

Open
1 task done
finnbear opened this issue May 8, 2020 · 0 comments
Open
1 task done

Comments

@finnbear
Copy link

finnbear commented May 8, 2020

Prerequisites

Description

After using the find and replace all option, the number of results found is reset to 0. This is sometimes appropriate but not always.

Steps to Reproduce

1.In any file, type a string like "abcdabcd"
2. Find and replace "abcd" with "abcdabcdabcd" (atom shows 2 results found before clicking replace)
3. Watch the number of results found right after clicking the find and replace button

Expected behavior:

Text in the file is now: abcdabcdabcdabcdabcdabcd
Number of results found is: 6

Actual behavior:

Text in the file is now: abcdabcdabcdabcdabcdabcd
Number of results found is: 0
Number of results found after a second or two: 6

Proposed solution:

Instead of setting the number of results found to 0, multiply the previous number of results found by the number of times the string to find appears in the string to replace.

Reproduces how often:

100%

Versions

1.46.0
Ubuntu 19.04

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

1 participant