adobe/brackets — pull request #5572 by njx (2013-10-18 19:00:53+00:00)
Title: Add keyboard shortcut for new rule

@dangoor

This adds a menu item and keyboard shortcut (Cmd-Alt-N) for creating a new rule in the focused CSS inline editor (in the menus, it's added near the previous/next match commands). It also properly enables/disables the command (as well as the previous/next match commands) based on focus and availability.

One thing that I'd like @larz0 to look at is the case where there are no matching rules. Originally, opening the inline editor in this case wouldn't set focus to it, but that meant that the shortcut wouldn't work. So I made it so that if there are no matching rules, we set focus to the "New Rule" button, which is kind of nice since it draws attention to it and you can just hit Space to activate it (or Cmd-Alt-N to use the normal shortcut). However, the focused state looks rather strong for the mini button. We might want to tone it down for the mini button case.

@redmunds might also want to do a drive-by since this is related to his code.