-
I'm working on file parsing and have a region of a file identified by a start column and start line number, and end column and end line number. And I would like that text to be selected when the file is loaded into Notepad++ by command-line. That would allow selecting of the block that caused a problem when clicking on an error, or jumping directly to some block of text to begin editing. I would like to request a feature enhancement that would allow the ability to select the text between the Goto line/column position, and a new Select to line/column position. It could be a feature that could be enabled / disabled in Preferences, and if enabled would add two more line/column controls to the Goto Line, Column panel:
The cursor position would still remain at the Go to value, but the text between the two positions would be selected. If the cursor position and/or text that is selected changes, and the options are set to auto update the panel, the new cursor position would be updated and also the new selected region's end line/column would be updated too. The -pluginMessage=GLC could be modified to add a new option, "s", which would specify a pair of numbers like 8,22 for the select to funcitonality. Thank you in advance for your consideration. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
First of all, thank you very much for your enhancement idea. I very much like the command line enhancement part of your suggestions. It seems to me that an implementation of just this command-line part will be sufficient to meet the goal stated at the start of your post. Hence I am a bit less enthused with the panel interface enhancement part. Reasons:
I think I will be able to quickly implement the command line enhancement part of your suggestions. So, that is the good news. However, I will need more persuasive arguments from you for the panel enhancement part. |
Beta Was this translation helpful? Give feedback.
-
Thank you for responding so quickly. The command However, the command-line is slow. Right now the command line launches a new NPP process, but that process communicates to the already running instance and then shuts down. And that's pretty slow. So, to speed things up, I'm working on JNA access using Java to send messages to Notepad++. So, having all the controls available in the Goto Line, Column panel would allow me to interact with the panel through messages to change the value. So, unless there's a way to send the plugin a message directly through SendMessage(), the controls would allow interaction through the User32 API. Getting all the control IDs seems pretty easy: I just create a macro and look at the macro in shortcuts.xml.to get the values that are needed to be sent with SendMessage(). I haven't tried with the Goto Line, Column controls yet, but I assume I should be able to record a macro that interacts with the panel and get those IDs too. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
I forgot to mention this earlier since it has been a few years:
I prototyped the core functionality for GotoLineCol initially with the PythonScript plugin, and only after that did I proceed to implement it in C++ as a standalone plugin. In fact, I later submitted those prototype scripts to be included as sample scripts in the PythonScript plugin. If you have PythonScript plugin installed within NPP, and navigate to NPP menu:
Plugins » Python Script » Scripts » Samples
, you will find the listings for GotoLineCol and GotoLineCol_Barebones. The scripts are located in the folder path:Notepad++\plugins\PythonScript\scripts\Samples
. I recommend that you review theGotoLineCol_Barebones.py
file…