Home

How do I return the focus back to the editor after running the code?

Hi,
I appreciate if this does not inconvenience anybody else, but I'll take the risk of sounding 'eccentric' (at best): I find it disrupting that Linqpad takes the focus away from the editor when I run C#/F# code.

It appears the focus is stolen by the result pane, and there is not a keyboard shortcut/workaround to take the focus back to where the cursor was in the editor. This is Windows 10 pro, running LinqPad v7.2.7(x64).

This behaviour is counter productive for me when I'm trying to figure out the outcomes of changes I'm making. Imagine a REPL workflow in which REPL's input lost focus every time you run a command :smile:

Am I missing something?

Comments

  • No, you're not eccentric: this is most definitely not how LINQPad is supposed to work! The issue that you describe is a result of a feature?/bug? in a recent Microsoft WebView2 update. AFAIK this has not made it to RTM, so I'm guessing that (maybe through installing some other software) you've ended up with a pre-RTM WebView2 on your machine. Because I subscribe to the WebView2 dev channel, I've been aware of this issue for some time and have incorporated a workaround into recent beta releases. Try the beta and let me know if this fixes it:

    https://www.linqpad.net/LINQPad7.aspx

  • Hi Joe,

    Thanks for the rapid response. I can confirm that the beta behaves as expected.

    I'm not sure how I ended up with the pre-RTM WebView2 though. This is my workstation I use for company work, I keep Windows 10 up to date, but I don't install optional updates or beta of anything to make sure it stays as stable as possible.

    I'll stick to the beta for the moment, thanks again!

  • @JoeAlbahari I thought I'd let you know: The behaviour of v7.2.7 is back to the expected behaviour now. I don't understand why it reverted to what it should do. No restarts, no new installs of anything to Windows.

    The beta I ran is an exe extracted from a zip package, so unless that exe is modifying something when it's run, I don't have an explanation for the release version acting different now.

    Adding this update just in case there's a hard-to-reproduce bug here and someone else encounters this.

  • It's possible that the issue is intermittent. In any case, I'm hoping to roll 7.3.9 out to RTM fairly soon, so there will be a permanent fix.

Sign In or Register to comment.