I just want to say I tried Special:ExtensionDistributor/CodeMirror, linked from the infobox, but it says «No such extension "CodeMirror". Unable to fetch extension list!».
Jump to navigation Jump to search
Reply to "Multiple carets, bug or feature?"
Reply to "Red dot"
Reply to "Using browser search with CodeMirror"
Reply to "Revamp of CodeMirror"
Reply to "How to check if switched on and access its API"
Reply to "Page should be updated"
Reply to "User talk:GregU/dashes.js"
@Herr Klugbeisser Do you have the toolbar disabled? I would suggest you enable the toolbar and then in the toolbar click the icon
which will turn off syntax highlighting. After that you can disable the toolbar again and you will have no problems with syntax highlighting any more.
About this board
Error in extension distributor
Well, now it works. I don't know why.
Multiple carets, bug or feature?
MediaWiki 1.31.1 PHP 7.2.10-0ubuntu0.18.04.1 (apache2handler) MySQL 5.7.24-0ubuntu0.18.04.1-log https://www.perrypedia.proc.org
We are using CodeMirror for a few weeks now and rate it very useful. There is an odd phenomenon which I don't know whether it is intended:
- Activate CodeMirror, place the caret (mouse cursor for text input) anywhere.
- Move the mouse, press "Ctrl" and left-click. Now there are two carets.
- This may be repeated several times.
- Now when typing text, it'll be inserted multiple times at all of the caret locations!
It is a little bit cumbersome because (esp. if one has clumsy fingers like me) this happens often when insertig text via Copy&Paste; the "Ctrl+V" is executed and the oversensitive touchpad detects an additional "Ctrl+click".
Is it a bug or a feature?
I'm working with Firefox 62-something but it is also reproducible with Opera and Chrome, even if not logged in.
MW 1.31.1, Code Mirror 4.0.0 (a435d54) 22:01, 26. Apr. 2018
Sometimes there is a red dot beneath a category link. What does it mean?
I don't think CodeMirror has any feature which produces a red dot under category links. Although a screenshot would help.
Editor with CodeMirror off:
At the moment, this is the first and only where it happens.
@Alzi24 Thanks for the screenshots! I tried to reproduce this with the same categories on a random page but I didn't see the dot. Can you give me a link to the page you are editing with? I tried figuring it out from the screenshots but searches on dewiki turned up nothing for Aracyclin. :)
This is a deliberate feature of codemirror. It highlights some invisible characters..
@NKohli (WMF): Our wiki URL is https://www.perrypedia.proc.org Don't know what dewiki is, our article pages usually appear high-ranked in most search engines, as long as they are no trivial terms out of the real life.
@IP: I have no idea how it could happen that someone inserted invisible characters. Anyway, you've answered my question and our simple solution is: remove characters, save page.
Thanks to all!
Using browser search with CodeMirror
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)
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.
Example for the problem is:
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.
Yes, that must be it. Good, I was worried that the bug fix had been reverted somehow. :)
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.
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.
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.
MW upgraded to 1.31, plus new version of the extension installed -> works fine!
CodeMirror in collaboration with WikiEditor, MW 1.31
Hello there! I have just upgraded our test wiki to Mediawiki 1.31.
In our previous MW version, the CodeMirror extension (3.4.something) broke the browser search Ctrl+F, which should have been solved in the newer extension (4.0.0)
Unfortunately now with MW 1.31 the extension does not work at all. Seems as if there are problems with the WikiEditor (0.5.1), if the CodeMirror extension is installed.
There should be an additional icon in the WikiEditor's toolbar to switch the code highlighting on or off, but there isn't. Worse: If I set the user preference for the extended toolbar, then in the WikiEditor the toolbar disappars at all. And worst: As soon as the CodeMirror extension is installed, I earn an additional malfunction within the user preferences; it refuses switching to another tab: the browser URL tells me e.g. Spezial:Einstellungen#mw-prefsection-rc but the preferance still sticks on the first tab.
Does anyone have any ideas what I am doing wrong here?
That is very strange. Where did you download the 4.0.0 version from? I'd recommend you use the master https://github.com/wikimedia/mediawiki-extensions-CodeMirror as it is the latest, stable version. Try that and let me know if it works for you.
I have to apologize, I've made a mistake yesterday. Don't know what I did wrong. Today I removed the extension and reinstalled it from the ExtensionDistributor (which I thought was the same procedure I performed yesterday). It is still version 4.0.0 but now everything works fine.
For your interest: the master version results in
PHP Fatal error: Uncaught ExtensionDependencyError: CodeMirror is not compatible with the current MediaWiki core (version 1.31.1), it requires: >= 1.32.0.
which seems reasonable ;-)
Sorry for stealing your time!
Oops, sorry about that. :)
Revamp of CodeMirror
Recently, Marijn and Adrian, the developers and maintainers of CodeMirror posted an explanation of the big changes they have in-store for Version 6 of CodeMirror: https://codemirror.net/6/
I work with the Community Tech team which helped integrate CodeMirror with the wikitext editor. Given this new version, we want to do two things.
First, we want to voice our support for Marijn and Adrian in their efforts. CodeMirror and the syntax highlighting it provides via this extension are a valuable feature for MW users.
Second, I'd like to gather some feedback on the current extension's strengths and what it lacks. If we take on the work to integrate this new version, we want to be sure to keep things that users like now and possibly fix or add features that users want. Marijn and Adrian are building CodeMirror with their own feature set in mind. We cannot and would not try to dictate feature requests or bug fixes. In the interest of collaboration, we do want to collect as much user feedback as we can so we can all have a better library and extension.
Our hope is that the new version will enable much easier integration which will create fewer bugs with the extension. Your input here can go a long way to making that true. It's important to point out that this is a preliminary discussion as the timeline for a finished library and my team's ability to start working with it is currently unknown.
How to check if switched on and access its API
For some reason the page Extension:CodeMirror does not explain these simple questions. If the API is not accessible in MediaWiki this should obviously be documented on the extension's page.
P.S. thanks to a comment by User:Trustable in another thread I figured out that you can check if CodeMirror is switched on with: $('.mw-editbutton-codemirror-active').length > 0 and you can swith it on/off with: $('#mw-editbutton-codemirror').click()
Page should be updated
Some (if not most) of us know that the extension is not compatible at Internet Explorer and lesser-known browsers. The "Browser support" section should be updated to reflect that. What about other parts of the page?
en:User talk:GregU/dashes.js is a useful script on English Wikipedia for turning hyhens into dashes. It appears it is no longer works when I use "Wikitext syntax highlighting" beta.
@Delusion23 Thanks for letting us know. There are several similar user scripts which break with CodeMirror. It seems like the script author isn't active on wiki anymore, unfortunately. We'll try to take a look at it.
CodeMirror breaks any script wich need manipulating plain Wiki text. To need fix every script except of CodeMirror is an absolute no-go. Why need CodeMirror a new Textbox? Other older (sometimes better) Syntax-highlighter have not this problem (my favorite is de:User:Schnark/js/syntaxhighlight).
PS: There is a difference in the textbox access .
$( '#wpTextbox1' ).val() is different to $( '#wpTextbox1' ).value
Which is normally fully the same, but seems a use of hook or something.
Problem when copy/paste from external text editors
Hello, I consistently face a problem when I do the following:
- I make big edits or write new articles in a text editor outside the web browser (mostly because I write when I am offline)
- When I copy/paste the text into the edit window, then
- no syntax is highlighted
- after using the "preview" function, the original text is previsualized and the text in the edit window is reset (and thereby lost)
This is a new phenomenon that arrived together with syntax highlighting. It happens consistently in Win7 and Internet Explorer. I used to see a similar phenomenon in Linux and Firefox, but not consistently.
See below for your reference:
I don't see the syntax highlighting icon in the toolbar in your images. Which editor are you using?
As long as you are not using syntax highlighting, you should not be affected by it at all. The way you describe your problem, it does not seem like it is being caused by syntax highlighting.
Hello, I also don't see any syntax highlighting icon, but syntax highlighting has been activated for me some weeks ago. At least syntax is highlighted when I open the source of an article.
I am not aware of having any choice of editor. I assume I use the default editor in the German wikipedia. I have noticed that syntax highlighting is "off" for my user in the English wikipedia, but "on" in the German. I can't see any difference in the preferences. Emptying *.js and *.css subpages has not helped, switching between skins also not.
@Herr Klugbeisser the content in your screenshots above does not appear to have syntax highlighting. What makes you think syntax highlighting is causing these issues for you?
I let you see what I see:
When I open any article in the German Wikipedia under Win7/IE, I see the above picture.
Syntax highlighting is obviously active. There is no icon, I don't know why. I have deleted my *css and *js yesterday, maybe this is the reason; it is opaque for the average user. Anyway, the icons were completely useless to me so I'm happy they are gone.
Now, assume I scroll down in the text and I want to edit the line where the cursor is.
If I click on the word "Eisenbahn" in the textbox, then
- the text displayed "jumps" to the beginning
- the scroll bar of the text box remains where the cursor is
- the user has to look for the cursor
Marking a text is practically impossible because at clicking, the focus is lost and the user does not see the text he wanted to mark any more.
This is extremely annoying (I read several complaints in discussions of the German wikipedia). I have not experienced this before syntax highlighting was introduced. If you are sure that syntax highlighting is not the cause of this issue, please channel this bug to the right place inside Wikimedia.
Given this bug, the only way to work efficiently for me is to copy the whole text into an external editor, carry out my edits, then copy the complete text back to the editing window.
However, when I copy such a text back from any text editor (I have tried several), syntax highlighting fails to highlight (no loss), but also saving or previewing fails to show the text pasted from the external editor but instead visualises the original text.
This means that at the moment, I can't contribute under Windows.
I don't know how many people experience this issue.
The implementation of syntax highlighting was very poorly communicated, it took me some time to find out the probable cause of these issues even though I consider myself a regular contributor.
For some reason, in English Wikipedia syntax highlighting seems to be "off" for me even though my user settings are identical.
Under Linux (Mint 19/Firefox), syntax highlighting is also obviously active. No icon, however.
Editing works fine.
Pasting text from a text editor (kate in my case) usually works, but I have observed the issue described above occasionally.
@Herr Klugbeisser Do you have the toolbar disabled? I would suggest you enable the toolbar and then in the toolbar click the icon
Hello NKohli, it seems that I have found the reason: the CodeMirror conflicts with other "Helpers", in my case this one:
After removing this helper from my subpages, and activating/deactivating the standard toolbar, it seems that everything works.
I mistook the toolbar from the above "helper" for the standard mediawiki toolbar, hence the confusion.
Sorry for this. This point can be closed.
I am glad it got resolved for you.