#201 NppExec BUG and feature request

closed-fixed
DV
NppExec (13)
5
2012-09-09
2012-08-10
SFforum
No

The "Follow $(CURRENT_DIRECTORY)" option is glitched. If this option is already checked when I launch notepad++, AND then I create a new file, it will not recognize the current path(even if I then save it), and the compiler will say that the file is not there(for example I press f6 type in gcc -c test.c). The workaround I use is to close the file and open it again(reload doesn't work), so that the "Follow $(CURRENT_DIRECTORY)" option works and the compiler finds the file. Thank you.

I also have a feature request for this plugin: I wish there was an option to execute a defined user command by default. That's cause I'm getting used to making the so called make files, and it would be great if I could just press f9 the first time I open notepad++ and it runs my make file. I don't see how this would harm other users, since it would just be another option to choose. Hope it will be implemented. Thank you.

Discussion

  • DV
    DV
    2012-08-10

    Regarding the bug. Can you make the changes described below and rebuild the plugin? (I use Visual Studio 2005 Express or 2008 Express for this.)
    Open the file "NppExec.cpp" at line number 1192. You will see:

    if ( notifyCode->nmhdr.code == NPPN_BUFFERACTIVATED )
    {
    if ( bNppReady )
    UpdateCurrentDirectory();
    }

    Change it to:

    if ( notifyCode->nmhdr.code == NPPN_BUFFERACTIVATED ||
    notifyCode->nmhdr.code == NPPN_FILESAVED )
    {
    if ( bNppReady )
    UpdateCurrentDirectory();
    }

    It should fix the problem, I think.

    Regarding the feature request. I don't understand what is the difference between this request and assigning a menu item to some script with further assigning a hotkey for this item. Thus you'll have a script which will be executed by pressing a hotkey - which looks like what you want.

     
  • SFforum
    SFforum
    2012-08-11

    thank you for the reply, but I can not find the file "NppExec.cpp", only "NppExec.ini" at %appdata% directory, which doesn't have those lines you wrote. The menu item thing solved my problem, I didn't understand before now I do. A curious event happened, now that I assigned my script to f9 hotkey, the bug disappeared. Now the compiler always finds the file. But I still want to know where is the "NppExec.cpp" file :). Thank you.

     
  • DV
    DV
    2012-08-11

    "NppExec.cpp" is one of the source files, you can find it inside the archive with plugin's sources: NppExec/NppExec/src/NppExec.cpp :) To build NppExec from the sources, you need at least Visual Studio 2005 or 2008 Express. I mentioned it because you wrote about your make-file. Let me explain. I thought, probably mistakenly, that your make-file may be related to C or C++ sources (as cross-platform C or C++ code is usually built via make-files) and, if so, you should be aware about building of C/C++ applications from sources :)

     
  • SFforum
    SFforum
    2012-08-11

    inside the folder "C:\Program Files (x86)\Notepad++\plugins" I have the NppExec folder, which has the files "BaseDef", "menuCmdID", "Notepad_plus_msgs", and "Scintilla". Nothing else. And at %appdata% there is only the "NppExec.ini" I mentioned. Am I missing a folder notepad++ creates? Anyway, I've changed my mind, let it be. Everything is working as I want now. Thank you for the support :).

     
  • SFforum
    SFforum
    2012-08-11

    My bad the bug I mentioned still exists...now I have to press f9 when the makefile is selected or I close the file(main) and open it again. You said to open the file "NppExec.cpp" and edit it, but it is nowhere to be found . Help me out here please, thank you.

     
  • DV
    DV
    2012-08-12

    Well, my comment was related to source code of the plugin (http://sourceforge.net/projects/npp-plugins/files/NppExec/NppExec%20Plugin%20v0.4.3/NppExec_043_src.zip/download).
    A regular user can not do anything with it until the user knows how to compile and rebuild the plugin from its sources.
    If you don't know what I'm talking about, just don't mind :) I've attached a modified version with the mentioned changes included. Please try to see if it has the problem fixed.

     
  • DV
    DV
    2012-08-12

     
    Attachments
  • SFforum
    SFforum
    2012-08-14

    Thank you for the support. Ah...the glitch just isn't happening right now lol. Seems like it comes and goes, I can't test the modified version at the moment :(. Well, when I cross with it again I will test it, and give you feedback :). Have a good night.

     
  • DV
    DV
    2012-09-09

    fixed in v0.4.3.1

     
  • DV
    DV
    2012-09-09

    • status: open --> closed-fixed