diff options
| -rw-r--r-- | include/Scintilla.h | 1 | ||||
| -rw-r--r-- | include/Scintilla.iface | 2 | ||||
| -rw-r--r-- | src/Editor.cxx | 2 | ||||
| -rw-r--r-- | src/LineMarker.cxx | 12 | ||||
| -rw-r--r-- | src/LineMarker.h | 2 | 
5 files changed, 16 insertions, 3 deletions
| diff --git a/include/Scintilla.h b/include/Scintilla.h index 285f81a96..9d5edb70a 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -99,6 +99,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,  #define SC_MARK_CIRCLEPLUSCONNECTED 19  #define SC_MARK_CIRCLEMINUS 20  #define SC_MARK_CIRCLEMINUSCONNECTED 21 +#define SC_MARK_CHARACTER 10000  #define SC_MARKNUM_FOLDEREND 25  #define SC_MARKNUM_FOLDEROPENMID 26  #define SC_MARKNUM_FOLDERMIDTAIL 27 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 4bce389e9..3b7fc5594 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -229,6 +229,8 @@ val SC_MARK_CIRCLEPLUSCONNECTED=19  val SC_MARK_CIRCLEMINUS=20  val SC_MARK_CIRCLEMINUSCONNECTED=21 +val SC_MARK_CHARACTER=10000 +  # Markers used for outlining column  val SC_MARKNUM_FOLDEREND=25  val SC_MARKNUM_FOLDEROPENMID=26 diff --git a/src/Editor.cxx b/src/Editor.cxx index 73114f103..fecd4b08e 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -859,7 +859,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {  				if (marks) {  					for (int markBit = 0; (markBit < 32) && marks; markBit++) {  						if (marks & 1) { -							vs.markers[markBit].Draw(surface, rcMarker); +							vs.markers[markBit].Draw(surface, rcMarker, vs.styles[STYLE_LINENUMBER].font);  						}  						marks >>= 1;  					} diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index dc1468d83..9cb5d0d79 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -40,7 +40,7 @@ static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, C  	surface->FillRectangle(rcH, fore);  } -void LineMarker::Draw(Surface *surface, PRectangle &rcWhole) { +void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter) {  	// Restrict most shapes a bit  	PRectangle rc = rcWhole;  	rc.top++; @@ -230,6 +230,16 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole) {  		surface->MoveTo(centreX, rcWhole.top);  		surface->LineTo(centreX, centreY - blobSize); +	} else if (markType >= SC_MARK_CHARACTER) { +		char character[2]; +		character[0] = ' '; +		character[0] = markType - SC_MARK_CHARACTER; +		int width = surface->WidthText(fontForCharacter, character, 1); +		rc.left += (rc.Width() - width) / 2; +		rc.right = rc.left + width; +		surface->DrawTextClipped(rc, fontForCharacter, rc.bottom - 2,  +			character, 1, fore.allocated, back.allocated); +  	} else { // SC_MARK_SHORTARROW  		Point pts[] = {  			Point(centreX, centreY + dimOn2), diff --git a/src/LineMarker.h b/src/LineMarker.h index ee0f36c25..b9dd15d06 100644 --- a/src/LineMarker.h +++ b/src/LineMarker.h @@ -20,7 +20,7 @@ public:  		fore = Colour(0,0,0);  		back = Colour(0xff,0xff,0xff);  	} -	void Draw(Surface *surface, PRectangle &rc); +	void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter);  };  #endif | 
