• Snaphot not work with Plugin !?

    4
    0 Votes
    4 Posts
    231 Views
    Michael VincentM

    @Mes-E-M said in Snaphot not work with Plugin !?:

    How can a Plugin interfere with periodic autosave?

    The Notepad++ API changes so does the underlying Scintilla API - so it could be any number of things.

    What old version of Notepad++ did it work on?

    Where is the code to your plugin?

    Cheers.

  • 0 Votes
    7 Posts
    1k Views
    Alan KilbornA

    @pbarney said in Is it possible to replace individual characters inside a regex capture group?:

    If I owned a software development business, I’d hire you as Chief RegEx Officer.

    I fully endorse this.

  • langs.xml

    2
    0 Votes
    2 Posts
    207 Views
    PeterJonesP

    @DomOBU ,

    My general procedure in something like that is to do a DIFF between the two versions (the Compare Plus plugin is quite helpful for that) – and anyplace that is undoing your own setting can be ignored, but anything added to the v8.5.1 one that isn’t in your existing should be added; once your copy has been updated to include any new entries from v8.5.1, then you can copy your updated XML overtop the one in the v8.5.1 directory and restart Notepad++.

  • Insert new line after every comma, colon AND period mark

    4
    1 Votes
    4 Posts
    18k Views
    Alan KilbornA

    @Luís-Gonçalves said in Insert new line after every comma, colon AND period mark:

    The problem with that regex is that it deletes the commas, colons and period marks, which I don’t want to. I want to keep them as they are, while inserting a new line after them.

    Ah, I missed that detail.

    Revise the Replace: $0\r\n

  • Replace text inside Quotations

    6
    0 Votes
    6 Posts
    443 Views
    Alan KilbornA

    @geeman72 said in Replace text inside Quotations:

    and worked with this

    Seems reasonable!

  • How to get search partially instead of exact match?

    7
    0 Votes
    7 Posts
    878 Views
    Alan KilbornA

    @Neil-Schipper said in How to get search partially instead of exact match?:

    This could be achieved by using a suitable regex with a logical or directive and Mark All.

    I meant when using the simple regex I supplied.

  • mouse cursor changing shape as i move it

    4
    0 Votes
    4 Posts
    2k Views
    Terry RT

    @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

  • add attribute to element from value of next element

    2
    0 Votes
    2 Posts
    169 Views
    Mark OlsonM

    @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?

    4
    0 Votes
    4 Posts
    3k Views
    Mark OlsonM

    @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

    3
    0 Votes
    3 Posts
    333 Views
    Alan KilbornA

    @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.

  • WordWeb Pro 10.1 not working in Notepad++ 8.5

    15
    0 Votes
    15 Posts
    1k Views
    EkopalypseE

    @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

  • How do you make a note pade file .ush for unreal engine

    2
    0 Votes
    2 Posts
    410 Views
    Emile BrouillardE

    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?

    14
    0 Votes
    14 Posts
    1k Views
    Alan KilbornA

    @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.

  • Markdeep files won't render properly

    4
    0 Votes
    4 Posts
    321 Views
    Lycan ThropeL

    @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.

  • notepad++ 8.5 url for install/update plugins

    6
    0 Votes
    6 Posts
    1k Views
    Paul LeoP

    @Alan-Kilborn
    Makes total sense, thanks again

  • Today's date instead of YYYYMMDD

    5
    0 Votes
    5 Posts
    510 Views
    Alan KilbornA

    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

    3
    0 Votes
    3 Posts
    211 Views
    Alan KilbornA

    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
    507 Views
    Alan KilbornA

    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

    3
    0 Votes
    3 Posts
    229 Views
    Taddeus TentakelT

    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!

  • Ctrl + L/R Arrow Keys... "distance" modification?

    8
    0 Votes
    8 Posts
    2k Views
    Alan KilbornA

    @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.