• Open two files side by side from command line

    7
    0 Votes
    7 Posts
    1k Views
    EkopalypseE

    @MMMZZZZ said in Open two files side by side from command line:

    ü

    not 100% sure what the issue is. The generation of the session file or opening the sessions with npp?

    What I did is the following:

    a) created a file D:\über.txt
    b) created a file D:\temp\ökonmische betrachtung\ärger.txt
    c) moved the second file to the second view
    d) used File->SaveSession and saved it as D:\test_session.xml
    e) open a cmd and started D:\Tests\npp\810\x64\notepad++.exe -openSession D:\test_session.xml

    resulted in

    613d2d9c-ef38-44cc-b59f-2f38573a23e7-image.png

    To reuse this mechanism, I would modify the session.xml file and replace the two filename tags with something unique like %%FILE1%% and %%FILE2%% and then have my script replace them with the real name of the file, making sure they are xml encoded.
    As a template, of course. The script would create the real session file.

  • Styles not working anymore

    3
    0 Votes
    3 Posts
    819 Views
    Alan KilbornA

    In my reply, I made a presumption. That was, that OP is affected by recent changes in how the feature works.

    @christian-faisstnauer said:

    But if I select several lines and try to do the same, it does not work anymore; I can’t mark the text.

    But upon rereading, I’m not sure now that this is the OP’s problem.

    But…without OP providing more details than “it does not work”, I don’t think this problem can be solved.

    So, @christian-faisstnauer , can you show some data and be more explicit about the problem?

  • I need to add some code at the end of some lines :

    4
    0 Votes
    4 Posts
    190 Views
    Alan KilbornA

    @oumal-bana

    You still aren’t being very clear.

    If you want to transform this:

    <p><strong>Loremipsum1 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <p><strong>Loremipsum2 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    into this:

    <p><strong>Loremipsum1</strong><br /> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <p><strong>Loremipsum2</strong><br /> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    You could search for (?-s)^<p><strong>.* and replace with ${0}</strong><br />

  • Dark Mode title bar still white in Windows 11

    8
    0 Votes
    8 Posts
    7k Views
    mere-humanM

    @MilkManEX said in Dark Mode title bar still white in Windows 11:

    Takes the color if you force it, but stays white when not in focus. I assume Notepad++ is, for whatever reason, being treated by Windows the same way.

    Yes, it seems Win32 apps (like Task Manager or Notepad++) are treated differently than latest UWP or similar apps (like Windows Settings window). The latter can also have transparency on the title bar.

  • Restore txt files in the Doc Switcher?

    5
    0 Votes
    5 Posts
    268 Views
    PeterJonesP

    @Cletos said in Restore txt files in the Doc Switcher?:

    I have those settings:

    The first “Backup path” says unsaved files get snapshots into J:\Programme\Notepad++\backup, until such point as they are saved or closed, at which point the backup goes away.

    The second “Custom Backup Directory” setting means that manually saved files get backed up (with a verbose blah.txt.timestamp.bak into the same folder.

    So the unsaved files respectively their back ups are lost forever. Cannot be restored.

    You might be able to use file recovery software like Recuva or similar, but there is no guarantee that will work for you.

    Saving files, and using external backup software / version control software / cloud storage are your best bet against data loss.

  • Help: N++ crashes when "run as admin"

    9
    0 Votes
    9 Posts
    438 Views
    PeterJonesP

    @L-Smxxx said in Help: N++ crashes when "run as admin":

    Can you kindly explain what is, and how to acquire, “portable version” of N++?

    Sorry, I thought I did explain. I mean, I said, " That is effectively what my advice in the other thread is telling you how to do.". And I linked to the other post. And in that other post, I directed you to https://notepad-plus-plus.org/downloads/ .

    Admittedly, the clues ran dry there, probably because I assumed you could figure out the rest: you would have to pick one of the releases (like “Notepad++ 8.1.1 release”, and once on that page, you would see the various download options, including the section like Download 64-bit x64 which contains a link to “Portable (zip)”, and once you saw that link, you would be able to see how to download the portable version.

    de9002bf-08ba-4d5f-8c0a-fbd1438f57c1-image.png

    After downloading the portable zip file, you would have to unzip it to a known location – for example, into Desktop\npp.8.1.1.portable.x64\ – and then run the portable version from there

    And what is the difference between that, and a “regular” version?

    A regular version comes in a bundled installer, and usually goes into your standard Program Files. A portable version runs from whatever folder you unzip it into. The other benefit of the portable is that the portable version by default uses the config files from the same folder you unzipped, rather than using your config files in AppData – this allows you to have multiple copies of Notepad++ with different configurations… which is often the point of running the portable edition (and in your case, to see whether you can get Run As Admin to work for a different copy of Notepad++.

  • Help: Safely have several N++ versions on PC; how to access each?

    7
    0 Votes
    7 Posts
    799 Views
    L SmxxxL

    Thank you very much, Peter! — Appreciate your patient(!) assistance!

  • Bug: "Rename" Opens to Default Directory, Can End Up Moving File

    5
    0 Votes
    5 Posts
    203 Views
    mere-humanM

    By the way, here is the related issue on GitHub:
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/10095

  • Dashes not supported in link names

    4
    0 Votes
    4 Posts
    158 Views
    tho-gruT

    @PeterJones thanks for finding the related issue.

  • 4 Votes
    37 Posts
    3k Views
    mario ahnerM

    I’m just glad, it is fixed. :-)

    Next time I will cry louder and earlier.

  • How to do a simple sort of lines in a text file?

    2
    0 Votes
    2 Posts
    136 Views
    PeterJonesP

    @bob_diebel ,

    Edit menu > Line Operations > Sort…

    https://npp-user-manual.org/docs/editing/#edit-menu

  • A RegEx question - How to remove a line, including the \r\n? Thanx,

    6
    0 Votes
    6 Posts
    7k Views
    bob_diebelB

    @PeterJones Thanx a bunch. Much appreciated

  • multi line editing

    25
    0 Votes
    25 Posts
    3k Views
    PeterJonesP

    Submitted update as PR#254

  • 1 Votes
    16 Posts
    3k Views
    Alan KilbornA

    …OR…

    Train yourself such that whenever you are tempted to use * (from your command-line thinking), to use .*? instead – a rough regex equivalent, meaning: match 0 or more of any character, minimally. The “minimally” part is there mainly for safety. But of course this is just a rough guide, as things go deeper than that.

    BTW, this is all similar for ? – this is different in regex than it is on the command line as well.

  • How do you choose a specific value between a csv

    3
    0 Votes
    3 Posts
    208 Views
    artie-finkelsteinA

    Assuming it’s a regular CSV file I’d:

    select the lines to be copied from use the “\TextFX\TextFX Edit\E:Line up multiple lines by (,)” option carefully check to make sure TextFX didn’t get confused by commas inside the quoted fields; it may not get confused, but if it did get confused STOP NOW and undo (Ctrl-Z) the alignment option (or throw away this edit session) use Alt-‘left click’ and drag to mark the source block Ctrl-C to copy the block into the clipboard paste the block in the clipboard to wherever you want it optionally undo (Ctrl-Z) the alignment performed on the original tab
  • Android analog?

    2
    0 Votes
    2 Posts
    221 Views
    PeterJonesP

    @Lisa-LePome ,

    Sorry, recommending text editors that aren’t Notepad++ isn’t really the focus of this Forum.

  • 0 Votes
    2 Posts
    252 Views
    PeterJonesP

    @Antisomniac said in N++ used to save sessions on shutdown without fail. Now it fails about half the time.:

    Checking to see if this is a known issue or whether it’s more likely an issue with Windows, etc

    I have never seen the active session get clobbered, so that it opens without remembering the current session. Ways to mitigate:

    Don’t use multiple instances of Notepad++ open at the same time – that is, make sure Settings > Preferences > Multi-Instance is set to ☑ Default (mono-instance), and don’t use the -multiInst command-line option. Notepad++ only has one default session, and when you have multiple instances open at the same time, then it saves the session and other settings for whichever instance you happen to close last – this might clobber the default session.xml compared to what you hope it would be. Use File > Save Session to manually save the Session to a named session; if you lose your default session again, you can manually File > Load Session to get it back. Unfortunately, this won’t help with unnamed files, but at least it won’t forget what other files you have open. Use View > Project Panels to create one or more Projects which define sets of files that are grouped in your mind, to be able to easily access them. Again, this won’t help with unnamed files. Use Settings > Preferences > Backup and uncheck ☐ Enable session snapshot and periodic backup; once you do this, every time you exit, if you have unsaved files (whether edits to named files, or new unnamed files that haven’t been saved yet), Notepad++ will ask you to save each of the files, and this way you avoid the root cause of “I don’t think to save the file anywhere” Use Plugins > Plugins Admin to install the AutoSave plugin, then configure it (see my notes in this recent discussion I am linking here, where it shows the default AutoSave config, and explains how to change it in order to make it actually do the auto-saving) – used properly, this can help you avoid “I forgot to save the temporary file”-syndrome. Teach yourself to “Save Early, Save Often”. And if you use external backup software, version control, and/or cloud services, you can have external locations where you data is backed up so that if something does go wrong, you don’t lose too much data.
  • 0 Votes
    5 Posts
    231 Views
    Ramanand JhingadeR

    @Terry-R Terrific, it worked perfectly. For your information, I used this in the “replace” field: <table style="text-align: left; width: 100%;" border="0" cellpadding="2" cellspacing="2"><tbody><tr><td align="left" valign="top"><span style="color: rgb(0, 0, 0); font-family: Verdana,sans-serif; font-size: 18px; font-style: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">-</span></td><td align="left" valign="top"><span style="color: rgb(0, 0, 0); font-family: Verdana,sans-serif; font-size: 18px; font-style: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">$1</span></td></tr></tbody></table>

    @guy038 I have other such, similar strings (>- and <br></span>) which is why I needed a RegEx.

    I believe that other people will search online and find this “solution” which is why I am making time to post a reply.

    Thanks @Terry-R and @guy038 for your help and time!

  • Two Recent Changes/Bugs/Issues (don't know for sure)

    2
    0 Votes
    2 Posts
    212 Views
    artie-finkelsteinA

    check the setting for “Lock (no drag and drop)” in the ‘Tab Bar’ group of the \Preferences\General menu

    sorry, I don’t use open as workspace, maybe someone else can help

  • Notepad ++ Crashed when I open a file while it's running a Regex

    1
    0 Votes
    1 Posts
    91 Views
    No one has replied