Search code examples
c++qtnotepad++scintillaqtextedit

I want to make my own source code editor, what are the good choices to make?


I've had it of those dozens of editors which never provides simple things like:

  • distinguish type keywords and instruction keywords so I can put different colors on them.
  • being cross platform using a standard GUI lib like qt gtk etc (notepad++, yes, I almost hate you).
  • enough keyboard shortcut like duplicate line, comment selection, and a decent find-replace.
  • Decent task-easing features like single-click-on-the-number-line-margin to select the entire line.
  • Scintilla or another good-enough lexer that highlights enough different things, because brain-compiling code is one thing, quickly identify with the eyes what is what is something I find important.

I just want to support very basic languages like C, C++, maybe Python, not HTML or CSS.

Is Scintilla a good choice to just highlight those languages, and is a lexer really necessary ?

Isn't QT enough to program a text editor such as the one I want to do ? I know there is QScintilla, but is there a reason I shouldn't use a lib that integrates a lexer ? Why is Scintilla such a good lib ?

Is QT a good choice for such an editor ? (I also want to hard embed ProFont in the editor to kill any reluctant font problem between OSes).

EDIT: In short, I want to make an editor, only with the same syntax highlight features of notepad++. That's my main goal, and the use of QScintilla might be a little harder than I thought...

EDIT2: Well I found textadept, it's not so known but is quite awesome. I didn't manage to make my lexer, since I have other to do which I do under windows, unfortunately it's slow on the mac. Apparently there isn't any Scite official build for the mac.


Solution

  • Like everyone else is saying, it's probably more trouble than it's worth, but if you really want to do it, Qt's a good choice since it's cross platform. Use QSyntaxHighlighter to do your keyword/type highlighting, and take full advantage Qt's support for keyboard shortcuts.