Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

F5 sometimes triggers wrong menu item (after run unit tests?) #3037

Closed
peterflynn opened this issue Mar 4, 2013 · 9 comments
Closed

F5 sometimes triggers wrong menu item (after run unit tests?) #3037

peterflynn opened this issue Mar 4, 2013 · 9 comments

Comments

@peterflynn
Copy link
Member

  1. Launch Brackets
  2. Choose Debug > New Brackets Window from menu
  3. Close the new window once it's done loading
  4. Back in original window, hit F5

Result: a new Brackets window is opened. Brackets doesn't reload.

Expected: F5 is still listed next to the "Reload" menu item...

If you click the Reload menu item, it works fine. After that, F5 will work correctly until the next time you trigger New Brackets Window.

@peterflynn
Copy link
Member Author

Hmm, this might be UTR. It seemed I was in a weird state where shortcuts from most extensions (including DebugCommands) weren't working right. After restarting Brackets I can't repro this anymore. (And Brackets was definitely in a bad state because on quit, the second .exe hung around stuck at max CPU until I killed it).

Is there anything suspicious in the native shortcut handling code that could cause something like this?

@peterflynn
Copy link
Member Author

Reviewed. Closing as UTR for now, can reopen if seen again. But @gruehle, we're curious if this rings any bells at a glance?

@gruehle
Copy link
Member

gruehle commented Mar 6, 2013

Doesn't ring a bell. We do have different internal mapping tables for command->tag and tag->item, so there is a possibility that somehow one of the maps got confused. We should keep an eye out for reproducible steps.

@peterflynn
Copy link
Member Author

@gruehle I got in a similar state today, where pressing F5 did nothing but other shortcuts seemed to work fine. I put a breakpoint in ShellAPI.executeCommand() and see that it's getting called with eventName = "brackets-menuDivider-23". Definitely some sort of bug there. Should I reopen?

Btw, I had run unit tests at least once in this session of the .exe -- could the issue be related to menu state leaking between different windows?

@peterflynn
Copy link
Member Author

Unlike the original report, if I "soft" reload via clicking the menu or hitting F5 in dev tools the bug persists. Same bad command ID as before. Only quitting the whole process fixes it -- so it's definitely something in the native shell state.

@peterflynn
Copy link
Member Author

Also, fwiw -- with the set of extensions I have enabled there are exactly 24 menu dividers, so divider index 23 would be the very last divider in the whole menu structure.

@gruehle
Copy link
Member

gruehle commented Mar 7, 2013

When reloading, were you running code that changed the menu structure at all (eg adding/removing an extension that adds a menu item, or editing DefaultMenus.js)?

@peterflynn
Copy link
Member Author

I don't think I had touched any menu-related code. But I did run unit tests, including tests that spawn other Brackets windows. I think unit tests disable user extension loading, which means those windows would have had a different menu item set from the main window (and of course the Jasmine window has different menus too).

@peterflynn
Copy link
Member Author

I suspect this was finally fixed for real by all the menubar work leading up to PR #5078

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants