Opened 17 years ago

Last modified 11 years ago

#602 confirmed New Feature

Syntax highlight and go to line

Reported by: objectcat@… Owned by:
Priority: Normal Milestone:
Component: UI : Source View Version: 3.0
Keywords: SF HasPatch Cc: icesoftware@…, orfjackal@…


It would be a great idea to be able to use highlighting in source mode like you get in some text editors for coding.

a button for go to line would be great because sometimes you have this huuuge files and you got an error on line 345. Would be great for debugging.

Moved from SF:

Change History (14)

comment:1 Changed 17 years ago by Martin Kou

Cc: icesoftware@… orfjackal@… added
Reporter: changed from Martin Kou to objectcat@…

Hi everyone!

I did that this way... put this JavaScript code in your page (like before </HEAD>):

<script type="text/javascript">
var ultimaLinea = -1, coll;
function resettaRiga()
         if (ultimaLinea >= 0)
         ultimaLinea = -1;
function vaiAriga(riga)
var ilframe = (document.getElementById
         if (riga == "") return false;
         riga = riga.replace(/^\s*|\s*$/g,"");
         if (isNaN(riga) || riga==0) return false;
         if (coll.length >= riga)
         ultimaLinea = riga;
         return true;

If your editor is not called FCKeditor1 adjust that. Then you put a button and an input field in your form:

<INPUT type="button" value="Vai a riga" class="S4NBOTT" 
<INPUT Id="NumRiga" name="NumRiga" type="text" 
class="S4NEDIT" size="4" maxlength="4">

Hope this is useful to you!


Moved from SF. Original poster: icesoftware

I would really much like this feature to be added. Syntax highlighting for the source view would help the writing of code very much. Right now it is necessary to copy the source code to and external editor and paste it back to the browser.

Could somebody help me to find the right places from the code, so I could try adding syntax highlighting myself?

Moved from SF. Original poster: orfjackal

comment:2 Changed 16 years ago by Alfonso Martínez de Lizarrondo

Component: GeneralUI : Source View

comment:3 Changed 16 years ago by Wojciech Olchawa

Keywords: Confirmed added

comment:4 Changed 16 years ago by Wojciech Olchawa

Keywords: HasPatch added

comment:5 Changed 16 years ago by Wojciech Olchawa

#612 has been marked as DUP. View #612 - it has a lot of information about this feature.

comment:6 Changed 16 years ago by Frederico Caldeira Knabben

#2360 has been marked as DUP.

comment:7 Changed 15 years ago by dricks2222

CodeMirror does this kind of thing very very well.

Example of mixed parsers(html/css/javascript) highlighting :

Integrate this into FCKEditor would be just great.

comment:8 Changed 15 years ago by Dan Dascalescu

Summary: highlight and go to lineSyntagx highlight and go to line

Seconding CodeMirror, as I wrote a PHP parser which the author integrated in the package. Here is a demo of PHP+HTML+JavaScript+CSS:

HTH, Dan Dascalescu

comment:9 Changed 13 years ago by Wiktor Walc

Summary: Syntagx highlight and go to lineSyntax highlight and go to line

comment:10 Changed 13 years ago by Wiktor Walc

Version: 3.0

comment:11 Changed 13 years ago by Adam


Reference plugin that's integrated. It was made by someone in this thread.

One thing it lacks is some indicator on the non-source side to show where the code snips are. Without that it's too easy to delete them if they are intertwined with the text. Some block character would be good.

Also, if there's going to be a 'go to line', there should also be line numbering to go with it.

comment:12 Changed 12 years ago by apatheticresistance

The website that was hosting that plugin seems to have disappeared. Does anybody have access to it, or a newer version? Thanks!

comment:13 Changed 12 years ago by Jakub Ś

@apatheticresistance In you can find three plugins for syntax highlighting:


The last two are based on:

If none of those solutions suits you maybe you could use them as a jump start in your own plugin.

comment:14 Changed 11 years ago by sirtet

actually, 2. and 3. are about highlighting code in your content, not for the source, as asked here. The latter is done by 1. only, but you can directly use this Plugin now:

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy