First of all, the right-click menu (in the code editor) does work. But making it disappear does not :)
The only way to make the right-click menu disappear is to select an item, but left-clicking somewhere else does not make it disappear (which is very odd, because that's default Windows behavior...) Hitting Esc does make it disappear, so there is a way at least.
Also the right-click menu needs waaaay more options. I would suggest to copy over some of the most frequently used items from the Edit menu.
Another thing is when no text is selected, it automatically selected a word or whole line, which may inflict confusion when dismissing it after accidentally opening it, and carrying on editing (that selection would be overwritten by mistake). A context menu should not select text - if the items require that, then disable them if no text is selected.
Just noticed this not-wanting-to-disappear issue also goes for the right-click menu on files. But not for the menu bar at the top.
@thany, are you using a Themes extension?
@thany Addressing each of your three issues separately...
1) The right-click menu is hidden when you click anywhere within the Brackets UI, but it's not hidden if you click elsewhere on the screen (including clicking on the Brackets window's own chrome). This is a known issue.
2) We haven't had a lot of design discussion about how big the editor context menu should be. I think in general we prefer to keep context menus relatively short (unlike some IDEs where they are giant, and not necessarily very contextual). We have a backlog item for adding cut/copy/paste to the context menu, but nothing is tracking the larger question of what else should go on that menu. I'll mark this issue 'move to backlog' as a reminder for us to have that discussion.
3) It is definitely a bit odd that we select the current word when right-clicking if nothing was selected previously -- especially since sometimes that still doesn't result in a selection (e.g. when right-clicking past the end of the line, or between two non-word characters). Personally I wouldn't be opposed to ripping that out if anyone wants to submit a PR for it...
1) You are right. The Themes for Brackets extensions may be causing that issue. Or not, but I report it there and if needed, let you fight it out, so to speak :)
2) Too big is certainly not good either. However, missing default items that even notepad has, feels a bit odd. So please do have that discussion, Im curious what will come of it. Maybe try to somehow find out what users do (or would do) with a context menu, that should definately help.
3) Small note: Opera has a feature where you can doubleclick text, and it'll select something useful (like a word) and pop up the context menu right away. Maybe it's an idea to do the current word-selection behavior that way? Or maybe after a tripleclick if it's too annoying? I dunno, just throwing a bone here.
(hm, maybe I should have created separate issues now that I see how this disussion is going... apologies)
@thany, sounds good. The reason I asked is I already filed this issue a while ago: MiguelCastillo/Brackets-Themes#9.
However, it looks like you are using the other Themes extension. There's a lot of common code between these two extensions, so maybe the developer there can figure out the solution and we can get it fixed in both extensions.
Also, you can confirm that this issue is caused by Themes by removing Themes and seeing if the problem is still there. Pretty sure the extension is causing the problem you are seeing though.
@peterflynn, the first issue is an Extension bug and it sounds like the second issue is a "move to backlog". If the third issue is something to address, maybe an issue title change is in order?
Another option is to use middleclick, because that's not assigned to anything yet (or so it seems), while tripleclick is. Although not nearly all pointing devices have a middle mouse button (think touchpads, designer tablets, trackballs). Hm...
Why exactly is Brackets imposing weirdo functionality (other than opening the contextual menu, which would be sane and expected on all platforms) when you right click?
I am running the most up to date master version as of tonight, so maybe it's not doing this in the current sprint release?
Because contextual menu right click is nearly universal, Brackets should not edit the file automatically in any way, which also messes up any Extensions that might want to use that contextual menu.
This bums me out man.
@peterflynn @thany @lkcampbell
@LucasKA, I agree with you, that is a really weird bug. Good catch!
It doesn't seem to happen on every file I try it on but I can definitely repro it on some files.
Would you mind filing a new issue on it? I will play around with it today also and see if I can figure out what the heck is going on.
I am debugging this issue right now... I noticed that documents are marked as modified when right clicking on them as well.
The issue is really happening in what CodeMirror does when setting the theme. There is really nothing that Themes is doing to interject in the click event handling directly. But events are getting blocked under some circumstances when a theme is set in CodeMirror. Hopefully I will come up with something to resolve this issue soon enough.
I can reproduce the new issue reported by @LucasKA in a vanilla CodeMirror demo page and just file this issue codemirror/CodeMirror#2481.
Update: This new issue is not in sprint 38, it is only in master with recent CodeMirror update. Thanks @LucasKA for catching it.
@MiguelCastillo Yes that's definitely another issue. Another would be if you have just a word selected, and you right click, it deselects the word and moves the cursor to the end.
@lkcampbell Should I still file an issue in Brackets now that @RaymondLim filed that one at CodeMirror? Also, should I file a separate issue for each behavior?
Ok, just to be clear, I am debugging the issue where the menu does not disappear... But yes, the issue with the cursor moving to the end of the word and stuff is definitely another issue.
@LucasKA Yes, each issue that is different from the original context menu issues should be filed as a separate issue.
@LucasKA, you know, we might as well get some separate issues filed. This issue has become pretty confusing because there are so many things being discussed.
File your issue with the hyphen as one issue and make sure to include a link to the CodeMirror issue that @RaymondLim filed because it will become our tracking issue.
And, yeah, if you can get good repros on the other issues (not including the issue that @MiguelCastillo is working on for Themes), file those issues as well. Then maybe we can close this issue in lieu of those other filing and reduce the confusion.
@LucasKA, to clarify, the issue that you do not need to file is issue 1, where the right click menu is not going away when using themes.
@MiguelCastillo is working on that issue as part of his Themes work and it is already filed at:
But the other two, if you have good repros, please file them separately.
@lkcampbell Alright, they are filed.
To summarize, issues discussed in this issue:
I am going to close this issue since all of its components are now addressed by other issue reports.
@thany, if you feel like we missed anything, please file a new issue so that we can address each one separately. Thanks for everyone's help on catching all of these context menu bugs!