Community
    • Login

    Highlight modified text

    Scheduled Pinned Locked Moved General Discussion
    38 Posts 7 Posters 19.6k 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.
    • EkopalypseE
      Ekopalypse @Alan Kilborn
      last edited by

      @Alan-Kilborn

      it seemed to hang N++ when I saved …

      happened to me as well one time - interesting, so it must be the script - thought it might
      be me doing registering callback, deleting callback … over and over for testing
      Did you do something similar perhaps?

      Btw. I’m currently trying to figure out how one could easily assign a shortcut from script

      shortcut_dict = {}
      
      def register_shortcut(shortcut):
          def decorator(function):
              if shortcut not in shortcut_dict:
                  shortcut_dict[shortcut] = function
                  print 'shortcut', shortcut, 'assigned to', function.__name__
              else:
                  print 'shortcut {} already assigned to funtion {}'.format(shortcut, shortcut_dict[shortcut])
          return decorator
      
      
      # important to note that this function cannot be called from within the script
      @register_shortcut('CTRL+-')
      def test():
          print 'test_it'
          
      # test()  <--- that does not work
      

      run this the first time, then comment the shortcut_dict = {} line and run it a second time. Finally call shortcut_dict['CTRL+-']() from the console

      The only thing left is to hook the scintilla hwnd :-)

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

        @Ekopalypse said:

        Did you do something similar perhaps?

        No, but I have a lot of other cute scripts running, will have to dig in and disable some for this testing.

        run this the first time, then comment the shortcut_dict = {} line and run it a second time

        why not?:

        try:
            shortcut_dict
        except NameError:
            shortcut_dict = {}
        
        EkopalypseE 1 Reply Last reply Reply Quote 1
        • EkopalypseE
          Ekopalypse @Alan Kilborn
          last edited by Ekopalypse

          @Alan-Kilborn

          why not …

          LOL because my brain doesn’t work like that :-D
          First I type something and then if it works I try to optimize it,
          but have posted it before even thinking about doing it properly :-D

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

            @Ekopalypse said:

            The only thing left is to hook the scintilla hwnd

            Yes, but there are some caveats. I tried this kind of thing before. If same shortcut is already mapped in Shortcut Mapper, you won’t see it. Not sure if this matters to you, could be a point of confusion for your users (as you now seem to be publishing! :) )

            BTW, this thread is now officially deemed hijaaked, not once but now twice.

            EkopalypseE 1 Reply Last reply Reply Quote 2
            • EkopalypseE
              Ekopalypse @Alan Kilborn
              last edited by

              @Alan-Kilborn

              If same shortcut is already mapped in Shortcut Mapper

              I would argue if you register a shortcut within a script you know that you did it?
              But you are right - might be a area of confusion - hmm …

              I guess, once I have something useful I will open a different thread :-)

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

                @Ekopalypse said:

                I would argue if you register a shortcut within a script you know that you did it?

                People tend to just run scripts, forgetting the details… :(

                And, BTW, I HATE plugins (and maybe in the future, scripts!) that hijaak keycombos I’m possibly already using. Ugh. Better to leave them unassigned and let ME decide which functions need them, and then what they should be.

                EkopalypseE 1 Reply Last reply Reply Quote 1
                • EkopalypseE
                  Ekopalypse @Alan Kilborn
                  last edited by

                  @Alan-Kilborn

                  Better to leave them unassigned and let ME decide which functions need them, and then what they should be.

                  Agreed, I assume that something like

                  PREVIOUS_CHANGE = None  # replace None with e.g. CTRL+- to assign a shortcut
                  @register_shortcut(PREVIOUS_CHANGE)
                  

                  and checking in register_shortcut for None would be ok.

                  1 Reply Last reply Reply Quote 2
                  • guy038G
                    guy038
                    last edited by guy038

                    Hi, @ekopalypse,

                    I saw the the @alan-kilborn suggestion and your proposition to remove the old @eko-palypse account. Of course, I can delete a post, move a specific post from a topic to an other topic and, even, delete an acount, but I don’t think I have any possibility to modify the acoount owner of a specific post :-((

                    Quite logical : would it be any interest to attribute a post, written by a member to an other member !

                    On the other hand, it would not be sensible to disconnect your replies to some posts, made with your old acoount, from the other posts, on a particular topic, wouldn’t it ? Indeed, as anyone else, your replies depends on the context of the precedent posts, on a specific topic, and are still valuable ;-))


                    Just for information, with the old @eko-palypse account, you have written 283 posts, covering 109 topics. The most recent one was on 02/17/2019 and the older one was on 11/22:2019.

                    If you don’t mind, I may post the list of the 283 links to posts, on this site or, if you prefer, send it by e-mail. Just tell me about it !

                    Best Regards,

                    guy038

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

                      hi @guy038 @Alan-Kilborn @Ekopalypse et al.

                      i agree with @guy038 and also think it is best to leave eko’s accounts like they are, as it would otherwise break the continuity and the whole history what happened and what lead to the dual-account.
                      and changing the old user account name would also break all reply address references to that account (everything directly addressed to @Eko-palypse) for all past posts.

                      who knows, maybe @Ekopalypse gets his old account back one day, and wants to start a discussion with himself ? 😂

                      and @Alan-Kilborn if you’d need a memory hook to remember @Ekopalypse 's new account, you could use the following:
                      “@Ekopalypse is continuously present, so his name is continuously written”
                      but i guess after all these posts, plus @Ekopalypse 's 100 plus post-topics, you won’t need any hook on that anymore. 😉

                      Alan KilbornA 1 Reply Last reply Reply Quote 3
                      • Alan KilbornA
                        Alan Kilborn @Meta Chuh
                        last edited by

                        All,

                        To be fair (to me!), I did retract my original suggestion about Eko’s duality.

                        1 Reply Last reply Reply Quote 3
                        • AZJIO AZJIOA
                          AZJIO AZJIO
                          last edited by

                          I recently made my own version of the plugin, because LocationNavigate had unnecessary features. But I’m not sure that I did it right. I looked at the LocationNavigate code and did not understand anything. Therefore, if someone has a problem with LocationNavigate, then try mine. I used to use NppPlugin_ChangeMarker, but he had a problem, he crashed the program while saving the file after an hour of work.
                          On my system, LocationNavigate is working fine. I set such parameters so that he does not save the history of jumps.

                          my plugin https://yadi.sk/d/IQD33JVWbtwQXw

                          1 Reply Last reply Reply Quote 0
                          • EkopalypseE
                            Ekopalypse
                            last edited by

                            I haven’t thought about the old post and that it might generate trouble, therefore, better
                            just leave it as it is and don’t worry about it anymore.

                            Thx for all insights and tips. :-)

                            1 Reply Last reply Reply Quote 2
                            • Alan KilbornA Alan Kilborn referenced this topic on
                            • First post
                              Last post
                            The Community of users of the Notepad++ text editor.
                            Powered by NodeBB | Contributors