-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTL layout for paragraphs starting with #65648
Comments
(Experimental duplicate detection) |
@vscodebot not related |
Thanks for assigning this :) What I am requesting is entering this code,
Which turns Into this, The hard part however is to fix the issues afterward like incorrect assumption of text place, So maybe you should do the direction detection in JavaScript so you will be in control of it and know what is its value. |
You can also use dir=auto but detect the assigned direction using getComputedStyle I guess, better however be in control of direction detection algorithm I guess however as it is done somewhere else on the code already AFAIK. |
Thank you for working on this! I would like my department at work (we correct translated HTML and work with Arabic and Hebrew) to start using VS Code but I know that the ability to view these RTL languages right-aligned will be a crucial requirement. We currently use Notepad++ which allows you to manually flip the entire file to be viewed as right-aligned but I like the implementation you are discussing which would only right-align lines that are in the RTL language. However, we edit English JSON files that have Arabic/Hebrew strings, so the beginning of the line is English but we would still need to view it RTL, so we would probably need a full-document right-align ability for it to be effective. Please let me know if you need help implementing this, I'm not quite sure where to start but am willing to assist. |
What's the status of this? I am also looking for this solution, and it looks like many people are looking for it as well. |
I strongly support this request. Connected to this issue, also consider how punctuation behaves in this matter. Right now, VS Code will place a period at the end of a sentence to the very right of the Arabic text, like: شيء مكتوب في اللغة العربية. [WRONG] Visibly different from: .شيء مكتوب في اللغة العربية [CORRECT] This can also mess up brackets, making them face the wrong way: )٢٣( [WRONG] Instead of: (٢٣) [CORRECT] |
@ebraminio I think the brackets problem arises because the paragraph direction is always set to LTR, as I've described here. Fixing the paragraph direction should fix the brackets issue. |
Even the fact paragraph direction solves the issue for some of the cases but it doesn't always solve the issue where paragraph or document direction is not the same as the text, like the two above comments, bidi bracket is a separate matter http://www.unicode.org/notes/tn39/ which deserves to get fixed separately, like your analysis, let's don't mix that to this where is possible to keep them separate, mixing them makes just harder to vscode devs to know what is needed to get fixed. |
@ebraminio Agreed. Which comments are you referring to? This comment is independent of paragraph direction, but AFAICT this comment happens because of paragraph direction -- AFAICT a period within an Arabic text run should render on the left, instead of on the right. @lwcvl Can you confirm this? |
درود |
#11770 is so vague that I can't even understand what is the requested feature... a clear and achievable change to VSCode for RTL is I believe starts from this, please make a paragraph RTL if it starts with RTL text.
Steps to reproduce:
Put this on gedit:
Now try the same with VSCode
Expected:
Easily achievable by adding
dir=auto
to div element and removedir=ltr
from the span, I just did it for the first lineAlternatively, you can put a switch (toggle-able with command switch, something like > Toggle Direction) and apply document direction switch to whole document and detect whether a document needs RTL direction behind the scene, if you don't like per paragraph direction setting.
The text was updated successfully, but these errors were encountered: