Categories

  • Announcements regarding our community
    275 Topics
    5k Posts
    guy038G

    Hello, @donho and All,

    As promised, the GitHub issue :

    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16465#issue-3016715149

    BR

    guy038

  • Frequently Asked Questions and Guides (about Notepad++ and this Forum)

    36 Topics
    60 Posts
    PeterJonesP
    Pork To Sausage

    The pork2Sausage.ini, accessible through Plugins > Pork to Sausage > Edit user commands, has a number of parameters for use in the the INI definitions, plus two special variables.

    Parameters:

    progPath: [Mandatory] The full path of the program to launch This is the full path, including the name of the .exe progCmd: [Mandatory] The whole command to call the program This is the whole command; because the program path is given in the first Parameter, this one can use just the name of the command rather than the full path workDir: [Mandatory] The path of working directory This is needed for setting the “working directory” for the program – for example, if it needs to be able to find specific libraries relative to some “current directory” progInput: [Optional] The full path name of the program input file. Pork to sausage plugin will write the selected text in a new created file with the given full path file name. This is helpful if you don’t want to try to input the “selected text” (see variables, below) on the command line (or example, if the selected text is too long, or the external program doesn’t accept text input on the command line) progOutput: [Optional] The full path name of the program output file. Pork to sausage plugin will replace selected text by the content of indicated file, which is supposed to be the output file of the program. If this parameter is absent, then Pork to sausage plugin will use the stdout of program to replace the selected text. This is useful if the external program writes its output to a file, instead of STDOUT. replaceSelection: [Optional] If its value is false, then the selected text will be untouched. Set this to false if you don’t want the active selection in Notepad++ to be overwritten.

    Variables

    $(SELECTION): Your text selection. The text will be encoded as UTF16-LE. Your external command must be able to handle the text in that encoding. $(TIMESTAMP): the Timestamp which will be generated by Pork to Sausage at the start of the call. This varible used for naming the file created by Pork to sausage plugin (progInput) to ensure the unicity (uniqueness) of the created file.

    Discussion

    There are two primary input methods to your application.

    You can send the selected text as an argument on the command line:progCmd=external.exe -inText "$(SELECTION)" ... You can have Pork to Sausage create a temporary file containing the selection:progInput=%TEMP%\Pork2Sausage.$(TIMESTAMP).input progCmd=external.exe -inputFile "%TEMP\Port2Sausage.$(TIMESTAMP).input"

    Example

    The default pork2sausage.ini gives a couple of examples of using just the command-line for the input text and the STDOUT of the command as the output text.

    But to give an example which requires the selected-text be sent to a temporary file (progInput) and the output of the command to another file (progOutput), here is a version of the same action as used by the NppExec example from earlier:

    [gpg-decrypt selection to self] progPath=c:\usr\local\apps\gnupg\bin\gpg.exe progCmd=gpg --output "C:\Users\XYZ\AppData\Local\Temp\p2s.$(TIMESTAMP).output" --decrypt "C:\Users\XYZ\AppData\Local\Temp\p2s.$(TIMESTAMP).asc" progInput=C:\Users\XYZ\AppData\Local\Temp\p2s.$(TIMESTAMP).asc progOutput=C:\Users\XYZ\AppData\Local\Temp\p2s.$(TIMESTAMP).output workDir=C:\Users\XYZ\AppData\Local\Temp

    The selected text will be written to the progInput file. Then progCmd will be run, which decrypts from the same file as progInput, and puts the result in the same file as progOutput. Then the plugin replaces the selected text with the contents of the progOutput file.

  • Notepad++ discussions that don’t fit in other Categories

    4k Topics
    21k Posts
    pnedevP

    I have also ‘stumbled’ upon that behavior when working on Compare plugins.

    @Coises said in Two buffer-activated notifications instead of just one:

    The best way I have found to work around it is to try to write NPPN_BUFFERACTIVATED processing such that doing it repeatedly on a file that hasn’t changed does nothing, and does it quickly. That usually means tracking changes with SCN_MODIFIED and keeping a map that associates Scintilla document IDs, Notepad++ buffer IDs, and status information. It’s ugly.

    @Coises , I would just add that back in the time when I analyzed that behavior I noticed that NPPN_BUFFERACTIVATED is send for the same file that hasn’t changed also when it is changed outside Notepad++ and it is reloaded in the editor. I actually currently use that to detect that the current file is changed outside and reloaded in Notepad++ to refresh the compare.

    I agree with what Alan wrote:

    @Alan-Kilborn said in Two buffer-activated notifications instead of just one:

    But if the user is using e.g. a plugin that does a not-insignificant operation on buff-activated, and that operation is time-related to the size of the file, and the currently-active tab in the inactive view is absolutely huge and the above happens, the user can notice.

    I would also add that it is not only the plugins processing of NPPN_BUFFERACTIVATED involved here but unfortunately also some Notepad++ internal functions.
    For example let’s suppose we have opened two files in the first (main) view and one file in the second (sub) view. Now let’s assume one of the files in the first view is small and loads quickly and the second file is large xml for example and it is the currently active file in the view. Now if we switch to the second view and activate the Notepad++'s function list and then click on the small file’s tab in the first view then it seems the large file is first ‘activated’ in the view and the function list seems to be processing it before immediately switching to the small file. And that delay is noticeable by the user in that case even though plugins are not involved

  • 10k Topics
    53k Posts
    Ben HardyB

    @PeterJones yes that was it!
    So indeed it was an easy one - you’d think I would have figured that out. Haha
    Thank you for pointing me to the setting!

  • Technical discussion of building or contributing to Notepad++ or Plugin codebases

    1k Topics
    8k Posts
    Ako SajaiaA

    plzz add koltin guys , i love notepad ++ everything i’m writing in it , pluzz doit :3

  • Security shouldn't be the privilege of rich people
    49 Topics
    195 Posts
    dinkumoilD

    @Emmanuel-Meekers
    AFAIK there is no technical means to limit the number of plugins a user is able to install. You can only remove the capability to install plugins at all.

    You could do a survey which plugins your employees need. There can be different needs, e.g. technical staff likely needs other plugins than employees that ar more involved in administrative tasks. Then you can install these plugins on the employee’s machines.

    After that you need to rename or delete <install-directory>\updater\GUP.exe to prevent users from installing any other plugins. As long as your employees don’t have admin access to Notepad++'s install directory, they are not able to revert these changes.

    The disadvantage is that your users neither will be able to update Notepad++ itself nor the installed plugins. This is something your ICT department has to do.

  • All the issues (publications/questions) about binary translation
    72 Topics
    462 Posts
    Alan KilbornA

    @PeterJones

    Ah…

  • Say fuck to Notepad++ here, and only here
    85 Topics
    499 Posts
    donhoD

    As title.

  • No support request and bug report here, only unconditional praise and worship

    1 Topics
    3 Posts
    T

    @martaisty I agree, this is a pretty awesome idea! I actually forgot there was a war going on.

    I’m a new user of Notepad++ and I already love it very much, both the politics and the software itself.

    It’s nice to see Don Ho has provided several ways I can help stop this damn war.

    As he suggested, I wanted to donate to one of the reliable organizations “Dronators” which is to help Ukraine assemble an army of drones but that project is already over and it’s no longer possible to donate.

    Anyways, I don’t think they will need my $50 as the project has collected $1,443,157,017! Impressive, but the war didn’t stop, what a bummer!

    In the end I chose to donate to the National Bank of Ukraine which is reliable as it is the national bank of Ukraine. Don Ho says this is to “help people suffering” and funding the military always leads wars to stop, eventually.

  • Blog posts from individual members
    56 Topics
    211 Posts
    barisusakliB

    Should be fixed now, thanks for reporting!

  • Computer/Programming Jokes are welcome here

    47 Topics
    145 Posts