• 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
    896 Views
    TheRobsterT

    Thanks, I got what I was looking for!

  • Make default file the far right file.

    2
    0 Votes
    2 Posts
    203 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
    440 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
    617 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
    656 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
    180 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...

  • 0 Votes
    9 Posts
    910 Views
    CletosC

    OK, that looks great, I will try that, thank you very much!

  • Problem with Reload

    14
    0 Votes
    14 Posts
    11k Views
    Eduardo Lúcio Amorim CostaE

    This is an unsolved problem… =[ Frankly, I don’t know what can be done to resolve this situation. I have already searched in many forums what can be done, but this set with a network share (samba, SMB) and Notepad ++ is problematic. As reported, the problem with constant file reloading makes it impossible to use Notepad ++ reliably and, especially, the use of bookmarks. Note that other code editor do not have the same problem even using the same network share. I would love to know what can be done. I’ve tried everything regarding the configuration of Notepad ++ and Samba, but I haven’t been successful so far.

    NOTE: Realize that I cannot do without the detection of changes (with warning) in files, as I work with several open source editors at the same time and this is a very big risk for me.

    Thanks friends! =D

  • Remove specific lines fron nfo's

    8
    0 Votes
    8 Posts
    416 Views
    Alan KilbornA

    @Andrew-Gill said in Remove specific lines fron nfo's:

    remove any lines that start with <studio>

    I’ll just point out that your original problem statement said the above.
    The solution I provided considered that.
    But your real data didn’t have that condition.
    So that’s why my solution didn’t work initially.

  • 0 Votes
    2 Posts
    355 Views
    EkopalypseE

    @Dennis-Bareis

    that is the way to reload saved sessions. Is ThisSession really the file?
    I would have expected ThisSession.xml. If it is the file, can you check if it contains useful data?
    If it does not work, can you post your debug info, available from the last menu, the ? menu and the content of ThisSession?

  • 0 Votes
    17 Posts
    1k Views
    Ohm DiosO

    @guy038 Dear Sir,
    Really Great! .Thanks a Lot its works 100%. You saved Me lot of time. Notepad plus plus is great. You’re the one who truly understand my requirements Please accept My Love and Thanks. I am forever grateful for your support!

  • Ignore diacritics in search

    3
    0 Votes
    3 Posts
    262 Views
    guy038G

    Hello, @steven123, @ekopalypse and All,

    @steven123, I’m pleased to tell you that your request can be solved, easily, by using a POSIX collating sequence into a character class / bracket expression, which defines a list of equivalent characters to the character mentioned in the collating sequence

    The regex syntax of a POSIX collating sequence is [=<Char>=]. Note also that this POSIX collating sequence must be inserted, itself, inside a normal character class [....] or a negative character class [^....] in order to match all the equivalent characters to character Char !

    Refer, for additional information, to :

    https://www.boost.org/doc/libs/1_70_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html#boost_regex.syntax.perl_syntax.equivalence_classes

    https://www.regular-expressions.info/posixbrackets.html#eq

    For instance, the regex (?-i)[A-E[=0=]5-9] would match a uppercase letter from A to E, a digit from 5 to 9, the digit 0 or any of the 4 equivalent characters to digit 0 of the list below :

    0030 Nd 0 Basic Latin DIGIT ZERO 2070 No ⁰ Superscripts and Subscripts SUPERSCRIPT ZERO 2080 No ₀ Superscripts and Subscripts SUBSCRIPT ZERO 24EA No ⓪ Enclosed Alphanumerics CIRCLED DIGIT ZERO FF10 Nd 0 Halfwidth and Fullwidth Forms FULLWIDTH DIGIT ZERO

    So, in order to match, either, the string Ho Chi Minh and the string Hồ Chí Minh, simply use the regex :

    H[[=o=]] Ch[[=i=]] Minh, with the collating sequences [=o=] and [=i=] embedded in a character class

    Some other examples :

    The regex \t[[=a=]]\t, against the list below, would match all the equivalent characters of the a letter, whatever, the case, the accentuation, the size and other specifications of these equivalent chars. That is to say 69 characters ! 0041 A ; Upper_Letter # Lu LATIN CAPITAL LETTER A 0061 a ; Lower_Letter # Ll LATIN SMALL LETTER A 00AA ª ; Other_Letter # Lo FEMININE ORDINAL INDICATOR 00C0 À ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH GRAVE 00C1 Á ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH ACUTE 00C2 Â ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH CIRCUMFLEX 00C3 Ã ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH TILDE 00C4 Ä ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH DIAERESIS 00C5 Å ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH RING ABOVE 00E0 à ; Lower_Letter # Ll LATIN SMALL LETTER A WITH GRAVE 00E1 á ; Lower_Letter # Ll LATIN SMALL LETTER A WITH ACUTE 00E2 â ; Lower_Letter # Ll LATIN SMALL LETTER A WITH CIRCUMFLEX 00E3 ã ; Lower_Letter # Ll LATIN SMALL LETTER A WITH TILDE 00E4 ä ; Lower_Letter # Ll LATIN SMALL LETTER A WITH DIAERESIS 00E5 å ; Lower_Letter # Ll LATIN SMALL LETTER A WITH RING ABOVE 0100 Ā ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH MACRON 0101 ā ; Lower_Letter # Ll LATIN SMALL LETTER A WITH MACRON 0102 Ă ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH BREVE 0103 ă ; Lower_Letter # Ll LATIN SMALL LETTER A WITH BREVE 0104 Ą ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH OGONEK 0105 ą ; Lower_Letter # Ll LATIN SMALL LETTER A WITH OGONEK 01CD Ǎ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH CARON 01CE ǎ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH CARON 01DE Ǟ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON 01DF ǟ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH DIAERESIS AND MACRON 01E0 Ǡ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON 01E1 ǡ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON 01FA Ǻ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE 01FB ǻ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE 0200 Ȁ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH DOUBLE GRAVE 0201 ȁ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH DOUBLE GRAVE 0202 Ȃ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH INVERTED BREVE 0203 ȃ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH INVERTED BREVE 0250 ɐ ; Lower_Letter # Ll LATIN SMALL LETTER TURNED A 0251 ɑ ; Lower_Letter # Ll LATIN SMALL LETTER ALPHA 0252 ɒ ; Lower_Letter # Ll LATIN SMALL LETTER TURNED ALPHA 1E00 Ḁ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH RING BELOW 1E01 ḁ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH RING BELOW 1E9A ẚ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH RIGHT HALF RING 1EA0 Ạ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH DOT BELOW 1EA1 ạ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH DOT BELOW 1EA2 Ả ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH HOOK ABOVE 1EA3 ả ; Lower_Letter # Ll LATIN SMALL LETTER A WITH HOOK ABOVE 1EA4 Ấ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE 1EA5 ấ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE 1EA6 Ầ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE 1EA7 ầ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE 1EA8 Ẩ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE 1EA9 ẩ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE 1EAA Ẫ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE 1EAB ẫ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE 1EAC Ậ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW 1EAD ậ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW 1EAE Ắ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH BREVE AND ACUTE 1EAF ắ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH BREVE AND ACUTE 1EB0 Ằ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH BREVE AND GRAVE 1EB1 ằ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH BREVE AND GRAVE 1EB2 Ẳ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE 1EB3 ẳ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE 1EB4 Ẵ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH BREVE AND TILDE 1EB5 ẵ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH BREVE AND TILDE 1EB6 Ặ ; Upper_Letter # Lu LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW 1EB7 ặ ; Lower_Letter # Ll LATIN SMALL LETTER A WITH BREVE AND DOT BELOW 212B Å ; Upper_Letter # Lu ANGSTROM SIGN 249C ⒜ ; Other_Symbol # So PARENTHESIZED LATIN SMALL LETTER A 24B6 Ⓐ ; Other_Alpha. # So CIRCLED LATIN CAPITAL LETTER A 24D0 ⓐ ; Other_Alpha. # So CIRCLED LATIN SMALL LETTER A FF21 A ; Upper_Letter # Lu FULLWIDTH LATIN CAPITAL LETTER A FF41 a ; Lower_Letter # Ll FULLWIDTH LATIN SMALL LETTER A In the same way, the regex \t[[===]]\t matches all the equivalent characters of the equal sign = : 003D Sm = Basic Latin EQUALS SIGN 207C Sm ⁼ Superscripts and Subscripts SUPERSCRIPT EQUALS SIGN 208C Sm ₌ Superscripts and Subscripts SUBSCRIPT EQUALS SIGN 229C Sm ⊜ Mathematical Operators CIRCLED EQUALS FF1D Sm = Halfwidth and Fullwidth Forms FULLWIDTH EQUALS SIGN And the regex \t[[=Q=]]\t matches all the equivalent characters of the Q letter : 0051 Lu Q Basic Latin LATIN CAPITAL LETTER Q 0071 Ll q Basic Latin LATIN SMALL LETTER Q 02A0 Ll ʠ IPA Extensions LATIN SMALL LETTER Q WITH HOOK 211A Lu ℚ Letterlike Symbols DOUBLE-STRUCK CAPITAL Q 24AC So ⒬ Enclosed Alphanumerics PARENTHESIZED LATIN SMALL LETTER Q 24C6 So Ⓠ Enclosed Alphanumerics CIRCLED LATIN CAPITAL LETTER Q 24E0 So ⓠ Enclosed Alphanumerics CIRCLED LATIN SMALL LETTER Q FF31 Lu Q Halfwidth and Fullwidth Forms FULLWIDTH LATIN CAPITAL LETTER Q FF51 Ll q Halfwidth and Fullwidth Forms FULLWIDTH LATIN SMALL LETTER Q

    Best Regards,

    guy038

  • paste text to the right of cursor

    11
    1 Votes
    11 Posts
    3k Views
    fahrrad13F

    @Alan-Kilborn thanks a lot - that works perfectly.
    So here the final solution to this thread summarized from above:

    p = editor.getCurrentPos() editor.paste() editor.setEmptySelection(p) editor.chooseCaretX()
  • Reversing blocks of lines

    4
    0 Votes
    4 Posts
    768 Views
    Viktoria OntapadoV

    Awesome idea, I didn’t think of that!
    Thank you so much for the solution and for the step-by-step guide as well. Much obliged.

    Viktória

  • Syntax highlighting updates?

    4
    1 Votes
    4 Posts
    435 Views
    Alan KilbornA

    @ajpanton

    I’m not sure about this case, but I know for certain files, an update won’t change them. This is so that possible user customizations aren’t blown away. The process intends to be “smart” but it isn’t infinitely smart. I believe it errs on the side of caution. Again, not sure about your use case. Maybe someone else knows more about this one.

  • Converting spaces to tabs

    4
    0 Votes
    4 Posts
    6k Views
    Mark531M

    @Alan-Kilborn You are right, it was a python file, so I had to change the setting for python files. Thank you!

  • Notepad Search and repalce - help

    10
    0 Votes
    10 Posts
    463 Views
    John Praveen Kumar RJ

    Thanks a Lot. This works fine.