{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/34105","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/34105/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/34105/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/34105/events","html_url":"https://github.com/Microsoft/vscode/issues/34105","id":256543270,"number":34105,"title":"Selection, highlighting and search colors conflict with each other","user":{"login":"monk-time","id":7759622,"avatar_url":"https://avatars0.githubusercontent.com/u/7759622?v=4","gravatar_id":"","url":"https://api.github.com/users/monk-time","html_url":"https://github.com/monk-time","followers_url":"https://api.github.com/users/monk-time/followers","following_url":"https://api.github.com/users/monk-time/following{/other_user}","gists_url":"https://api.github.com/users/monk-time/gists{/gist_id}","starred_url":"https://api.github.com/users/monk-time/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monk-time/subscriptions","organizations_url":"https://api.github.com/users/monk-time/orgs","repos_url":"https://api.github.com/users/monk-time/repos","events_url":"https://api.github.com/users/monk-time/events{/privacy}","received_events_url":"https://api.github.com/users/monk-time/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-10T21:54:38Z","updated_at":"2017-09-10T21:54:38Z","closed_at":null,"author_association":"NONE","body":"- VSCode Version: Code 1.16.0 (787b31c0474e6165390b5a5989c9619e3e16f953, 2017-09-06T16:27:49.891Z)\r\n- OS Version: Windows_NT x64 6.1.7601\r\n- Extensions: \r\n\r\nExtension|Author (truncated)|Version\r\n---|---|---\r\nintellij-idea-keybindings|k--|0.2.13\r\nselectline-statusbar|tom|0.0.2\r\n\r\n<!-- Launch with `code --disable-extensions` to check. -->\r\nReproduces without extensions: Yes\r\n\r\n---\r\n\r\nBackground colors for the editor selection, word highlighting and search matches all conflict with each other in an unexpected way, which seems to be caused by multiple bugs in color priorities and mixing rules.\r\n\r\n### Text selection color is not restored after searching\r\nThe following rules set all three highlighting colors to `#FF0000` and text selection to `#00FF00` on a black background. \r\n\r\n    \"workbench.colorCustomizations\": {\r\n        \"editor.background\": \"#000000\",\r\n        \"editor.foreground\": \"#FFFFFF\",\r\n        \"editor.lineHighlightBackground\": \"#000000\",\r\n        \"editor.selectionHighlightBackground\": \"#FF0000\",\r\n        \"editor.findMatchBackground\": \"#FF0000\",\r\n        \"editor.findMatchHighlightBackground\": \"#FF0000\",\r\n        \"editor.findRangeHighlightBackground\": \"#000000\",\r\n        \"editor.selectionBackground\": \"#00FF00\",\r\n        \"editor.inactiveSelectionBackground\": \"#00FF00\"\r\n    }\r\n\r\nNormal selection works as expected:\r\n\r\n![2017-09-11_00-37-43](https://user-images.githubusercontent.com/7759622/30253230-6a5fb4aa-9689-11e7-9587-d2fa735e04d0.gif)\r\n\r\n**Case 1**: put the cursor at the start of the second line and press Ctrl+D (\"Add Selection To Next Find Match\") three times, none of the three selections become partially or completely green. Pressing Shift+Left to shrink selection re-applies the green selection color:\r\n\r\n![2017-09-10_20-48-29](https://user-images.githubusercontent.com/7759622/30251514-5631aa30-9669-11e7-8102-1d6e204be5e5.gif)\r\n\r\nChanging both `editor.findMatch*` settings to different colors and repeating the steps above doesn't change anything, selected regions are still red.\r\n\r\nThis is even more confusing if you use the search bar, because multiple cursors for Ctrl+D don't get drawn or animated in that mode (**case 2**). \r\n\r\n**Case 3**: put the cursor at the start of the file, press Ctrl+F, type \"aaa\", press Esc (here I expect green color to be applied to the selection, but it doesn't), press Shift+Left. Only then the selection color appears.\r\n\r\n![2017-09-10_20-22-40](https://user-images.githubusercontent.com/7759622/30251300-c0cafa9e-9665-11e7-904f-08a5c39d1103.gif)\r\n\r\nThis looks a bit different if `editor.findMatchBackground` is set to `#0000FF`, but the green color is still not applied after hitting Esc:\r\n\r\n![2017-09-10_21-12-57](https://user-images.githubusercontent.com/7759622/30251654-c1c89134-966c-11e7-8fca-f7f83f566549.gif)\r\n\r\n**Case 4**: while \"aaa\" is still the last searched term, put the cursor at the start of the file, press F3 (\"Find Next\") and then Esc. This is the only way I could force the green selection color to appear right after using the search:\r\n\r\n![2017-09-10_20-34-21](https://user-images.githubusercontent.com/7759622/30251443-eec11fa8-9667-11e7-83c7-222bca9740c5.gif)\r\n\r\n**Case 5**: there's something weird going on with the first match. If you repeat the steps from the case above but press F3 several times, after hitting Esc the color of the first match disappears completely:\r\n\r\n![2017-09-10_20-42-42](https://user-images.githubusercontent.com/7759622/30251498-e0786bf8-9668-11e7-95aa-58011f9d4894.gif)\r\n\r\n---\r\nExpected behavior for all cases above: `editor.selectionBackground` color should be applied to all selected regions when the selection is made without opening the search bar or after it was closed.\r\n\r\n### Inconsistent blending of `findMatch*` colors\r\nThe following rules set text selection to `#303030` (to affect other colors as little as possible), regions with the same content as selection to `#FF0000`, and current/other search matches to `#0000FF`/`#00FF00`. \r\n\r\n    \"workbench.colorCustomizations\": {\r\n        \"editor.background\": \"#000000\",\r\n        \"editor.foreground\": \"#FFFFFF\",\r\n        \"editor.lineHighlightBackground\": \"#000000\",\r\n        \"editor.selectionHighlightBackground\": \"#FF0000\",\r\n        \"editor.findMatchBackground\": \"#0000FF\",\r\n        \"editor.findMatchHighlightBackground\": \"#00FF00\",\r\n        \"editor.findRangeHighlightBackground\": \"#000000\",\r\n        \"editor.selectionBackground\": \"#303030\",\r\n        \"editor.inactiveSelectionBackground\": \"#303030\"\r\n    }\r\n\r\nIn this setup, depending on how and where the search bar is opened, the highlighting of matches changes in an unpredictable and seemingly random way.\r\n\r\n**Case 6**: remove the last searched term from the search bar, put the cursor at the start of the file, press Ctrl+F, type \"aaa\", press Enter or F3 several times. Both `editor.findMatch*` are blended with alpha 50% with the red `editor.selectionHighlightBackground` .\r\n\r\n![2017-09-10_22-49-54](https://user-images.githubusercontent.com/7759622/30253129-7e2c12aa-9687-11e7-887a-ce320d84756a.gif)\r\n\r\n**Case 7**: while \"aaa\" is the last searched term, put the cursor at the start of the file, press Ctrl+F, then F3 or Enter several times. Unblended green `editor.findMatchHighlightBackground` appears until you select search matches, then it changes to blended colors from the previous case. \r\n\r\n![2017-09-11_00-10-25](https://user-images.githubusercontent.com/7759622/30253025-83d9a520-9685-11e7-9e08-01a563346a71.gif)\r\n\r\n**Case 8**: while \"aaa\" is the last searched term, put the cursor at the start of the file and press F3 several times (same as in case 5). All colors are unblended, but  `editor.findMatch*` apply only to the first match.\r\n\r\n![2017-09-11_00-20-51](https://user-images.githubusercontent.com/7759622/30253093-fd4c348a-9686-11e7-9580-ce571d190c68.gif)\r\n\r\n**Case 9**: put the cursor at the start of the second line and press F3 several times. None of `editor.findMatch*` apply at all.\r\n\r\n![2017-09-11_00-29-05](https://user-images.githubusercontent.com/7759622/30253159-244ce290-9688-11e7-99f2-223c125777c9.gif)\r\n\r\n---\r\nIn all four cases the expected behavior would be to apply `editor.findMatch*` correctly no matter how the search was triggered. Also, blending is undocumented and very unexpected: `editor.selection*` and  `editor.findMatch*` pairs seem to be designed to mirror each other, with each active only in their respective editor mode. But only `editor.selectionHighlightBackground` is blended with one or both colors from the other pair, and there's no way to influence or override this. Since there are two pairs, blending seems completely unnecessary to me."}}
{"actor":{"display_login":"monk-time"}}