@Troglo37 said in Is There a Way to Prevent Pasted Text from Spreading Out with Rows of Spaces?:
I don’t see anywhere in the FAQ how to apply an icon to the script.
Reading the manual yourself would be more beneficial. But, to help you:
Plugins > Python Script > Configuration… Choose either Machine Scripts (if your script is in c:\program files\notepad++\plugins\PythonScript\scripts hierarchy) or User Scripts (if your script is in %AppData%\Notepad++\plugins\Config\PythonScript\scripts hierarchy, where it should be for normal usage) Click on your script The Add button above the Toolbar icons panel at the right should be available now; click Add, and the script will be added Click the script in that panel, and click Set Icon…, and navigate to whatever 32x32 BMP or ICO you want to use If you exit Notepad++ and run it again, that script will have an button on the toolbar, using whatever icon you chose (or the Python icon if you didn’t choose one)Or, since you said,
there aren’t any unused ones available under Plugins > Customize Toolbar
If you prefer using the Customize Toolbar, you can. However, there’s probably confusion that you need cleared up. Customize Toolbar has two separate ways of customizing the toolbar
It can manipulate the icon for tools that are already on the toolbar, or a few other builtin commands, using Plugins > Customize Toolbar > Customize Toolbar… interface, which you are likely familiar with I assume this is the one where you say, “there aren’t any unused ones available”. I cannot imagine that you’ve actually enabled another couple-dozen buttons from its list, so that there are no other “available toolbar buttons”, as that toolbar would be so full as to be unusable. On the other hand, that’s the only thing I imagine that you could mean by such a sentence. It can add an icon for other builtin or plugin tools using its Custom Buttons Use Plugins > Customize Toolbar > Custom Buttons to add a checkmark to that option. It will tell you that it will take effect the next time you start Notepad++. You can use Plugins > Customize Toolbar > Help - Custom Buttons to read more about the syntax of the file, though the file itself will have comments that help you set things up exit Notepad++ open Notepad++ File > Open %AppData%\Notepad++\plugins\config\CustomizeToolbar.btn, which was created automatically when you checkmarked the option in the earlier step Use something akin to the followingPlugins,Python Script,Scripts,No New Lines,*R:PN,*R:PN,*R:PN That setup assumes you named your script No New Lines, and that you want it to show up as a pseudo-icon with red background, with the text “PN” for “Paste: No New Lines”: d2e3ec03-e741-4d7f-a0f5-e92ca710deb1-image.png If you actually want icons, put NoNewLines.bmp, NoNewLines_light.ico, and NoNewLines_dark.ico in the same directory as CustomizeToolbar.btn Important Things To Note To add to toolbar, pick one of the two methods – either use the PythonScript Configuration… dialog, or use the Customize Toolbar’s Custom Buttons feature. DON’T USE BOTH AT THE SAME TIME If you use the script I suggested, using a button makes sense. If you use the script @mpheath suggested, it just needs to be run ATSTARTUP, and you won’t need a button at all, because it will intercept the normal paste command.