Community
    • Login

    Problem with Margins in PythonScript Plugin and Margins in Distraction Free mode

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    27 Posts 4 Posters 2.9k 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.
    • Alan KilbornA
      Alan Kilborn @Neko Nekokovic
      last edited by

      @Neko-Nekokovic

      …startup.py…

      You don’t want to change any “machine” scripts (e.g. its startup.py) at all.

      There’s info about getting user startup.py going HERE.

      Really, though, you don’t want to do a lot of coding in user startup.py, you want to keep that fairly clean and call out to separately named scripts.

      I’ve also seen this article where one guy suggested this script

      I don’t see the relevance of that, other than it calls the margin functions you want to call…

      Also, is “update-ui” the only difference I’d need to change in given script or is this just a more general example to illustrate how I go about achieving desired behavior in “buffer-activated” environment ? Or whatever it is called.

      The pointer to the other script was just for showing how to do a callback function in general; nothing else about that script is relevant.

      Neko NekokovicN 1 Reply Last reply Reply Quote 0
      • Neko NekokovicN
        Neko Nekokovic @Alan Kilborn
        last edited by

        @Alan-Kilborn I’ve read that post from Peter Jones but, as mentioned in my last comment - nothing shows up and/or changes.

        I cannot make any User script to appear in Plugins > Python Script > Scripts

        I’ve read your “thread script” post and at the end of it the same thing was linked. So I’ve read it and tried to have User scripts work, but it just doesn’t appear anywhere.

        The pointer to the other script was just for showing how to do a callback function in general; nothing else about that script is relevant.

        Oh okay. Thanks.

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

          @Neko-Nekokovic said in Problem with Margins in PythonScript Plugin and Margins in Distraction Free mode:

          I cannot make any User script to appear in Plugins > Python Script > Scripts

          Even if you manually create a file in the correct place?
          For me, sometimes the New Script wants to save my intended new file in a weird directory, i.e., not the Scripts directory. :-(
          So if it happened to do that to you, then you went to the Scripts menu, that script wouldn’t appear.

          So by “manually create” I mean, make a .py file without using the New Script command…

          If you suspect the same kind of weird thing is happening to you, try opening one of the “Samples” scripts by holding Ctrl while clicking on it in the menus, then when it opens do a SaveAs but when saving move up one folder level, i.e., don’t save it in the “Samples” folder, but the parent of samples. And give it a new base name, e.g. “testme.py”.
          Then see if testme appears in the Scripts menu.

          Neko NekokovicN 2 Replies Last reply Reply Quote 0
          • Neko NekokovicN
            Neko Nekokovic @Alan Kilborn
            last edited by

            @Alan-Kilborn

            Even if you manually create a file in the correct place?

            Yes. Well, this is a bit different. I’m unable to create a new text file in C:\ProgramFiles\Notepad++\plugins\Config\PythonScript\scripts

            The only option I have is this

            So to overcome this what I’ve managed to do is - I’ve created a text file on Desktop. Pasted python scirpt there. Saved it as a .py file. And then successfully moved it over in:
            C:\ProgramFiles\Notepad++\plugins\Config\PythonScript\scripts

            That’s how “proba.py” and “startup.py” are there. Upon moving, it asked me to “Continue” with Admin rights which I have clicked.

            If you suspect the same kind of weird thing is happening to you, try opening one of the “Samples” scripts by holding Ctrl while clicking on it in the menus, then when it opens do a SaveAs but when saving move up one folder level, i.e., don’t save it in the “Samples” folder, but the parent of samples. And give it a new base name, e.g. “testme.py”.

            Then see if testme appears in the Scripts menu.

            That worked indeed! Now I see “proba.py” listed.

            But if I go Plugins > Python Script > Configuration every script that I see is under “Machine scripts” and none in “User scripts”.

            Alan KilbornA 1 Reply Last reply Reply Quote 0
            • Neko NekokovicN
              Neko Nekokovic @Alan Kilborn
              last edited by

              @Alan-Kilborn The thing that I’ve found in one of the above linked posts is this. This is exactly what I’ve want and it seems that someone managed to make it that way.

              Although I’d exclude numbers as well, but that is trivial.

              But the thing that I don’t understand in this picture, or in that post is - A guy below said that it was a feature that was going to be available after v7.9.6 release. Do you know anything about it?

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

                @Neko-Nekokovic

                Oh, wait, it appears I gave bad advice. The “Samples” are considered “machine scripts”. :-(
                Sorry, but I honestly don’t think about this much, because I don’t have such troubles…

                OK, so user scripts are under ...\Config\PythonScript\scripts (note the important part of that is “Config”).

                Machine scripts are NOT under Config.

                The only option I have is this

                So if “this” is a link to a screenshot, don’t do that, just Ctrl+v paste an image directly. Nobody is clicking links that aren’t immediately recognizable.

                But if I go Plugins > Python Script > Configuration every script that I see is under “Machine scripts” and none in “User scripts”.

                You have clicked on this, right?:

                6fb531fb-53f9-4462-bc0f-8d7d69db5c85-image.png

                Neko NekokovicN 2 Replies Last reply Reply Quote 0
                • Alan KilbornA
                  Alan Kilborn @Neko Nekokovic
                  last edited by Alan Kilborn

                  @Neko-Nekokovic said in Problem with Margins in PythonScript Plugin and Margins in Distraction Free mode:

                  The thing that I’ve found in one of the above linked posts is this. This is exactly what I’ve want and it seems that someone managed to make it that way.

                  Again, nobody is clicking on such a “this” link.
                  Paste a screenshot right into your posting.

                  But the thing that I don’t understand in this picture, or in that post is - A guy below said that it was a feature that was going to be available after v7.9.6 release. Do you know anything about it?

                  I can’t answer questions deriving from links I’m not clicking on. :-)

                  Alan KilbornA 1 Reply Last reply Reply Quote 0
                  • Neko NekokovicN
                    Neko Nekokovic @Alan Kilborn
                    last edited by

                    @Alan-Kilborn

                    So if “this” is a link to a screenshot, don’t do that, just Ctrl+v paste an image directly. Nobody is clicking links that aren’t immediately recognizable.

                    Ah, okay.

                    slika.png

                    And that was from a post named “Is there a distraction-free writing mode like Vimroom(a plugin of Vim)?” on this website. So if you don’t want to click a link of it, you can go there and find this part.

                    Alan KilbornA 1 Reply Last reply Reply Quote 0
                    • Neko NekokovicN
                      Neko Nekokovic @Alan Kilborn
                      last edited by

                      @Alan-Kilborn

                      You have clicked on this, right?

                      Yes. That’s what I meant when I said “User Scripts” is empty.

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

                        @Neko-Nekokovic said in Problem with Margins in PythonScript Plugin and Margins in Distraction Free mode:

                        And that was from a post named “Is there a distraction-free writing mode like Vimroom(a plugin of Vim)?” on this website. So if you don’t want to click a link of it, you can go there and find this part.

                        Or YOU could have just provided this link.

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

                          @Alan-Kilborn said in Problem with Margins in PythonScript Plugin and Margins in Distraction Free mode:

                          A guy below said that it was a feature that was going to be available after v7.9.6

                          That “guy” is the author of Notepad++. :-)
                          Turns out after reviewing that other thread that he meant “Distraction free mode” would be available…and that made it into v8.0 (there was no v7.9.6).

                          1 Reply Last reply Reply Quote 0
                          • Neko NekokovicN
                            Neko Nekokovic @Alan Kilborn
                            last edited by

                            @Alan-Kilborn

                            Or YOU could have just provided this link.

                            I guess there is a misunderstanding here.

                            You’ve said earlier:

                            Again, nobody is clicking on such a “this” link.

                            And in the last comment you’ve said:

                            Or YOU could have just provided this link.

                            I understand that pictures should have been pasted as images, but either way you cannot know what is on the “link” no matter how I name it. You don’t know if it’s a link to a post or a link to an image. If you’re not clicking “this link” then why would I provide a link in the first place?

                            I guess you can have a preview when you hover over a link, but https://ibb.co/… is a popular domain as far as I know. I’ve seen it many times since many people link images from imgBB website and that is their domain. It’s quite popular so I don’t understand what was the problem.

                            I guess we don’t understand each other here.

                            That “guy” is the author of Notepad++. :-)

                            Ah cool.
                            Oh only Distraction Free mode. :/

                            But in that post, the picture shows exactly what I want to achieve. I guess it is possible, I just don’t know how.

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

                              @Neko-Nekokovic said in Problem with Margins in PythonScript Plugin and Margins in Distraction Free mode:

                              I guess we don’t understand each other here.

                              I think we do…

                              I guess you can have a preview when you hover over a link

                              Yep, which is exactly how I know where links lead, no matter what they say, e.g. a blue/purple this.

                              but https://ibb.co/… is a popular domain as far as I know

                              And it is blocked by my I.T. department since it is so popular.
                              And since I do all of my Notepad++ work on my work PC, in my spare time at work, I can’t click on those links. Well, I can, but they won’t lead anywhere.

                              But in that post, the picture shows exactly what I want to achieve

                              I think first things first…you need to get beyond problems with putting script files in user scripts folder and having them appear in the Notepad++ menus…are you beyond that?

                              Neko NekokovicN 1 Reply Last reply Reply Quote 0
                              • Neko NekokovicN
                                Neko Nekokovic @Alan Kilborn
                                last edited by

                                @Alan-Kilborn said in Problem with Margins in PythonScript Plugin and Margins in Distraction Free mode:

                                I think we do…
                                Well we haven’t on this very issue then.

                                And it is blocked by my I.T. department since it is so popular.

                                What does that mean? Which I.T. department? I don’t understand what that means. Why would a link from imgBB be banned or blocked?

                                Is there any other “imageToLink” website that isn’t blocked by anyone and that you would happily open even if it’s a picture in the link? What about Imgur? I’m curious now. I’ve never heard that someone blocks that website. Is there any specific reason? (Well I am sure there is, the question is rather - what is the reason behind the block?)

                                I think first things first…you need to get beyond problems with putting script files in user scripts folder and having them appear in the Notepad++ menus…are you beyond that?

                                Yeah I agree. Well, no. I’ve managed to make them appear only if I put them in “Machine Scripts”. If I save them in Config/PythonScript/scripts nothing seems to show up.

                                I should fix that first definitely. I hope I’ll find a way. Currently I have no idea how to overcome that.

                                Alan KilbornA EkopalypseE 2 Replies Last reply Reply Quote 0
                                • Alan KilbornA
                                  Alan Kilborn @Neko Nekokovic
                                  last edited by

                                  @Neko-Nekokovic said in Problem with Margins in PythonScript Plugin and Margins in Distraction Free mode:

                                  Which I.T. department?

                                  Umm, the one where I am employed?

                                  Why would a link from imgBB be banned or blocked?

                                  To keep people from going there.

                                  Is there any other “imageToLink” website that isn’t blocked by anyone and that you would happily open even if it’s a picture in the link? What about Imgur?

                                  Imgur was used here before the forum software got the ability to directly paste images. So, yes, I could access that one.
                                  But it is all kind of pointless, because we CAN paste here directly and there is no reason at all to user external sites for such things.

                                  Neko NekokovicN 1 Reply Last reply Reply Quote 1
                                  • EkopalypseE
                                    Ekopalypse @Neko Nekokovic
                                    last edited by Ekopalypse

                                    @Neko-Nekokovic

                                    I have not read the whole thread but from what I understand you
                                    have Npp installed and so I assume your configuration directory
                                    is the one in APPDATA, could that be?
                                    If not, can you paste your debug information, which is available
                                    from the last menu item (the ? menu)?

                                    Neko NekokovicN 1 Reply Last reply Reply Quote 1
                                    • PeterJonesP
                                      PeterJones @Neko Nekokovic
                                      last edited by PeterJones

                                      I know this is going back to the beginning, but I’ve been away for a few days.

                                      @Neko-Nekokovic originally said,

                                      lso is it possible that I can edit Margin values inside of Distraction Free mode? Currently the default is quite a bit “wider” than my 80 characters centered.

                                      yes. That’s why there’s a setting for it.

                                      On my current monitor, which could handle about 230 characters wide in true full-screen mode (View > Toggle Full Screen): if Settings > Preferences > Margins/Border/Edge > Padding > Distraction Free is at 9 (the widest), I get about 170 characters wide in Distraction Free mode, and at 3 (the narrowest), I get about 70 characters wide; and at the default 4, I get about 110 characters wide.

                                      If that’s not enough range for you, then you will have to go through the PythonScript rigamarole, as has already been described to you.

                                      As has been described, though I’ll phrase it differently:
                                      C:\Program Files\Notepad++\plugins\PythonScript\scripts is for “machine scripts”. For a standard installation, user scripts will go in the %AppData% config directory, which is technically %AppData%\Notepad++\plugins\config\PythonScript\scripts (which you can paste directly into Windows Explorer or the File > Save As dialog) – this will probably resolve to something like C:\users\<your user name here>\AppData\Roaming\Notepad++\plugins\config\PythonScript\scripts, but the infinite number of Windows conifgurations possible means this is not guaranteed – whereas just pasting in the %AppData%-based path will work on any Windows installation I’ve used in the last couple decades. And, as @Ekopalypse said, if you are having trouble finding the user-scripts directory, using the ?-menu’s Debug Info, and copying that debug info and pasting into your reply, will tell us where your user-script location will be.

                                      Neko NekokovicN 1 Reply Last reply Reply Quote 2
                                      • Neko NekokovicN
                                        Neko Nekokovic @Alan Kilborn
                                        last edited by

                                        @Alan-Kilborn

                                        Umm, the one where I am employed?

                                        And where are you employed?

                                        To keep people from going there.

                                        Oh come on man, that’s circular.

                                        “Why is it banned? Because people should not use it.
                                        Why should people not use it? Because it’s banned.
                                        ”

                                        Why would you want to keep someone from using imgBB or Imgur?

                                        Imgur was used here before the forum software got the ability to directly paste images. So, yes, I could access that one.
                                        But it is all kind of pointless, because we CAN paste here directly and there is no reason at all to user external sites for such things.

                                        It’s really not the problem to paste a picture instead of posting a hyperlink. Sure if that’s “the standard” on this forum I’ll do it. Not a big deal anyway.

                                        But I’m curious about the reasons imgBB or imgur are advised not to be used. This is the first time I ever heard of that and I’d like to know the reasoning behind it.

                                        PeterJonesP 1 Reply Last reply Reply Quote 0
                                        • Neko NekokovicN
                                          Neko Nekokovic @Ekopalypse
                                          last edited by Neko Nekokovic

                                          @Ekopalypse Hi, first thanks for the comment.

                                          I understand you have Npp installed and so I assume your configuration directory is the one in APPDATA, could that be?

                                          No I don’t have a Configuration directory in %Appdata%/Notepad++ (neither in the parent directory, that is only %Appdata%)

                                          1.png

                                          If not, can you paste your debug information, which is available from the last menu item (the ? menu)?

                                          I sure can. Here it is:

                                          Notepad++ v8.4.4   (64-bit)
                                          Build time : Jul 15 2022 - 17:54:42
                                          Path : C:\Program Files\Notepad++\notepad++.exe
                                          Command Line : "C:\Users\krete\Desktop\Alat\Filozof\New Text Document.txt"
                                          Admin mode : OFF
                                          Local Conf mode : OFF
                                          Cloud Config : OFF
                                          OS Name : Windows 10 Pro (64-bit) 
                                          OS Version : 21H2
                                          OS Build : 19044.2006
                                          Current ANSI codepage : 1252
                                          

                                          (Don’t know why there is such a big gap below the picture. I’ve tried to Edit, but I cannot make it shorter for some reason. Sorry)

                                          1 Reply Last reply Reply Quote 0
                                          • Neko NekokovicN
                                            Neko Nekokovic @PeterJones
                                            last edited by Neko Nekokovic

                                            @PeterJones Thanks for the comment.

                                            I know this is going back to the beginning, but I’ve been away for a few days.

                                            No, it’s fine, I’m happy people are eager to help. I appreciate that.

                                            Settings > Preferences > Margins/Border/Edge >Padding > Distraction Free is at 9 (the widest)

                                            I have tried every number from 3 to 9. Every number from 4 onwards is way too wide, while 3 was way to narrow. It’s 63 characters wide.

                                            Aah %Appdata%/Notepad++/plugins/PythonScript/scripts

                                            I was looking for a config directory into %Appdata% itself.

                                            Anyway, the folder %Appdata%/Notepad++/plugins/PythonScript/scripts is empty.

                                            And here is my Debug Info:

                                            Notepad++ v8.4.4   (64-bit)
                                            Build time : Jul 15 2022 - 17:54:42
                                            Path : C:\Program Files\Notepad++\notepad++.exe
                                            Command Line : "C:\Users\krete\Desktop\Alat\Filozof\New Text Document.txt"
                                            Admin mode : OFF
                                            Local Conf mode : OFF
                                            Cloud Config : OFF
                                            OS Name : Windows 10 Pro (64-bit) 
                                            OS Version : 21H2
                                            OS Build : 19044.2006
                                            Current ANSI codepage : 1252
                                            Plugins : 
                                                mimeTools (2.8)
                                                NppConverter (4.4)
                                                NppExport (0.4)
                                                PythonScript (2)
                                            
                                            

                                            Thanks for your comment.

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