Topic on Extension talk:CodeMirror

Using browser search with CodeMirror

8
AnonymusGdpr (talkcontribs)

Nice feature, works good for us. There seems to be a minor bug when Code Mirror is active. The browser search (Ctrl+F) sometimes finds the search text within the editor, sometimes it doesn't. Maybe it depends on how far one has scrolled forward within the editor. With code mirror off, the search result is reliably correct regardless if one has scrolled or not.

(MW 1.27.4. Firefox 57.0)

DannyH (WMF) (talkcontribs)

Hmm, that's a bug that I believe we fixed a little while ago... Let's see if we can reproduce the problem.

I'm on Firefox 57.0 too, and I did a successful browser search on a random page (en:Geologic time scale, looking for the word Putman).

Can you show me an example or two where you have the problem? Wiki, page and search term would help a lot.

AnonymusGdpr (talkcontribs)

Example for the problem is:

https://www.perrypedia.proc.org/mediawiki/index.php?title=Die_Dritte_Macht_(Zyklus)&action=edit

CodeMirror on & Ctrl+F & search for "al-khor", which is at the very bottom of the page => nothing found.

CodeMirror off => search successful

Edits are restricted to registrated users only, so you'll first have to create an account https://www.perrypedia.proc.org/wiki/Spezial:Benutzerkonto_anlegen

But maybe that is not necessary, maybe the bug has been fixed in a later version? We use MW 1.27.4 and what I get through the ExtensionDistributer is CodeMirror 3.4.0, wheras the current version is 4.something.

DannyH (WMF) (talkcontribs)

Yes, that must be it. Good, I was worried that the bug fix had been reverted somehow. :)

@NKohli (WMF) or @MaxSem (WMF), could you help this user update to a later version of CodeMirror?

NKohli (WMF) (talkcontribs)

Hi @Alzi24 you can either upgrade your MW to a higher version or you can choose to get the 'master' version of CodeMirror from ExtensionDistributor. We cannot guarantee that it won't break anything but you can revert back to 3.4.0 if it does. Hope this helps.

Pastakhov (talkcontribs)

there is a patch that breaks compatibility with older Extension:WikiEditor, I chosen one the 'master' version too and it worked fine for me, you may try to do the same.

AnonymusGdpr (talkcontribs)

Not our day today.

I will rather not upgrade to a higher (but no-LTS) MW. So I tried the newer versions of CodeMirror to inject in our MW 1.27.4:

- the version for 1.29 is still 3.4.0 with the reported problem

- the version for 1.30 & master is 4.0.0 but will not run under MW 1.27.4. The editor icon for activating the feature is missing. The reason seems to be a dependency by MobileFrontend, which calls a function CodeMirrorHooks::getGlobalVariables() that no longer exists in 4.0.0.

In a nutshell, it's all way to expensive for the original minor problem. As far as I know the next LTS Mediawiki will appear mid of next year, so that's the best time for the next MW upgrade.

Thanks anyway!

AnonymusGdpr (talkcontribs)

MW upgraded to 1.31, plus new version of the extension installed -> works fine!

Reply to "Using browser search with CodeMirror"