Support custom syntax; customize popup menu?

Post Reply
hycmos
Posts: 86
Joined: 06.11.2019 02:17

Support custom syntax; customize popup menu?

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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.
hycmos
Posts: 86
Joined: 06.11.2019 02:17

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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
hycmos
Posts: 86
Joined: 06.11.2019 02:17

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Startup time was slow with plugin Config Toolbar, it was fixed in latest Cud 1.89.2 and fixed in ConfigToolbar.
hycmos
Posts: 86
Joined: 06.11.2019 02:17

Post by hycmos »

:D
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.
:lol: :lol: :lol:

Thank Alexey for your help.
Post Reply