• Enable session snapshot and periodic backup?

    8
    0 Votes
    8 Posts
    2k Views
    I.zi.biaI

    @Michael-Vincent said in Enable session snapshot and periodic backup?:

    Again, without looking at the code, I believe “Remember current session for next launch” saves the current session on Notepad++ exit, whereas “Enable session snapshot and periodic backup” saves the current session on the time interface specified and at Notepad++ exit. In that respect, it’s more like a background auto-save in case of a “crash”?

    I have run some tests with npp v8.4.8, and my observations are different:

    “Enable session snapshot and periodic backup” only enables periodic snapshot. It has nothing common neither with sessions nor with config: I tried to kill notepad++.exe and I noticed no changes of config.xml and session.xml.

    Remember current session for next launch has two effects

    it allows that session.xml is (re)written on npp close it allows that session.xml is loaded on next startup of npp
    (of course, 1. and 2. happens only if all conditions are met.)

    (Unchecking Remember current session for next launch doesn’t delete existing session.xml, and so it may6 be activated later by config.xml edit)

  • Compatibility of Notepad++ 7.5.1 with Windows 11 pro

    2
    0 Votes
    2 Posts
    469 Views
    mkupperM

    @Özgür-Aydogdu said in Compatibility of Notepad++ 7.5.1 with Windows 11 pro:

    Is Notepad++ version 7.5.1 compatibel with Windows 11 pro?

    I use Win 11 normal (I assume home) and v7.5.1 portable 32-bit edition seems to run fine. I would assume it would also work on Win 11 Pro.

    It is safe and easy to download and try any of the portable versions. A portable copy of Notepad++ is just a set of files that don’t make any changes to the Windows registry or other parts of Windows.

    Note that if you want to run two or more versions of Notepad++ at the same time, side by side, then use the -multiInst command line option. If you don’t then the second instance of Notepad will see that the first is running and will jump to using that instead of the copy you wanted to start. For example, I had downloaded v7.5.1 to c:\bin\npp751 and so run it using c:\bin\npp751\notepad++ -multiInst Now I have my normal copy of Notepad++ running and a second Notepad++ that’s the v7.5.1 for testing.

  • problem with this regex: \b.{1,6}\b

    5
    0 Votes
    5 Posts
    339 Views
    Bahaa0013B

    @Mark-Olson
    Thank you very much, it worked very well…
    Also thanks to everyone who tried to help.

  • Find and Replace with variable within RegEx

    10
    0 Votes
    10 Posts
    2k Views
    guy038G

    Hi, @peterjones,

    Sorry, Peter, but as I well used to posting on our forum, I has not had a look, yet, to the FAQ about formatting :-((

    And, indeed, all is very well explained in this FAQ ;-)) So, my previous post is redundant and useless !

    BR

    guy038

  • How can I open timestamps?

    14
    0 Votes
    14 Posts
    2k Views
    Lycan ThropeL

    @Mark-Olson ,
    He still doesn’t get it. He doesn’t get that this is not a wordprocessor which MIGHT record those kind of changes within the meta data of the document. Let’s move on.

  • Ignoring empty lines counting

    24
    0 Votes
    24 Posts
    10k Views
    CoisesC

    @Alan-Kilborn said in Ignoring empty lines counting:

    @guy038 said in Ignoring empty lines counting:

    The regex ^$, indeed, does not count true empty lines !

    but :

    The regex ^\R does count empty lines !!

    If the regex is purely an assertion, e.g. ^$ or \b (to name but two), then its match won’t be counted by Count.

    True (since a pure assertion is always an empty match), but empty matches aren’t counted regardless of how the regular expression is specified. In a file that has empty lines, but no lines containing only capital Ws, ^W*$ counts zero matches. ^\R counts all empty lines (except the last line, if it’s empty) because it isn’t an empty match: it matches line ending characters. ^.*$ and ^.+$ both count all lines that are not empty.

  • Copy then paste elsewhere

    6
    0 Votes
    6 Posts
    1k Views
    Cal MurphyC

    @Alan-Kilborn

    Thanks for that i will have a look at it, when i have a bit of time available.

  • Acoustic signal when search no (more) results

    6
    0 Votes
    6 Posts
    410 Views
    guy038G

    Hello, @tdi-ger, @alan-kilborn, @peterjones and All,

    Oh…, my bad ! I just didn’t read the original post carrefully :-((

    As I unchecked this setting for the very first time, I wanted to verify that it did not interfere with the OS. Hence, my remark about my music’s try !

    So, as you said, @tdi-ger should verify if that option is UN-checked , in its configuration -))

    BR

    guy038

  • Exclusive Session file group

    3
    0 Votes
    3 Posts
    265 Views
    guy038G

    Hello, @Jagganath69, @mark-olson and All,

    @Jagganath69, here is a way to get exclusive session group of files :

    In a DOS console window, run the command notepad++.exe -nosession

    Note that I personnaly chose the ses extension as the session file extension ( Settings > Preferences > MISC. )

    Open, let’s say, three files, named A, B and C

    Use the File > Save session... option

    Save the current session, for instance, as First.ses

    Close Notepad++.exe

    Restart the same command notepad++.exe -nosession

    Open, this time, three other files, named D, E and F

    Use the File > Save session... option

    Save the current session, for instance, as Second.ses

    Close Notepad++.exe

    From now on :

    If you run the command notepad++.exe -nosession -openSession First.ses, the three files A, B and C will ONLY be opened

    If you run the command notepad++.exe -nosession -openSession Second.ses, the three files D, F and F will ONLY be opened

    If you run the command Notepad++.exe, you should see all the files which were present in the current session, when you last closed notepad++

    Of course, when you simply start notepad++.exe, the current session may contain :

    Files which are absent of all the particular sessions First.ses, Second.ses, …

    Files which are present in particular sessions ONLY

    Files which are present in all the particular sessions First.ses, Second.ses, …

    Best Regards,

    guy038

  • Is it possible to change color of title bar when window is active?

    4
    1 Votes
    4 Posts
    1k Views
    Lycan ThropeL

    @Divzed ,
    In the dBASE newsgroups, we just had such a request of trying some code to do just this kind of thing, and as one of our more experienced programmers stated, it’s been difficult to do this kind of thing because the colors on the Windows Title bar, etc, are connected to the “themes” aspect and is diffiult to change without in depth knowledge, because as he pointed out, if you change that, you have to change everything related to it (window resizing, etc) because you’re intercepting and overriding the current theme with specific items in the UI, meaning, you now own the control of everything pertaining to it. He also pointed out that in the past, it may have been ‘relatively’ easier, but with Windows 11, the whole game has changed with regard that control.
    Not being his caliber of programmer, I’m only able to relay the gist of his more technical explanation, but it’s something I wouldn’t even be tempted to attempt as I can’t see that kind of work just to change a color. Microsoft keeps making customization harder than it needs to be to just plug and place a color change, so it doesn’t appeal to me. :)

  • Find & Replace question with RegEx solution

    2
    0 Votes
    2 Posts
    625 Views
    JustinJudoJ

    I did some googling and found a RegEx solution:

    Find:

    \?.*$

    Replace with:
    (null)

  • Sorting text

    6
    1 Votes
    6 Posts
    865 Views
    PeterJonesP

    @Qwfsdf-Qdfwefx said in Sorting text:

    i really dont know what i need to change in ur code

    Oddly enough, if you don’t have quotes and commas in your new text document, you would likely get rid of quotes and commas from @Mark-Olson’s example regex.

    ----

    Please note: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you. If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future. But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin. The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.

    ----

    Useful References Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • CTRL+DOWN/UP ARROW to move down/up to previous/next paragraph

    4
    0 Votes
    4 Posts
    367 Views
    Todd CarsonT

    @Todd-Carson said in CTRL+DOWN/UP ARROW to move down/up to previous/next paragraph:

    @Paul-Wormer Thank you very much, Paul. Yep, that works.

    However, for me, that’s totally non-standard for Windows. Is there a way to customise the keyboard shortcut to CTRL+DOWN/UP ARROW?

    (Please say yes!)

    Never mind. I found it. Thanks again.

  • Remove part of lines of text

    5
    0 Votes
    5 Posts
    2k Views
    mkupperM

    I interpret “I have a large number of text files which all start with a line as seen below” in that the afcad_path thing is always on line 1, or possibly is the first non-blank line.

    I would search for (?-s)\A\R*afcad_path =\K.+ and replace with nothing (blank) in regular expression mode.

    See https://npp-user-manual.org/docs/searching/#regular-expressions but in summary, (?-s) disables . matching newline (this is the default for most people and so (?-s) is redundant but is there just in case someone has . matches newline enabled), \A is the start of the file, \R* gobbles up the blank lines, if any, afcad_path = is the header string the OP is interested in, \K says to keep everything that has been matched so far (the blank line(s) and “afcad_path =” thing), and .+ wipes out the remainder of the line.

    If the file already starts with “afcad_path =” with nothing following, or does not start with a “afcad_path =” line then the search/replace will do nothing and the file is not modified.

  • Automated install not really installing

    2
    0 Votes
    2 Posts
    410 Views
    PeterJonesP

    @Jonathan-De-Carvalho ,

    I have no experience with remote installation, but I wouldn’t expect it to magically change Notepad++ over to the updated version while it’s actively running… and I’d actually be surprised if it could write the new notepad++.exe if the user were actively running the old notepad++.exe at the time.

    Could you do something like TASKKILL /IM notepad++.exe to forcefully kill the user’s Notepad++ instance? (if so, you might want to also send some message to the user before doing so, warning them that it’s about to happen, giving them a 30 sec pause so they can save their work before your taskkill, or similar.)

  • How to batch remove all lines after the nth line?

    4
    0 Votes
    4 Posts
    859 Views
    Alan KilbornA

    @melanievt

    Learn more to be able to apply such techniques on your own in the future; start HERE.

  • Increase counter

    5
    0 Votes
    5 Posts
    381 Views
    Daniel HolzmannD

    Thanks guys. I will go with litos81’s proposal which is working perfectly fine for what I need.
    The plug-in version I’d have considered for private purposes, but installing plug-ins on my work PC is always a big challenge for our IT department.

  • Removing multiple blank lines

    5
    0 Votes
    5 Posts
    591 Views
    Alan KilbornA

    @namx3249 said in Removing multiple blank lines:

    and why don’t use command from Edit - Line operations - Remove empty lines ?

    Because OP wanted a “single blank line” to remain after the operation.

  • UDL comment that requires seperators

    10
    0 Votes
    10 Posts
    1k Views
    Mark OlsonM

    I finally came up with a regex-replace that adds buffer spaces internally as well as externally, if you are interested.

    Replace (?s)(\S)?/\*((?!\*/)\S)?((?:(?!\S?\*/).)+?)?((?!\*/)\S)?\*/(\S)?
    with (?1\1\x20)/*(?2\x20\2)(?3\3:\x20)(?4\4\x20)*/(?5\x20\5)

    Just for the record, a lot of the complexity of that regex-replace is due to dealing with the silly corner case of replacing /**/ with /* */. You could absolutely come up with something simpler if you didn’t care about that.

  • Are hanging indents not possible?

    2
    0 Votes
    2 Posts
    277 Views
    CoisesC

    Settings | Preferences… | Editing | Line Wrap : Indent