-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Command Line Usage #11
Comments
@pidgeon777, you may already be aware that Notepad++ has command prompt options that achieve this without using the Goto-Line-Col-NPP plugin. Just to recap, opening a file with, for example: You can find all command line options for NPP at: https://npp-user-manual.org/docs/command-prompt/ Of course, the NPP command line option for column navigation does not handle TAB and Unicode characters in the more sophisticated manner that Goto-Line-Col-NPP plugin does. Even then, it will still navigate to the correct line and the vicinity of the intended column position. So this should suffice for most text files. |
Thanks for the prompt reply. You're right, but I was trying to look for a way to position |
I have implemented the command line options processing in GotoLineCol. In addition to Please try the v2.1.0.0 Release and let me know if you find any regressions or new issues. Thanks. DLL-only manual upgrade of a previously installed version of the pluginDownload the zip file version to match your Notepad++ bitness. Then, either:
|
Post Script: |
Latest Update: Consolidated GLC Command Line Options has been introduced in the v2.1.1.0 Release. Please ignore my two previous posts on this issue and try the v2.1.1.0 Release and let me know if you find any regressions or new issues. Thanks! |
Tried it with this command:
Unfortunately, the caret still doesn't get positioned at the proper byte (column) position. In short, it has the same effect as this command, with no
Tested with Notepad++ v8.1.5 32bit on Windows 10 x64 Pro. |
@pidgeon777, the Sample command used for byte column positioning ( Sample command used for char column column positioning ( [In my NPP, the TAB is set at 3 spaces. Hence a shift of two chars between byte and char column positions.] If the GLC option is not working for you, check for these:
I also recommend that you include the |
I just did a test with this command:
The curious thing is that no call tip appeared, also the plugin itself after the jump reported a position that was coherent with the resulting Notepad++ position, but differed from the wanted byte position: I specified byte Also, the cursor has been wrongly positioned to the This is confirmed also by the fact that none of the GLC options had any effect (no call tip was shown and so on), even if I added them to my command line. So, the problem unfortunately seems to be still there. I configured my tab size to 4 spaces, and GLC version is |
You haven't confirmed if you have updated the GotoLineColumn DLL. I had this query in my previous post:
I reiterate that I have tested it with single & multiple files; x64 & x86 versions; and portable & installed versions of NPP. So, I strongly suspect that you still have the version of GLC DLL that gets installed with the NPP's Plugins Admin. That would be GLC v2.0.0.0 which doesn't process any command line options. If you have updated the GLC DLL, you should see this GLC » About message box: If you are not seeing a matching version number and build timestamp, then use the instructions below to update the DLL. DLL-only manual upgrade of a previously installed version of the pluginGo to the v2.1.1.0 Release page. Download the zip file version to match your Notepad++ bitness. Then, either:
|
The plugin is not able to see your command line options. That is why it is not processing the byte positioning switch or any of the other visual action switches. This could happen if an NPP process was already running before you issued the command line options. So, check for these possibilities:
You can also try including the The fresh NPP process requirement is not a deficiency of the GLC plugin. Even Microsoft SysInternal's venerable Process Explorer utility is unable to see the command line parameters if you were to issue a fresh set of command line options when an NPP instance is already running or hidden in the system tray. If you have complied with the two checks listed above and the GLC is still not processing your command line options, please run this extra Process Explorer check before replying back to my post:
The GLC plugin uses the |
Thanks for the explanation. At this point, I suppose my issue is due to the fact that I'm trying to browse my source code by keeping my instance of Notepad++ always active. I didn't know Notepad++ had to be closed every time, before issuing the GLC command. It is a pity because loading a new Notepad++ instance every time have two big disadvantages:
I suppose the only way to fix this, would be to ask Notepad++ developers to hardcode your plugin or part of it in the next Notepad++ release, then. |
@pidgeon777, Alternatively, we need NPP to add a new NPM_xxx message to its API that will provide plugin writers with the new command line text used to re-invoke an existing NPP process. Firstly, as sort of an addendum to my previous post, I will list two other ways to view the Initial NPP Command Line:
So, how does NPP manage to open new files when re-invoked, and process fresh command line options? Here is how: Actually, when NPP is re-invoked, a new NPP process is started. This new process captures the new command line via its wWinMain function (file: notepad-plus-plue/PowerEditor/src/winmain.cpp). Note that NPP is not using the GetCommandLine Windows API at all. Within winmain.cpp, there is a check for multi-instance and initial process: From within this if block, two WM_COPYDATA messages are sent out from this new NPP process to the existing, initial NPP process. One message contains a list of the new command line options, and the other one a list of the file names specified for this fresh NPP invocation. After this, the new, not-yet-visible NPP process will terminate. The initial NPP process will use these two messages to open new files and process any fresh command line options that came along with it. For our purposes here, we will need NPP to store the information from these two messages and make them available to the plugins via a new NPPM_xxx message call. |
This feature request has been implemented with this commit: Implemented -pluginMessage="GLCb1..." command line option for NPP 8.4.2. This feature is available with the GotoLineCol 2.4.0.0 Release. If you are testing this, please make sure you are using it with the Notepad++ 8.4.2 version. See: Notepad++ v8.4.2 Release Candidate 2. |
Is there any way to implement some kind of command line?
The idea would be to be able to open a file in Notepad++ by specifying the wanted line and column (byte) position.
The text was updated successfully, but these errors were encountered: