Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

View Whitespace

jacobslusser edited this page May 31, 2015 · 2 revisions

Scintilla has several properties for controlling the display and color of whitespace (space and tab characters). By default, whitespace is not visible. It can be made visible by setting the ViewWhitespace property. Since whitespace can be significant to some programming languages the default behavior is for the current lexer to set the color of whitespace. To override the default behavior the SetWhitespaceForeColor and SetWhitespaceBackColor methods can be used. To make whitespace visible and always display in an orange color (regardless of the current lexer), try:

// Display whitespace in orange
scintilla.WhitespaceSize = 2;
scintilla.ViewWhitespace = WhitespaceMode.VisibleAlways;
scintilla.SetWhitespaceForeColor(true, Color.Orange);