• 0 Votes
    4 Posts
    2k Views

    @Terry-R said in mouse cursor changing shape as i move it:

    I only ever have the pointer when on menu options , radio buttons (under settings) and the I when over a text input field or in the tab itself to type characters.

    After seeing @Alan-Kilborn response I checked again. it took some searching but found the “finger”, when over Settings, Preferences, Recent Files History, Max. number of entries. I doubt there are many occurrences of those “pointers”, but as @Alan-Kilborn says, it’s normal behaviour.

    Terry

  • 0 Votes
    2 Posts
    175 Views

    @Anar-Movsumov
    find/replace form; replace (?s)<request>\s*<num>(\d+)</num>(.*?</request>) with <request id="\1">\2.

    The very excellent regex manual on the reference website has some pages that may be of interest:

    single character matches on \s, ., and \d capture groups and backreferences for why I wrapped (\d+) and (.+</request>) in parentheses search modifiers to understand how (?s) works multiplying operators on why you need to use .*? and not .* to match everything between the <num> element and the remaining children of the <request> tag.
  • all files are one line?

    Mar 19, 2023, 2:29 AM
    0 Votes
    4 Posts
    4k Views

    @Vap
    Yeah, this is either JSON or something infuriatingly close to JSON that taunts the user by having a few strategically placed syntax errors.
    In either case, JsonTools and JSMinNPP are both fine choices. In the case of JsonTools, once you have the plugin, Pretty-print JSON will get you where you want to go.

  • Find and replace text with regex

    Mar 19, 2023, 10:41 AM
    0 Votes
    3 Posts
    361 Views

    @PeggoC82

    Regardless, this is a now-classic “replacing in a specific zone of text” problem, and we have a solution for that; reference HERE to get started and post back again if you need further help.

  • 0 Votes
    15 Posts
    1k Views

    @R-D

    I don’t see the problem on my end.
    I downloaded the free version and Ctrl+mouse-right click seems to trigger Wordweb. But there is a problem with recognizing the correct word. It only works reliably if I select the whole line and then do the action at the particular word.

    wordweb.gif

  • 0 Votes
    2 Posts
    430 Views

    i figured it out in the end it was just a mather of renaming the text file type in the right hierachy of folder for unreal . So you need to rename it in .ush and with all folder type engaged and your good when you see fichier USH27e0e338-1dd6-4051-bd4c-f0a1d7df2ad5-image.png

  • Remove "save file" prompt?

    Mar 15, 2023, 8:01 PM
    0 Votes
    14 Posts
    1k Views

    @Alan-Kilborn said in Remove “save file” prompt?:

    STOP! You’re doing it wrong!
    Every time you run that script, you put another callback in place.

    So let’s explore this a bit further.

    Create a script much like the earlier one in this thread:

    # -*- coding: utf-8 -*- from __future__ import print_function from Npp import * console.show() print('user ran the script! (let us flash the screen for fun)') editor.flash(250) def BufferActivated(args): print('system-generated buffer activated! tab:', notepad.getCurrentFilename().rsplit('\\', 1)[-1]) notepad.callback(BufferActivated, [NOTIFICATION.BUFFERACTIVATED])

    Run it once via the Plugins > Python Script > Scripts menu. Then click on different tabs, get something like this as output in the PythonScript console window:

    user ran the script! (let us flash the screen for fun) system-generated buffer activated! tab: new 3 system-generated buffer activated! tab: new 1 system-generated buffer activated! tab: new 2 system-generated buffer activated! tab: new 3

    All good. Now run the script 3 more times from the Plugins > Python Script > _Run Previous Script() _ menu.

    Now select a few different tabs (I did same sequence as above) to obtain:

    user ran the script! (let us flash the screen for fun) user ran the script! (let us flash the screen for fun) user ran the script! (let us flash the screen for fun) system-generated buffer activated! tab: new 3 system-generated buffer activated! tab: new 3 system-generated buffer activated! tab: new 3 system-generated buffer activated! tab: new 3 system-generated buffer activated! tab: new 1 system-generated buffer activated! tab: new 1 system-generated buffer activated! tab: new 1 system-generated buffer activated! tab: new 1 system-generated buffer activated! tab: new 2 system-generated buffer activated! tab: new 2 system-generated buffer activated! tab: new 2 system-generated buffer activated! tab: new 2 system-generated buffer activated! tab: new 3 system-generated buffer activated! tab: new 3 system-generated buffer activated! tab: new 3 system-generated buffer activated! tab: new 3

    As one can see, each time you switch a tab now, the callback gets called FOUR times! That’s because the script was run 4 times, and 4 separate callback functions were registered. It doesn’t matter that it was the “same” function that was registered each time.

    How does one avoid/prevent this kind of thing from happening? Well, don’t run the script multiple times. But, accidents happen, so change the code to protect yourself. But how?

    The changed script below shows how I like to do it (there are certainly other ways to achieve it):

    # -*- coding: utf-8 -*- from __future__ import print_function from Npp import * console.show() print('user ran the script! (let us flash the screen for fun)') editor.flash(250) def BufferActivated(args): print('system-generated buffer activated! tab:', notepad.getCurrentFilename().rsplit('\\', 1)[-1]) # --- vvv --- differences from original script are below --- vvv --- try: i_am_installed except NameError: notepad.callback(BufferActivated, [NOTIFICATION.BUFFERACTIVATED]) i_am_installed = True else: print('callback is already installed!')

    The effect should be somewhat self-explanatory from the code. If you try the multiple runs experiment with this new version of the script, you shouldn’t see multiple buffer-activated processing when tabs are switched in the Notepad++ UI.

  • 0 Votes
    4 Posts
    332 Views

    @Alan-Kilborn

    @Alan-Kilborn said in Markdeep files won't render properly:

    why not just use View menu > View Current File in > Edge ?

    Yikes, I didn’t realize it was already included :-) My bad.

  • 0 Votes
    6 Posts
    1k Views

    @Alan-Kilborn
    Makes total sense, thanks again

  • Today's date instead of YYYYMMDD

    Mar 16, 2023, 1:19 PM
    0 Votes
    5 Posts
    544 Views

    Anyway, here’s a demo script that could accomplish the goal. I call it ReplaceYyyymmddOnFileOpen.py:

    # -*- coding: utf-8 -*- # references: # https://community.notepad-plus-plus.org/topic/24257 #------------------------------------------------------------------------------- from Npp import * import time #------------------------------------------------------------------------------- class RYOFO(object): def __init__(self): notepad.callback(self.fileopened_callback, [NOTIFICATION.FILEOPENED]) notepad.callback(self.bufferactivated_callback, [NOTIFICATION.BUFFERACTIVATED]) self.process_next_buf_act = False def fileopened_callback(self, args): self.process_next_buf_act = True def bufferactivated_callback(self, args): if self.process_next_buf_act: editor.replace('YYYYMMDD', time.strftime('%Y%m%d', time.localtime())) self.process_next_buf_act = False #------------------------------------------------------------------------------- try: ryofo except NameError: ryofo = RYOFO()
  • no Folder as Workspace

    Mar 16, 2023, 12:24 AM
    0 Votes
    3 Posts
    218 Views

    Ah, some good memories of the old Crutchfield catalog from my teenaged youth. This was pre-internet and I’d wear the catalog out, turning the pages and dreaming of the stereo I’d love to have…

    (But yes, Terry, you make some excellent points with your reply!)

  • -1 Votes
    6 Posts
    556 Views

    Actually if you use N++ 8.5 or later, going where @datatraveller1 suggests will show you this:

    72b2fe19-9393-438d-af92-8cb376c01f37-image.png

    Number 3 is a new command to Notepad++ 8.5; see the Edit menu:

    b9bcc9f2-067e-44b2-8606-9c23dc137cac-image.png

    Personal note: I actually added this to N++ 8.5 – my FIRST contribution to Notepad++ code! :-)

  • Bug found in np++ 8.5

    Mar 14, 2023, 11:53 AM
    0 Votes
    3 Posts
    241 Views

    Funny, i was just about to say i found it xD sry it always worked automatically with enter so i assumed it was a bug, my bad!

  • 0 Votes
    8 Posts
    2k Views

    @guy038

    I tried the “word character list” thing before you posted about it. I found that adding [] to it still doesn’t make N++ work like other windows applications in regards to Ctrl+left/right, so I don’t think that will satisfy the OP.

  • TAB OUT OF CONTROL

    Mar 11, 2023, 10:19 PM
    0 Votes
    4 Posts
    424 Views

    @Garry-Petrie said in TAB OUT OF CONTROL:

    All I wanted to do is use word wrap and intent the first line with a tab character, you know, like normal writing and typing. Once tab is invoked, it repeats on every subsequent line. BAD, BAD, BAD.

    Couldn’t you not whine, and just ask a civilized question, like “How do I do this?”

    You obtained this:

    f6eed6f6-fec9-4549-8425-232fc62e3a2f-image.png

    And to get what you wanted all you had to do was select this:

    314072dc-ba95-43fd-9810-c034cd172ca3-image.png

    But you’re long gone now, back to Notepad.exe.
    Lucky you.

  • 2 Votes
    9 Posts
    441 Views

    Hello, @luís-gonçalves, @mark-olson, @alan-kilborn, @peterjones and All,

    Here is a quick way to mark all consecutive equal lines but the first !

    First, add a final line-break at the end of your number’s list ! ( IMPORTANT )

    MARK (?x) ^ ( \d+ \R ) \K ( \1 )+

    Bookmark line, Purge for each search and Regular expression checked

    Then, you can follow the @mark-olson’s instructions ! So :

    Put a single space char in the clipboard with Ctrl + C

    Run the Search > Bookmark > Paste to (Replace) Boomarked Lines option

    Finally, run the simple S/R :

    SEARCH ^\x20$

    REPLACE Leave EMPTY

    Or use the Edit > Blank Operations > Trim Trailing Space option

    Best Regards

    guy038

  • 2 Votes
    12 Posts
    850 Views

    @glimmerwell said in Custom Toolbar Icon - Custom Date Time Stamp: Mini-Tutorial:

    That is how I extracted the icon. But I am not using the Fluent toolbar. I just personally like the standard icons better.

    Then you have to use a bitmap.

    I still would like a bitmap version of the clock icon

    Microsoft Windows still comes with an application called mspaint.exe, even though it’s not their default for image editing anymore. You can open that application (WindowsKey + R => mspaint.exe, et voila, it appears), load the .ico file, and Save As a .bmp. Or you can find one of a plethora of app-based or online-based image converters which could convert the icon from .ico to .bmp for you.

  • 0 Votes
    5 Posts
    569 Views

    @Bahaa-Eddin-ツ said in “Invalid regular expression” error after crossing line ~3000000:

    Can you explain the thing you didn’t understand so I can edit the post

    His point was, because you didn’t use ` before and after your regex (to put it in a red typeface), the asterisk wildcards in your regex became italics in your post. It makes it very hard to know what regex you tried when you don’t even look at the “preview” or the post after you’ve hit SUBMIT, and notice that the regex that’s shown isn’t the regex that you tried.

    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • Wrong manipulation help

    Mar 9, 2023, 5:37 PM
    0 Votes
    3 Posts
    222 Views

    @PeterJones said in Wrong manipulation help:

    @Clément-Berguerand ,
    By default, Notepad++ enables the Settings > Preferences > Backup option for session-snapshot-periodic-backup, which only keeps a temporary backup copy to keep unsaved changes, it’s not a true “backup”, and it goes away when you hit SAVE or CLOSE in Notepad++
    Notepad++ has an additional feature “backup on save” available in the same Preferences dialog, which will create filename.bak or similar every time you hit SAVE. But if you didn’t already have that option enabled, it won’t help you now, and there’s nothing that Notepad++ can do for you. If you did already have that option enabled, there should be a .bak file next to your saved game, or in the “custom backup directory” listed in the Preferences dialog. (Notepad++ doesn’t enable that option by default because when the developer tried, a plethora of users complained about too many .bak files being created that they didn’t want. I argued in favor of data safety, but don’t-create-.bak-files-by-default crowd won that argument.)
    For future data safety, I highly recommend reading our backup features and autosave plugin FAQ, and set things up to make it less likely that you will lose your data.
    If your data is lost, that FAQ does mention a potential piece of software (not officially recommended or endorsed, other than some users have had luck with that tool) that can help recover deleted files.
    Good luck.

    Thank you very much. I’ll try to do it.

  • How Np++ handles char count?

    Mar 10, 2023, 3:51 PM
    0 Votes
    8 Posts
    1k Views

    Thanks for all the replies. Byte count looks good enough for me, there is already a dedicated plugin to more refined statistics like count chars and words, for statusbar I believe byte count is enough.

    However, the other editor I’m talking about (CudaText) doesn’t use Scintilla, it has its own editing component (ATSynEdit) that doesn’t use simple buffer storage to retrieve byte count, it has “list of lines” according to the dev so the count would be slow.

    An optimization is possible by caching the size of each line, adding them up and then updating with edit events (typing one char sums 1…). But at the moment he don’t plan to work on it because it’s not that trivial as the editor supports multiple carets, multiple selections ans so on.

    Just adding, other text editor I have installed here, Kate, displays not only chars count (precisely, not bytes) but also count of words in statusbar. However these counts aren’t instant, I can see they wait for like half a second without change in the text to update. Clearly it’s done this way because it’s not that cheap to be done instantly.