Page 1 of 1
Support custom syntax; customize popup menu?
Posted: 06.11.2019 02:33
by hycmos
Sir,
I try to find one replacement editor for Notepad++.
So I want to those features:
1) userDefineLang for a special docment("Define you language..." in Notepad++), so I can define the keywords by myself;
2) code explorer for this special docment("Function List" in Notepad++), so I can explore the function, keyword;
3) custumize the pop-up menu("shortcuts.xml" in Notepad++), so I can run those orders easily;
Can do CudaText Now?
That's all.
Thanks.
Posted: 06.11.2019 09:50
by Alexey
1) yes, it is lexers.
lexers can parse any syntax and find keywords.
https://wiki.freepascal.org/CudaText#Lexers
2) yes, lexers too. lexers can find items for Code Tree panel (in the sidebar).
3) yes, plugin "Configure Menu" allows to change your top menu and context menu.
Posted: 07.11.2019 04:41
by hycmos
Thanks.
1) it is ok
2) it is ok
I open the lexer zip file which is exported from Synwrite, this lexer was imported correctly.
then, I opened one file for testing.
Cuda showed one window. This window asked me for assign color map.
I cancel it.
after this, I reopened Cuda, it re-asked for the assign action.
To resolve this action, I changed 'ui_lexer_themes' to false in the default.json file.
It seems ok.
Is it right by this way?
3)plugin "Configure Menu" allows to change your top menu and context menu.
yes, I got it. I can customize many menus.
But I can not find out how to add plugin's command into context menu,
for example, Plugins-->Comments-->Toggle comment line, at line start
all below do not work:
,{"cap":"Comments", "cmd":"<Comments>,<Toggle comment line, at line start>"}
,{"cap":"Comments", "cmd":"Comments,Toggle comment line, at line start"}
,{"cap":"Comments", "cmd":"Comments","Toggle comment line, at line start"}
In Noepad++, I input its main menu's name to customize context menu for this plugin's command.
Posted: 07.11.2019 10:14
by Alexey
Don't change option in default.json, it is not used - change in user.json.
You can a) change ui_lexer_themes to false, or b) in the Color Map dialog, assign "-" to all items.
Posted: 07.11.2019 10:24
by Alexey
Use such text in menu.json
Code: Select all
,{"cap":"Toggle line comment", "cmd":"module=cuda_comments;cmd=cmt_toggle_line_body;"}
cuda_comments - folder in py/ subdir
cmt_toggle_line_body - taken from py/cuda_comments/install.inf
Posted: 08.11.2019 00:14
by hycmos
cool,
I can customize every menu now!
your code also inspired me.
Now I can get any command by openning the plug-in 'configure toolbar' --> 'add item' --> 'choose command...', then copy the command showed in command box.
By now, everything is OK.
Thanks.
(The startup time becomes a little slow if some customized toolbars are added into the main toolbar. But this is a small bug, it is not really a problem)
I will play with this good editor now to try to find more. Thanks.
Posted: 08.11.2019 09:06
by Alexey
Startup time was slow with plugin Config Toolbar, it was fixed in latest Cud 1.89.2 and fixed in ConfigToolbar.
Posted: 08.11.2019 15:52
by hycmos
update to the newest version 1.89.2,
update CongfigToolbar,
The speed is so fast.
more, I install the 'plugin.Highlight_Occurrences'.
This is called 'smart hightlighting' in NP++.
Other editors may call different name.
all implent the same function.
very nice.
By now, I already get exactly same things as Notepad++.
A duplicate NP++.
Good!
I try to discover more intersting functions,
then I can make one special editor which will be better than any others.
Thank Alexey for your help.