News:

Download Pelles C here: http://www.pellesc.se

Main Menu

Enhanced editor suggestion

Started by PhilG57, February 14, 2026, 05:58:31 PM

Previous topic - Next topic

PhilG57

I often mess around with existing code written years ago, often for systems other than Windows.  It would be helpful to me if the editor would show which #ifdef/#else/#endif paths were active.  This might be done by highlighting, or not, the appropriate code sections.  Sometime I run into multiple, nested #ifdef's and sorting it all out is a big pain.  Thanks.

John Z

Hi PhilG57,

I don't see this as a good fit with a text editor.  You'd have the editor constantly checking every key stroke to see if it was a #DEFINE xxxxx, #DEFINE a 1, #DEFINE macro, or an #undef yyyyy and so on then checking every file, or a list of #ifdef and others, to see if the define/undef was used somewhere then highlighting the use path, which might not be that simple with nested cases (as you mentioned).  It would need to not just check C source but all headers and all project ppj configs.  It would really bog down the editor with unrelated editing task.  Imagine constantly checking 45 source files plus headers...

Even if the editor were to build a list as text is entered of where checks are done like #ifdefs it would need to check the list constantly every time a #... was typed, and not just then as a previously #DEFINE xxxx might be changed at any edit time or somewhere else.  Then too if it old existing source code then no one is typing everything so some initialization would need to be done to develop the initial list.

So an Add-IN that can be called ad-hoc to process all the source files and headers seems more reasonable, even though it would be snapshot in time, it could be run as needed.

Add-ins can be written by the user community so you have a path to do it.  The editor is only updated by Pelle the developer.  I don't think he will will be interested, but just imo.

John Z

Michele

This is behavior of ECLIPSE IDE, it is a really useful feature! I like it very much.
Nevertheless it requires a grammar checking engine very powerful or the result could even be counterproductive.
And I imagine the POIDE isn't so strong.

John Z

Eclipse IDE installation requirements are huge, yet it was a very popular IDE.  No Java on my systems  :).
Now superseded by IntelliJ IDEA I understand.

Eclipse IDE has features to use its IDE with PelleC build programs if one really wanted that IDE.

John Z

PhilG57

Yes, one of the reasons I like the Pelle's environment is the editor is fast, smooth, and displays text crisply;  I would not want to mess that up.  But maybe a task running every second or so, to scan the #ifdef's, etc. and update the screen display appropriately would not negatively impact the editor's overall performance and appeal.