• Find first occurence feature ?

    Locked
    2
    0 Votes
    2 Posts
    401 Views
    Alan KilbornA

    @Vincent-Morin

    Seems like you could do something like this for that:

    Find (?s)foo.*
    Search mode Regular expression

    (Replace foo with your real search term)

  • Saving style

    Locked
    14
    0 Votes
    14 Posts
    10k Views
    PeterJonesP

    I’ve bumped issue#5415, trying to gain traction on at least adding “portable” in prominent locations on the download page, so that eventually people searching for “portable notepad++” will see the official page, rather than the portableapps, as the first and primary link. (I guess it won’t actually help on this one, because the OP got it from the Windows store… but at least the Windows store points out it’s unofficial.)

  • Ctrl-C to copy again?

    Locked
    3
    0 Votes
    3 Posts
    3k Views
    Thomas BihnT

    Awesome! Thanks Peter, that did it.

  • 7 Votes
    2 Posts
    4k Views
    dinkumoilD

    For some unknown reason the solution @guy038 posted above doesn’t work anymore or at least not always. Thus I want to share an alternative solution. The basics for it have been found by @Ekopalypse in this thread.

    To accomplish the comparison task in a user-friendly way we need the following:

    The Compare plugin (obviously). The NppExec plugin. An NppExec script to start comparison. A Batch script as the controller. A VBScript as launcher for the Batch script to avoid flickering console windows. An Explorer context menu entry. The Compare Plugin

    The Compare plugin can be installed using PluginManager (when using Notepad++ v7.5.9 or below) or PluginsAdmin (when using Notepad++ v7.6 or above). It is also possible to download it from this site (click on releases in the menu bar) and install it manually.

    The NppExec Plugin

    The NppExec plugin can be installed using PluginManager (when using Notepad++ v7.5.9 or below) or PluginsAdmin (when using Notepad++ v7.6 or above). It is also possible to donwload it from this site (click on releases in the menu bar) and install it manually.

    The NppExec Script

    After installing the NppExec plugin navigate in Notepad++ to (menu) Plugins -> NppExec -> Execute.... Copy the following code and paste it into the edit area of the popped up window.

    if $(SYS.NppCommand) == CompareFiles then npp_menucommand Plugins/Compare/Compare endif

    Please note: The npp_menucommand command requieres the path to the menu item it should simulate a click on to be localized. That means you have to provide the name of the Plugins menu in the locale your Notepad++ UI is set to.

    The code checks if there is an environment variable NppCommand with the value CompareFiles. If this is the case it triggers the Compare plugin to start file comparison by simulating a mouse click on the according menu entry.

    Now click on button Save... and enter CompareFilesOnStartup into the combo box. This is the name the script can be called with. Then click the Save button and close the dialog by clicking the OK button.

    Now navigate to (menu) Plugins -> NppExec -> Advanced Options... and select in the combo box under Execute this script when Notepad++ starts the CompareFilesOnStartup script you created above. Close the dialog by clicking the OK button.

    The Controlling Batch Script

    Open a new file in Notepad++ and paste the code below into it. Store it as NppCompareFiles.cmd.

    @echo off & setlocal set "File1Buffer=%TEMP%\NppCompare_File1.txt" if "%~2" neq "" ( set "File1=%~1" set "File2=%~2" ) else if not exist "%File1Buffer%" ( (set /p "=%~1" < NUL & echo.) > "%File1Buffer%" exit /b 0 ) else ( set /p "File1=" < "%File1Buffer%" set "File2=%~1" ) set "NppCommand=CompareFiles" start "" "%ProgramFiles(x86)%\Notepad++\notepad++.exe" "%File1%" "%File2%" del "%File1Buffer%" 1>NUL 2>NUL

    The script can be called once, providing two file paths as parameters. In lines 6 and 7 they are copied to two internal variables.

    The script can also be called twice, providing only one file path each. In this case it checks if a buffer file for storing the first file’s path already exists. If not it copies the provided file path to that buffer file and exits (lines 9 to 11).

    To avoid problems with file paths containing special characters which would be interpreted as control characters by the Batch script interpreter, I use the set /p command to write the file path to the buffer file. This way I can use double quotes, which prevent the evaluation of control characters by the Batch script interpreter, without writing these quotes to the buffer file.

    If the buffer file already exists, the contained file path is read from it and stored into an internal variable to be used as the first file for comparison. The file path of the second file is taken from the provided parameter (lines 13 to 15).

    As a last step an environment variable named NppCommand is created and set to the value CompareFiles (this variable is queried in the NppExec script above). After that Notepad++ is executed with the two file paths retrieved before as arguments (lines 18 to 19). By using the start command it is possible to avoid the script getting paused until Notepad++ is closed. Instead execution continues immediatly.

    Finally the buffer file for the first file’s path is deleted (line 21).

    The VBScript Launcher Script

    It would be possible to use the Batch script created above directly. But that would cause console windows popping up and disappearing immediatly, an ugly flickering effect.

    For that reason we need the following launcher script. Open a new file in Notepad++, paste the code below into it and save it as NppCompareFilesLauncher.vbs.

    If WScript.Arguments.Count = 0 Then WScript.Quit Set objFSO = CreateObject("Scripting.FileSystemObject") Set objWshShell = CreateObject("WScript.Shell") strScriptPath = objFSO.GetParentFolderName(WScript.ScriptFullName) strScriptFullPath = objFSO.BuildPath(strScriptPath, "NppCompareFiles.cmd") strArgs = "" For intIdx = 0 To WScript.Arguments.Count - 1 strArgs = strArgs & """" & WScript.Arguments(intIdx) & """ " Next objWshShell.Run """" & strScriptFullPath & """ " & strArgs, 0, False

    The script collects all the provided command line arguments one by one and generates a new command line consisting of the full path to the NppCompareFiles.cmd script and all the original command line arguments. Then it executes the Batch script in a hidden window, which avoids flickering console windows.

    The Explorer Context Menu Entry

    At first move both the two files NppCompareFiles.cmd and NppCompareFilesLauncher.vbs to a folder of your choice. For this How-To I will use C:\Program Files (x86)\Notepad++\plugins\ComparePlugin\ComparePlugin.

    Open a new file in Notepad++, paste the code below into it and save it as NppCompareFiles.reg. In line 7 you have to provide the folder where you stored the two script files in the last step.

    Please note: Strings in *.reg files have to follow the escaping rules of strings in the C programming language. That means that e.g. " and \ have to be escaped with the \ character, which causes the double-backslashes in the file’s content below.

    Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\CompareWithNpp] @="Compare with Notepad++" [HKEY_CLASSES_ROOT\*\shell\CompareWithNpp\command] @="wscript.exe /nologo \"C:\\Program Files (x86)\\Notepad++\\plugins\\ComparePlugin\\ComparePlugin\\NppCompareFilesLauncher.vbs\" \"%1\""

    Now double-click the resulting *.reg file and confirm the UAC dialog and all other dialogs. This will install an entry named Compare with Notepad++ in the Explorer context menu of all files. After that you can delete the *.reg file, it is no longer needed.

    First Try

    Now close Notepad++. Open an Explorer window, right-click one file, select Compare with Notepad++ from the context menu, right-click another file and do the same. Notepad++ should open and the files should be compared by the Compare plugin.

    Close Notepad++ again. Select two files at once, right-click one of them and select Compare with Notepad++ from the context menu. Notepad++ should open and the files should be compared by the Compare plugin.

  • functionList.xml PureBasic

    8
    0 Votes
    8 Posts
    3k Views
    AZJIO AZJIOA

    <association id= “purebasic_function” userDefinedLangName=“PureBasic” />
    <association id= “purebasic_function” langID=“68” />
    <association id= “purebasic_function” ext=“.pb” />
    <association id= “purebasic_function” ext=“.pbi” />
    <association id= “purebasic_function” ext=“.pbf” />

    ; !i!i!i!i!i!i!i!i!i!i!i!i!i!i!i!i!i!i!i!i!i

    <parser
    displayName=“PureBasic”
    id =“purebasic_function”
    commentExpr=“(?x)(?m-s:^\h*;.*?$) # !Single line comment”

    <classRange mainExpr ="(?x)(?mi)^\h*Module\h+\K[A-Za-z_]\w*\s+.+?(?=EndModule)" > <className> <nameExpr expr="\w+" /> </className> <function mainExpr="(?x)(?mi)^\h*(?:Procedure[CDL$]{0,5}?(?:\h*\.[abcdfilqsuw])?\K|Macro)\h+[A-Za-z_]\w*\h*(?=\()" > <functionName> <funcNameExpr expr="[\w\h.$]+" /> </functionName> </function> </classRange> <function mainExpr="(?x)(?mi)^\h*(?:Procedure[CDL$]{0,5}?(?:\h*\.[abcdfilqsuw])?\K|Macro)\h+[A-Za-z_]\w*\h*(?=\()" > <functionName> <nameExpr expr="[\w\h.$]+" /> </functionName> </function>

    </parser>

  • Something wrong with the latest version

    Locked
    7
    0 Votes
    7 Posts
    878 Views
    PeterJonesP

    @PeterJones said:

    automatic “in selection” box-enabling to be at a lower threshold

    As an addendum: The problem with a lower threshold is that many users want to be able to select two or so lines of text, and search the rest of the document for those same lines. That is possible now… but if the threshold were made too short, it might frustrate that use case.

    It’s hard to make everybody happy at the same time with software design decisions.

  • How to Remove unwanted space in Row After 4 Number?

    9
    0 Votes
    9 Posts
    1k Views
    guy038G

    Hi, @jinko-solar, @alan-kilborn,@meta-chuh, @peterjones and All,

    Aaaaaaaaah I see ! Just the way to interpret the OP’s request !

    So, Alan, rest assured, your regex S/R is working as expected !

    Assumming the text :

    0300 8229386 0300 8253137 0334 0210214 0300 2692165 03008229386 03008253137 03340210214 03002692165

    The regex S/R, below :

    SEARCH ((^\d+.+\R){4})\R      OR       ^((\d+.+\R){4})\R

    REPLACE \1

    will leave you with the text :

    0300 8229386 0300 8253137 0334 0210214 0300 2692165 03008229386 03008253137 03340210214 03002692165

    Cheers,

    guy038

  • Upgrading Scintilla, need help for boost

    5
    5 Votes
    5 Posts
    838 Views
    MAPJe71M

    and see: Library Naming

  • Remove Panel

    Locked
    5
    0 Votes
    5 Posts
    1k Views
    Indra Lung SpiritI

    @Meta-Chuh Big Thank!

  • What about Google+ link in main site?

    Locked
    1
    2 Votes
    1 Posts
    311 Views
    No one has replied
  • v 7.6.6 tiggerred auto-updater, after ages

    Locked
    2
    1 Votes
    2 Posts
    454 Views
    Meta ChuhM

    @V-S-Rawat

    it usually stays in %Temp%, as e.g. npp.7.6.6.Installer.exe.

    you can also always re-download the most recent installers from here: https://notepad-plus-plus.org/download/
    this link will always forward you to the latest version.

    or select any of the older versions if you need them.

  • Autosave not working in v 7.6.6

    Locked
    14
    1 Votes
    14 Posts
    7k Views
    Mike BeharM

    @Meta-Chuh
    Just to be clear… I did use the original link you provided to download NP++. It threw this error
    (And thanks for the markdown tip)

    I added the missing “gpup.exe” and created the folder as before. It was then I discovered the “correct” settings to make AutoSave work. After that – for fun – I tried the portable apps version – and hit the same error message

    So here is what is not clear to me.

    Am I the only one seeing that error message or is something broken on BOTH sites where we can get a portable version of NP++ ?

    Why does checking “save autorecover in the same directory” create a file extension that end with ~ Should it not create a file with the same name and an extension of bak or something similar?

    Thanks

    @PeterJones and @Alan Kilborn
    I appreciate the advice – thanks. Hope the main site will clear show a portable version is available…

    Best to All,

    Mike

  • Writing in Italian language

    Locked
    4
    0 Votes
    4 Posts
    770 Views
    andrecool-68A

    @Luigi-Ferrari
    With utf-8 encoding works well

  • Where's my plugins? npp.7.6.6

    Locked
    4
    0 Votes
    4 Posts
    920 Views
    GubithG

    All the steps I took to complete the move:
    cd “C:\Program Files (x86)\Notepad++\plugins”
    dir .dll
    for %a in (.dll) do @echo %a
    for %a in (.dll) do @echo %~na
    for %a in (.dll) do @if not exist %~na echo %~na
    for %a in (.dll) do @if not exist %~na echo %~na & mkdir %~na
    dir
    for %a in (.dll) do @move %a %~na
    dir

    Steps that actually did the work:
    cd “C:\Program Files (x86)\Notepad++\plugins”
    for %a in (.dll) do @if not exist %~na echo %~na & mkdir %~na
    for %a in (.dll) do @move %a %~na

    Opening NPP again listed the missing addons (all were missing).
    One was outdated, I don’t use it anyway.

  • W10 keyboard pop-up when notepad++ open?

    Locked
    6
    0 Votes
    6 Posts
    2k Views
    andrecool-68A

    @Johnny-Heng
    Create VBScript with this code, it will launch two programs at the same time.

    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run("notepad++.exe")
    WshShell.Run("%windir%\system32\osk.exe")

    Just change the path to the notepad ++ in the script

  • I quit. You win. I'll go find another tool.

    22
    1 Votes
    22 Posts
    7k Views
    GubithG

    NPP is one of the greats. I tried and do use other editors. Each has it’s pros and cons. NPP is particularly awesome for all it does in a small footprint.

    I finally updated today, because addons were misbehaving, and now it seems they’ve been disabled in user data? I found something about creating a file in the program folder to allow the user folder, so I reanmed the readme to that file name. Maybe it was meant to go in the users folder.

  • Dark mode so that it looks more like Command Prompt

    9
    0 Votes
    9 Posts
    3k Views
    GubithG

    Vibrant Ink with some minor adjustments is close to what I want out of the box.

    Updating themes during updates…
    Pro: Updates fix issues with themes and maybe adjusts to match UI changes.
    (?? Con: User customization replaced with defaults? ??)

    The UI is affected by other things like windows theme, windows color hacks (since w10 infringes upon customization). UI tools like Windowblinds can enhance but also cause display issues. Microsoft could design a more consistent and intelligent UI framework… nvm.

    Style requires much fiddling with all the different formats available. This requires excessive clicking. I sometimes edit the XML to mass replace specific colors. But my plate is full, and when I stacked NPP dev, my bbq ribs pushed into the mashed potatoes, toppling the outer wall, and gravy spilled over and spread under the butter dish, which someone grabbed and… we had gravy circles all over the place, and sticky wet elbows. But my NPP was perfect :)

  • 64 bit Version - max file size

    Locked
    6
    0 Votes
    6 Posts
    4k Views
    Alan KilbornA

    @chcg

    Is that what we come to since Scintilla in mainstream N++ is so out of date?

  • open/edit files without extension

    Locked
    3
    1 Votes
    3 Posts
    1k Views
    Meta ChuhM

    welcome to the notepad++ community, @copenhaus

    to avoid automatic .txt extension, for files without extensions, e.g. hosts, when saving:

    please go to settings > preferences > default directory and activate use new style dialog, as seen at the screenshot below.

    after that you can save any extension-less file, as well as saving any file with full manual file extension control.

    Imgur

  • Bug Fix: Windows 10 Virtual Desktops

    10
    1 Votes
    10 Posts
    12k Views
    Kirby RsK

    Thx to Simon Liddington, NPP might not annoying you.
    But it’s not fixed yet? NPP is the only app which appears on all Virtual Desktops in Windows 10.
    It does whatever mode (multi- or mono-) you set.