diff -r 9a21022f5e68 doc/ScintillaDoc.html
--- a/doc/ScintillaDoc.html	Thu Dec 14 10:28:52 2017 +1100
+++ b/doc/ScintillaDoc.html	Tue Dec 19 14:47:54 2017 +1100
@@ -3594,6 +3594,8 @@
      <a class="message" href="#SCI_GETCODEPAGE">SCI_GETCODEPAGE &rarr; int</a><br />
      <a class="message" href="#SCI_SETIMEINTERACTION">SCI_SETIMEINTERACTION(int imeInteraction)</a><br />
      <a class="message" href="#SCI_GETIMEINTERACTION">SCI_GETIMEINTERACTION &rarr; int</a><br />
+     <a class="message" href="#SCI_SETBIDIRECTIONAL">SCI_SETBIDIRECTIONAL(int bidirectional)</a><br />
+     <a class="message" href="#SCI_GETBIDIRECTIONAL">SCI_GETBIDIRECTIONAL &rarr; int</a><br />
      <a class="message" href="#SCI_GRABFOCUS">SCI_GRABFOCUS</a><br />
      <a class="message" href="#SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</a><br />
      <a class="message" href="#SCI_GETFOCUS">SCI_GETFOCUS &rarr; bool</a><br />
@@ -3718,6 +3720,24 @@
      and the inline behaviour with <code>SCI_SETIMEINTERACTION(SC_IME_INLINE)</code>.
      Scintilla may ignore this call in some cases. For example, the inline behaviour might only be supported for some languages.</p>
 
+    <p><b id="SCI_SETBIDIRECTIONAL">SCI_SETBIDIRECTIONAL(int bidirectional)</b><br />
+     <b id="SCI_GETBIDIRECTIONAL">SCI_GETBIDIRECTIONAL &rarr; int</b><br />
+     Some languages, like Arabic and Hebrew, are written from right to left instead of from left to right as English is.
+     Documents that use multiple languages may contain both directions and this is termed "bidirectional".
+     The default text direction may be right to left or left to right.
+     Scintilla only correctly displays bidirectional text on some platforms and there can be additional processing and storage
+     costs to this.
+     Currently, bidirectional text only works on Win32 using DirectWrite.
+     As some applications may not want to pay the costs, bidirectional support must be explicitly enabled by calling
+     <code>SCI_SETBIDIRECTIONAL(SC_BIDIRECTIONAL_L2R)</code> (1) which chooses left to right as the default direction or
+     <code>SCI_SETBIDIRECTIONAL(SC_BIDIRECTIONAL_R2L)</code> (2) for default right to left.
+     This should be done after setting the technology to <code>SC_TECHNOLOGY_DIRECTWRITE</code>,
+     <code>SC_TECHNOLOGY_DIRECTWRITERETAIN</code>, or
+     <code>SC_TECHNOLOGY_DIRECTWRITEDC</code>.</p>
+     <p>If the call succeeded <code>SCI_GETBIDIRECTIONAL</code> will return the same value otherwise
+     <code>SC_BIDIRECTIONAL_DISABLED</code> (0) is returned.
+     </p>
+
     <p><b id="SCI_GRABFOCUS">SCI_GRABFOCUS</b><br />
      <b id="SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</b><br />
      <b id="SCI_GETFOCUS">SCI_GETFOCUS &rarr; bool</b><br />
diff -r 9a21022f5e68 include/Scintilla.h
--- a/include/Scintilla.h	Thu Dec 14 10:28:52 2017 +1100
+++ b/include/Scintilla.h	Tue Dec 19 14:47:54 2017 +1100
@@ -107,6 +107,11 @@
 #define SC_IME_INLINE 1
 #define SCI_GETIMEINTERACTION 2678
 #define SCI_SETIMEINTERACTION 2679
+#define SC_BIDIRECTIONAL_DISABLED 0
+#define SC_BIDIRECTIONAL_L2R 1
+#define SC_BIDIRECTIONAL_R2L 2
+#define SCI_GETBIDIRECTIONAL 2708
+#define SCI_SETBIDIRECTIONAL 2709
 #define MARKER_MAX 31
 #define SC_MARK_CIRCLE 0
 #define SC_MARK_ROUNDRECT 1
diff -r 9a21022f5e68 include/Scintilla.iface
--- a/include/Scintilla.iface	Thu Dec 14 10:28:52 2017 +1100
+++ b/include/Scintilla.iface	Tue Dec 19 14:47:54 2017 +1100
@@ -266,6 +266,17 @@
 # Choose to display the the IME in a winow or inline.
 set void SetIMEInteraction=2679(int imeInteraction,)
 
+enu Bidirectional=SC_BIDIRECTIONAL_
+val SC_BIDIRECTIONAL_DISABLED=0
+val SC_BIDIRECTIONAL_L2R=1
+val SC_BIDIRECTIONAL_R2L=2
+
+# Retrieve bidirectional text display state.
+get int GetBidirectional=2708(,)
+
+# Set bidirectional text display state.
+set void SetBidirectional=2709(int bidirectional,)
+
 enu MarkerSymbol=SC_MARK_
 val MARKER_MAX=31
 val SC_MARK_CIRCLE=0
diff -r 9a21022f5e68 src/EditModel.cxx
--- a/src/EditModel.cxx	Thu Dec 14 10:28:52 2017 +1100
+++ b/src/EditModel.cxx	Tue Dec 19 14:47:54 2017 +1100
@@ -63,6 +63,7 @@
 	highlightGuideColumn = 0;
 	primarySelection = true;
 	imeInteraction = imeWindowed;
+	bidirectional = Bidirectional::bidiDisabled;
 	foldFlags = 0;
 	foldDisplayTextStyle = SC_FOLDDISPLAYTEXT_HIDDEN;
 	hotspot = Range(Sci::invalidPosition);
diff -r 9a21022f5e68 src/EditModel.h
--- a/src/EditModel.h	Thu Dec 14 10:28:52 2017 +1100
+++ b/src/EditModel.h	Tue Dec 19 14:47:54 2017 +1100
@@ -38,6 +38,8 @@
 
 	enum IMEInteraction { imeWindowed, imeInline } imeInteraction;
 
+	enum class Bidirectional { bidiDisabled, bidiL2R, bidiR2L  } bidirectional;
+
 	int foldFlags;
 	int foldDisplayTextStyle;
 	ContractionState cs;
diff -r 9a21022f5e68 src/Editor.cxx
--- a/src/Editor.cxx	Thu Dec 14 10:28:52 2017 +1100
+++ b/src/Editor.cxx	Tue Dec 19 14:47:54 2017 +1100
@@ -6736,6 +6736,13 @@
 	case SCI_GETIMEINTERACTION:
 		return imeInteraction;
 
+	case SCI_SETBIDIRECTIONAL:
+		// SCI_SETBIDIRECTIONAL is implemented on platform subclasses if they support bidirectional text.
+		break;
+
+	case SCI_GETBIDIRECTIONAL:
+		return static_cast<sptr_t>(bidirectional);
+
 		// Marker definition and setting
 	case SCI_MARKERDEFINE:
 		if (wParam <= MARKER_MAX) {
diff -r 9a21022f5e68 win32/ScintillaWin.cxx
--- a/win32/ScintillaWin.cxx	Thu Dec 14 10:28:52 2017 +1100
+++ b/win32/ScintillaWin.cxx	Tue Dec 19 14:47:54 2017 +1100
@@ -1744,6 +1744,17 @@
 			}
 			break;
 
+		case SCI_SETBIDIRECTIONAL:
+			if (technology == SC_TECHNOLOGY_DEFAULT) {
+				bidirectional = EditModel::Bidirectional::bidiDisabled;
+			} else if ((wParam >= SC_BIDIRECTIONAL_DISABLED) && (wParam <= SC_BIDIRECTIONAL_R2L)) {
+				bidirectional = static_cast<EditModel::Bidirectional>(wParam);
+			}
+			// Invalidate all cached information including layout.
+			DropGraphics(true);
+			InvalidateStyleRedraw();
+			break;
+
 #ifdef SCI_LEXER
 		case SCI_LOADLEXERLIBRARY:
 			LexerManager::GetInstance()->Load(reinterpret_cast<const char *>(lParam));
