• Regex Search Help!

    6
    0 Votes
    6 Posts
    337 Views
    Alan KilbornA

    @Nick-Brown 's regex is problematic for at least 2 more reasons:

    it does a greedy search rather than a minimal search, meaning that it will match something like "Number":"12345","23456","34567", fully, not stopping after only matching “one number”, which seems to be what the OP desires

    in conjunction with the first point, without specification of whether or not the . should match newlines, this regex could potentially match a lot of lines and a lot of data!

  • Hyperlinks not clickable anymore

    2
    0 Votes
    2 Posts
    320 Views
    L

    @BernieStn said in Hyperlinks not clickable anymore:

    Is this a known issue?

    I’m using Notepad++ 7.9 and it does recognise the last two lines as URLs I guess the protocol part of the URL is necessay for Notepad++ detect as a proper URL. Could you please check if you have enabled the option to make links clickable? (https://npp-user-manual.org/docs/preferences/#misc). Settings > Preferences... > MISC

    Also, it may help to post here Notepad++'s Debug info... that is under the ? Menu, and whether you are using any particular theme.

  • Hotkeys for Zoom don't work!

    5
    0 Votes
    5 Posts
    621 Views
    Дмитрий 1Д

    Peter Jones, thank you very much! I found the " / " key on the numeric keypad! Hotkeys a work now :)

  • Dual View

    3
    0 Votes
    3 Posts
    197 Views
    Tom OveringtonT

    Thank You Kindly. Figured it was something simple. Tried everything except that.

  • Download Dictionaries Dialog

    6
    1 Votes
    6 Posts
    2k Views
    pellelinP

    Hello Peter!

    That was spot on! You are a lifesaver!
    Had almost given up and was thinking of installing an older version of Notepad++.
    I managed to get the eng UK, eng US and swedish! YAY! :D

    Thanks Peter, stay safe and healty, best regards,
    pellelin

  • 0 Votes
    8 Posts
    371 Views
    PeterJonesP

    @Richard-Skinner ,

    Rather than arguing with those who are trying to help you, why not provide better example data, for both “before” and “after” the transformation you want, that matches your description of the data, so that we have a better understanding of what you’re trying to achieve? Since your descriptions don’t match the example text, it’s rather difficult for us to come up with a regex that will work with your data. If column number is the important thing, then focus on columns in your description and example data; if the important thing is actually anything after the seven digits of ?id=7777777, then focus on that string and not column number. But insisting on 52 characters when your example data isn’t 52 characters long is … tiring.

    Even though you haven’t shown that you understood or took my advice to heart, I’ll give you two guesses: one that assumes that the critical piece of information is 52 characters, and one that assumes that the id is the critical piece:

    52 char FIND = (?-s)^(.{52}).*$ Explanation: turn off .-matches-space, match beginning of line, match 52 characters and store in group 1, match remaining characters on line REPLACE = $1 replace with contents of group 1 (so effectively deletes everything after the first 52 characters) MODE = Regular Expression ID FIND = (?-s)(\?id=\d{7}).* Explanation turn off .-matches-space, match ?id= followed by 7 digits and store in group 1, match remaining characters on line REPLACE = $1 replace with contents of group 1 (so effectively deletes everything after the 7-digit ID) MODE = regular expression
  • 3 Votes
    1 Posts
    959 Views
    No one has replied
  • Hyperlink to a file? Win10

    11
    1 Votes
    11 Posts
    10k Views
    GarySe7enG

    @PeterJones said in Hyperlink to a file? Win10:

    you can select a path (whether relative or absolute, like c:\blah\file.txt or …\blah\file2.txt, and right click and select Open File

    Wow! This is great. Obviously, I’ve never noticed that before. But this certainly makes the ability to link notes significantly easier.

    I’ve given up on most note taking applications. Evernote, OneNote, even tried Joplin. But nothing has replaced a bunch of old fashioned text files, many of them now in markdown format, and replicated using NextCloud.

    NextCloud has a decent markdown editor for mobile. All workstations need nothing more than NPP (which is on all of my systems).

    Thanks again!

  • ShellExecute failed (2) is this command correct

    2
    0 Votes
    2 Posts
    550 Views
    Alan KilbornA

    @Phil-Kuffner

    It might be best to post a screenshot of the error rather than just summarizing its text; we can probably glean information to help you better that way.

  • Error Build from Source Code

    2
    0 Votes
    2 Posts
    252 Views
    andrecool-68A

    Where are the photos of these errors?

  • SaveAs as last command in macro; possible?

    5
    1 Votes
    5 Posts
    1k Views
    PeterJonesP

    @Alan-Kilborn ,

    The end of NppCommands.cpp has the list of IDM_ entries (ie, the menu commands) that are macro-recordable. So any not listed there are not.

  • Notepad++ just deleted all the text from my files

    40
    0 Votes
    40 Posts
    6k Views
    Alan KilbornA

    @carypt said in Notepad++ just deleted all the text from my files:

    to absolutely know , what is done and where and under what name in my filesystem

    When you have a file open in a tab in Notepad++, you can see where changes to it will be saved by:

    looking at the title bar of N++, where the full path is shown (there is a preference setting to turn this off but it is on by default)

    hovering over the tab with the mouse, at which point a tooltip window will pop up, showing the complete path

    REPEAT: There is no need ever to do a Save As on an existing file, unless you intend to create a copy with a different name.

    You seem to be a different kind of thinker.

    And for other readers: No, @carypt 's postings in this thread are NOT related to the NUL NUL NUL problem in Notepad++.

  • File Filtering based on content

    6
    0 Votes
    6 Posts
    913 Views
    TheRobsterT

    Thanks, I got what I was looking for!

  • Make default file the far right file.

    2
    0 Votes
    2 Posts
    208 Views
    Alan KilbornA

    @Cheryl-Bouc

    The one you are noticing it activate is likely the one you “visited” prior to the one you are closing. That behavior is called “MRU” or “Most Recently Used”. You can select/deselect that behavior with this setting:

    7a545e41-a612-4339-9cbe-803f7863e793-image.png

  • Is there a way to center text like this?

    6
    0 Votes
    6 Posts
    1k Views
    guy038G

    Hi, @hello313241, @michael-vincent, @terry-r and All,

    Very, very clever solution Terry ! Indeed, no need for \K and just to type in half the screen size of spaces, in the Replace zone ;-))

    And I also improved the process as we do not need, any more, to trim the trailing blank chars at the end. In addition to the mandatory regex part .{80}, I placed, before, a look-ahead (?=(.+[^\x20\r\n])\x20+) which splits these 80 characters in two zones :

    A first zone (.+[^\x20\r\n]) which must end with a non-blank and Non-EOL character, to rewrite in replacement ( \2 )

    A second zone \x20+ of blank characters only, to ignore

    So we need two regex S/R, only ( Note that I follow my previous post with 140 characters for screen size )

    The first S/R removes possible blank chars of a pure blank line OR replace any range, possibly null, of leading and trailing blank chars with 70 space characters ( 140 / 2 )

    SEARCH ^\h*$|(^\h*|\h*$)

    REPLACE ?1<followed with 70 spaces>

    The second S/R replaces any full line of the selection, magically, with the range of ( 140 - L ) / 2 space chars, followed by the text to be centered, of size S :

    SEARCH (?-s)^(\x20*)(?=(.+[^\x20\r\n])\x20+).{140}\1\x20?

    REPLACE \2

    Remarks :

    As the total of any line of the selection is 140 + S characters long, thus the length of the surrounded range \1 is S/2 characters

    I had to add the final \x20? regex because, in case the size S is an odd number, this extra space char is also matched and deleted after replacement !

    All lines of the selection must have a size inferior or equal to 140. Lines, with size over 140, are shifted by 140 / 2 space characters !

    So, the final macro is now simplified as :

    <Macro name="Center Selected Lines" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="^\h*$|(^\h*|\h*$)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="?1 " /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)^(\x20*)(?=(.+[^\x20\r\n])\x20+).{140}\1\x20?" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="\2" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>

    For instance, this initial text, where I used some sentences from the License.txt file and add some trailing blank chars :

    This example works ONLY IF the TOTAL size of your SCREEN contains 140 characters ADAPT to your CONFIGURATION, by adding HALF the APPROPRIATE number of SPACES, after "?1", in the REPLACEMENT zone of the 2ND regex S/R >< >< >< Copyright (C)2016 Don HO <don.h@free.fr> The licenses for most software are designed to take away your freedom to share and change it 1 Copyright (C) 1989, 1991 Free Software Foundation, Inc. ABCD Everyone is permitted to copy and distribute verbatim copies You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee 12345 12345 12345 12345 12345 az 1 To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. 1234567890 >< >< ><

    Would be modified and centered as below :

    This example works ONLY IF the TOTAL size of your SCREEN contains 140 characters ADAPT to your CONFIGURATION, by adding HALF the APPROPRIATE number of SPACES, after "?1", in the REPLACEMENT zone of the 2ND regex S/R >< >< >< Copyright (C)2016 Don HO <don.h@free.fr> The licenses for most software are designed to take away your freedom to share and change it 1 Copyright (C) 1989, 1991 Free Software Foundation, Inc. ABCD Everyone is permitted to copy and distribute verbatim copies You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee 12345 12345 12345 12345 12345 az 1 To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. 1234567890 >< >< ><

    Best Regards,

    guy038

  • RegEx.: Fetched Group not working at replacement string;?

    10
    0 Votes
    10 Posts
    448 Views
    Flores FranciscoF

    @guy038 said in RegEx.: Fetched Group not working at replacement string;?:

    Best Regards,
    guy038

    Guy I like how you see things.

    Thank you for your time good sir…

    I understand your explanation well.

    Regards…

  • Is there a way to get the current line number into the copy/paste buffer?

    13
    0 Votes
    13 Posts
    3k Views
    Alan KilbornA

    @mkupper

    Changing the offsets for the Go To dialog box so that they start at 1…

    Actually, “offset” (being zero-based) makes perfect sense.
    If it were strictly “position” maybe it would make less sense, as that seems to more imply one-based.
    Although, in Scintilla-speak, SCI_GETCURRENTPOS returns a 0 if the caret is at beginning-of-file.

    I think I saw that a change is coming to Notepad++ where “position” is going to be displayed on the status bar. I can’t remember if it is zero-based or one-based.

    That change would break scripts that invoke the Go To box and use offset mode.

    I don’t think there are any such scripts as the Go To box isn’t scriptable?

    -p on the command line likely should remain zero based.

    It seems like Notepad++ should get its act together and be internally consistent, be either 0-based or 1-based when dealing with “position”, no matter what existing functionality it might break. :-)

    I just noticed in a UTF-8 document, if I put my caret just before a Unicode character that encodes into 4 bytes, I get an editor.getCurrentPos() return of N and if I move it just after that character and repeat that Pythonscript command, I get N+4. This seems wrong to me; I should get N+1… I guess it is one more thing that needs “evaluation” in Notepad++.

  • 0 Votes
    4 Posts
    629 Views
    Eduardo Lúcio Amorim CostaE

    Good one @ Alan-Kilborn! I will search on the net for a solution to better deal with Samba “timestamp” resolution.

  • 0 Votes
    2 Posts
    683 Views
    Michael VincentM

    @David-Kuhne

    You mean like:

    Settings => Preferences…

    03f27b90-b92b-404e-9a91-fe6c4ec19d3a-image.png

    Cheers.

  • Need the spell checker

    2
    0 Votes
    2 Posts
    184 Views
    L

    Hi @James-Corpening

    If you go to Plugins menu in your notepad++ toolbar, do you see DSpellCheck listed?
    If it is not listed, then go to Plugins > Plugins Admin... Search for DSpellCheck and install it. Once it is installed you may need to go to Plugins > DSpellCheck > Settings... and install a (Hunspell) dictionary.

    If the plugin was listed, confirm that the option ‘Spell Check Document Automatically’ is enabled.

    If nothing helps. Could you please paste here your Notepad++ debug info? You can find that information in the toolbar menu: ? > Debug info...