Page MenuHomePhabricator

The search string should be automatically set as the selected text
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Enable CodeMirror 6 and open an edit page
  • Open the search panel, search something and then close the panel
  • Select some text, and open the search panel again

What happens?:

The search string is not automatically updated, which is different from CodeMirror's native search panel implementation.

What should have happened instead?:

The search string should be automatically updated.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Change #1221048 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CodeMirrorSearch: prefill Find input with selected text

https://gerrit.wikimedia.org/r/1221048

MusikAnimal changed the task status from Open to In Progress.Dec 25 2025, 6:02 PM
MusikAnimal claimed this task.

Change #1221048 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CodeMirrorSearch: prefill Find input with selected text

https://gerrit.wikimedia.org/r/1221048

Bhsd moved this task from Improvement to Done on the MediaWiki-extensions-CodeMirror board.
Nardog reopened this task as Open.EditedJan 9 2026, 10:06 AM
Nardog subscribed.

Ctrl+F/H should also update the input while the panel is open.

Ctrl+F/H should also update the input while the panel is open.

It feels strange to update the search input with Ctrl+H which places focus on the replace input.

Change #1224955 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] CodeMirrorSearch: update search input with Mod-f/openPanel

https://gerrit.wikimedia.org/r/1224955

It feels strange to update the search input with Ctrl+H which places focus on the replace input.

I find it pretty handy. It allows you to quickly replace occurrences of the string you're selecting. Try it on Ace, VSCode, etc.

Change #1224955 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CodeMirrorSearch: update search input with Mod-f/openPanel

https://gerrit.wikimedia.org/r/1224955

MusikAnimal moved this task from Improvement to Done on the MediaWiki-extensions-CodeMirror board.
MusikAnimal updated Other Assignee, added: Bhsd.

Ctrl+F/H should also update the input while the panel is open.

Sorry to keep asking you to do paperwork, but this too should be a separate task, I think. The bug that was reported has been fixed. What's being asked beyond that sounds like a feature request. Now, I know that I myself have not been particularly great at such task-splitting efforts for CodeMirror, hehe… but I'm trying to have us do better! This task for example already has two assignees. Ideally all tasks would have just one.

The other reason I'd prefer smaller tasks is to gauge interest. I have no reservations against Ctrl-H updating the replace input per se, but opinions may vary, and those opinions are unlikely to come when this specific request is buried in the comments instead of the task title.

Hopefully that makes sense! Thanks for your understanding :)