| Summary: | Bidi: In code editor (JS, Java, Ruby) we should enforce the text direction on the comments | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Moshe WAJNBERG <wajnberg> |
| Component: | Client | Assignee: | Grant Gayed <grant_gayed> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Silenio_Quarti, tomerm, wajnberg |
| Version: | unspecified | ||
| Target Milestone: | 13.0 | ||
| Hardware: | PC | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/77534 https://git.eclipse.org/r/79899 https://git.eclipse.org/r/80046 https://git.eclipse.org/r/80064 https://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=63002cb83553474d798f96d01df6b6e08eb1ad14 |
||
| Whiteboard: | |||
|
Description
Moshe WAJNBERG
New Gerrit change created: https://git.eclipse.org/r/77534 Hello Silenio, The goal of my changes is to enforce the text direction into a block comment Let's consider the following comment: /* This is a simple comment. */ If we enforce RTL text direction this comment should be displayed as: /* .This is a simple comment */ For now this comment is enclosed in a single span with the style comment block To properly enforce the text direction we should split this span into the 3 following spans: - 1st span will contain /* - 2nd span will contain : This is a simple comment. - 3rd span will contain */ Moreover we enforce the text direction of the second span by adding the dir attribute This is exactly what the function splitCommentRange is achieving. I am calling it from textview._createRange because it si the place where the ranges are being created. I hope it's a little bit clearer now Anyway please let me know if you have further questions/concerns Thank you very much for your review Best Regards What should happen if the comment has several lines? For example, /** * Line 1. * Line 2. */ Is the LTR Mark supposed to added to the beginning of every line (in between "*" and the rest of the line)? Hi Silenio. Overall we want to preserve following 2 things: 1. Syntax of comment (by syntax we relate to "//" or "/**" or "*/" 2. Text direction of comment independently for each row and based on user preferences for text direction. Specifically for sample comment you mentioned: a. We will preserve the syntax of comment - namely "/**" and "*/" will remain aligned to the left b. Regarding rest of lines we enforce text direction for entire line (square brackets indicate beginning and end of line) : [* Line 1.] [* Line 2.] Assuming text direction in user preferences is set to RTL we will get: /** .Line 1 * .Line 2 * */ Just in case you expected following display: /** * .Line 1 * .Line 2 */ We don't treat "*" character as part of comment in any special way. We have no idea if it has any special meaning. Please observe that similar visual effect can be achieved with different characters as well. For example: /** + Line 1. + Line 2. */ /** | Line 1. | Line 2. */ There is no way to understand which characters are used for decoration purpose and which relate to comment itself. I've released a fix that breaks comments down into *.start.*, * and *.end.* segments, commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=cfc39d52a59a12714a07d7ea76588a0edfed107a . Let me know if you need any additions/changes to these. In the meantime closing as FIXED. New Gerrit change created: https://git.eclipse.org/r/79899 New Gerrit change created: https://git.eclipse.org/r/80046 New Gerrit change created: https://git.eclipse.org/r/80064 Gerrit change https://git.eclipse.org/r/80064 was merged to [master]. Commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=63002cb83553474d798f96d01df6b6e08eb1ad14 |