sorry rh but I don't think porting QScintilla would be a good way to reach my goal.
Elcuco, it's your turn to shut up! Have a look at the code and think before giving feedbacks...
sorry rh but I don't think porting QScintilla would be a good way to reach my goal.
Elcuco, it's your turn to shut up! Have a look at the code and think before giving feedbacks...
Last edited by fullmetalcoder; 27th January 2006 at 13:19.
Current Qt projects : QCodeEdit, RotiDeCode
Original message said:Originally Posted by fullmetalcoder
You said tomorrow on the 22, now it's 24.
SHOW ME THE MONEY!
SHOW ME THE MONEY!
SHOW ME THE MONEY!
Now I do see the code...
comments tomrrow... /me shuts up now.
Last edited by elcuco; 24th January 2006 at 21:21.
Who's the best ???Originally Posted by elcuco
Just kidding!
Ok implementation is not that perfect!
a corrected version is coming soon!
Current Qt projects : QCodeEdit, RotiDeCode
meanwhile you is the king... me sux0rz...
don't worry, this will change over time... you just wait...
here is the new version.
- few bugs fixes
- line number calculation working fine
- lines highlighting done inside devhighlighter
have fun!
edit : removed attached .zip; copyright notice wasn't correct !
Last edited by fullmetalcoder; 30th January 2006 at 09:19.
Current Qt projects : QCodeEdit, RotiDeCode
the last version you supplied does not compile here:
Qt Code:
elcuco@opensuse:~/src/deveditor> qmake WARNING: Failure to find: parenmatcher.cppTo copy to clipboard, switch view to plain text mode
Easy to fix:
Qt Code:
elcuco@opensuse:~/src/deveditor> qmake -project -o edit.proTo copy to clipboard, switch view to plain text mode
Compiles ok, but does not run:
Qt Code:
elcuco@opensuse:~/src/deveditor> time make g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. -o DevEditor.o DevEditor.cpp DevEditor.cpp:287: warning: unused parameter ‘expr’ DevEditor.cpp:287: warning: unused parameter ‘cs’ DevEditor.cpp:287: warning: unused parameter ‘wo’ DevEditor.cpp:287: warning: unused parameter ‘forward’ DevEditor.cpp:287: warning: unused parameter ‘startAtCursor’ DevEditor.cpp:293: warning: unused parameter ‘find’ DevEditor.cpp:293: warning: unused parameter ‘replace’ DevEditor.cpp:293: warning: unused parameter ‘cs’ DevEditor.cpp:293: warning: unused parameter ‘wo’ DevEditor.cpp:293: warning: unused parameter ‘forward’ DevEditor.cpp:293: warning: unused parameter ‘startAtCursor’ DevEditor.cpp:293: warning: unused parameter ‘replaceAll’ DevEditor.cpp:302: warning: unused parameter ‘txt’ DevEditor.cpp:302: warning: unused parameter ‘first’ DevEditor.cpp:324: warning: unused variable ‘w’ DevEditor.cpp: At global scope: DevEditor.cpp:470: warning: unused parameter ‘e’ DevEditor.cpp:746: warning: unused parameter ‘txt’ DevEditor.cpp:746: warning: unused parameter ‘first’ g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. -o DevHighlighter.o DevHighlighter.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. -o DevStatus.o DevStatus.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. -o main.o main.cpp /usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/bin/moc -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. DevEditor.h -o moc_DevEditor.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. -o moc_DevEditor.o moc_DevEditor.cpp /usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/bin/moc -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. DevHighlighter.h -o moc_DevHighlighter.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. -o moc_DevHighlighter.o moc_DevHighlighter.cpp /usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/bin/moc -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. DevStatus.h -o moc_DevStatus.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. -o moc_DevStatus.o moc_DevStatus.cpp /usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/bin/rcc -name DevEditor DevEditor.qrc -o qrc_DevEditor.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtCore -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/include -I. -I. -I. -o qrc_DevEditor.o qrc_DevEditor.cpp g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/lib -o edit DevEditor.o DevHighlighter.o DevStatus.o main.o moc_DevEditor.o moc_DevHighlighter.o moc_DevStatus.o qrc_DevEditor.o -L/usr/local/Trolltech/Qt-4.1.0-snapshot-20051125/lib -lQtGui_debug -L/usr/X11R6/lib -L/home/elcuco/src/qt4-rsync/lib -lpng -lSM -lICE -lXi -lXrender -lXrandr -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lm -lQtCore_debug -lz -ldl -lpthread real 0m17.224s user 0m15.705s sys 0m1.472s elcuco@opensuse:~/src/deveditor> ./edit ASSERT failure in DevHighlighter::reformatBlock(): "reFormatBlock() called recursively", file DevHighlighter.cpp, line 162 AbortedTo copy to clipboard, switch view to plain text mode
Removing that assert fixes the compilation and the application runs. Much better then previous version.
My impressions:
1) wow, that works!
2) wow... it really works!
3) damm... it's slow.
I am running this application on a AMD XP2500 and when I move thr text cursor, I see big spikes of CPU usage. The loading time, is HUGE, since the SH works way to hard on that. Using QRegExp on every line make the code to be colored on a O(N^2) complexity, which is definatly bad for GUI.
The implementation of "current line" and "breakpoint" are just bad. Marking only part of the line is very wrong, as you pointed already. Nice try, but drop it. IMHO that engine will run faster when you drop it. We must find a solution to this.
The lines numbering is pretty good, I did not find any problems with it, but even with the older code it worked for me, so I shut up...
any way... enjoy (screen shot taken on OpenSuSE 10.0), Qt4.1.0 gcc 4.0.2, xorg 6.8.2:
new version on rails:
- no RegExps anymore (shave off loading time!!!)
- possibility to skip line highlighting (current, breakpoint and errors)
- reworked base class of syntax highlighter for convinience
- built in find & replace
coming soon!!!
Current Qt projects : QCodeEdit, RotiDeCode
are you stealing ideas from me... ? or just implementations....Originally Posted by fullmetalcoder
If you are ditching the QRexExp idea, please look at kate HL definitions. Those syntax are the best ones, they can define anything, since they not define languages but state machines.
did you notice that prototype of find & replace were already present in the earlier versions?Originally Posted by elcuco
my syntax highlighting is working fine but I may have a look at your kate stuff give me somewhere to look for them...
edit : posted the last version
nb : it' still a beta but works pretty fine except replace function that is in early developpement state
Last edited by fullmetalcoder; 30th January 2006 at 09:18.
Current Qt projects : QCodeEdit, RotiDeCode
Sorry everyone but I removed all attached files because the copyright notice wasn't correct.
New version is coming soon with right copyright notice, fixed find & replace and improved syntax highlighting ( those who tried the old versions probably noticed that it didn't handle floats)
Current Qt projects : QCodeEdit, RotiDeCode
Missing too much to be a good editor. Not cross-platform. Needs lots of work.Originally Posted by impeteperry
QTextEdit was not really designed to be an editor. The best thing to do to make a good editor is make one from scratch using parts of Qt's code as a baseline That's what I am doing currently
Hi! And where is the code?Originally Posted by fullmetalcoder
All of us want to have a look at it...
Thanks.
There was a twist in the copyright notice so I removed all zip files yesterday.Originally Posted by Xagen
I used this time to :
- fix highlighting (handles floats and comments after a preprocessor)
- fix find & replace
- add a built-in loading/saving API
- add a print function
- add both of these to context menu
But current line highlighting (and breakpoints/errors as well) is still ugly!!!
No way making it kepp coloring after last character!!!!
Have fun and please give feedback (and hints about background coloring) !!!
Last edited by fullmetalcoder; 10th February 2006 at 15:41.
Current Qt projects : QCodeEdit, RotiDeCode
In your pro file, there is a line:
change it to
(remove the +). Otherwise it does not compile on my system. The loading is still wayy.... slow... I compared it to my code (which you trashed...) and not that fast ... my code can load much more files (and highlight them properly....), I know for sure it can load C/C++/CSS/XML/Makefile... I need to investigate why it fails on bash/sh... (to the forum, I plan on release it soon, don't worry).
The issue with the one context menu is interesting... but now with 10 commands, it's hard to find the correct item. You should start using submenus or do a window menu, like people expect.
Besides this, this is great... nice work!
Don't say my editor is slow compared to mine:Originally Posted by elcuco
yours take more than 50 seconds to load the qrc_new-editor.cpp file produced by your project (104kb) while mine manage to load it (and highlight it as well) in less than 4 seconds !!!! Impressive isn't it?
Anyway, apart from that SLOOOOOOOOOOOW loading, your version isn't that bad (and I don't worry about release dates : I'm quite patient).
[quote=elcuco]
The issue with the one context menu is interesting... but now with 10 commands, it's hard to find the correct item. You should start using submenus or do a window menu, like people expect.
[quote]
It's only a core editor! The IDE is already on rails and it, of course , includes a window menu. Did you try Dev-C++, there's not 10 items but about 20!!
Current Qt projects : QCodeEdit, RotiDeCode
... so it's possible to use Dev-C++ to code Qt under windows...? I guess that would be another thread...
Not what I said! True anyway (I'm doing it ) but need ugly (to my mind) work around!Originally Posted by elcuco
Not the topic of that thread anyway!
Last edited by fullmetalcoder; 2nd February 2006 at 15:36.
Current Qt projects : QCodeEdit, RotiDeCode
me too! me too!
It's not like I want to fall behind... so here is my code.
This is not an syntax highliter only for C/C++, but an engine for lading language descriptions, and coloring files. The code just seems big, but there is a readme file which explains how to use it.
The code here can load these syntaxes:
- javascript
- php
- xml
- xsl
- css
- Makefile
- Perl
- TCL
The reason why not all languages are supported yet, is because the mime type matching is not perfect. This will be fixed soon. With luck, some other languages are already defined and working, I just could not test them...
Hi elcuco, I came here just to see your code.
I download-it, and make a test (I sugest you to do the same):
Run 'new-editor';
Than open a big CPP file, in my case "$QTDIR/src/gui/widgets/qtextedit.cpp";
Whats happen is that 'new-editor' loads the file very quick but it doesn't do the highlight and freezes the entire application.
I think you'll like to know
--
Thiago dos Santos Alves
Computer Scientist
thiago.salves@gmail.com
-----------------------------------------------------
"A mind that opens to a new idea never gets its original size again."
- Albert Einstein
Bookmarks