madskristensen / AddAnyFile

A Visual Studio extension
Apache License 2.0
262 stars 119 forks source link

After creating files, point VS focus to code editor window instead of Solution Explorer #137

Closed WhitWaldo closed 1 year ago

WhitWaldo commented 1 year ago

Describe the bug I'm pretty sure the extension didn't use to have this behavior as I only started noticing it once I upgraded to 17.4, but when I create a new file now, instead of being able to type immediately in the file itself, my focus in VS is on the Solution Explorer on the file that was created rather than on the code editor (with the caret just after the opening brace for the class).

It's more an annoyance that I have to create the file, then use the mouse to put focus back on the code, especially since I often find myself hitting the arrow keys to change the class visibility or the like and instead find myself looking at previews of other files since I'm not actually navigating around in the code as I expect.

To Reproduce Steps to reproduce the behavior:

  1. Hit Alt + F2 and create a new file
  2. Hit the arrow up key and note that you didn't move the caret up in the, but rather selected the item in the Solution Explorer above your new file.

Expected behavior I would instead expect the previous behavior of the focus immediately and automatically shifting to the code editor, placing the caret just after the opening brace for the class.

Screenshots Not really applicable, but easily reproducible.

Additional context Again, pretty sure this is something to do with the upgrade to 17.4 as I've never experienced it prior.

a-jackson commented 1 year ago

@WhitWaldo I just figured this out. 17.4 added this functionality built in so you're not using the extension any more. If you remap Shift+F2 from "AddQuickFile" back to "NewEmptyFile" it'll be the original command and should work as you want again.

WhitWaldo commented 1 year ago

Thank you @a-jackson!