Python plugin not working correctly



  • 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



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



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



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



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


Log in to reply