• Login
Community
  • Login

Python plugin not working correctly

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 2 Posters 408 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.
  • D
    DaveyD
    last edited by Jul 13, 2021, 8:25 PM

    Hi. As I mentioned in my last question, I’ve been away for a few years and now coming back.
    I have a script for the python plugin which was working fine a few years ago. Now, it is not doing what it is supposed to do.
    For example, editor.getCurrentPos() is not returning the current position of the cursor.
    After some testing, I realized that this is being caused by Hebrew text in the file.

    My question is two-fold:

    1. Did something change in the python plugin? Or maybe it has to do with the new plugins setup?
    2. How can I fix this issue?

    Any help would be greatly appreciated
    Thanks,
    David

    E 1 Reply Last reply Jul 14, 2021, 8:38 AM Reply Quote 0
    • E
      Ekopalypse @DaveyD
      last edited by Ekopalypse Jul 14, 2021, 8:39 AM Jul 14, 2021, 8:38 AM

      @DaveyD

      What version of the plugin are you using?
      Currently there is version 1.5.x, which still references the python2.7 dll
      and is the one that can be installed via the plugin manager
      or the new version 3.0.x, which is in beta.

      When you state that this seems to be related to Hebrew text,
      does that mean text you want to manipulate, or python code?

      1 Reply Last reply Reply Quote 0
      • D
        DaveyD
        last edited by Jul 19, 2021, 2:08 AM

        @Ekopalypse - thanks for the reply and sorry for the delayed response
        I am running version 1.5.4.0
        I checked the plugin manager but I didn’t see an option for a version to install

        Regarding the Hebrew text, I am referring to Hebrew in the file I am attempting to manipulate (not the python source code)

        Thanks again,
        David

        1 Reply Last reply Reply Quote 0
        • E
          Ekopalypse
          last edited by Jul 19, 2021, 11:02 AM

          @DaveyD

          Seems to work for me. new1 is an utf8 encoded and new3 an ansi encoded buffer. The cursor was placed directly after the Ä in both cases.

          36644ea7-6d63-4927-a063-6714e0c34741-image.png

          If the plugin was installed via the PluginAdmin, then
          there should be no problems with the new plugin setup.
          Since 1.5.4 is the current stable version, the beta version 3.X can only be installed manually, the major changes made by the update of Scintilla should not be a problem either.
          Without seeing an example of the text and script used, it is hard to say what the problem could be.
          You are using a recent Npp version, aren’t you?

          1 Reply Last reply Reply Quote 1
          • D
            DaveyD
            last edited by Jul 19, 2021, 1:34 PM

            @Ekopalypse - thanks again
            I think you are correct. I was confusing the current ‘position’ with the number of characters in the selection.
            That, together with a funny bug in my code, was making me think there was a problem.

            Thanks,
            David

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