Community
    • Login

    Open files tabs - auto-sorted how?

    Scheduled Pinned Locked Moved General Discussion
    23 Posts 8 Posters 2.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.
    • EkopalypseE
      Ekopalypse @maxitrol
      last edited by

      @maxitrol

      there is no official notepad++ API to handle this case but this doesn’t
      mean it can’t be done. Maybe one needs to hook into
      npps message queue and act accordingly.
      If I have time I will see if a python script can be written to make it work,
      but this means you need to install pythonscript plugin and,
      more important, exactly describe what you want to have.

      Michael VincentM 1 Reply Last reply Reply Quote 1
      • Michael VincentM
        Michael Vincent @Ekopalypse
        last edited by

        @Ekopalypse

        The code to “Sort tabs” in the Window=>Windows… menu dialog seems to be here.

        I tried in Perl Script, but like you said the API doesn’t seem to be exposed - there is no getBufferByIndex() and setBuffer() calls. in Perl Script.

        Cheers.

        EkopalypseE 2 Replies Last reply Reply Quote 3
        • EkopalypseE
          Ekopalypse @Michael Vincent
          last edited by

          @Michael-Vincent

          thx - now I remember that I have thought about it once and
          I guess it isn’t that easy. WDN_NOTIFY is NOT a normal windows message but one registered by npp.
          Hmm … have to think about it once more.

          1 Reply Last reply Reply Quote 1
          • EkopalypseE
            Ekopalypse @Michael Vincent
            last edited by

            @Michael-Vincent

            I have not found a way to receive the custom registered messages
            using the Windows API.
            I’ve also tried to see if this is cached in the registry in any way,
            but no luck so far.

            1 Reply Last reply Reply Quote 0
            • Maxitrol - MatM
              Maxitrol - Mat
              last edited by

              Too bad. I really want auto-sort tabs because it is driving me crazy when I am coding and having 10 tabs open. Any other light weight editor with such feature? I only need three things:

              1. auto sort tabs in real time
              2. list of functions in current file i am editing
              3. list of files in folder
              EkopalypseE 1 Reply Last reply Reply Quote 0
              • EkopalypseE
                Ekopalypse @Maxitrol - Mat
                last edited by

                @Maxitrol-Mat

                you can always ask here for a feature request.

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

                  auto sort tabs in real time

                  But it is really a dumb feature to use or not use an editor based upon. And…you’re not going to find any editors out there that do it.

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

                    Hello @maxitrol-mat, @ekopalypse, @michael-vincent, @alan-kilborn and All,

                    @maxitrol-mat, you said :

                    I really want auto-sort tabs because it is driving me crazy when I am coding and having 10 tabs open

                    To my mind, it doesn’t seem that difficult to distinguish a particular tab among a set of 10 tabs or so ! Am I missing something, here ?


                    Four tips :

                    • You could un-tick the Reduce option in Settings > Preferences... > General > Tab Bar

                    • You could un-tick the Darken inactive tabs option in Settings > Preferences... > General > Tab Bar

                    • You may also change the color of the foreground and/or the background of these inactive tabs in Settings > Style Configurator... > Global Styles > Inactive Tabs

                    • May be, dividing your tabs between the main view and the sub-view could be interesting, with the main used files in the main view and the others in the secondary view, which would be allowed a smaller area ?


                    Moreover, hitting twice on the default shortcut Alt + W to get the list of all opened files, then on the Alt + T shortcut to sort them doesn’t seem an insurmountable task…, especially since you only have to do it if you open an other file, not yet present in your current N++ session !

                    Best Regards

                    guy038

                    EkopalypseE PeterJonesP 2 Replies Last reply Reply Quote 3
                    • EkopalypseE
                      Ekopalypse @guy038
                      last edited by

                      @guy038

                      Am I missing something, here ?

                      Apart from the fact that the OP wants this automated, probably nothing.

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

                        Not that I think the whole concept of auto-sorted tabs has much usefulness…

                        But how about a P.S. “buffer-activated” solution that checks the “order” (whatever that means, path, file, type, etc. hasn’t been defined yet, really by the OP) and if it finds an out-of-order situation, it saves the current state to a session xml file, closes all tabs (save or not could be a problem here), reorders the session file according to the sort algo, then opens the session file.

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

                          @Alan-Kilborn said in Open files tabs - auto-sorted how?:

                          But how about a P.S. “buffer-activated” solution that checks the “order”

                          That might work, but it would certainly annoy me.
                          I mean, you always get the closing and opening
                          and possibly confirm the task whether to save or not …
                          Would definitely annoy me :-D

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

                            @Ekopalypse

                            annoy

                            Well, a use-case of questionable value (auto-sorted tabs) may spur on extraordinary suggested solutions. :-)
                            Maybe the OP could say more about why the sorted tabs makes a lot of sense for his application, but I’m thinking that this might be impossible.

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

                              @Alan-Kilborn said in Open files tabs - auto-sorted how?:

                              Maybe the OP could say more about why the sorted tabs makes a lot of sense for his application, but I’m thinking that this might be impossible.

                              Yes, how we say, that would give room for further thoughts.

                              1 Reply Last reply Reply Quote 0
                              • PeterJonesP
                                PeterJones @guy038
                                last edited by

                                @guy038 said in Open files tabs - auto-sorted how?:

                                Moreover, hitting twice on the default shortcut Alt + W to get the list of all opened files, then on the Alt + T shortcut to sort them doesn’t seem an insurmountable task…, especially since you only have to do it if you open an other file, not yet present in your current N++ session !

                                If the OP really wanted to do that a lot, and since Notepad++ Macros cannot influence inside the Windows dialog box, I’d suggest an external macro-defining application, such as AutoHotKey (which I never use, but have heard good things about). In AHK, one should be able to define a macro that sends the keystrokes Alt+W Alt+W Alt+T Alt+O (I added clicking the OK when done sorting), then it could be done with a single keystroke instead of 4, which is an improvement (though not technically automatic).

                                Alan KilbornA astrosofistaA 2 Replies Last reply Reply Quote 4
                                • Alan KilbornA
                                  Alan Kilborn @PeterJones
                                  last edited by

                                  @PeterJones said in Open files tabs - auto-sorted how?:

                                  such as AutoHotKey

                                  or maybe some SendKeys games with P.S.

                                  1 Reply Last reply Reply Quote 2
                                  • astrosofistaA
                                    astrosofista @PeterJones
                                    last edited by

                                    @PeterJones said in Open files tabs - auto-sorted how?:

                                    I’d suggest an external macro-defining application, such as AutoHotKey (which I never use, but have heard good things about)

                                    OK, I bite. I scripted something related to this Window... menu item a couple of weeks ago —wanted a list of all the open tabs—, so here is my attempt (works fine here :)

                                    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
                                    ; #Warn  ; Enable warnings to assist with detecting common errors.
                                    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
                                    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
                                    
                                    #IfWinActive, ahk_class Notepad++
                                    !w::
                                    WinActivate ahk_exe notepad++.exe ahk_class Notepad++
                                    WinMenuSelectItem, A, , Window, Window...
                                    Sleep, 100
                                    WinActivate, Windows
                                    SetControlDelay -1
                                    ControlClick, Button4, Windows
                                    Sleep, 100
                                    ControlClick, Button5, Windows
                                    WinClose, Windows
                                    return
                                    #If
                                    

                                    This AutoHotkey script only works if Notepad++ is the active application —as the #IfWinActive directive stats— so it cannot interfere with other applications. Fire it pressing Alt + W, the same key combo that opens the Window... window.

                                    Have Fun!

                                    1 Reply Last reply Reply Quote 3
                                    • Maxitrol - MatM
                                      Maxitrol - Mat
                                      last edited by

                                      I don’t understand why some of you are complicating this like its a rocket science. Simple tickbox either: A) Leave tabs unsorted (like it is now) B) Always auto sort in real time

                                      A programmer who is working on this editor, could do that in 10 minutes. I would, but I am not C programmer and I don’t have to source code.

                                      Its that easy… and yes, it is useful!

                                      PeterJonesP 1 Reply Last reply Reply Quote 0
                                      • PeterJonesP
                                        PeterJones @Maxitrol - Mat
                                        last edited by

                                        @Maxitrol-Mat ,

                                        You asked if it was possible. We told you how it wasn’t possible in the current application, and gave you workarounds. If you don’t like that, fine.

                                        We aren’t the programmers. A quick search of this forum, or the offiical Notepad++ homepage, would have directed you where to actually request new features: I’ll give you a hint, it’s not here. Oh, right, @Ekopalypse even linked you to the FAQ that explains it.

                                        yes, it is useful!

                                        Maybe so, maybe not. But no one above said it wasn’t. You may have misread Alan, who said the lack of that feature was a dumb reason to stop using Notepad++, but he didn’t say the feature itself was dumb.

                                        I am not C programmer and I don’t have to source code.
                                        Its that easy…

                                        There are two errors in those statements:

                                        1. You do have access to the source code, and you can submit PR to that source code, if you have the ability.
                                        2. If you are not a C programmer, then you cannot know how easy, or not, it is – especially if you have not studied the source code. Every time a user says “it only takes a few minutes, but I won’t/can’t”, that person proves they don’t have the knowledge to comment meaningfully on the programming task at hand. There are often many complicating factors that you, as a user, cannot think of immediately; one change may affect something else unexpected, or require edits in multiple sections, or…

                                        And, as I said before, you never asked in the right place to request a new feature , so it doesn’t matter how long it would take to program, because the developers never got the request.

                                        Your choices are to continue to whine, which helps no one and annoys many; to accept things the way they are and possibly use a workaround as suggested above; or to submit a feature request, and possibly use a workaround while waiting for the feature to either be added or rejected.

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

                                          I’m not sure if it is the OP or someone else (it appears some username games are going on?), but someone recently opened a true feature request for it HERE.

                                          You may have misread Alan, who said the lack of that feature was a dumb reason to stop using Notepad++, but he didn’t say the feature itself was dumb.

                                          Don’t make me say it Peter! :-)

                                          In this case I think it might help the OP’s case to cite any other editors out there that provide this feature.

                                          1 Reply Last reply Reply Quote 0
                                          • Maxitrol - MatM
                                            Maxitrol - Mat
                                            last edited by

                                            Feature request is like screaming in the wild. As you can see nothing has happened.

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