|
|
Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » Started my second attempt at redesigning CSyntax
Started my second attempt at redesigning CSyntax [message #47828] |
Fri, 07 April 2017 15:22  |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
The CSyntax class from CodeEditor is good enough for what TheIDE needs and is very close to covering my needs too, but not quite.
Over a year ago I proposed a change but no one was on board. So I forked it and have been using the forked version since.
But it is quite the hassle to update the fork when U++ gets new updates.
So I'm going back to my original proposal, this time more refined, and I will implement it and post it.
I also want to add a dark color scheme to CodeEditor.
U++ comes with Chameleon skins, 2 custom ones, so maybe it is also time to add a standard "dark" skin to U++? It is very "fashionable" these days to have dark GUIs.
|
|
|
Re: Started my second attempt at redesigning CSyntax [message #47880 is a reply to message #47828] |
Sun, 16 April 2017 13:41   |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
Some time ago I was thinking about adding theme manager to TheIDE. In my opinion the simplest version would be just adding array ctrl in "Syntax highlight options". In this array we will have the list of themes. Users should be able to edit, import and export such theme. By default TheIDE should bring two themes white (default) and dark.
I am personally "black on white" guy, so this feature is not important for me - but it is something that we should invest. I know that a lot of people likes to code in dark environment.
I am looking forward to your changes in CodeEditor. Do you plan to improve TheIDE as well?
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sun, 16 April 2017 17:57] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: Started my second attempt at redesigning CSyntax [message #48190 is a reply to message #48176] |
Wed, 31 May 2017 14:52   |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
So, phase one is done.
I maintained current CodeEditor API and capabilities, but completely decoupled highlight options from language.
But beyond the current capabilities, you can also create custom languages:
CSyntaxOptions newLang = CSyntax::GetSyntaxDesc(CSyntax::HIGHLIGHT_CPP);
newLang.SlashBlockComments = false; // remove /* */ comments
newLang.SlashLineComment = false; // remove // comments
newLang.PoundLineComment = true; // the new way to comment is #
newLang.DashInId = true; // still C++, but a-b is a valid identifier
newLang.Keywords << "event";
newLang.MacroList << "beginregion" << "endregion";
RegisterCSyntax("foo", newLang, "*.foo", "Best language");
Other than adding new languages like this, the main use is to allow semantic highlighting: U++ identifiers are no longer static and once per syntax. Each CodeEditor can be assigned a separate derivative syntax descriptor with a different U++ identifier list.
Now comes phase two: adding the new capabilities, in short binary literals, 100'000 numerical identifiers, #region #endregion, some extra colors and customizable macro markers/language.
Two things that I won't add for now but do kind of need are code folding and nested comment highlighting (I tried and failed).
|
|
|
|
|
Goto Forum:
Current Time: Sat May 10 00:31:35 CEST 2025
Total time taken to generate the page: 0.00706 seconds
|
|
|