Enable user-select for monaco editor on macOS#156755
Conversation
| /* Use user-select: text for lookup feature on macOS */ | ||
| /* https://github.com/microsoft/vscode/issues/85632 */ | ||
| .monaco-editor.mac .lines-content:hover, | ||
| .monaco-editor.mac .view-line:hover, | ||
| .monaco-editor.mac .view-lines:hover { | ||
| user-select: text; | ||
| -webkit-user-select: text; | ||
| -ms-user-select: text; | ||
| } |
There was a problem hiding this comment.
I can confirm this working, by modifying local CSS through builtin dev tools.
But not without a catch, when editor.renderWhitespace is set to all, the whitespace indicators between words (<span class="mtkw">·‌</span>) may interfere with OS's tokenization, causing lookup to pick up the wrong word.
It may be outside the scope of this PR, though.
Screen.Recording.2022-07-31.at.13.31.42.mov
There was a problem hiding this comment.
Good catch. I am afraid that we can't do much about OS tokenization.
UPDATE
I found a fix for this. Since it is out of scope of the original issue. I will make another PR after this one get merged.
There was a problem hiding this comment.
Can you share the change here, just curious what it would be?
There was a problem hiding this comment.
MacOS won't treat ‌(0x200C) as word separators. So we could add normal whitespace characters similar to #150349
|
Any hope for this to be looked at and closed soon? :) |
bpasero
left a comment
There was a problem hiding this comment.
I am curious though, if #44517 does not reproduce, why would we do this change only for :hover? It seems very hard for me to reason about a CSS change for selection only on hover, because isn't that exactly when a selection occurs? When hovering with the mouse over?
|
Elements in the editor will inherit default stylesheet
|
That's a fear I have. Why is We can merge this early next iteration and see if there are any regressions in insiders for mac-users. |
|
Yes I like early milestone merge to scan for regressions. |
Fixes #85632
macOS lookup won't work for text setting or inherited
user-select: nonestylesheet.The related code was changed many years ago:
I tested #44517 is not reoccurring.