Topic on Extension talk:CodeMirror/5

Disabling line numbering?

7
Maksim E. Otstavnov (talkcontribs)
wfLoadExtension( 'CodeMirror' );
$wgDefaultUserOptions['usecodemirror'] = 1;
# Enable bracket matching in CodeMirror
$wgCodeMirrorEnableBracketMatching = true;
# Enable accessible colors in CodeMirror
$wgCodeMirrorAccessibilityColors = true;
#Enable line numbering in CodeMirror
#defaults to the template namespace `[ NS_TEMPLATE ]`
#`null` enables it for all namespace
#[] for disabling everywhere
$wgCodeMirrorLineNumberingNamespaces = [];

seems to have no effect on editing templates, I still see the line numbers. (Unfortunately, this forum prevents me from attaching screenshots.)

MediaWiki 1.36.1, PHP 7.4.15 (cgi-fcgi), MySQL 5.7.28-log, ICU 60.2, Apache 2.4.29-1ubuntu4.16 Extensions: Echo – (1a15ef8), VisualEditor 0.1.2, MyVariables 3.5.1, NoTitle 0.4.0 (780dbb6), DynamicSidebar 1.1 (b2f3feb), Lockdown – (2409546), MassMessage0.4.0 (c9b6e87), CodeMirror4.0.0 (508b9f6) 15:59, 22 July 2021.

Thiemo Kreuz (WMDE) (talkcontribs)

Using [] is correct and should do the job. Maybe it's a caching thing and you need to shift+reload the page?

Maksim E. Otstavnov (talkcontribs)

I see no effect even for newly created pages.

I believe something went wrong with my local settings. Just encountered the same problem with $wgNamespacesWithSubpages.

Christoph Jauera (WMDE) (talkcontribs)

Hej @Maksim E. Otstavnov, thanks for the report.

We just took another look at this and it seems that there is a bug that disallows disabling the default namespace. The bug is tracked in task T290226 now and will be taken care of. :-)

Adamw (talkcontribs)

The bug should be fixed, if you check out the newest version of CodeMirror it will disable line numbering given the OP's config.

Shall I download the newest version from Git? --previous unsigned comment by Maksim E. Otstavnov

Adamw (talkcontribs)

Yes, take the newest code from Git. Let us know how it goes!

Maksim E. Otstavnov (talkcontribs)
Reply to "Disabling line numbering?"