Community
    • Login

    Focus on opened file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 3.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.
    • Harold CoenenH
      Harold Coenen
      last edited by

      Closing n++ with a sidebar active like workspace/docswitcher or the character panel for instance, has a bit of an annoying side-effect, next time you open a file (and I usually do that with shortcut-keys/typing only) the focus automatically goes to one of the sidebars, instead of the just opened file a tab.
      I’m usually already typing away or hitting pgdn or something (and yes I fall for this time and time again hehe) to only notice the character panel scrolling down.

      I’m not using n++ that long yet, so I might not know every hidden setting yet, but I browsed the xml’s, the settings… but can’t really find a setting which let’s me alter this behavior. Is it possible using a setting ? Or do I need to find a different solution ? Plugin ?

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Harold Coenen
        last edited by

        @Harold-Coenen

        Depending upon the lengths you want to go to…the following is semi-related and worked for me: https://notepad-plus-plus.org/community/topic/12467/keystroke-to-switch-focus-from-console-window-to-active-editor-tab/5

        1 Reply Last reply Reply Quote 0
        • Harold CoenenH
          Harold Coenen
          last edited by

          Perfect solution ! Didn’t have the python-script plugin installed yet, but already noticed it will most definitely come in handy for all sorts of quick and dirty tricks/automation :-)

          By the way: why SendKeys.SendKeys(“%{W}W{ENTER}”) and not just SendKeys.SendKeys(“{F8}”) ? That is, if you like the SendKeys import and method… the editor.grabFocus() as last line in the startup.py is my preferred solution - no extra import and no faking key-presses, yet still 100% fail-proof focus to main edit window (with init set to ATSTARTUP in the python script configuration of course).

          Thank you for the great tip ! I didn’t look hard at existing plugins… will try some others too :-)

          Scott SumnerS 1 Reply Last reply Reply Quote 0
          • Scott SumnerS
            Scott Sumner @Harold Coenen
            last edited by

            @Harold-Coenen

            Regarding “why not use SendKeys(”{F8}“) or editor.grabFocus() in startup.py”?

            Because neither of those things worked (for me, at least) that way. Just checked again, and they still don’t work. :-)

            1 Reply Last reply Reply Quote 0
            • Harold CoenenH
              Harold Coenen
              last edited by

              Good enough reason /me thinks ;-) lol

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