Community
    • Login

    Notepad++ 7.7 breaking change of SCNotification definition in x64 build

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    17 Posts 8 Posters 3.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • PredelnikP
      Predelnik
      last edited by

      I don’t know if many plugins make use of SCNotification struct but since updating Scintilla to 4.14 type of its second field called position was changed from int to Sci_Position which is basically ptrdiff_t. Thus if you use it by old definition every field except the first one will unfortunately be shifted.

      So basically each plugin using SCNotification should update its scintilla.h to work correctly with Notepad++ 7.7

      1 Reply Last reply Reply Quote 7
      • pnedevP
        pnedev
        last edited by

        Hi all,

        Good point @Predelnik .

        The question is shall the affected plugins be updated in the PluginAdmin’s list?
        The answer is probably yes but this means that those plugins will not work then in Notepad++ versions prior 7.7 as the nppPluginList is not per Notepad++ version.

        Perhaps there should be minimum and maximum required Notepad++ API for each plugin in the nppPluginList json file (those might not be mandatory but the idea is to be unable to install plugins from PluginAdmin that are not compatible or at least the user to be warned about that. Or why not to be pointed to the right plugin version for the corresponding Notepad++ version?).

        BR

        Meta ChuhM 1 Reply Last reply Reply Quote 1
        • Meta ChuhM
          Meta Chuh moderator @pnedev
          last edited by Meta Chuh

          @pnedev

          The answer is probably yes but this means that those plugins will not work then in Notepad++ versions prior 7.7 as the nppPluginList is not per Notepad++ version.

          no, nppPluginList currently is per notepad++ version.

          the older versions will only present you with the plugin versions that existed at that specific notepad++ version’s release date.
          so it’s safe to update the newer versions.
          older notepad++ will always download older plugins, this will also stay the same, if notepad++ would get a live nppPluginList one day, as the older npp releases will not use such live lists.

          best regards.

          1 Reply Last reply Reply Quote 4
          • dinkumoilD
            dinkumoil
            last edited by

            @Predelnik , @pnedev

            AFAICS there are even more members of the SCNotification struct which have been changed from int to Sci_Position, namely

            • length
            • linesAdded
            • line
            • annotationLinesAdded

            See >>> here <<<.

            PredelnikP 1 Reply Last reply Reply Quote 4
            • PeterJonesP
              PeterJones
              last edited by

              @Meta-Chuh said:

              older notepad++ will always download older plugins, this will also stay the same, if notepad++ would get a live nppPluginList one day, as the older npp releases will not use such live lists.

              It will stay the same for ones we call “older” now (like 7.6.6, or even v7.7, since it still uses the fixed list)

              Assume for the moment that “live” nppPluginList is released with v7.8. When v7.9 then releases sometime later and nppPluginsList is then updated as plugins add SuperNiftyFeature79 to their plugins, there may be some plugins that are compatible with v7.9 that are not compatible with v7.8… but since v7.8 uses the live nppPluginList, it will try to download plugins from the most-recent live-nppPluginList. Implementing @pndev’s suggestion of compatibility ranges in the nppPluginList now, before live-nppPluginList is released, will help future-proof the live-nppPluginList system. Waiting until users start complaining (“I have Notepad++ v7.8, and suddenly it’s downloading plugins that claim they aren’t compatible with v7.8”) to fix it might be harder than getting it implemented now.

              dinkumoilD 1 Reply Last reply Reply Quote 5
              • dinkumoilD
                dinkumoil @PeterJones
                last edited by dinkumoil

                @PeterJones said:

                Waiting until users start complaining (“I have Notepad++ v7.8, and suddenly it’s downloading plugins that claim they aren’t compatible with v7.8”) to fix it might be harder than getting it implemented now.

                Yeah, do it right at the right time and not when foreseeable issues arise.

                1 Reply Last reply Reply Quote 5
                • PeterJonesP
                  PeterJones
                  last edited by

                  @PeterJones said:

                  Implementing @pndev’s suggestion

                  /me notices he misspelled @pnedev’s user name. Sorry. (Username links are one of the things that doesn’t render in the PREVIEW window when editing a post, so it’s harder to notice. :-( )

                  1 Reply Last reply Reply Quote 4
                  • PredelnikP
                    Predelnik @dinkumoil
                    last edited by

                    @dinkumoil said:

                    AFAICS there are even more members of the SCNotification struct which have been changed from int to Sci_Position, namely

                    Good point! But change of the size of the second argument is already enough to make access by previous definition incorrect in almost all of the cases unfortunately.

                    1 Reply Last reply Reply Quote 1
                    • pnedevP
                      pnedev
                      last edited by pnedev

                      Hi @Meta-Chuh ,

                      I didn’t know that, thanks.

                      Does this mean that if I have Notepad++ v 7.6.6 and never change it I won’t get any plugin updates or newly released plugins ever?

                      BR

                      Meta ChuhM 1 Reply Last reply Reply Quote 2
                      • Meta ChuhM
                        Meta Chuh moderator @pnedev
                        last edited by

                        @pnedev

                        yes, correct.

                        even if a newer plugin version has been submitted to the current pluginlist, 7.6.6 will only use the one it was shipped with, inside nppPluginList.dll.

                        same for all older versions since 7.6.
                        it’s a cool thing for testing though, as i have every portable npp version, and i can download exactly the old versions of a plugin available at that time (as long as the author doesn’t remove the older release downloads from his repo)

                        best regards.

                        1 Reply Last reply Reply Quote 1
                        • dinkumoilD
                          dinkumoil
                          last edited by

                          @all

                          I’ve filed an issue, see >>> here <<<.

                          1 Reply Last reply Reply Quote 2
                          • pnedevP
                            pnedev
                            last edited by

                            @Meta-Chuh ,

                            OK, thanks.

                            Its cool for testing and support but not quite flexible for the user.
                            If you want your plugins updated (or get newly released plugins) via PluginsAdmin you are forced to update Notepad++ itself.

                            1 Reply Last reply Reply Quote 0
                            • pnedevP
                              pnedev
                              last edited by

                              @dinkumoil ,

                              I have added this suggestion. I think it is the better approach.

                              1 Reply Last reply Reply Quote 0
                              • Alan KilbornA
                                Alan Kilborn
                                last edited by

                                It didn’t seem quite right to mention this in the github issue, but this forum is more tolerant if you get off topic…

                                Thinking about these proposed Plugin attributes and the recent changes (and then change-back) in core Notepad++ security/authentication, what assurances do we have that plugins are coming across from untampered-with files?

                                1 Reply Last reply Reply Quote 1
                                • gstaviG
                                  gstavi
                                  last edited by

                                  Sci_Position is used in lots of places. For example LexAccessor. It should break plugins binary compatibility left and right.
                                  This kind of demonstrates the difference between Windows mindset that holds binary compatibility sacred and Linux mindset that assume that packages are always built from sources and no binary should ever interact with different versions.

                                  Somewhat surprising that Scintilla developers allowed this incompatibility so easily. I wonder if they realized the impact.

                                  Plugin manager may mitigate the affect in case plugin developers will cooperate but in it is a real pity if newer plugins will not work with older Notepad++.

                                  Depending of the amount of plugin breakdown that will occur @donho should consider if Notepad++ user base will not be served better by temporary rolling back Notepad++ to the older Scintilla and announce some 6 month to plugin developers to get ready for the change.

                                  dailD 1 Reply Last reply Reply Quote 0
                                  • dailD
                                    dail @gstavi
                                    last edited by

                                    @gstavi

                                    Somewhat surprising that Scintilla developers allowed this incompatibility so easily

                                    The Scintilla developers are not at fault. This is the entire reason they changed from the 3.x to 4.x version.

                                    1 Reply Last reply Reply Quote 2
                                    • gstaviG
                                      gstavi
                                      last edited by

                                      @dail said:

                                      The Scintilla developers are not at fault. This is the entire reason they changed from the 3.x to 4.x version.

                                      It is very much in dispute whether a library should ever allow itself a major compatibility breaking change to its API. Changing the library’s major version does not magically justifies it. This is definitely the Linux mindset with its advantages and shortcomings.
                                      A responsible developer should go through all possible hoops to extend the API rather than change it before going this path. Maybe they did, I don’t know.

                                      Specifically for this change, I would challenge, the need to support 64 bit position within a document. Opening a text file over 1GB is such a bad user experience that I doubt that you can find 0.01% within your user base that do it routinely. Your guess is good as mine for the amount of users that will be pissed by the compatibility break.

                                      Still need to audit plugins to see how many are actually broken. Maybe I am overly pessimistic.
                                      But it is possible that 32 bit version of Notepad++ just became much more attractive.

                                      1 Reply Last reply Reply Quote 2
                                      • First post
                                        Last post
                                      The Community of users of the Notepad++ text editor.
                                      Powered by NodeBB | Contributors