How to implement syntax highlighting in a native text editing application?

1.2k Views Asked by At

My background is as a self taught web developer. I am used to the request/response cycle. However, I'm getting more involved in event driven programming (JavaScript, native apps, etc). I had the idea that I wanted to write a native text editor with syntax highlighting (as a learning experience), and I realized I was stumped as to how to implement syntax highlighting. I am used to using a stock syntax highlighting library where you give the library some text an HTML version with syntax highlighting is returned. This is not how a normal text editor/IDE works. As you type, the characters are highlighted accordingly as the editor realizes what you are trying to type. So, from a high level overview, how would one implement syntax highlighting.

1

There are 1 best solutions below

0
On

Read this before you start: http://codemirror.net/1/story.html