It should do the following:
1. On file open, N++ fires this plugin, or on button press in N++, doesn't really matters.
2. Plugin, runs through the opened file, through each line in this file, and matches each line to regex pattern.
3.1. If line didn't match the pattern, plugin does nothing.
3.2. If line matches the pattern, plugin highlights this line with some color.
===========================================================================
4. If user right clicks on highlited line, plugin, is connecting to database and displays a comment for this line.
5. User can add comment or edit existing comment for any line, in this case plugin connects to db, adds or edits this comment, many users should be able to add/edit/remove comments.
Does anybody know if such plugin already exists?
If not, could you please help in writing it?
Questions are:
- How to automatically start plugin on file open in N++
- How to start plugin on button press in N++, from menu.
- How to highlight a line of text in N++, or how to add some pictogram at the beginning of line, so user could see there is a comment available for this line?
Thanks in advance!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to get started on a C# plugin. To start I have downloaded NppPlugin.NET.v0.5 then compiled and built it with Microsoft Visual Studio Express 2012 for Windows Desktop, Version 11.0.50727.42. First, when I do a "Rebuild solution" I get the error "The system cannot find the file specified" with no clues as to which file. See the output below.
But, the Demo.dll file is created. Copyied this file into the "C:\Program Files (x86)\Notepad++\plugins" directory and ran Notepad++ version 6.2. Get a pop-up with it first line saying "This ANSI plugin is not compatible with tour Unicode Notepad++." Checked the source files and find that file "C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\UnmanagedExports.cs" contains the lines:
I have been looking, without success, for a simple unicode plugin for Notepad++ that is written in C# that I can use as a guide to understanding what is right and what is wrong with the C# template I downloaded previously. Would appreciate a link to the source code for a simple C# plugin.
Thanks
Adrian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the two weeks since my first post here, there have been about 90 views of this thread. So there is a lot of interest in it. But no one has been able to provide any help.
After several years as a user of Notepad++ I wanted to increase my knowledge of the editor and of C# by adding a small feature that I would like to use.
The documentation of Notepad++ and its plugins says that they can be written in C#. As this is the plugin forum for Notepad++ I assumed that it was the place to look for help on this topic. Perhaps the readers of this forum can direct me to somewhere that can help.
Regards
Adrian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey Adrian, I recently started developing a plugin using C# template. Not published it yet as it is still not final, but should be enough for you to get started. Drop me a note on shaleen.mishra@gmail.com and i will revert with the source if you think that might help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Shaleen has been kind enough to send me a copy of her files. After studying them and doing some more investigation I found why I had had the problems. One of the last stages in the build of a C# plugin invokes the "ildasm.exe" program, which is part of Visual Studio. Unfortunately, the Visual Studio 2012 Express installer does not add the directory with ildasm.exe to the path. The error message I quoted, above, must be complaining that the executable can not be found on the path.
I added the directory "c:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools" to the path. Then both the NPP C# demo and Shaleen's code compile successfully. Both work when their DLLs are added to the Notepad++ plugin directory.
Question: Is adding the directory to the path the best solution? Is there some better way of making Visual Studio 2012 find ildasm.exe?
Regards
Adrian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Adrian,
Thanks for the tip adding that to the Path fixed it for me (In Visual Studio 2013 too) Have you figured out how to do it without setting the Path variable?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Adrian,
Thanks for the tip adding that to the Path fixed it for me (In Visual
Studio 2013 too) Have you figured out how to do it without setting the Path
variable?
Hi Shaleen,
Sorry for the late reply. When I change the version to 4.0 or 4.5, the extension crashes with the useful, "Unknown exception". The Title of the message box says "PluginsManager::runPluginCommand Exception"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam);
Unicode glyphs are returned as three characters. For my extension, this is a big problem. I tried changing the UnmanagedType to LPWStr but that returned gibberish. Any Advice?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all.
Need your help in writing plugin.
It should do the following:
1. On file open, N++ fires this plugin, or on button press in N++, doesn't really matters.
2. Plugin, runs through the opened file, through each line in this file, and matches each line to regex pattern.
3.1. If line didn't match the pattern, plugin does nothing.
3.2. If line matches the pattern, plugin highlights this line with some color.
===========================================================================
4. If user right clicks on highlited line, plugin, is connecting to database and displays a comment for this line.
5. User can add comment or edit existing comment for any line, in this case plugin connects to db, adds or edits this comment, many users should be able to add/edit/remove comments.
Does anybody know if such plugin already exists?
If not, could you please help in writing it?
Questions are:
- How to automatically start plugin on file open in N++
- How to start plugin on button press in N++, from menu.
- How to highlight a line of text in N++, or how to add some pictogram at the beginning of line, so user could see there is a comment available for this line?
Thanks in advance!
You should really start reading https://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Development_Quick_Start_Guide
At that point, you'll wonder what notifications you can catch or how to drive Scintilla. The reference readings are http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Messages_And_Notifications and http://www.scintilla.org/ScintillaDoc.html
You can then do pretty much what you like. Of course, for the most intricate details, you can refer to https://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Development
HTH
CChris
I am trying to get started on a C# plugin. To start I have downloaded NppPlugin.NET.v0.5 then compiled and built it with Microsoft Visual Studio Express 2012 for Windows Desktop, Version 11.0.50727.42. First, when I do a "Rebuild solution" I get the error "The system cannot find the file specified" with no clues as to which file. See the output below.
But, the Demo.dll file is created. Copyied this file into the "C:\Program Files (x86)\Notepad++\plugins" directory and ran Notepad++ version 6.2. Get a pop-up with it first line saying "This ANSI plugin is not compatible with tour Unicode Notepad++." Checked the source files and find that file "C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\UnmanagedExports.cs" contains the lines:
namespace NppPluginNET
{
class UnmanagedExports
{
[DllExport(CallingConvention=CallingConvention.Cdecl)]
static bool isUnicode()
{
return true;
}
From what I have read, the above should mean it is not an ANSI plugin.
Would like to know what I have done wrong.
Regards
Adrian
1>------ Rebuild All started: Project: NppManagedPluginDemo.VS2010, Configuration: Debug Any CPU ------
1> NppManagedPluginDemo.VS2010 -> C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\bin\Debug\Demo.dll
1> ILDasm: calling 'ildasm.exe' with /quoteallnames /unicode /nobar /linenum "/out:C:\Users\Adrian_2\AppData\Local\Temp\tmpAB1F\Demo.il" "C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\bin\Debug\Demo.dll"
1>C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\DllExport\NppPlugin.DllExport.targets(8,5): error : The system cannot find the file specified
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I have been looking, without success, for a simple unicode plugin for Notepad++ that is written in C# that I can use as a guide to understanding what is right and what is wrong with the C# template I downloaded previously. Would appreciate a link to the source code for a simple C# plugin.
Thanks
Adrian
In the two weeks since my first post here, there have been about 90 views of this thread. So there is a lot of interest in it. But no one has been able to provide any help.
After several years as a user of Notepad++ I wanted to increase my knowledge of the editor and of C# by adding a small feature that I would like to use.
The documentation of Notepad++ and its plugins says that they can be written in C#. As this is the plugin forum for Notepad++ I assumed that it was the place to look for help on this topic. Perhaps the readers of this forum can direct me to somewhere that can help.
Regards
Adrian
Hey Adrian, I recently started developing a plugin using C# template. Not published it yet as it is still not final, but should be enough for you to get started. Drop me a note on shaleen.mishra@gmail.com and i will revert with the source if you think that might help.
Shaleen has been kind enough to send me a copy of her files. After studying them and doing some more investigation I found why I had had the problems. One of the last stages in the build of a C# plugin invokes the "ildasm.exe" program, which is part of Visual Studio. Unfortunately, the Visual Studio 2012 Express installer does not add the directory with ildasm.exe to the path. The error message I quoted, above, must be complaining that the executable can not be found on the path.
I added the directory "c:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools" to the path. Then both the NPP C# demo and Shaleen's code compile successfully. Both work when their DLLs are added to the Notepad++ plugin directory.
Question: Is adding the directory to the path the best solution? Is there some better way of making Visual Studio 2012 find ildasm.exe?
Regards
Adrian
Hi Adrian,
Thanks for the tip adding that to the Path fixed it for me (In Visual Studio 2013 too) Have you figured out how to do it without setting the Path variable?
Hi,
I just ported my Translate plugin to C# (Based on the C# plugin template).
Please have a look at :
https://sourceforge.net/p/npptranslate/code/HEAD/tree/nppTranslateCS
Hope that helps.
Regards
Shaleen Mishra
On Wed, Sep 17, 2014 at 2:25 PM, Chris McGrath cpmcgrath1@users.sf.net
wrote:
Has anyone figured out how to stop using .NET 3.5 and use 4/4.5?
Well, target framework under plugin project properties can be changed to
whichever version you want to build with...doesn't that work for ypu?
-Shaleen
On Dec 14, 2014 11:15 AM, "Chris McGrath" cpmcgrath1@users.sf.net wrote:
Hi Shaleen,
Sorry for the late reply. When I change the version to 4.0 or 4.5, the extension crashes with the useful, "Unknown exception". The Title of the message box says "PluginsManager::runPluginCommand Exception"
Here's an interesting one,
When I call
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam);
Unicode glyphs are returned as three characters. For my extension, this is a big problem. I tried changing the UnmanagedType to LPWStr but that returned gibberish. Any Advice?