How to remove to separation lines in the menu?
-
Depends, the first level of the menu is created by Npp via the getFuncsArray callback, but other levels, obviously if you want to have menus with multiple levels, need to be handled by your plugin and need to be created/handled using the msdn documentation that @Alan-Kilborn pointed to.
-
@lifehack-nerd said in How to remove to separation lines in the menu?:
Thank you! Is there official document about how to customize the menu?
“yes”, in the plugin template. You can modify the menu items as you’ve shown, and I typically use:
setCommand( 3, TEXT( "-SEPARATOR-" ), NULL, NULL, false );
for separators so it’s pretty obvious it’s a separator (note the text “-SEPARATOR-” does not actually appear in the menu, just the line). You will ALSO NEED TO CHANGE in
PluginDefinition.h
//-----------------------------------------------// //-- STEP 2. DEFINE YOUR PLUGIN COMMAND NUMBER --// //-----------------------------------------------// // // Here define the number of your plugin commands // const int nbFunc = 21;
the
nbFunc
which is the number of menu items you have. If this doesn’t agree, you’ll get a shorter menu, or a bunch of extra separator lines. Note this number must be the TOTAL of menu items INCLUDING seprators, so in your example code above, you should set:const int nbFunc = 5
since you show:
setCommand(0, TEXT("Filter1"), filterRun1, NULL, false); setCommand(1, TEXT("Filter2"), filterRun2, NULL, false); setCommand(2, TEXT("Filter3"), filterRun3, NULL, false); setCommand(3, TEXT("Edit Configuration"), conversionPanel, NULL, false); setCommand(4, TEXT("About"), about, NULL, false);
Cheers.
-
@michael-vincent WOW IT’S THE ANSWER! It works! Thank you very much Michael!
-
@michael-vincent Hi Michael, do you know how to make our own plugins can be searched in the Plugins Admin? like offical document indicates how to make it?
I hope that my plugin can be searched in it. I will be very proud of it though it’s still under developing. -
@lifehack-nerd said in How to remove to separation lines in the menu?:
how to make our own plugins can be searched in the Plugins Admin?
I think you want THIS.
-
@alan-kilborn Yes! Thank you!
-
Just a tip: You might want to discuss your plugin and what it does in a new thread on this site. You may find that, while very useful to you, your plugin may not have a wider appeal, or there may already be a plugin existing (that you don’t know about) that covers its functionality.
-
@alan-kilborn Well, I need some time to read the document because my English is not good. But I want to ask first:
1.If my plugin do not have a wider appeal, will I be rejected? How to make that judgement?
2.there may already be a plugin existing (that you don’t know about) that covers its functionality, will I be rejected?
Thanks! -
@lifehack-nerd said in How to remove to separation lines in the menu?:
1.If my plugin do not have a wider appeal, will I be rejected? How to make that judgement?
2.there may already be a plugin existing (that you don’t know about) that covers its functionality, will I be rejected?I don’t think it will be rejected - there are some plugins up there that have overlapping functionality. I think @Alan-Kilborn 's point is more about “work smarter, not harder” - you’re asking good questions and getting help here, but a more fundamental question might be:
“Hey, is there a way or plugin to do ‘X’?”
and you may find, yes, there are 2 plugins and a way to script it in either PythonScript and / or NppExec.
The other reason to describe your plugin here is there may be some who are willing to test functionality for you or even help develop it if it “scratches an itch”.
If you’re developing a plugin just for the experience, that works fine too! Good luck :-)!
Cheers.
-
@michael-vincent Thanks Michael! Very helpful!
Is there a plugin to search multi text tag and display the result?
I am an embedded software engineer and often need to analyse logs. I want to make a multiline search plugin, because the power events have unique log pattern, the device communication events and the brightness events of the screen or other events all have their own patterns. I want fill the log patterns in the plugin and search them totally. Then I can analyse them in the sequence base on timestamp.I almost finish it but blocked by the separator. So ask questions here. The function is indeed “scratches an itch” but … maybe I am just too eager to have relationship with a widely used editor and just do it before ask. Haha.
-
@lifehack-nerd said in How to remove to separation lines in the menu?:
Is there a plugin to search multi text tag and display the result?
I am an embedded software engineer and often need to analyse logs. I want to make a multiline search plugin, because the power events have unique log patternHave a look at AnalysePlugin which is for analyzing log files and allows multiple search patters (including regex) and can color the file or output to a search window. That may cover 80% of your use case - feel free to continue your development either way.
Cheers.
-
@michael-vincent This plugin is good especially it can color the found logs and the full log reacts when click on the found log. It was started 10 years ago! I am going to terminate my work.
-
@lifehack-nerd said in How to remove to separation lines in the menu?:
This (Analyse) plugin is good especially it can color the found logs and the full log reacts when click on the found log. It was started 10 years ago! I am going to terminate my work.
Yea…I certainly didn’t want to discourage your work, but putting effort into something just to discover you’ve reinvented the wheel is a bummer.
-
@lifehack-nerd said in How to remove to separation lines in the menu?:
It was started 10 years ago! I am going to terminate my work.
I think just recently updated to address the N++ 8.3 breaking changes. So the author is active thus if you want to contribute, you may ask him/her on the plugin’s site and perhaps help improve that plugin for the good of all.
Cheers.
-
@alan-kilborn Yeah, I didn’t know there already had a good wheel here.
How do you avoid this kind of thing happened?
If you have a idea, will you annouce to everybody or trend to just start it?
Thanks! -
@michael-vincent Got it.Thanks!
-
@lifehack-nerd said in How to remove to separation lines in the menu?:
How do you avoid this kind of thing happened?
If you have a idea, will you annouce to everybody or trend to just start it?I took the time at one point to read through all the plugins and understand what they do (at least according to their documentation or README). Then I installed the ones I wanted, tested and either kept or removed.
There are “repeats”, for example - ctags-based code navigation plugins:
all of which did 80% of what I wanted, but not necessarily an overlapping 80% and there were still some missing features. So I forked one and added to it and made my “own” which folks here know about and I provide a pre-release on GitHub, but do not push to the actual Plugin Admin so it won’t collide with the original author’s version.
If there’s something I want that I don’t think exists and I can’t find a way to automate it through a scripting plugin I use (NppExec and PythonScript), I’ll ask here “Help Wanted” category. If I don’t find something suitable, I’d try an announcement / request for comments here in the “Plugin Development” category.
But ultimately, it’s open source so there is no right or wrong way and if you “duplicate” something someone else has already done, the “market” (i.e., users) will determine what they like best. And there is no harm in developing a plugin that only you yourself use.
Happy coding!
Cheers.
-
@michael-vincent said in How to remove to separation lines in the menu?:
all of which did 80% of what I wanted, but not necessarily an overlapping 80% and there were still some missing features. So I forked one and added to it and made my “own” which folks here know about and I provide a pre-release on GitHub, but do not push to the actual Plugin Admin so it won’t collide with the original author’s version.
Emm,it’s a very logical method.
Could I know are you a big fan of Notepad++, because you know much things about it and always online. And what driver you to be a contributor of it?
For me, to be honest, I am just a light user though have been using it for years. Maybe this is a bad habit that I didn’t experience things deeply and always want to make something “innovative” to it and finally find that it had been done by others long time ago. Seems it keep happenning. HAHA. -
@lifehack-nerd said in How to remove to separation lines in the menu?:
Could I know are you a big fan of Notepad++, because you know much things about it and always online. And what driver you to be a contributor of it?
I just used Windows Notepad back in the day because coding was not primary to my job. The more I did coding (for network automation), the more I saw others with IDE’s and how they helped workflow. But I never coded in a single language so a full blown IDE for a given language wouldn’t work nor would an IDE per language - no consistency.
I discovered Notepad++ did all the text editor things an IDE could do and with plugins, I could actually get some IDE-like/lite features that were enough for me to supplement my workflow for the little coding I did do (e.g., Perl, Python, Batch, Bash, and text files like JSON, XML, CSV and log files). Mind you, this was yonks ago, before VS-Code was around and everyone seemed to migrate to that from Atom or Sublime - all of which I’ve tried, but I keep coming back to Notepad++.
Again, I’m not a software developer and my skills (or lack thereof) are self-taught and Google’d so I contribute how I can - answer questions here, testing new builds, dabbling and plugins and contributing a pull request here and there when it’s easy enough for me to implement.
Cheers.
-
@michael-vincent Yeah, thank you very much for sharing your story. I also experienced sublime and ultraeditor before and then come back to Notepad++. It’s neat and very light-weight to run.
Cheers.