• New API to fix eventual regression regarding SCN_MODIFIED for some plugins

    Pinned
    31
    2 Votes
    31 Posts
    3k Views
    donhoD

    @PeterJones said in New API to fix eventual regression regarding SCN_MODIFIED for some plugins:

    update: per Don’s comments in the linked issue, and the issue it linked back to, apparently, the always-write was always the intention, and implied that it’s always been the behavior, but I didn’t remember it doing that; either my memory is wrong, or …

    Sorry I’ve provided the wrong information. Here’s the correct one:
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16186#issuecomment-2678965165

    @mkupper said in New API to fix eventual regression regarding SCN_MODIFIED for some plugins:

    A couple of weeks ago I noticed that Npp seemed to be writing to disk every 7 seconds despite Notepad++ being idle/unused at the time.

    It’s a regression, and it should be fixed in the PR:
    https://github.com/notepad-plus-plus/notepad-plus-plus/pull/16225

    The fix will go into the v8.7.8.

  • Read This First

    Pinned Locked
    1
    5 Votes
    1 Posts
    2k Views
    No one has replied
  • MultiReplace Now Supports Lookup Files!

    1
    4 Votes
    1 Posts
    41 Views
    No one has replied
  • 0 Votes
    5 Posts
    84 Views
    PeterJonesP

    @ThosRTanner said in Are the shortcut key pointers when initialising your menu maent to be const ?:

    It does raise another question though - does that mean your menu structure have to remain unchanged once you’ve registered it with notepad++? If it was allocated in a piece of temporary memory which got discarded for instance it would be a little hard to track down!

    No. Plugins like NppExec and PythonScript change the number of menu entries on the fly, though I don’t know whether they can give those commands shortcuts when generated after-the-fact or not. You might be able to look through their source code to see how they dynamically add a new menu entry after-the-fact.

    As far as shortcuts are concerned, after the plugin’s initial request when it’s loaded, I believe the expectation is that the Shortcut Mapper will be used for any future changes to keyboard shortcuts (and that those are restricted to a plugin’s top-level of menu). And when PythonScript or NppExec dynamically adds a command to its top-level menu, Shortcut Mapper makes you wait until the next Notepad++ launch – when the entry is initialized at plugin load, rather than dynamically after – to be able to assign the keystroke.

    update: And when Shortcut Mapper changes any command’s shortcut, you can actually process NPPN_SHORTCUTREMAPPED to see how Shortcut Mapper changed your menu’s command.

  • NppCppMSVS: A Visual Studio Project Template for a Notepad++ C++ Plugin

    5
    7 Votes
    5 Posts
    161 Views
    Lycan ThropeL

    @Coises ,
    This was much easier to follow, and it’s installed and I saw that it was there. Thanks. That’s it for now, as I’ve already burned my candle on both ends for now and am needing sleep, so…will play more later with your instructions to see how it fares. Thanks for the assist.

  • Need help with getting started using C++ Plugin Template

    23
    4 Votes
    23 Posts
    317 Views
    ThosRTannerT

    @PeterJones as far as building goes, I’ve never had any problems building notepad++ i normal mode and my dll in debug mode. However, it’s a littel tricky getting n++ to recognise your dll. You have to either hijack another plugin’s directory, or go to plugin admin mode and point it to a zip file you’ve built.

    Some instructions on installing a plugin manually (pretty sure you wrote them) are here: https://github.com/ThosRTanner/notepad-pp-linter/blob/master/README.md

    But to build it, you’ll need to add a post build step - see https://github.com/ThosRTanner/notepad-pp-linter/blob/master/post-build.ps1 or https://github.com/ThosRTanner/Docking_Dialogue_Interface/blob/master/post-build.ps1 for examples on that.

    You also need to customise the debug command to point to the actual notepad++ exe (doesn’t need the debug version) - then the debugger loads up notepad+ and will hit the breakpoints in your dll

  • Yet Another C++ Plugin Template...

    11
    4 Votes
    11 Posts
    794 Views
    ThosRTannerT

    @Alan-Kilborn fairly mature. I have a couple of other tweaks to do while trying to do a version of the linter plugin, which needed some extra functionality to make a few things simpler.

    That and it’s not really a template of course. It’s a library you can use.

  • Columns++ version 1.2: better Unicode search

    15
    6 Votes
    15 Posts
    349 Views
    guy038G

    Hi, @coises and All,

    I think this will be the last answer concerning your Columns++_v1.2 plugin !

    Here is the recapitulation of the way to access the invisible characters, whatever the file type :

    For ANSI files : just one possible syntax for these collating names :

    [[.NUL.][.SOH.][.STX.][.ETX.][.EOT.][.ENQ.][.ACK.][.alert.][.backspace.][.tab.][.newline.][.vertical-tab.][.form-feed.][.carriage-return.][.SO.][.SI.][.DLE.][.DC1.][.DC2.][.DC3.][.DC4.][.NAK.][.SYN.][.ETB.][.CAN.][.EM.][.SUB.][.ESC.][.IS4.][.IS3.][.IS2.][.IS1.][.DEL.]] which returns 33 matches, against the Total_ANSI.txt file, wihich contains the 256 characters of the Win-1252 encoding

    Note that the lowercase syntax is NOT allowed, in ANSI files, for ANY collating names, presently in UPPER case

    Note also that the four chars, from \x1c to \x1f must be referred as from IS4 to IS1, in UPPER case ( and NOT from fs to us ! )

    For UTF-8 files : two possible syntaxes for these collating names :

    [[.nul.][.soh.][.stx.][.etx.][.eot.][.enq.][.ack.][.bel.][.bs.][.ht.][.lf.][.vt.][.ff.][.cr.][.so.][.si.][.dle.][.dc1.][.dc2.][.dc3.][.dc4.][.nak.][.syn.][.etb.][.can.][.em.][.sub.][.esc.][.fs.][.gs.][.rs.][.us.][.del.][.pad.][.hop.][.bph.][.nbh.][.ind.][.nel.][.ssa.][.esa.][.hts.][.htj.][.lts.][.pld.][.plu.][.ri.][.ss2.][.ss3.][.dcs.][.pu1.][.pu2.][.sts.][.cch.][.mw.][.spa.][.epa.][.sos.][.sgci.][.sci.][.csi.][.st.][.osc.][.pm.][.apc.][.nbsp.][.shy.][.alm.][.sam.][.ospm.][.mvs.][.nqsp.][.mqsp.][.ensp.][.emsp.][.3/msp.][.4/msp.][.6/msp.][.fsp.][.psp.][.thsp.][.hsp.][.zwsp.][.zwnj.][.zwj.][.lrm.][.rlm.][.ls.][.ps.][.lre.][.rle.][.pdf.][.lro.][.rlo.][.nnbsp.][.mmsp.][.wj.][.(fa).][.(it).][.(is).][.(ip).][.lri.][.rli.][.fsi.][.pdi.][.iss.][.ass.][.iafs.][.aafs.][.nads.][.nods.][.idsp.][.zwnbsp.][.iaa.][.ias.][.iat.][.sflo.][.sfco.][.sfds.][.sfus.]] which return 120 matches, against the Total_Chars.txt file

    [[.nul.][.soh.][.stx.][.etx.][.eot.][.enq.][.ack.][.alert.][.backspace.][.tab.][.newline.][.vertical-tab.][.form-feed.][.carriage-return.][.so.][.si.][.dle.][.dc1.][.dc2.][.dc3.][.dc4.][.nak.][.syn.][.etb.][.can.][.em.][.sub.][.esc.][.fs.][.gs.][.rs.][.us.][.del.][.pad.][.hop.][.bph.][.nbh.][.ind.][.nel.][.ssa.][.esa.][.hts.][.htj.][.lts.][.pld.][.plu.][.ri.][.ss2.][.ss3.][.dcs.][.pu1.][.pu2.][.sts.][.cch.][.mw.][.spa.][.epa.][.sos.][.sgci.][.sci.][.csi.][.st.][.osc.][.pm.][.apc.][.nbsp.][.shy.][.alm.][.sam.][.ospm.][.mvs.][.nqsp.][.mqsp.][.ensp.][.emsp.][.3/msp.][.4/msp.][.6/msp.][.fsp.][.psp.][.thsp.][.hsp.][.zwsp.][.zwnj.][.zwj.][.lrm.][.rlm.][.ls.][.ps.][.lre.][.rle.][.pdf.][.lro.][.rlo.][.nnbsp.][.mmsp.][.wj.][.(fa).][.(it).][.(is).][.(ip).][.lri.][.rli.][.fsi.][.pdi.][.iss.][.ass.][.iafs.][.aafs.][.nads.][.nods.][.idsp.][.zwnbsp.][.iaa.][.ias.][.iat.][.sflo.][.sfco.][.sfds.][.sfus.]] which returns 120 matches, against the Total_Chars.txt file

    -Note that the Uppercase syntax is allowed, in UTF-8 files, for ANY collating name, presently in LOWER case

    Finally, for an ANSI file, containing the 256 chars of the Win-1252 encoding and converted as an UTF-8 file ( Encoding > Convert to UTF-8 ), two syntaxes are possible :

    [[.nul.][.soh.][.stx.][.etx.][.eot.][.enq.][.ack.][.bel.][.bs.][.ht.][.lf.][.vt.][.ff.][.cr.][.so.][.si.][.dle.][.dc1.][.dc2.][.dc3.][.dc4.][.nak.][.syn.][.etb.][.can.][.em.][.sub.][.esc.][.fs.][.gs.][.rs.][.us.][.del.][.pad.][.hop.][.ri.][.ss3.][.dcs.][.osc.][.nbsp.][.shy.]] which returns 40 matches, agasint the Total_UTF-8.txt file

    [[.nul.][.soh.][.stx.][.etx.][.eot.][.enq.][.ack.][.alert.][.backspace.][.tab.][.newline.][.vertical-tab.][.form-feed.][.carriage-return.][.so.][.si.][.dle.][.dc1.][.dc2.][.dc3.][.dc4.][.nak.][.syn.][.etb.][.can.][.em.][.sub.][.esc.][.fs.][.gs.][.rs.][.us.][.del.][.hop.][.ri.][.ss3.][.dcs.][.osc.][.nbsp.][.shy.]] which returns 40 matches, against the Total_UTF-8.txt file

    Note that the Uppercase syntax is allowed, in UTF-8 files, for ANY collating name, presently in LOWER case

    Now, against the Total_ANSI.txt file, containing the first 256 UNICODE characters, we get these results :

    (?s). ANY character => 256 (?-s). ANY character different from LIKE-BREAKS => 253 = [^\x0A\x0C\x0D] [[:unicode:]] = \p{unicode} an OVER \x{00FF} character => 0 = [^\x00-\xFF}] [[:cntrl:]] = \p{cntrl} a CONTROL code character => 39 = [\x00-\x1F\x7F\x81\x8D\x8F\x90\x9D\xAD] [[:space:]] = \p{space} a WHITE-SPACE character => 7 = [\t\n\x0B\f\r\x20\xA0] [[:blank:]] = \p{blank} a BLANK character => 3 = [\t\x20\xA0] [[:upper:]] = \p{upper} an UPPER case letter => 60 = [A-ZŠŒŽŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ] [[:lower:]] = \p{lower} a LOWER case letter => 65 = [a-zƒšœžªµºßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ] [[:digit:]] = \p{digit} a DECIMAL number => 13 = [0-9²³¹] [[:word:]] = \p{word} a WORD character => 139 = [[:alnum:]]|\x5F = \p{alnum}|\x5F [[:punct:]] = \p{punct} any PUNCTUATION or SYMBOL character => 80 = [\x21-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E\x82\x84-\x87\x89\x8B\x91-\x97\x9B\xA1-\xBF\xD7\xF7] [[:alpha:]] = \p{alpha} any LETTER character => 125 = (?-i)[[:upper:][:lower:]] [[:alnum:]] = \p{alnum} an ALPHANUMERIC character => 138 = (?-i)[[:upper:][:lower:][:digit:]] [[:graph:]] = \p{graph} any VISIBLE character => 212 = [^\x00-\x1F\x20\x7F\x80\x81\x88\x8D\x8F\x90\x98\x99\x9D\xA0] [[:print:]] = \p{print} any PRINTABLE character => 219 = [[:graph:][:space:]] = [^\x00-\x1F\x20\x7F\x80\x81\x88\x8D\x8F\x90\x98\x99\x9D\xA0]|[[:space:]] [[:xdigit:]] an HEXADECIMAL character => 22 = [0-9A-Fa-f] = (?i)[0-9A-F]

    Remark : the [[:unicode:]] class; for characters OVER \x{00FF}, must correspond to the C1_DEFINED type from Ctype 1 list here.

    From this same article, and after I realized that the POSIX classes are not totally independent, I deduced this layout :

    C1_DEFINED Other characters 0 C1_CNTRL Control characters 39 C1_SPACE Space characters 2 ( only the SPACE and NBSP chars, OUT of 7, as ALL other are ALREADY included in the CNTRL chars class ) C1_UPPER Uppercase 60 C1_LOWER Lowercase 65 C1_DIGIT Decimal digits 13 C1_PUNCT Punctuation 73 ( and NOT 80, because the \xAD char is ALREADY included in the CNTRL chars class because the \xAA, \xB5 and \xBA are ALREADY included in the LOWER chars class because the \xB2, \xB3 and \xB9 are ALREADY included in the DIGIT chars class ) ----- TOTAL : 252 chars

    So, if I exclude, from my Total_ANSI.txt file, all the following classes with the S/R :

    FIND [[:cntrl:][:space:][:upper:][:lower:][:digit:][:punct:]]

    REPLACE Leave EMPTY

    Either, with your plugin or with native N++, it remains 4 characters ( 256 - 252 ) which are the ( \x{20AC} ), ˆ ( \x{02C6} ), ˜ ( \x{02DC} ) and ( \x{2122} ) characters

    Moreover, absolutely no POSIX character class and no UNICODE character class, of course, can find these 4 characters !

    Thus, the only way to find out one of these 4 characters, in an ANSI file, is to use the regex [\x80\x88\x98\x99] or to use the characters themselves :-((

    In this article, it is also said :

    Printable | Graphic characters and blanks (all C1_* types except C1_CNTRL). Thus …

    So, from the previous total of chars of my Total_ANSI.txt file, the [[:print:]] class should detect 252 - 39, so 213 matches.

    Thus, as [[graph:]] = [[:print:]] - [[space:]], this means that [[:graph:]] should be : 213 - 2, so 211 matches.

    But current result is 212 matches. The difference of one unit comes from the \xAD char whith is, both, part of the [[:cntrl:]] and [[graph:]] POSIX character classes !

    If we remember of the 4 lacking chars, which, obviously, are visible and printable, this means that [[:graph:]] and [[:print:] should return, respectively 215 ( 211 + 4 ) and 217 ( 213 + 4 ) matches, for ANSI files.

    And it easy to verify that [[:print:]] + [[:cntrl:]] = 217 + 39 = 256 !

    Just for info : from the Total_UTF-8.txt file, containing these same chars, we get these results :

    (?s). ANY character => 256 (?-s). ANY character different from LIKE-BREAKS => 254 = [^\x0A\x0D] [[:ascii:]] an UNDER \x{0080} character => 128 = [\x{0000}-\x{007F}] = \p{ascii} [[:unicode:]] = \p{unicode} an OVER \x{00FF} character => 27 = [^\x00-\xFF}] = [\x{20AC}\x{201A}\x{0192}\x{201E}\x{2026}\x{2020}\x{2021}\x{02C6}\x{2030}\x{0160}\x{2039}\x{0152}\x{017D}\x{2018}\x{2019}\x{201C}\x{201D}\x{2022}\x{2013}\x{2014}\x{02DC}\x{2122}\x{0161}\x{203A}\x{0153}\x{017E}\x{0178}] [[:cntrl:]] = \p{cntrl} a CONTROL code character => 38 = [\x00-\x1F\x7F\x81\x8D\x8F\x90\x9D] = \p{Cc} [[:space:]] = \p{space} a WHITE-SPACE character => 7 = [\t\n\x0B\f\r\x20\xA0] [[:blank:]] = \p{blank} a BLANK character => 3 = [\t\x{0020}\x{00A0}] = \p{Zs}|\t [[:upper:]] = \p{upper} an UPPER case letter => 60 = [A-ZŠŒŽŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ] = \p{Lu} [[:lower:]] = \p{lower} a LOWER case letter => 63 = [a-zƒšœžµßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ] = \p{Ll} [[:digit:]] = \p{digit} a DECIMAL number => 10 = [0-9] = \p{Nd} [[:word:]] = \p{word} a WORD character => 137 = \p{L*}|\p{Nd}|_ [[:graph:]] = \p{graph} any VISIBLE character => 215 = [^\x00-\x1F\x20\x7F\x81\x8D\x8F\x90\x9D\xA0\xAD] = (?![\x20\xA0\xAD])\P{Cc} [[:print:]] = \p{print} any PRINTABLE character => 222 = [[:graph:][:space:]] = [^\x00-\x1F\x20\x7F\x81\x8D\x8F\x90\x9D\xA0\xAD]|[[:space:]] [[:punct:]] = \p{punct} any PUNCTUATION or SYMBOL character => 73 = \p{P*}|\p{S*} = [\x21-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E\x{20AC}\x{201A}\x{201E}\x{2026}\x{2020}\x{2021}\x{2030}\x{2039}\x{2018}\x{2019}\x{201C}\x{201D}\x{2022}\x{2013}\x{2014}\x{02DC}\x{2122}\x{203A}\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7] [[:alpha:]] = \p{alpha} any LETTER character => 126 = \p{L*} = \p{Lu}|\p{Ll}|[ˆªº] [[:alnum:]] = \p{alnum} an ALPHANUMERIC character => 136 = \p{L*}|\p{Nd} [[:xdigit:]] an HEXADECIMAL character => 22 = [0-9A-Fa-f] = (?i)[0-9A-F]

    Best regards,

    guy038

  • Gcode text file analyzing

    8
    0 Votes
    8 Posts
    115 Views
    Michael VincentM

    @Holger-Suchi said in Gcode text file analyzing:

    Maybe there is already available a plugin that does the following (or could be a basis to mod):

    @PeterJones

    There aren’t any general-purpose GCode plugins available, to my knowledge.

    There is https://github.com/NCalu/NCneticNpp

    Not sure it’s in Plugin Admin so you need to go looking and manually install.

    UPDATE: Also never used it myself so have no idea if it’s of any use - I don’t do any GCode work at all myself.

    Cheers.

  • batch script run in place

    2
    0 Votes
    2 Posts
    66 Views
    PeterJonesP

    @Chris-Robertson ,

    You didn’t say, but for the sake of my answer, I will assume when you say “I can run my script in place”, you mean “I use the Run > Run menu command to run cmd /c "$(FILE_NAME)" (or similar) to run the active file using its default assocation” or maybe “I have saved that Run > Run command into the Run menu, and maybe have a keyboard shortcut for it”. If I have misinterpreted your statement, you will have to clarify with much more detail.

    The Notepad++ macro system can record certain actions then play them back. Unfortunately, as explained in our FAQ: Automating Notepad++, certain commands – like those from plugins, and the user-defined commands that you save in the Run menu (or even calls to other macros) – cannot be recorded . However, that same FAQ explains that you can trick the macro system to run non-recordable commands by manually editing the macro, as described in that second post. So you could manually create a macro that runs the File > Save then runs the dynamic menuCmdID assigned to your Run command or Plugin command, that you can find using UISpy!

    Alternatively, the NppExec plugin is designed for being a “shell scripting” language for Notepad++, allowing running various N++ commands and various filesystem commands. I have saved the following NppExec script as RunMyself, which saves the active file, changes to that file’s directory, and runs that file:

    NPP_SAVE cd "$(CURRENT_DIRECTORY)" cmd /c "$(FILE_NAME)"

    … and I use Shortcut Mapper to set its keyboard shortcut to F5 (and relegate the Run>Run command to Ctrl+Shift+F5, because I’d rather have the easiest shortcut be for the actions I use the most)

    You could do a similar script for the PythonScript plugin or other of the scripting plugins, but IMO, NppExec is best suited when you are trying to do just a sequence of actions that are too complex for Macros, but don’t have the logic or computational needs of a full programming language like Python.

  • Help w/ console.run editor output

    3
    0 Votes
    3 Posts
    60 Views
    4SHAKEN4

    @Ekopalypse Great, that will suffice for what I’m trying to do. Thank you!

  • [New Plugin] CSV Lint

    81
    6 Votes
    81 Posts
    68k Views
    Bas de ReuverB

    The CSV Lint plug-in was updated to v0.4.6.8. Just missed the Notepad++ 8.7.8 update, but that’s no problem it’ll automatically be available in the next update. It’s a small update anyway, as I don’t really have the time to work on the plug-in at the moment due to work related stuff. So for now I just wanted to get some minor updates out the door, hopefully more updates in the near future.

    Sort Data, enumeration columns now sort according to code index Metadata scripts, now includes sort examples SQL scripts, placeholders for column comments Settings button on docked window
  • Columns++: Where regex meets Unicode (Here there be dragons!)

    27
    6 Votes
    27 Posts
    627 Views
    CoisesC

    @guy038

    Thank you so much for all your testing!

    As I think you’ve seen, I decided to release a nominally “stable” version that has only a few small changes from the fourth experimental version and with (I think) up-to-date documentation.

    I will be taking a closer look at the equivalence classes, and your tests and references will be very helpful. I also need to sort out the situation with digraphs and ligatures. (Unicode distinguishes between the two, and I might be forgetting a third thing — all cases where what we normally think of as multiple characters act as one, sometimes visually, sometimes for collation even when they are visually separate.) Particularly vexing is that this should affect character ranges depending on the active locale; e.g., in Slovak, “ch” sorts between “h” and “i”; in Spanish, it sorts between “c” and “d” and in English, it isn’t a digraph at all, just two letters. So [[.ch.]-i] should match “f” in Spanish but not in Slovak… and in English it makes no sense at all, because ch isn’t a digraph in English.

    This sort of thing is why I decided to table the whole notion until I can rest and regroup.

  • Run python script (pythonscript plugin) with a shortcut?

    9
    1 Votes
    9 Posts
    10k Views
    Franklin DelgadoF

    @Scott-Sumner said in Run python script (pythonscript plugin) with a shortcut?:

    @Mikhail-V said:

    How do I run specific script with a keyboard shortcut?

    To elaborate on @Claudia-Frank 's answer:

    Go to Plugins (menu) -> Python Script -> Configuration. The Python Script Shortcut Configuration window will appear.

    In the Scripts area at the top of the Python Script Shortcut Configuration window, locate and select the script you want to bind to a shortcut (and/or toolbar button).

    Between the Scripts box and the Menu items (or Toolbar icons) caption there is an Add button. To get your script added as a menu item (necessary to bind a keycombo to it via the “Shortcut Mapper”), press the Add button (the one above the Menu items caption). Very similar but hopefully obvious what to do for a toolbar button.

    Once you click OK to dismiss the Python Script Shortcut Configuration window, you should be able to go into Plugins (menu) -> Python Script (just point to that and let the menu cascade open) and then see your script at this level of the menu (between the Scripts-> and Configuration entries). Seeing your script appear here is key to being able to tie it to a shortcut keycombo.

    Restart Notepad++. This allows the “Shortcut Mapper” to see that you’ve changed the Plugins (menu) -> Python Script menu contents.

    Now go to Settings (menu) -> Shortcut Mapper… and select the Plugin commands tab. Scrolling down somewhat you should see your script in the Name column (along with “Pythonscript” in the Plugin column). Go ahead and select your script and assign a keycombo to it just like you would for any other command.

    excelente muchas gracias tu aporte

  • [New Plugin] NppOpenAI

    42
    8 Votes
    42 Posts
    25k Views
    S

    wow, this sounds like a great tool, cant wait to use it.

    i wonder if it will be possible to add support for google code assist, they have just opened up free access for individual developers.

    also abillity to use the latest grok (3) would be cool too.

  • is anyone working on a google code assist plugin?

    3
    0 Votes
    3 Posts
    55 Views
    S

    @PeterJones wow, cool! thanks for the info! yes im sure some bright spark will add a config to enable using code assist. i will look into it, cheers!

  • Import Tkinter in PythonScript on Window

    8
    0 Votes
    8 Posts
    123 Views
    Philippe DestrumelP

    I have to go, but I will continue tomorrow.
    Thank you again for your answers.

  • 1 Votes
    15 Posts
    833 Views
    Mark OlsonM

    @4SHAKEN
    In the future you should wrap your code snippets in ``` blocks.

    if foo: blah = -3 return bar() # notice syntax highlighting, indentation preserved else: return zut()
  • 2 Votes
    1 Posts
    54 Views
    No one has replied
  • 1 Votes
    17 Posts
    322 Views
    CoisesC

    @Alan-Kilborn said in Correct event / 'trigger when' to determine which tab is active after NPP start?:

    Two points:

    What is the true definition of NPPN_READY? Ready for what? Should notifications received before NPPN_READY not be acted upon, or buffered by the plugin until NPPN_READY is received, and then acted upon?

    I don’t think there is a “true” definition other than the code itself. In general, NPPN_READY is a place to do things you only want to do once, but after “most” of the Notepad++ environment is set up — for example, the menus are already built, the tool bars are set up (I think NPPN_TBMODIFICATION comes before NPPN_READY; and you noted that NPPN_SNAPSHOTDIRTYFILELOADED comes before NPPN_READY), I believe dockable panels are up —but the message loop hasn’t yet started and user interaction hasn’t yet become possible.

    Looking over my own plugin, I recall that I ignore NPPN_BUFFERACTIVATED messages before NPPN_READY, but I did need to call my buffer activated process during NPPN_READY, because an NPPN_BUFFERACTIVATED message didn’t reliably come afterward.

    I can work with N++ the way it is, but I’m a scripter, and if PythonScript isn’t forwarding me notifications before it itself receives NPPN_READY, because someone judged that that’s what NPPN_READY means, then I can explore that via a PythonScript “issue”.

    If plugins were never supposed to process messages before NPPN_READY, Notepad++ wouldn’t send them. I have no idea if PythonScript has its reasons for ignoring all messages before NPPN_READY — there might be one-time setup that it does in NPPN_READY that leaves it unable to function earlier — but there is no general expectation that plugins should do that.