madskristensen / Tweakster

A Visual Studio extension
Apache License 2.0
239 stars 23 forks source link

CTRL+W to close a document window does not work with a sql file in a Database project #29

Open ghost opened 4 years ago

ghost commented 4 years ago

Tested with 1.0.78 - the keystroke combination has no effect when attempting to close a sql file within a Database project.

madskristensen commented 4 years ago

Can you please try the latest version to see if the issue still reproduces?

ghost commented 4 years ago

@madskristensen The issue persists in 1.0.83. In a database project, CTRL+W doesn't close a sql file (when enabled in Tweakster options and not mapped to CloseDocumentWindow in Keyboard settings), but CTRL+F4 does (which is mapped to CloseDocumentWindow).

madskristensen commented 4 years ago

I don't have the database tools installed. Can you tell me which command is mapped to Ctrl+W?

ghost commented 4 years ago

Window.CloseDocumentWindow

madskristensen commented 4 years ago

I'm not sure I understand. You said that Ctrl+F4 is mapped to CloseDocumentWindow, so what is Ctrl+W mapped to?

ghost commented 4 years ago

Sorry - I'll try to explain more clearly. CTRL+F4 is mapped to CloseDocumentWindow. CTRL+W was previously mapped to CloseDocumentWindow as well, but I removed that mapping when enabling the equivalent setting in Tweakster. So CTRL+W is not mapped to anything when attempting to use Tweakster.

With the above config, CTRL+W does not close the sql files in the Database project.

In fact CTRL+W doesn't appear to be closing cs files in a web project either anymore, now that I'm on 1.0.83. Restarted VS and turned that Tweakster setting off and on but still has no effect.

I hope it's not something to do with my environment as I don't want to lead you on a wild goose chase.

madskristensen commented 4 years ago

It's because you removed Ctrl+W from the command it used to be mapped to. This extension takes over that command and closes the document instead. To make it more bullet proof, I should add a custom command and assign in Ctrl+W for cases like yours

ghost commented 4 years ago

I assumed it would work regardless; I previously hit the issue of it closing two windows, so thought it was running that command independently of the keyboard-mapped command.