• Importing PythonScript Library to IDE

    11
    0 Votes
    11 Posts
    968 Views
    John Doe 1J

    @peterjones There’s no need for an apology, you’ve been a great deal of help in learning Notepad++ development. I truly appreciate all of the demonstrations you’ve provided and they were very helpful. I would advise you not to take a break from this forum, you’ve helped a lot and I am sure there are others that could use your assistance. I can be a bit hard headed at times which can lead to frustration and I am sorry for that. Have a great one! : - )

  • PythonScript Toggleable Script?

    34
    0 Votes
    34 Posts
    3k Views
    John Doe 1J

    @alan-kilborn You’re exactly correct, this has been a great learning experience for me regarding Notepad++ plugin development. I plan to continue improving my current plugins and write new ones. Once again thank you @Alan-Kilborn and @PeterJones for pointing me in the right direction, you’ve been helped a great deal! : - )

  • PythonScript: Check If Notepad++ Was Closed To Terminate an Infinite Loop

    14
    0 Votes
    14 Posts
    824 Views
    John Doe 1J

    @peterjones Yeah that is my concern, I’m gonna work on this some more later to see if I can get the script all cleaned up so that is no longer an issue. Thanks for your help so far!

  • Interesting behavior from editor.getFirstVisibleLine()

    7
    0 Votes
    7 Posts
    306 Views
    PeterJonesP

    @alan-kilborn ,

    Do we know of any workarounds in order to get good data?

    Yes, like I showed above, editor.docLineFromVisible(editor.getFirstVisibleLine()), gives the actual document line number as derived from the display line number. Hence, the correct 75 that got printed on the second line in the final example box.

    Addenda:

    As implied in the editor section of the PythonScript docs when searching for “display line”, the visible line’s number is influenced by hidden lines and line wrapping. The “document line” is the real underlying line number for the line in the file. So there are a few conversion helpers: visibleFromDocLine converts the “document line” into the “display line”; docLineFromVisible converts the “display line” into “document line”; and wrapCount gives the number of “display lines” necessary to render the given “document line”. (All the other mentions of “display line” have to do with where HOME and END and their related commands end up.)

    Similarly, if you want to set the first visible line (to scroll) based on an actual document line number, it would be editor.setFirstVisibleLine(editor.visibleFromDocLine(actualLineNumber))

  • PythonScript and Customize Toolbar Question

    9
    0 Votes
    9 Posts
    599 Views
    Alan KilbornA

    @john-doe-1 said in PythonScript and Customize Toolbar Question:

    if the user does not turn off Column Mode before closing Notepad++ the “Alt” key remains pressed, this is of course a bit of an issue. If you know of a way to detect when Notepad++ is tabbed out of or closed I would appreciate your help.

    This is bringing the discussion back to the other script you hinted at in your first posting in this thread. See HERE for that other thread, and some ideas about the “Alt” key.

  • occurences or comparison with a list

    9
    0 Votes
    9 Posts
    966 Views
    guy038G

    Hi, @chamzon-chamzon, @lycan-thrope, @peterjones and All,

    OK… I understand that in real cases, this causes a complete failure of the regex engine :-(( Why ?

    Well, let’s suppose the temporary file containing, first, your entire firewall configuration file followed with your entire IP-adresses list file

    Now, imagine the worst case : an unique match between the first IP-address of your firewall configuration file and the last IP-address of your IP-adresses list

    Then, and despite I use a non-capturing regex group, the part of the regex (?s:.*?...) represents all the characters, included line-endings, right after the first IP-address till the same IP-address excluded, at the very end of file

    As you said that your firewall configuration file has about 68,000 lines, it’s easy to guess that it probably exceeds the capacity of the regex engine to handle such a gap of chars !!

    So, in order to find out, somehow, a work-around to this situation, could you give me :

    The number of lines of your firewall configuration file and its approximate size

    The number of lines of your IP-addreses list and its approximate size

    A short example of your real firewall configuration file

    A short example of your real IP-addresses list

    In order to get the raw text, click on that button, when writing your post, to insert text in the right way !

    41d95003-7608-410a-958d-539e9c906c41-Capture d’écran 2022-03-07 123711.png

    Thanks for your time to collect these infos !

    Best Regards,

    guy038

  • 0 Votes
    6 Posts
    1k Views
    J KoJ

    @klaus-isbruchdn try disabling the XML tools --> Enable XML syntax auto-check

  • Bypassing the download process when installing plugins

    4
    0 Votes
    4 Posts
    245 Views
    Alan KilbornA

    @e5584071

    Can you follow the steps above to obtain and install it, or do you really need someone to walk you through the process specifically with the Compare plugin?

  • Add Loading Screen to Script?

    4
    0 Votes
    4 Posts
    445 Views
    John Doe 1J

    @PeterJones Thanks for your input and search advice, it is much appreciated. @Alan-Kilborn Yeah that is what I ended up doing, funny we had the same thought. The loading screen seems to be too much of a time sink for right now. Maybe later on in development.

  • PythonScript CSV Sort Help

    17
    0 Votes
    17 Posts
    741 Views
    John Doe 1J

    @chcg I would say it is pretty far from usable currently, and I have plans to add some libraries to it (including pandas) in the near future, thanks for the suggestion though : - )

  • Make External Lexer Plugin work with v8.4

    1
    3 Votes
    1 Posts
    6k Views
    No one has replied
  • NppExec v0.8.1 has been released!

    1
    6 Votes
    1 Posts
    278 Views
    No one has replied
  • Lokking for a line filter plugin

    2
    0 Votes
    2 Posts
    878 Views
    Alan KilbornA

    @richard-devenezia

    One word: Analyse (plugin)

  • Where to begin

    3
    0 Votes
    3 Posts
    313 Views
    Derek BrownD

    I believe you could use the NPPN_FILEOPENED notification and check the filename to see if it’s a new file (it will have no path and just a name like “new 1”). Then run your code to have the user select a template and insert text.

    Alternatively, you could just create a menu command for your plugin that lets the user select a template, then create a new file with that template text. Also note that the user can bind shortcut keys to plugin menu items.

  • NppExec Console not recognizing block pasting of input into it.

    7
    0 Votes
    7 Posts
    613 Views
  • Adding Libraries to PythonScript Plugin

    40
    0 Votes
    40 Posts
    6k Views
    Alan KilbornA

    @john-doe-1 said in Adding Libraries to PythonScript Plugin:

    point me to a more specific forum for Pandas

    Hmm, can’t say I’ve ever used one.
    I searched it up; apparently a “more important” pandas is a medical condition. And of course the cute bears…

    But I did find this one, no idea of its quality: https://community.developers.refinitiv.com/tags/pandas.html

    I’m sure some more intensive searching will provide others.

  • Icons in Menus.

    4
    0 Votes
    4 Posts
    323 Views
    Alan KilbornA

    @alan-kilborn said in Icons in Menus.:

    Issue created

    When I said this, I was meaning an issue requesting the native support.

  • Is there a way to use the CustomFileDialog from a plugin?

    2
    0 Votes
    2 Posts
    240 Views
    PeterJonesP

    @martin-honnen ,

    I do not believe that you can have access from the plugin to the custom file dialog already compiled into Notepad++.exe – at least, it doesn’t seem to be exposed by any of the API commands, and I don’t know of a way for a DLL to access a function from the parent EXE.

    That said, rather than fully implementing your own version, you might just be able to copy the source code for the CustomFileDialog, and compile it as part of your plugin’s DLL. I know, it has downsides (if they changed the source code, you would have to change your source code, rather than just calling their function), but it might be easier than completely re-implementing.

    Or you could just use a win32api-standard file-selection dialog, like GetOpenFileName or GetSaveFileName rather than NPP’s customized version.

    Caveat: I am not a plugin-authoring expert, though I have dealt heavily with the NPP messaging API, and know a tiny bit about generic win32 coding.

  • Anyone used the new v8.3.3 API calls yet?

    16
    3 Votes
    16 Posts
    653 Views
    PeterJonesP

    @alan-kilborn & @Ekopalypse ,

    After getting back from the coast, I confirmed that

    import ctypes notepad.hwnd = ctypes.windll.user32.FindWindowW(u'Notepad++', None) nppv = ctypes.windll.user32.SendMessageW(notepad.hwnd, 1024+1000+50,0,0) console.write("NPP v{}.{}\n".format(nppv>>16, nppv&0xFFFF)) ctypes.windll.user32.SendMessageW(notepad.hwnd, 1024+1000+104, u'GEDCOM', 2) mode = ctypes.c_ssize_t(0) ctypes.windll.user32.SendMessageW(notepad.hwnd, 1024+1000+103, u'GEDCOM', ctypes.pointer(mode)) mode.value

    did what I wanted in old PythonScript, so it was a matter of the missing unicode marker. Which probably means that the reason my compiled version failed was probably that it wasn’t in UTF-16-LE like it should have been. But it gives me a lead, and I know in my PerlScript source code what I need to do to make sure that I send the string as UTF-16-LE.


    c4847b06-4ba8-4e99-a958-78dcbcbfe77f-image.png
    (A few minutes before the moon set behind the clouds this morning. Twas a nice few days… but now, back to reality.)

  • I need auto sort tabs plugin (I will pay)

    3
    0 Votes
    3 Posts
    247 Views
    Maxitrol - MatM

    I am asking if anyone can write such a plugin for payment.