Open
Description
p5.js version
1.11.1
What is your operating system?
Windows
Web browser and version
132.0.6834.160
Actual Behavior
When switching between files in the p5.js Web Editor, the search match counter does not reset. The counter continues displaying results from the previously opened file instead of updating to reflect matches in the new file.
Because of this, it shows wrong values of matched words (if any).
In the following image, I have one hello written in sketch.js:
I switch to index.html, which has 2 hellos written, but the counter doesn't update to 2 and instead shows a wrong value:
And if I type 2 more hellos, it still doesn't update correctly:
Once I switch back to sketch.js, it shows previous count, which again is a wrong behavior:
Expected Behavior
- When a user switches files, the search match counter should reset and update based on the newly opened file.
- If the new file contains matching search terms, the counter should reflect the correct number of matches.
- If no matches are found, the UI should display "No results".
Steps to reproduce
Steps:
- Open a file, write hello (only once)
- Click on ctrl+F to open the search dialog and search for the word hello. The search counter should display the correct number of matches.
- Switch to another file, which has a different number of matches for "hello".
- Observe the search match counter—it still displays the count from previous, instead of resetting.
Activity