Switching "Writing direction" is blocked in Web IDE and regular Editor
Switching "Writing direction" from LTR to RTL and back is blocked in both - Web IDE and regular Editor while editing files from git repositories. It does work in the Wiki editor or, for example, this "Issue editor". "Writing direction" should actually be switched automatically as soon as user starts a new line in an RTL language (e.g. Gmail does it).
Steps to reproduce
Go to any git repo, click on any file and try to edit it, either by pressing "Edit" or "Web IDE". Once in editing mode try to switch "Writing direction" from LTR to RTL (in Firefox by pressing "Ctrl+Shift+x"; in Chrome - mouse right button -> Writing direction -> Right to Left).
It can be done with any repository.
What is the current bug behavior?
(What actually happens) Nothing.
What is the expected correct behavior?
(What you should see instead) Text aligned to the right, like in Wiki editor or Issue editor, as in the attached screenshot. "Writing direction" should actually be switched automatically as soon as user starts a new line in an RTL language (e.g. Gmail does it).
Relevant logs and/or screenshots
It should be like this (here I show it with English text, but normally it would be Hebrew/Arabic/Persian):
Output of checks
This bug happens on GitLab.com
There are possible solutions that could solve this problem. However blocking the implementation of these solutions are known issues with the Monaco editor for the lack of support of RTL languages:
For an example of an IDE that supports RTL languages is with Jetbrain tools.
Manual solution: User toggles the text direction
This solution is similar to how writing direction is handled by browsers. This is how it is done with the wiki/issue editors currently in GitLab.
This is a rendition of how this solution could be surfaced within the Web IDE so that users could
Toggle writing direction which could handle scenarios where there are mixed languages used on the page.
Ideal solution: Auto detect
Automatically detect an RTL language (e.g. by the Unicode code of the first letters in a paragraph) and then switch writing direction to RTL automatically, the way Gmail does when writing an email. But at very least, don't block manual attempts to switch the writing direction. Also rendered .md/.org/etc files written in an RTL language should be displayed right aligned.