• 0 Votes
    15 Posts
    1k Views
    PeterJonesP

    @mm-john said in Alt+X is an undocumented/unreported keyboard shotcut for main menu file - close:

    Speculating, the &X would make it a npp shortcut and just “X” makes it a windows shortcut.

    Nope. When the developer prefixes a letter in the menu entry with the &, the developer is saying “Windows should use this letter as the accelerator key (if it can)”. It’s still Windows that is defining the behavior that Alt+Letter will open/activate that menu entry.

    &X would have it underlined all the time?

    In any situation in which case the F of File, E of Edit, … t of Settings, o of Tool, … are underlined, the X of X would be, too. If they had defined it as &X

    e9ad83a2-750d-4635-9f1d-37e479d5539b-image.png

    And, I’m guessing, &X would also make it appear in the Shortcut Mapper?

    Nope. Again, it’s not a “shortcut” from Notepad++'s perspective. It’s the Windows OS accelerator key for the menu entry. Notice for Windows that it doesn’t matter whether you type Alt+F to open the File menu or Alt then let go and pause, then hit F: it still opens the File menu in that sequence; and Alt, Pause, X will still close the active – that’s because it’s Windows OS handling the accelerator; it just tells Notepad++ “do whatever you’d do if someone clicked the File (or X) menu entry”. The Notepad++ Shortcut Mapper cannot define a keyboard shortcut that works that way; all Notepad++ keyboard shortcuts all must be simultaneously pressed, even if they have Alt in the shortcut.

    I am guessing there’s no way to have windows (os-level) shortcuts appear in the Shortcut Mapper.

    You’re right, because it’s not a shortcut; it is a menu accelerator, implemented by the OS, not by the application.

    Perhaps a note at the bottom of the Shortcut Mapper that says “additional shortcuts from the (windows) OS are active even tho they are not represented here. A shortcut here will override the OS.”

    Please, no. Way too much clutter. The windows accelerators are not shortcuts; they are accelerators, and they work that way in every single windows win32 api-based application that I have used since Windows 3.11, from what I remember. At this point in the windows history, if a user doesn’t know that Alt+letter activates a menu with that accelerator letter, no amount of clutter in a user interface will help with that. The next version of the user manual will attempt to clarify this, but it’s really a Windows default behavior that has worked that way for decades.

    Because of this discussion, I have added the paragraph listed above to the user manual repository, so on the next release of the manual, it will be easily accessible in the same place that the shortcut mapper itself is documented.

    I have portable, so the path to the shortcuts.xml is wherever the notepad++.exe is stored

    That’s well documented in the User Manual. I got tired years ago of typing in every response in this forum “shortcuts.xml in %AppData%\Notepad++ or wherever you happen to have placed your portable version, or in your cloud directory, or in the -settingsDir location”. If you are going to use something other than the standard installation, the onus is on you to understand how to translate the generic instructions into your specific configuration. If you had included the ?-menu’s Debug Info in your post, which would have told me that you had a non-standard installation, I would have customized my reply to your exact portable location. But barring that information being already transmitted to me, I will assume you have a standard installation. (And this despite the fact that for my entire workday every weekday, I am working out of a portable, and thus it’s more natural for me.)

  • Invoke find/replace with selection - selection box not marked

    12
    0 Votes
    12 Posts
    2k Views
    Alan KilbornA

    FWIW, and I don’t know why I didn’t mention this earlier, I wrote a PythonScript to handle this, and it is HERE.

  • #HELP ME..............................

    4
    0 Votes
    4 Posts
    841 Views
    PeterJonesP

    @eliot

    If you really have smart quotes in your data (doubful, but it’s what you posted):

    FIND = “priceMax”:\K\d+\.\d+ REPLACE = 0.1 SEARCH MODE = regular expression REPLACE ALL (because of \K, single replacement won’t work as expected)

    If you actually have ASCII quotes in the data

    FIND = "priceMax":\K\d+\.\d+ everything else the same

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions FAQ: Where to find regular expressions (regex) documentation Notepad++ Online User Manual: Searching/Regex
  • Custom XML syntax Highlighting? Custom XML UDL?

    14
    0 Votes
    14 Posts
    2k Views
    PeterJonesP

    To borrow an idiom from GitHub: 🚀

  • I did not receive the email from this forums to confirm my email...

    8
    0 Votes
    8 Posts
    836 Views
    MelchiorGasparM

    @peterjones said in I did not receive the email from this forums to confirm my email...:

    On the other hand, when I click on @MelchiorGaspar , it takes me to a 404-page-not-found error.

    And you don’t show up in the recent users list.

    Oh, that’s because you’ve had an account since 2017 (as I can see from searching on the users page for “melch”, which narrows the search down to
    065492fa-2045-4200-81a6-2f4f7958acde-image.png … so that explains why you weren’t in the new users.

    But it’s still strange that your profile seems to exist and you can post from it (and that at some point, you were able to set your avatar/profile picture), but that your profile doesn’t seem to be externally visible and returns 404. Someone with more power on the forum than me (maybe @guy038, if he’s around sometime soon) will have to take a look at your account to see what’s different about it.

    Given that I have confirmed that there is something wonky with your account specifically (given the 404), I will delete the dummy @e-pryrt account, since it’s not actually needed.

    I may have used a different login before… I thought I had an account here before… but could remember what I used to login… so I logged in with GitHub this time which imported my avatar and username…

  • Search and replace special characters ANSI-UTF

    5
    0 Votes
    5 Posts
    15k Views
    rodica FR

    I use this regex to find ANSI characters in all my documents:

    FIND: ¾|Ð|¼|°|Ñ|Ä|¢|º|ª|Å|Ÿ|ž|È|æ|Ã|¢|£|®|º|©|€|§|®|™|¢

    in almost all ANSI characters these signs are repeated: ¾|Ð|¼|°|Ñ

    But I use that longer regex, to make sure I don’t miss anything.

  • select language by name and not by extension

    12
    0 Votes
    12 Posts
    1k Views
    PeterJonesP

    @peterjones said in select language by name and not by extension:

    I think I will submit that as a bug report / feature improvement.

    Priority order on heuristic: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11504

    UTF-16 BE/LE ignores heuristic: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11505

  • Delete the entire content of all files with less than 100 words

    25
    0 Votes
    25 Posts
    1k Views
    rodica FR

    @guy038 said in Delete the entire content of all files with less than 100 words:

    \A[^\w]*(?:\w+[^\w]+){0,4}(?:\w+[^\w]*)?\z

    My joy is that, thanks to my regex, an alternative method has been discovered, quite good.

    thank you @guy038

  • Notepad++ link in SendTo Folder does not work any more

    4
    0 Votes
    4 Posts
    426 Views
    Alan KilbornA

    @susanne-senger said in Notepad++ link in SendTo Folder does not work any more:

    if I highlight some files (up to 8)

    Did you try with just ONE file? Does that work?
    (refer to Peter’s post where he says You also mentioned “a bunch of files”… which you clearly didn’t read…)

  • Notepad++ font

    2
    0 Votes
    2 Posts
    211 Views
    dfs-D

    Could you provide a screenshot illustrating the issue, so we can see where the cut-off happens?

    Do you have DirectWrite active in the Notepad++ preferences?

  • Theme creation: How to choose separate color for...

    5
    0 Votes
    5 Posts
    392 Views
    PeterJonesP

    @drawing-with-jakob-dam said in Theme creation: How to choose separate color for...:

    I’ve tried to copy the line to the HTML section and given it a unique styleID, but it didn’t work.

    Unfortunately, you cannot just arbitrarily copy XML from one language’s settings to another. Well, you can, but it won’t do anything.

    Each language’s lexer has its own bit of code that decides what will and what won’t be syntax highlighted; it reads the XML configuration for that language, and on the StyleID’s that it recognizes, it applies the styling defined by that line of XML to the sequences that match what that lexer is coded to match for that StyleID… but if you define a StyleID that the lexer doesn’t recognize, it won’t do anything with that definition, because there is no line of code in the lexer that does anything with that StyleID.

  • Window view problem

    5
    0 Votes
    5 Posts
    962 Views
    Cristina StoicaC

    @madzilla You are completely right, it also seems to happen on my end whenever I am using Ringcentral BlueJeans app, no matter if I screenshare or not. Rebooting does the trick.

  • Change a certain line in several documents with command/variables

    2
    0 Votes
    2 Posts
    865 Views
    PeterJonesP

    @ivan-k-0 said in Change a certain line in several documents with command/variables:

    Is there any command to execute to change this line for each document?

    It’s called regular expression search and replace.

    Your method of describing your data is rather confusing. I don’t know whether those digits really prefix each line, or if you are just numbering the lines, or numbering the documents that contain that as line#6. Using the Template for Search/Replace questions mentioned below would have helped you communicate more clearly.

    But I can come up with a solution that is agnostic of that prefix anyway.

    If you want to replace any json ("edition": ###,) line with json ( "external_url":"https://example.com/?token_id=###",) then you can use
    FIND = json \("edition": (\d+),\)
    REPLACE = json \( "external_url":"https://example.com/?token_id=${1}",\)
    SEARCH MODE = Regular Expression

    If you have many such lines in the same file, but only want to replace the one on line 6, then change the FIND to \A(?-s:^.*$\R){5}\K^json \("edition": (\d+),\), which looks for the beginning of the file and 5 lines, then restarts the match.

    If you allow other characters before the json prefix on line 6, you might have to tweak what comes after the \K to allow that. I will leave that as an exercise for the reader; give it a try using the docs below, and if you cannot figure it out, ask for hints.

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions FAQ: Where to find regular expressions (regex) documentation Notepad++ Online User Manual: Searching/Regex
  • Window layout problems after update

    21
    0 Votes
    21 Posts
    5k Views
    Reinier van RooyenR

    @domwesker I know it’s a year later, but if I found this in a google search so can someone else. I just want to confirm the later replies here. This problem seem to stem from using Slack. In my case I had the go into task manager and stop ALL(sort by name since they tend to play hide and seek) Slack processes. Then simply close NP++ and re-open.

  • Need help restoring records

    2
    0 Votes
    2 Posts
    220 Views
  • =lost settings after upgrading to 8.2.1 32bit

    3
    0 Votes
    3 Posts
    771 Views
    Marcelo FinkielszteinM

    @peterjones ,
    THANK YOU for the reply.
    Now, every time I upgrade, I am careful to empty the checkbox on the last dialog that would let me “open notepad++”. I just ask the install to finish without re-opening the app.
    With this workaround is enough.

    Thanks again.
    Marcelo

  • Insert Mode Help

    8
    0 Votes
    8 Posts
    519 Views
    guy038G

    Hello, @omar-salamah, @peterjones and All,

    @omar-salamah :

    Actually, here is your goal :

    You have a first File1.xml file containing N pure blank lines

    You have a second File2.xml file, below, containing M non-empty lines, with M <= N

    <nominal>8</nominal> <min>4</min> <nominal>3</nominal> <min>1</min> <nominal>2</nominal> <min>1</min> <nominal>0</nominal> <min>0</min> <nominal>0</nominal> <min>0</min> <nominal>5</nominal> <min>4</min> <nominal>0</nominal> <min>0</min> <nominal>0</nominal> <min>0</min> <nominal>3</nominal> <min>1</min> <nominal>3</nominal> <min>1</min> <nominal>2</nominal> <min>1</min> <nominal>10</nominal> <min>8</min> <nominal>0</nominal> <min>0</min> <nominal>3</nominal> <min>1</min> <nominal>0</nominal>

    And each non-empty line of File2.xml must replace the next pure empty line of File1.xml !

    The @peterjones’s python script, of course, works correctly using the minimal layout of File2.xml, too

    Best Regards,

    guy038

  • Regex: Add string in front of paragraph and after it

    9
    0 Votes
    9 Posts
    4k Views
    Robin CruiseR

    @PeterJones thanks. I understand now the DECODE.

    Notepad++ -> Menu -> Plugins -> Mime Tools -> Base64 Decode

    Thanks for solution @guy038

  • Function List weirdness and sorting

    5
    0 Votes
    5 Posts
    426 Views
    dfs-D

    Thank you for your insight. I added a PR for my other “wishes”.

  • 8.3.3 UPDATE

    3
    0 Votes
    3 Posts
    293 Views
    Neil SchipperN

    @myles-carpeneto You might benefit from this.