Opened 10 years ago

Last modified 4 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 10 years ago by martinkou

  • Cc icesoftware@… orfjackal@… added
  • Reporter changed from martinkou 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 9 years ago by alfonsoml

  • Component changed from General to UI : Source View

comment:3 Changed 9 years ago by w.olchawa

  • Keywords Confirmed added

comment:4 Changed 9 years ago by w.olchawa

  • Keywords HasPatch added

comment:5 Changed 9 years ago by w.olchawa

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

comment:6 Changed 9 years ago by fredck

#2360 has been marked as DUP.

comment:7 Changed 8 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 8 years ago by dandv

  • Summary changed from highlight and go to line to Syntagx 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 6 years ago by wwalc

  • Summary changed from Syntagx highlight and go to line to Syntax highlight and go to line

comment:10 Changed 6 years ago by wwalc

  • Version set to 3.0

comment:11 Changed 6 years ago by phazei


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 5 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 5 years ago by j.swiderski

@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 4 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 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy