Index: include/Scintilla.h
===================================================================
--- include/Scintilla.h	(revision 17275)
+++ include/Scintilla.h	(working copy)
@@ -201,6 +201,8 @@
 #define SCI_SETSELBACK 2068
 #define SCI_GETSELALPHA 2477
 #define SCI_SETSELALPHA 2478
+#define SCI_GETSELEOLFILLED 2479
+#define SCI_SETSELEOLFILLED 2480
 #define SCI_SETCARETFORE 2069
 #define SCI_ASSIGNCMDKEY 2070
 #define SCI_CLEARCMDKEY 2071
Index: include/Scintilla.iface
===================================================================
--- include/Scintilla.iface	(revision 17275)
+++ include/Scintilla.iface	(working copy)
@@ -442,6 +442,12 @@
 # Set the alpha of the selection.
 set void SetSelAlpha=2478(int alpha,)
 
+# Is the selection end of line filled?
+get bool GetSelEOLFilled=2479(,)
+
+# Set the selection to have its end of line filled or not.
+set void SetSelEOLFilled=2480(bool filled,)
+
 # Set the foreground colour of the caret.
 set void SetCaretFore=2069(colour fore,)
 
Index: src/ViewStyle.h
===================================================================
--- src/ViewStyle.h	(revision 17275)
+++ src/ViewStyle.h	(working copy)
@@ -60,6 +60,7 @@
 	ColourPair whitespaceBackground;
 	ColourPair selbar;
 	ColourPair selbarlight;
+	bool selEOLFilled;
 	bool foldmarginColourSet;
 	ColourPair foldmarginColour;
 	bool foldmarginHighlightColourSet;
Index: src/Editor.cxx
===================================================================
--- src/Editor.cxx	(revision 17275)
+++ src/Editor.cxx	(working copy)
@@ -2265,12 +2265,19 @@
 
 	rcSegment.left = xEol + vsDraw.aveCharWidth + xStart;
 	rcSegment.right = rcLine.right;
-	if (overrideBackground) {
-		surface->FillRectangle(rcSegment, background);
-	} else if (vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].eolFilled) {
-		surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated);
+	if (vsDraw.selEOLFilled && eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) {
+		surface->FillRectangle(rcSegment, SelectionBackground(vsDraw));
 	} else {
-		surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back.allocated);
+		if (overrideBackground) {
+			surface->FillRectangle(rcSegment, background);
+		} else if (vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].eolFilled) {
+			surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated);
+		} else {
+			surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back.allocated);
+		}
+		if (vsDraw.selEOLFilled && eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (vsDraw.selAlpha != SC_ALPHA_NOALPHA)) {
+			SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw), vsDraw.selAlpha);
+		}
 	}
 
 	if (drawWrapMarkEnd) {
@@ -6898,6 +6905,14 @@
 	case SCI_GETSELALPHA:
 		return vs.selAlpha;
 
+	case SCI_GETSELEOLFILLED:
+		return vs.selEOLFilled;
+
+	case SCI_SETSELEOLFILLED:
+		vs.selEOLFilled = wParam != 0;
+		InvalidateStyleRedraw();
+		break;
+
 	case SCI_SETWHITESPACEFORE:
 		vs.whitespaceForegroundSet = wParam != 0;
 		vs.whitespaceForeground.desired = ColourDesired(lParam);
Index: src/ViewStyle.cxx
===================================================================
--- src/ViewStyle.cxx	(revision 17275)
+++ src/ViewStyle.cxx	(working copy)
@@ -74,6 +74,7 @@
 	selbackground.desired = source.selbackground.desired;
 	selbackground2.desired = source.selbackground2.desired;
 	selAlpha = source.selAlpha;
+	selEOLFilled = source.selEOLFilled;
 
 	foldmarginColourSet = source.foldmarginColourSet;
 	foldmarginColour.desired = source.foldmarginColour.desired;
@@ -143,6 +144,7 @@
 	selbackground.desired = ColourDesired(0xc0, 0xc0, 0xc0);
 	selbackground2.desired = ColourDesired(0xb0, 0xb0, 0xb0);
 	selAlpha = SC_ALPHA_NOALPHA;
+	selEOLFilled = false;
 
 	foldmarginColourSet = false;
 	foldmarginColour.desired = ColourDesired(0xff, 0, 0);
