Scintilla has recently added some support for bidirectional text on Windows and a ‘bidirectional’ property is now available in SciTE to control it. Bidirectional support allows text that contains Arabic or Hebrew characters (which are drawn from right to left) to be edited more correctly.
The main changes in bidirectional mode are that selections and indicators should cover the correct characters which may man that two visual ranges are drawn. Carets should be drawn in the correct location. This means that pressing the right arrow to move through Arabic text will actually move the caret to the left. Mouse clicks and hovers should resolve to the correct position so clicking will show a caret near the click in most cases.
The implementation works with the most common modes but has issues with less common settings such as virtual space. In bidirectional mode, selections in virtual space may not be visible but the caret should be. However, if the last character on a line is Arabic then a mouse click will place the caret at the line end - not in virtual space.
The ‘bidirectional’ property may be set to
0 - disabled, like previous SciTE
1 - enabled, with text left-justified
2 - *not yet implemented* enabled, with text right justified
SciTE should be using DirectWrite (technology=1) and the file must be UTF-8.
The limitations mean that this mode is experimental and the ‘bidirectional’ property will not be described in the documentation for now.
The code is in the repository. Test source and executables are available from:
https://www.scintilla.org/scite.zip Source
https://www.scintilla.org/wscite.zip Windows executable
Most of the work on bidirectional text was contributed by Uniface and implemented by Raghda Morsy.
Neil