• Ctrl-S to save doesn't work for brand new files

    3
    2 Votes
    3 Posts
    4k Views
    Michel MerlinM

    Notepad++ only saves the file if its content has changed
    “Ed Kolis” ~20 aug « for some reason Ctrl-S is disabled until I enter some text! »
    I discovered the same problem a few years ago, reported it, and was replied (from memory):
    « This is normal, NP++ does NOT touch the file following your Ctrl+S if the contents has NOT been changed»
    I ranted (politely, NOT like here where I prefer to be clear than diplomatic) that this was NOT the expected standard Windows behavior, and that anything unexpected is misleading the user and compromising his efficiency and safety.
    Yet after years I finally found that the Notepad++ behavior is actually better than the standard one and could be followed by Windows, which would benefit everybody. Provided it is clearly explained, which I try here:

    The 1st line in the Notepad++ interface is the Menu line The 2nd line is the icon line In that 2nd line, 2nd position, you have the “Save” icon (a floppy disc); in 3rd position, “Save All” (a pile of 3 smaller floppies) At start, both icons are gray. In this state, if you order a “Save” (either by clicking the “Save” icon or by Ctrl+S or else), oppositely to standard Windows, this does NOT save the file. As soon as you change something in the file that has the focus, both icons turn light blue; then if you order a Save, it gets done, and both icons turn back to gray.

    After long use I highly appreciate this; I see immediately and clearly if all the open files (a hundred in my current case) are saved; if just one has been changed (by me, or by a batch program I did, or else), then I get immediately notified by the “Save All” icon that turns blue. Also, if you instinctively save a file to make sure you don’t lose anything, and you at once regret because you wanted to change the file Date ONLY after checking if the contents had changed, with regular Windows it’s too late, but with NPPP you are covered by just checking the file Date.
    I finally find that, especially with numerous files, the Notepad++ behavior is easier to manage and safer for the files.
    Versailles, Fri 30 Aug 2019 20:13:05 +0200, edited (list formatting) 20:14:45

  • Update dialog on the wrong monitor

    2
    0 Votes
    2 Posts
    286 Views
    EkopalypseE

    @Joseph-Steel

    agreed, but I assume you need to follow this.

  • bat file opening in MS notepad, now to open in npp?

    2
    0 Votes
    2 Posts
    488 Views
    PeterJonesP

    If you have the Edit with Notepad++ entry applied to all file types, it shows up whether or not the program has an “association” with Notepad++. That’s the safer way to do that.

    Go see https://notepad-plus-plus.org/community/topic/18140/how-to-get-windows-explorer-right-click-menu-open-edit-with-notepad for a very recent discussion started on how to get that entry. (ie, it was the post I answered just before reading yours.)

  • Can you copy the file caches from portable to installer

    2
    0 Votes
    2 Posts
    405 Views
    PeterJonesP

    @Rex-Parthi said:

    Is there anything can be added or exits to read the portable to the installer?

    By this, I assume you want some automated way for the installer to guess in which of the effectively-infinite possibility of path names you had your portable version, and automatically copy those open-but-unsaved files over to the installed instance.

    As you might be able to tell from my phrasing, that’s just not going to happen. It’s something you can do much easier than the installer – since you know where your portable version is; you know whether you’ve got open-but-not-saved files, and you know which are important and which don’t need to be copied.

    have a known portable version (for sake of this example, it’s in c:\portable-notepad++\ install a permanent version (for sake of this example, it’s in c:\program files\notepad++\ and your config files are in %AppData%\Notepad++) copy everything in c:\portable-notepad++\backup\ to %AppData%\Notepad++\backup\ copy the session file: c:\portable-notepad++\session.xml to %AppData%\Notepad++\session.xml when you open your permanent installed version, it should have all the unsaved-but-open files available.

    Or, better

    in the portable version, save all those files to a known location with known names in the portable version, File > Save Session…, and put the session file in a known location in the installed version, File > Load Session…, and browse to that session file Continue good file-saving and file-backup practices, not expecting unsaved files to survive without effort on your part, because you know that the safety of your critical data is up to you. (“Save early, save often”)

    Good luck.

  • Log startup of notepad

    3
    0 Votes
    3 Posts
    4k Views
    Παύλος ΓκέσοςΠ

    Seems that SysInternals Process Explorer does the trick.
    This is thread’s call stack:
    Clearly the DSpellCheck is the evil. I disable it and there is no hangs until now.

    ntoskrnl.exe!KiCpuId+0xaa
    ntoskrnl.exe!ExAcquireSpinLockExclusiveAtDpcLevel+0x2c2
    ntoskrnl.exe!KeWaitForSingleObject+0x1a3
    ntoskrnl.exe!ExReleaseResourceForThreadLite+0x60
    ntoskrnl.exe!KeInsertQueueApc+0x725
    ntoskrnl.exe!ExAcquireSpinLockExclusiveAtDpcLevel+0x4cd
    ntoskrnl.exe!KeWaitForMultipleObjects+0x272
    win32k.sys!memset+0x7c97
    win32k.sys!memset+0x7d59
    win32k.sys!EngFntCacheLookUp+0x1747b
    win32k.sys!memset+0x6c9e
    win32k.sys!EngFntCacheLookUp+0x60b0
    win32k.sys!W32pArgumentTable+0x3818a
    win32k.sys!EngSetLastError+0x7f
    win32k.sys!EngSetLastError+0xd836
    ntoskrnl.exe!longjmp+0x5b93
    USER32.dll!IsDialogMessageW+0x20a
    USER32.dll!UserHandleGrantAccess+0x4020
    DSpellCheck.dll!isUnicode+0x55ed2
    DSpellCheck.dll!isUnicode+0x3bae
    DSpellCheck.dll!isUnicode+0x35cb1
    DSpellCheck.dll+0x4a1d
    DSpellCheck.dll!beNotified+0x98
    Notepad++.exe+0xd7fe6
    Notepad++.exe+0xd7ede
    Notepad++.exe+0x8e94a
    Notepad++.exe+0x12fc4e
    Notepad++.exe+0x13e35f
    kernel32.dll!BaseThreadInitThunk+0xd
    ntdll.dll!RtlUserThreadStart+0x1d

  • 2 Votes
    9 Posts
    6k Views
    PeterJonesP

    @dinkumoil said:

    Session file ext. and define a file type. The image below shows that I’ve choosed nppssn.

    Cool, I didn’t know that’s what those preference fields were for. I’ve added that tidbit to my TODO list for the preferences documentation update.

    One benefit of my method vs yours (or of combining our two methods: using the same extension in both registry and Session file ext) – mine allows adding the -multiInst flag, so that if you’re normally in single-instance mode, but want to open multiple sessions simultaneously in separate instances, it will not work with always-single-instance mode. Oh, that’s what “open session in a new instance” is for. More clarifications to make in docs.

    Looks like I have enough TODOs in that file that I should be making a preferences-documentation pull request as soon as I have time. :-)

  • Environment variables in settings network share

    4
    0 Votes
    4 Posts
    4k Views
    Alan KilbornA

    @ThiloL

    Our advice on that is to start here.

  • Where to report Regex bug?

    2
    0 Votes
    2 Posts
    4k Views
    Alan KilbornA

    @David-Caylor said:

    Sorry if this is the wrong area

    It is. The official bug reporting area may be found via this link: https://notepad-plus-plus.org/community/topic/15741/faq-desk-feature-request-or-bug-report

    But of course it is ok to discuss suspected bugs here first.

    I think you might be a victim of a “catastrophic” regular expression situation.

    Try this, which may (or may not) be equivalent to the Replace All operation you’ve described, but for purposes of illustration it might be valid: Without changing anything else about your setup, change to the Mark tab of the Find window, then press Mark All. Notice that all of your text will be marked with a red background (indicating what matched), including ANNUAL_SALARY, which sanity says your regular expression should not match.

    Now have a look here: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4761 and do some reading…

    What it comes down to is that you should write a better regular expression to match your data. Perhaps \d+\R as a suggestion for your Replace All operation. Maybe I would do something different from that, but I don’t know what you are really trying to accomplish; I think your example is just that, an example, and your real task is hidden from us – that’s okay, not a problem.

    BTW, your regular expression is inefficient and/or “odd” in other ways. Would it surprise you to know that it will match the zero-length positions between every character in ANNUAL_SALARY? We offer some learning advice about regular expressions here: https://notepad-plus-plus.org/community/topic/15765/faq-desk-where-to-find-regex-documentation

  • 0 Votes
    2 Posts
    4k Views
    EkopalypseE

    @Prahlad-Makwana4145

    by comparing the dll with the official ones.
    Note, it is not reliable to compare SciLexer.dlls from different Npp versions.

  • Set style of LF/CR and similar characters?

    10
    0 Votes
    10 Posts
    4k Views
    Alan KilbornA

    @Maury-Markowitz said:

    so what is the option?

    All I meant was that you only spoke of the View All Characters option. I wasn’t sure if you noticed the other choice that doesn’t get you the “heavy” line-endings, specificially View Whitespace and TAB.

    if you need to look for a space followed by a line-ending, I’d suggest a search rather than visual inspection:

    Bring up the Find window (ctrl+f).
    Find what box: \x20\R
    Search mode: Regular expression
    Press the Find All in Current Document button.

  • Lost bookmarks

    12
    0 Votes
    12 Posts
    12k Views
    Maurizio LotauroM

    Thank you for the information!

  • Go language in Notepad++

    3
    1 Votes
    3 Posts
    6k Views
    EkopalypseE

    @ManPython

    not 100% sure what you are talking about.
    Delivering the udl you linked to together with npp, like it does with markdown language?
    Or creating a builtin lexer like the ones visible in the language menu (A-Z items).

    If you are talking about the first, then I would assume no as long as not everything is functional (the function list isn’t correct)
    and if you talk about the second then I would be surprised because this is normally scintilla territory.

    Btw. do you know scintillua?
    It seems it has a go lexer added.
    I have to admit, that I don’t know how it works as I’ve never used it but maybe you wanna give it a try.

  • Notepad++ infected with a virus Trojan.rHeur.Agent.dg ?

    3
    1 Votes
    3 Posts
    1k Views
    Sergey MuzychenkoS

    @Ekopalypse said:

    virustotal.

    Thanks for the info, checked virustotal, everything is in order.

  • Tabs in python

    13
    0 Votes
    13 Posts
    2k Views
    Michael MannionM

    Another victim of PEP 8.

    Frenzy Frenzy, I agree with Peter Jones that inconsistency is the issue here. That said, I presume that you were being consistent and that npp silently changed your tabs to spaces, per its default behavior (yea for npp for following the rules; boo for the PEP 8 authors for making that rule).

    It shouldn’t have been an issue if you were starting a module from scratch, but would definitely lead to problems if you were editing existing code that already contained real tabs. Once the code is hosed, you have a few options in npp for cleaning it up:

    View the white space characters, per Alan Kilborn’s post, and manually fix them

    Use the TAB to space option Peter cites - or, ideally, it’s inverse operations, Space to TAB (All) and Space to TAB (Leading)

    Use Search > Replace with the Search Mode > Extended option to manually find or replace tab characters using their special \t representation

    The automatic space-to-tab converters are good, but bulk operations inevitably (and understandably) overgeneralize. While time consuming, the third option gives you more control over the process, with some level of automation.

    FWIW, I’m +1 with you for using tabs. I’m always amused (or perhaps bemused) that right at the top of PEP 8 is a section called “A Foolish Consistency is the Hobgoblin of Little Minds”, followed immediately by the first, and most foolish, of its recommendations - to use spaces instead of tabs (which many in the Python community follow consistently, admittedly with good intentions).

    I’ll refrain from commenting on the merits of tabs; there’s plenty on the web about that already. Suffice it to say, there’s a large community of Python programmers that agree with your approach.

  • Left-justified comment symbols

    6
    0 Votes
    6 Posts
    677 Views
    Alan KilbornA

    @Michael-Mannion said:

    Maybe I need to look into making an npp macro;

    You can certainly macro-ize that replace op easily enough. See the Macro menu. Your macro would consist of one thing: A Replace All button press.

  • Copy all formats to clipboard not working (v. 7.7.1)

    4
    0 Votes
    4 Posts
    2k Views
    Chris JohnstonC

    Hi, super helpful. Thanks so much :)

  • xml-tools plugin won't install

    4
    0 Votes
    4 Posts
    2k Views
    Sverre TS

    A million thanks. I successfully downloaded plugin and installed it following the instructions. I also noticed that there was an old “dangling” XMLtools dll on the plugin root directory - which I deleted - but that alone did not solve the gui plugin installation problem where npp never restarted and XMLtools never installed. See screenshots
    https://www.dropbox.com/sh/2srv89fdjeb53kt/AAC9tCPbjRMccnORZ1E5C9UOa?dl=0

    I add that I have installed the plugin on another client - which worked as expected - running on same platform and similar win7 upgrade.

  • Correction needed !

    4
    3 Votes
    4 Posts
    529 Views
    PeterJonesP

    Given that I use NppExec and not NppExportPlugin, and that there have historically been a lot more questions in the forums that involve NppExec (often in the answer) compared to NppExportPlugin, my fingers have been trained to that sequence, apparently.

  • How do select multiple line and replace text?

    5
    0 Votes
    5 Posts
    6k Views
    Alan KilbornA

    @ajay-gohil

    How does THAT mess of a solution match the original problem??

  • Invitation for OSS Community Research based in the University of Leeds

    1
    0 Votes
    1 Posts
    302 Views
    No one has replied