#283 Bi-directional support

None
closed
nobody
None
2
2013-08-18
2012-04-26
ebi
No

I type Persian script, but there are some problems, after one changes the direction of text from LtR to RtL !
When you are in RtL mode, and you press right arrow key, the cursor will move on next character ! But is not comfortable for RtL writers, the cursor must back to previous character and when you press left arrow key, you must go forward to next character of a word.

Furthermore, the keys Home and Shift don't work properly when you are in RtL mode.

Discussion

  • Tim Hoffmann
    Tim Hoffmann
    2012-04-29

    Proper rtl support would have to be provided by the editor component we use (QCodeEdit).

    For the moment you may change the key mapping and switch left and right:
    Options -> Shortcuts -> Editor -> Basic Key Mappings

     
  • ebi
    ebi
    2012-07-17

    thanks Mr. hoffmann
    but your idea is not so useful, because some time you need to insert left to right letters such as math formula, and math symbols or English letters on a script.

    is not possible that QCodeEdit repair that?
    i think it must be very simple; notepad( that is very simple editor) on windows support this feature without any problem.

     
  • Tim Hoffmann
    Tim Hoffmann
    2012-07-17

    I forwarded the issue to the QCE developer.

    Another workaround could be to define a script in User Tags:
    %SCRIPT
    cursor.movePosition(1, cursorEnums.Left)

    You could assign the shortcut Ctrl+Right to this (and also define the other counterpart). Then holding Ctrl effectively reverses the Left/Right keys. Of course, you still have to pay attention, if you are in LtR or RtL and use Ctrl accordingly, but it's already a little less awkward. It might even be possible to find out the mode in the script and move accordingly, but I don't have the time to lokk into that now.

     
  • QCE development seems to be dead, so i would not expect any help there. By the way, our version is anyway heavily patched, so better fix it here.

     
  • it's not dead, Luc is doing a lot of work on qcodeedit3 (which is a
    complete rewrite of qce2)

    But he is also always doing a lot of other things

    On 07/17/2012 03:34 PM, SourceForge.net wrote:

    Feature Requests

     
  • ebi
    ebi
    2012-07-17

    thanks a lot for your help, and i appreciate your time and consideration.

    your software is a genius one ( it has very useful features ), i have introduced it to my colleagues ...

     
  • Tim Hoffmann
    Tim Hoffmann
    2012-07-27

    Answer by Hugues (for the developers):
    The poor bidi support in QCE2 is a known issue. It should be possible to fix this particular problem by changing the behavior of QDocumentCursor::Left and QDocumentCursor::Right in QDocumentCursorHandle::movePosition (qdocument.cpp).
    You can detect potential RTL lines by checking if the current line handle has a valid m_layout field (QTextLayout) and use relevant methods from that class to do bidi-aware cursor movement.

     
  • Tim Hoffmann
    Tim Hoffmann
    2013-08-18

    we had bidi improvements in revs. 4022, 4036, 4037, 4043.

    Particularly the last two should fix your issues. Pease report back if there are still problems.

     
  • Tim Hoffmann
    Tim Hoffmann
    2013-08-18

    • status: open --> closed
    • Group: -->