Index: Editor.cpp
===================================================================
--- Editor.cpp	(wersja 9063)
+++ Editor.cpp	(kopia robocza)
@@ -119,8 +119,8 @@
 		pi.bottom = GetPageY(sb + sz.cy);
 		pi.usecache = true;
 		pi.sizetracking = sizetracking;
-		pi.showcodes = showcodes;
-		pi.showlabels = !IsNull(showcodes) && viewborder >= 16;
+		pi.showcodes = GetNonprintableCharactersColor();
+		pi.showlabels = !IsNull(GetNonprintableCharactersColor()) && viewborder >= 16;
 		if(spellcheck)
 			pi.spellingchecker = SpellParagraph;
 		if(IsSelection()) {
@@ -135,7 +135,7 @@
 		}
 		text.Paint(pw, pagesz, pi);
 	}
-	w.DrawRect(tr.left, GetPosY(py) - sb, 20, 3, showcodes);
+	w.DrawRect(tr.left, GetPosY(py) - sb, 20, 3, GetNonprintableCharactersColor());
 	if(objectpos >= 0) {
 		Rect r = objectrect;
 		r.Offset(tr.left, -sb);
@@ -310,6 +310,11 @@
 	}
 }
 
+Color RichEdit::GetNonprintableCharactersColor()
+{
+	return nonprintable_characters ? showcodes : Color();
+}
+
 int  RichEdit::GetNearestPos(int x, PageY py)
 {
 	int c = text.GetPos(x, py, pagesz);
@@ -471,9 +476,16 @@
 	RefreshBar();
 }
 
+void RichEdit::NonprintableCharacters()
+{
+	nonprintable_characters = !nonprintable_characters;
+	Refresh();
+	RefreshBar();
+}
+
 void RichEdit::SerializeSettings(Stream& s)
 {
-	int version = 3;
+	int version = 4;
 	s / version;
 	s % unit;
 	s % showcodes;
@@ -488,11 +500,14 @@
 	s % findreplace.ignorecase;
 	RefreshBar();
 	imagefs.Serialize(s);
-	if(version >= 3)
+	if(version >= 3) {
 		for(int i = 0; i < 20; i++) {
 			StyleKey& k = stylekey[i];
 			s % k.styleid % k.stylename % k.face % k.height % k.ink % k.paper;
 		}
+	}
+	if(version >= 4)
+		s % nonprintable_characters;
 }
 
 void RichEdit::Reset()
@@ -626,7 +641,9 @@
 
 	showcodes = LtBlue;
 	spellcheck = true;
-
+	
+	nonprintable_characters = false;
+	
 	overwrite = false;
 
 	sb.WhenScroll = THISBACK(Scroll);
Index: RichEdit.h
===================================================================
--- RichEdit.h	(wersja 9063)
+++ RichEdit.h	(kopia robocza)
@@ -283,8 +283,10 @@
 	Color                    showcodes;
 	int                      zoom;
 	bool                     spellcheck;
+	bool                     nonprintable_characters;
 	bool                     paintcarect;
 
+
 	int                      undoserial;
 	bool                     incundoserial;
 	
@@ -294,7 +296,7 @@
 	
 	PaintInfo                paint_info;
 	bool                     ignore_physical_size;
-
+	
 	static int fh[];
 
 	struct UndoRec {
@@ -569,7 +571,10 @@
 
 	void SetupUnits();
 	void SpellCheck();
-
+	
+	void  NonprintableCharacters();
+	Color GetNonprintableCharactersColor();
+	
 	void    AddUserDict();
 	WString GetWordAtCursor();
 
@@ -720,6 +725,7 @@
 	void   LanguageTool(Bar& bar, int width = Zx(60));
 	void   HyperlinkTool(Bar& bar, int width = Zx(180), dword key = 0, const char *tip = NULL);
 	void   SpellCheckTool(Bar& bar);
+	void   NonprintableCharactersTool(Bar& bar);
 	void   IndexEntryTool(Bar& bar, int width = Zx(80), dword key = 0, const char *tip = NULL);
 
 	void   LeftTool(Bar& bar, dword key = K_CTRL_L);
@@ -791,6 +797,7 @@
 	RichEdit&       ViewBorder(int cx)                     { viewborder = cx; Refresh(); return *this; }
 	RichEdit&       ShowCodes(Color c)                     { showcodes = c; Refresh(); return *this; }
 	RichEdit&       Unit(int u)                            { unit = u; Refresh(); return *this; }
+	RichEdit&       NonprintableCharacters(bool b = true)  { nonprintable_characters = b; Refresh(); return *this; }
 	RichEdit&       SpellCheck(bool b)                     { spellcheck = b; Refresh(); return *this; }
 	RichEdit&       SetZoom(int z)                         { zoom = z; Refresh(); return *this; }
 	RichEdit&       SetContext(void *ctx)                  { context = ctx; Refresh(); return *this; }
Index: RichEdit.iml
===================================================================
--- RichEdit.iml	(wersja 9063)
+++ RichEdit.iml	(kopia robocza)
@@ -67,6 +67,7 @@
 IMAGE_ID(PageNumber)
 IMAGE_ID(PageCount)
 IMAGE_ID(sss)
+IMAGE_ID(NonprintableCharacters)
 
 IMAGE_BEGIN_DATA
 IMAGE_DATA(120,156,237,90,177,146,26,49,12,37,147,76,224,82,229,19,168,249,128,75,9,147,15,72,197,213,201,79,144,84,1,106)
@@ -175,27 +176,28 @@
 IMAGE_END_DATA(1184, 17)
 
 IMAGE_BEGIN_DATA
-IMAGE_DATA(120,156,237,151,189,106,27,65,16,199,183,50,118,119,77,64,141,141,106,57,79,16,12,242,11,8,140,65,38,165,74,65)
-IMAGE_DATA(32,207,160,132,164,83,161,194,110,212,184,146,139,83,149,38,168,17,168,83,99,140,8,106,68,32,66,38,69,68,26,145)
-IMAGE_DATA(23,88,107,86,183,119,251,121,251,117,150,29,161,129,225,238,124,247,187,249,207,204,238,232,140,34,20,161,35,132,49,42)
-IMAGE_DATA(206,176,135,115,60,181,86,171,133,77,246,28,60,112,182,110,138,15,87,136,198,209,157,239,50,31,216,255,23,215,255,2)
-IMAGE_DATA(188,135,23,99,251,97,176,165,97,160,243,61,191,231,5,222,195,139,177,45,15,3,43,126,52,26,17,135,98,210,115,240)
-IMAGE_DATA(245,189,170,197,251,57,126,48,24,144,243,82,169,84,93,27,238,245,122,88,52,145,87,108,248,148,101,143,243,249,92,201)
-IMAGE_DATA(67,60,136,11,108,20,69,74,150,30,243,244,211,235,28,182,106,170,31,83,51,233,200,196,193,90,94,179,136,217,222,188)
-IMAGE_DATA(54,222,101,152,43,6,186,118,253,177,110,171,223,135,247,244,112,131,97,16,96,32,162,30,200,187,188,163,142,194,138,17)
-IMAGE_DATA(60,168,144,186,113,182,250,85,60,203,138,249,185,214,22,79,167,155,237,2,199,122,221,57,95,211,239,24,241,109,241,113)
-IMAGE_DATA(108,204,65,26,164,44,123,126,142,240,199,15,8,127,249,164,247,247,87,50,175,101,63,51,158,176,111,79,185,62,165,44)
-IMAGE_DATA(220,131,103,168,62,11,22,209,103,41,203,197,100,116,128,46,5,155,242,150,46,175,173,192,97,160,50,8,84,241,16,135)
-IMAGE_DATA(4,134,156,99,11,87,240,149,0,158,203,69,55,217,133,47,150,61,191,59,124,232,250,41,116,253,58,120,184,177,195,192)
-IMAGE_DATA(240,41,101,52,120,238,223,223,56,241,126,122,238,202,255,184,191,198,151,23,103,158,124,159,176,135,135,7,28,111,147,15)
-IMAGE_DATA(171,127,125,201,241,54,249,228,241,160,9,242,242,229,179,154,244,115,63,121,105,254,192,179,207,139,252,38,159,190,84,163)
-IMAGE_DATA(172,119,217,125,141,126,233,111,38,93,124,61,99,73,83,94,63,81,178,232,89,253,166,154,170,242,249,243,120,151,198,127)
-IMAGE_DATA(252,121,107,140,175,242,78,231,171,21,175,239,241,70,187,205,154,48,231,228,190,71,180,123,252,249,134,65,236,37,84,183)
-IMAGE_DATA(24,253,248,77,252,70,163,129,203,229,50,59,69,171,182,241,207,222,85,8,11,239,96,254,191,52,108,102,185,81,191,127)
-IMAGE_DATA(245,210,77,110,207,103,249,179,67,130,106,81,111,58,153,71,194,175,200,247,111,114,159,120,62,115,208,45,198,63,57,126)
-IMAGE_DATA(35,229,105,30,6,49,167,69,197,171,235,193,215,210,149,135,222,129,222,233,195,141,81,191,138,135,90,139,245,163,239,42)
-IMAGE_DATA(102,141,250,242,254,123,204,106,24,236,154,45,151,75,220,108,54,185,70,182,219,109,151,79,42,194,116,187,93,12,239,162)
-IMAGE_DATA(215,227,241,216,247,179,140,240,147,201,196,137,95,44,22,184,86,171,17,118,56,28,186,198,230,242,159,205,102,206,218,87)
-IMAGE_DATA(171,21,173,27,241,164,22,62,230,155,131,47,159,246,47,233,25,113,200,199,6,78,250,20,92,191,255,197,158,0,176,219)
-IMAGE_DATA(171,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
-IMAGE_END_DATA(736, 8)
+IMAGE_DATA(120,156,237,152,189,170,26,65,20,128,167,10,55,221,130,4,108,18,172,44,76,158,32,92,216,251,2,66,8,24,82,90)
+IMAGE_DATA(10,129,52,190,128,9,73,103,113,139,164,208,38,149,41,214,42,77,176,17,236,108,66,144,96,35,129,136,151,20,145,52)
+IMAGE_DATA(146,23,152,120,198,157,221,153,157,153,157,191,213,155,200,30,56,236,172,187,223,156,191,153,227,40,10,80,128,238,34,140)
+IMAGE_DATA(81,113,130,29,148,227,169,244,122,61,172,147,99,240,192,153,170,206,62,220,33,106,71,53,62,103,222,179,254,183,238,255)
+IMAGE_DATA(45,240,14,90,140,148,205,224,68,205,64,165,37,95,242,25,222,65,139,145,19,55,3,35,126,54,155,17,133,100,210,49)
+IMAGE_DATA(232,254,89,104,48,63,199,79,38,19,50,174,86,171,225,94,240,104,52,194,89,201,242,146,13,159,176,236,117,189,94,75)
+IMAGE_DATA(121,176,7,118,129,13,130,64,202,210,107,158,255,244,62,135,13,117,249,99,114,38,92,25,59,88,201,43,22,49,91,155)
+IMAGE_DATA(127,141,183,105,230,146,134,174,92,127,172,154,250,239,194,59,170,191,64,51,240,16,112,162,229,201,219,204,209,66,126,201)
+IMAGE_DATA(240,110,84,72,94,56,83,255,101,60,203,102,227,179,205,45,94,46,15,219,5,174,173,150,117,188,186,239,49,162,167,226)
+IMAGE_DATA(163,72,27,131,208,72,89,246,234,10,225,151,47,16,126,243,74,173,207,159,137,188,146,125,205,104,204,62,122,200,213,41)
+IMAGE_DATA(97,225,25,188,67,253,51,96,17,125,151,178,156,77,198,15,240,75,194,38,188,161,138,107,203,179,25,200,4,12,53,28)
+IMAGE_DATA(156,67,25,134,140,177,129,74,248,134,7,207,197,162,234,236,153,19,75,201,159,15,239,187,126,10,93,191,22,234,47,108)
+IMAGE_DATA(51,208,28,165,180,2,239,253,249,29,197,58,78,198,182,252,183,47,239,240,211,39,151,142,252,152,176,23,23,119,56,222)
+IMAGE_DATA(36,30,214,255,253,45,199,155,196,147,199,131,79,16,151,43,159,230,100,156,123,228,165,241,3,207,190,159,229,15,241,140)
+IMAGE_DATA(133,28,165,181,75,159,43,252,23,62,211,249,197,231,51,18,124,202,171,39,138,23,61,235,191,46,167,178,120,126,221,124)
+IMAGE_DATA(76,236,223,124,255,160,181,47,211,235,235,183,70,188,186,198,7,223,77,214,132,62,38,251,61,162,220,227,199,107,6,145)
+IMAGE_DATA(147,163,170,197,232,198,31,236,183,219,109,92,171,213,216,46,26,154,218,191,124,220,32,44,204,193,252,190,212,108,102,177)
+IMAGE_DATA(80,63,127,140,146,77,110,206,167,241,179,77,130,250,34,223,116,34,143,50,223,34,159,63,137,117,226,249,84,193,239,172)
+IMAGE_DATA(253,7,247,239,9,113,234,155,65,196,249,34,227,229,249,224,115,105,203,67,237,192,223,229,215,247,90,255,101,60,228,58)
+IMAGE_DATA(155,63,58,87,49,107,212,149,119,223,99,70,205,224,220,100,187,221,226,78,167,195,21,178,223,239,219,28,169,8,51,28)
+IMAGE_DATA(14,49,204,69,239,231,243,185,235,177,140,240,139,197,194,138,223,108,54,184,217,108,18,118,58,157,218,218,230,226,95,173)
+IMAGE_DATA(86,214,190,239,118,59,154,55,162,113,46,92,196,53,6,87,62,169,95,92,51,162,16,143,9,28,215,201,59,127,255,141)
+IMAGE_DATA(28,179,25,212,235,245,176,219,237,58,253,206,161,236,254,234,196,15,6,3,92,169,84,84,140,17,159,99,243,232,246,115)
+IMAGE_DATA(226,55,226,115,230,48,230,21,115,88,241,236,28,174,60,8,83,143,146,47,242,127,2,70,254,2,159,254,24,248,0,0)
+IMAGE_END_DATA(768, 9)
Index: Tool.cpp
===================================================================
--- Tool.cpp	(wersja 9063)
+++ Tool.cpp	(kopia robocza)
@@ -135,6 +135,12 @@
 	   .Check(spellcheck);
 }
 
+void RichEdit::NonprintableCharactersTool(Bar& bar)
+{
+	bar.Add(t_("Nonprintable characters"), RichEditImg::NonprintableCharacters(), USERBACK(NonprintableCharacters))
+		.Check(nonprintable_characters);
+}
+
 String PlusKeyDesc(const char *text, dword key)
 {
 	String r = text;
@@ -458,6 +464,7 @@
 	bar.Gap();
 	LanguageTool(bar);
 	SpellCheckTool(bar);
+	NonprintableCharactersTool(bar);
 	if(extended) {
 		bar.Gap();
 		IndexEntryTool(bar, INT_MAX);
