Change color of secondary cursor when text has both RTL and LTR text
Categories
(DevTools :: Source Editor, defect, P3)
Tracking
(firefox80 fixed)
| Tracking | Status | |
|---|---|---|
| firefox80 | --- | fixed |
People
(Reporter: pseudo_anon, Assigned: nchevobbe, NeedInfo)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
Open devtools web console
Paste in some expression containing both RTL and LTR text (Example: encodeURIComponent("jבkאkמת!"))
Using the arrow keys, move along the bidirectional text
Actual results:
The cursor shown in the console duplicates and the two cursors move around, sitting on the edges where RTL meets LTR. This happens in both single-line and multi-line console.
Expected results:
Expected behavior would be a single cursor moving left or right along with the arrow keys pressed rather than the two individual cursors seen in the screenshot provided.
Not sure if this is a feature that's supposed to help visualize bidirectional text, but I couldn't easily find any info on such a feature, nor was there any visual indication of such a feature being active (other than the duplicate cursor).
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•5 years ago
|
||
The severity field is not set for this bug.
:nchevobbe, could you have a look please?
For more information, please visit auto_nag documentation.
| Assignee | ||
Comment 3•5 years ago
|
||
Looks like a feature of CodeMirror (you can try to paste your example on the editor at https://codemirror.net/)
But on the example there, the second cursor is lighter.
Do you think we should do the same thing, or remove the second cursor completely ?
The other cursor has a CodeMirror-cursor CodeMirror-secondarycursor class, so it would be simple to style it differently or hide it.
Pinging itiel who might know what should be done here as well.
I'm not as advanced developer as other RTL users might be, so it's hard for me to decide if having a second cursor in this specific case is useful or not, but I tend to think this is unnecessary. I could be wrong though.
Maybe Tomer or Yaron can help on this matter.
Comment 5•5 years ago
|
||
I find it pretty helpful in cases where tags with RTL content are used in RTL context, for example:
<b>טקסט</b>
The logical movement of the cursor in this case is pretty confusing, if you copy this text to an RTL box and delete the characters from the beginning you'll see that the "digested" characters are different than the visual order.
I think that the lighter cursor solution is great, pretty self explanatory and pretty clear as opposed to the current solution.
| Reporter | ||
Comment 6•5 years ago
|
||
(In reply to Yaron Shahrabani from comment #5)
I find it pretty helpful in cases where tags with RTL content are used in RTL context, for example:
<b>טקסט</b>
The logical movement of the cursor in this case is pretty confusing, if you copy this text to an RTL box and delete the characters from the beginning you'll see that the "digested" characters are different than the visual order.
I think that the lighter cursor solution is great, pretty self explanatory and pretty clear as opposed to the current solution.
In total agreement here. Some other visual indicator like a lighter cursor would be less confusing.
Glad this does not seem to be a bug.
| Assignee | ||
Comment 7•5 years ago
|
||
Let's keep this open so we can change the cursor color.
The color is set here: https://searchfox.org/mozilla-central/rev/c86c19bd64f8f19590a4190c282781d3a9631422/devtools/client/shared/sourceeditor/codemirror/lib/codemirror.css#51-54 , but is probably overridden by higher specificity rules (maybe https://searchfox.org/mozilla-central/source/devtools/client/themes/light-theme.css#189 and https://searchfox.org/mozilla-central/source/devtools/client/themes/dark-theme.css#198)
We might want to change those rules and add a :not(.CodeMirror-secondarycursor) so we keep a distinct color for the helpful secondary cursor.
| Assignee | ||
Comment 8•5 years ago
|
||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
| bugherder | ||
Updated•5 years ago
|
Description
•