Currently, N++ plugin system doesn't enable you to specify the view in which a file should be opened. It is always opened in the primary view.
NPPM_DOOPEN could be extended, to also recieve WPARAM: MAIN_VIEW or SUB_VIEW. A file would be cloned to this view, if it was already open in the other view. If the file isn't open yet, it is just opened to that view, of course.
Alternatively, but much less comfortable, a new message could be added to enable cloning a file to the other view.
Also, DOOPEN seems to always return 0, even when it succeeds opening a file. Bug?
Don, could you please add this?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
3. This is the identifier lookup function. The user can avoid it by not having second view open. I can also add an option to disable it, so it won't be annoying if user wants to have second view without this function. To go to an identifier manually, the user would use SPACE (go to identifier function).
The identifiers are regenerated after every restart (when the dialog is first opened), and when the user manually regenerates them. The ctags.tmp file is created in the directory of the current file, and includes all found definitions for this directory and all subdirectories. There are some limitations, though. I'm still considering, how to solve the problem of subdirectory files.
Thanks for the upgrade. Will try it out as soon as I can.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> Currently, N++ plugin system doesn't enable you to specify the view in which a file should be opened.
> It is always opened in the primary view.
It's not totally true. NPPM_DOOPEN message opens specific file in the current view (which may be the second view).
But indeed, there's no way so far to specify a view to open a file.
NPPM_SETCURRENTVIEW message will be added.
Contact to me if you need new heaser and binary to test your plugin.
Don
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tested opening files directly in N++. I did notice that a file is opened in secondary view if secondary view has focus. The problem arises if the file is already opened in the other view.
If the file is open in primary view, I have no means to display it in secondary. As far as I know, N++ will switch to primary view if I try to open the file, even if the secondary view has focus - or is it not so?
The reason I need the file opened in exactly the specified view is, that I'm trying to use the secondary view as a utility view of my plugin. If the file is opened in primary view and not cloned already, I cannot work with the file.
So, what I really need, is either:
1. When opening a file (NPPM_DOOPEN), if file already opened in the other view, clone the file to current view.
2. A new message to request cloning of a specific file.
Thanks again!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, I've completed it (more or less). My plugin features powerful autocompletion, using ctags. I can send you the current version (0.95), if you would like a preview of it.
At the moment, the plugin is still somewhat crippled by inability to clone an already opened file to other view. Go-to-identifier and identifier-lookup functions don't work in some cases, depending on which files are opened in which view. The user has to manage the opened files by hand to keep things running, and I would really appreciate if something like
NPPM_CLONEFILE(?, ?, viewID, tabIndex)
would be added. It specifies viewID (MAIN_VIEW or SUB_VIEW) and tab index of the file to be cloned. It would function exactly the same as when user right clicks on a tab and chooses "clone to another view". Would that be a lot of work to add?
By the way, every documentation I have stated that WM_ACTIVATE_DOC (NPPM_ACTIVATEDOC, if I could find the new header file) has two parameters: index and viewID. In fact, the parameters are swapped. That had me debugging for a while ;)
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good plugin! A little confusing sometimes, but it's quite promising.
I have some questions and suggestions.
Let's begin with the suggestions :
1. Ctrl+Space is used by default to trigger the Notepad++'s auto-completion. So your shortcut definition Ctrl+Space doesn't work at all under my Notepad++ v4.2.2.
After resigning the shortcut of CCompletion to Ctrl+Alt+Space, I could finally launch the CCompletion dialog. I suggest to change the shortcut to Ctrl+Alt+Space.
2. The system X button to close dialog for users don't know the esc key (or lasy to move their hands to their keyboards :) ).
3. On each char typed, the focus can change from a item to another one in the list, it is very convenient.
The problem is that on each focus change, CCompletion opens the file on the second view (if present) automatically.
It may be annoying for an end user since he/she may hope open the files by him/herself.
To remedy such undesired behaviour, CCompletion can onpen the file only when user right clik on the item (to have the context menu), then choose one of items : open in the same view/open in another view.
Here's my question :
Where does CCompletion (or ctag) search the files in order to generate the symbols? In the current directory and its sub-directory?
Regarding the colon to another view :
I just implement a new message :
#define NPPM_MENUCOMMAND (NPPMSG + 48)
//void NPPM_MENUCOMMAND(0, int cmdID)
// uncomment //#include "menuCmdID.h"
// in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
// to access all the Notepad++ menu command items
So you can use this message to send IDM_VIEW_CLONE_TO_ANOTHER_VIEW to Notepad++ to do what you want.
Let me know if it works.
Regards,
Don
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Currently, N++ plugin system doesn't enable you to specify the view in which a file should be opened. It is always opened in the primary view.
NPPM_DOOPEN could be extended, to also recieve WPARAM: MAIN_VIEW or SUB_VIEW. A file would be cloned to this view, if it was already open in the other view. If the file isn't open yet, it is just opened to that view, of course.
Alternatively, but much less comfortable, a new message could be added to enable cloning a file to the other view.
Also, DOOPEN seems to always return 0, even when it succeeds opening a file. Bug?
Don, could you please add this?
Thanks!
No problem, will fix 1. and 2. when I get home.
3. This is the identifier lookup function. The user can avoid it by not having second view open. I can also add an option to disable it, so it won't be annoying if user wants to have second view without this function. To go to an identifier manually, the user would use SPACE (go to identifier function).
The identifiers are regenerated after every restart (when the dialog is first opened), and when the user manually regenerates them. The ctags.tmp file is created in the directory of the current file, and includes all found definitions for this directory and all subdirectories. There are some limitations, though. I'm still considering, how to solve the problem of subdirectory files.
Thanks for the upgrade. Will try it out as soon as I can.
> Currently, N++ plugin system doesn't enable you to specify the view in which a file should be opened.
> It is always opened in the primary view.
It's not totally true. NPPM_DOOPEN message opens specific file in the current view (which may be the second view).
But indeed, there's no way so far to specify a view to open a file.
NPPM_SETCURRENTVIEW message will be added.
Contact to me if you need new heaser and binary to test your plugin.
Don
I tested opening files directly in N++. I did notice that a file is opened in secondary view if secondary view has focus. The problem arises if the file is already opened in the other view.
If the file is open in primary view, I have no means to display it in secondary. As far as I know, N++ will switch to primary view if I try to open the file, even if the secondary view has focus - or is it not so?
The reason I need the file opened in exactly the specified view is, that I'm trying to use the secondary view as a utility view of my plugin. If the file is opened in primary view and not cloned already, I cannot work with the file.
So, what I really need, is either:
1. When opening a file (NPPM_DOOPEN), if file already opened in the other view, clone the file to current view.
2. A new message to request cloning of a specific file.
Thanks again!
OK, I've completed it (more or less). My plugin features powerful autocompletion, using ctags. I can send you the current version (0.95), if you would like a preview of it.
At the moment, the plugin is still somewhat crippled by inability to clone an already opened file to other view. Go-to-identifier and identifier-lookup functions don't work in some cases, depending on which files are opened in which view. The user has to manage the opened files by hand to keep things running, and I would really appreciate if something like
NPPM_CLONEFILE(?, ?, viewID, tabIndex)
would be added. It specifies viewID (MAIN_VIEW or SUB_VIEW) and tab index of the file to be cloned. It would function exactly the same as when user right clicks on a tab and chooses "clone to another view". Would that be a lot of work to add?
By the way, every documentation I have stated that WM_ACTIVATE_DOC (NPPM_ACTIVATEDOC, if I could find the new header file) has two parameters: index and viewID. In fact, the parameters are swapped. That had me debugging for a while ;)
Thanks.
A mail I sent regarding CCompletion plugin :
**************************************************************************
Bostjan,
Good plugin! A little confusing sometimes, but it's quite promising.
I have some questions and suggestions.
Let's begin with the suggestions :
1. Ctrl+Space is used by default to trigger the Notepad++'s auto-completion. So your shortcut definition Ctrl+Space doesn't work at all under my Notepad++ v4.2.2.
After resigning the shortcut of CCompletion to Ctrl+Alt+Space, I could finally launch the CCompletion dialog. I suggest to change the shortcut to Ctrl+Alt+Space.
2. The system X button to close dialog for users don't know the esc key (or lasy to move their hands to their keyboards :) ).
3. On each char typed, the focus can change from a item to another one in the list, it is very convenient.
The problem is that on each focus change, CCompletion opens the file on the second view (if present) automatically.
It may be annoying for an end user since he/she may hope open the files by him/herself.
To remedy such undesired behaviour, CCompletion can onpen the file only when user right clik on the item (to have the context menu), then choose one of items : open in the same view/open in another view.
Here's my question :
Where does CCompletion (or ctag) search the files in order to generate the symbols? In the current directory and its sub-directory?
Regarding the colon to another view :
I just implement a new message :
#define NPPM_MENUCOMMAND (NPPMSG + 48)
//void NPPM_MENUCOMMAND(0, int cmdID)
// uncomment //#include "menuCmdID.h"
// in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
// to access all the Notepad++ menu command items
So you can use this message to send IDM_VIEW_CLONE_TO_ANOTHER_VIEW to Notepad++ to do what you want.
Let me know if it works.
Regards,
Don
The new added message NPPM_MENUCOMMAND is a message allows plugins to execute all the available menu item commands.
You can download newest binary and needed headers here :
http://notepad-plus.sourceforge.net/commun/misc/nppNewMsg.zip
Don
> I can send you the current version (0.95), if you would like a preview of it.
I'm interested. Please send it to :
don . h @ free . fr
> NPPM_CLONEFILE(?, ?, viewID, tabIndex)
OK. I'll add this message then.
Don