diff options
author | Neil <nyamatongwe@gmail.com> | 2021-10-30 15:06:22 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-10-30 15:06:22 +1100 |
commit | 87151521974e24af545a877c3a004769c8533246 (patch) | |
tree | 7c472b5ba977c9df8e167ca1639457ce1d27e275 | |
parent | d0e3010d187e074f378f85b9cfcf68f944e1ab45 (diff) | |
download | scintilla-mirror-87151521974e24af545a877c3a004769c8533246.tar.gz |
Ensure all ViewStyle fields are initialized.
-rw-r--r-- | src/ViewStyle.cxx | 14 | ||||
-rw-r--r-- | src/ViewStyle.h | 34 |
2 files changed, 17 insertions, 31 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 1458ea96f..3f4ace4a4 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -136,8 +136,6 @@ ViewStyle::ViewStyle(size_t stylesSize_) : Element::SelectionBack, Element::SelectionInactiveBack, }); - selection.layer = Layer::Base; - selection.eolFilled = false; foldmarginColour.reset(); foldmarginHighlightColour.reset(); @@ -155,15 +153,9 @@ ViewStyle::ViewStyle(size_t stylesSize_) : Element::Caret, Element::CaretAdditional, }); - caret.style = CaretStyle::Line; - caret.width = 1; elementColours.erase(Element::CaretLineBack); elementAllowsTranslucent.insert(Element::CaretLineBack); - caretLine.alwaysShow = false; - caretLine.subLine = false; - caretLine.layer = Layer::Base; - caretLine.frame = 0; someStylesProtected = false; someStylesForceCase = false; @@ -210,12 +202,6 @@ ViewStyle::ViewStyle(size_t stylesSize_) : ctrlCharPadding = 3; // +3 For a blank on front and rounded edge each side lastSegItalicsOffset = 2; - wrap.state = Wrap::None; - wrap.visualFlags = WrapVisualFlag::None; - wrap.visualFlagsLocation = WrapVisualLocation::Default; - wrap.visualStartIndent = 0; - wrap.indentMode = WrapIndentMode::Fixed; - localeName = localeNameDefault; } diff --git a/src/ViewStyle.h b/src/ViewStyle.h index f799c4943..ce6bd5642 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -47,40 +47,40 @@ inline std::optional<ColourRGBA> OptionalColour(Scintilla::uptr_t wParam, Scinti struct SelectionAppearance { // Whether to draw on base layer or over text - Scintilla::Layer layer; + Scintilla::Layer layer = Layer::Base; // Draw selection past line end characters up to right border - bool eolFilled; + bool eolFilled = false; }; struct CaretLineAppearance { // Whether to draw on base layer or over text - Scintilla::Layer layer; + Scintilla::Layer layer = Layer::Base; // Also show when non-focused - bool alwaysShow; + bool alwaysShow = false; // highlight sub line instead of whole line - bool subLine; + bool subLine = false; // Non-0: draw a rectangle around line instead of filling line. Value is pixel width of frame - int frame; + int frame = 0; }; struct CaretAppearance { // Line, block, over-strike bar ... - Scintilla::CaretStyle style; + Scintilla::CaretStyle style = CaretStyle::Line; // Width in pixels - int width; + int width = 1; }; struct WrapAppearance { // No wrapping, word, character, whitespace appearance - Scintilla::Wrap state; + Scintilla::Wrap state = Wrap::None; // Show indication of wrap at line end, line start, or in margin - Scintilla::WrapVisualFlag visualFlags; + Scintilla::WrapVisualFlag visualFlags = WrapVisualFlag::None; // Show indication near margin or near text - Scintilla::WrapVisualLocation visualFlagsLocation; + Scintilla::WrapVisualLocation visualFlagsLocation = WrapVisualLocation::Default; // How much indentation to show wrapping - int visualStartIndent; - // WrapIndentMode::Fixed, _SAME, _INDENT, _DEEPINDENT - Scintilla::WrapIndentMode indentMode; + int visualStartIndent = 0; + // WrapIndentMode::Fixed, Same, Indent, DeepIndent + Scintilla::WrapIndentMode indentMode = WrapIndentMode::Fixed; }; struct EdgeProperties { @@ -137,10 +137,10 @@ public: /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin int leftMarginWidth; ///< Spacing margin on left of text int rightMarginWidth; ///< Spacing margin on right of text - int maskInLine; ///< Mask for markers to be put into text because there is nowhere for them to go in margin - int maskDrawInText; ///< Mask for markers that always draw in text + int maskInLine = 0; ///< Mask for markers to be put into text because there is nowhere for them to go in margin + int maskDrawInText = 0; ///< Mask for markers that always draw in text std::vector<MarginStyle> ms; - int fixedColumnWidth; ///< Total width of margins + int fixedColumnWidth = 0; ///< Total width of margins bool marginInside; ///< true: margin included in text view, false: separate views int textStart; ///< Starting x position of text within the view int zoomLevel; |