Skip to content

Appearance

Pass theme and settings into SweetEditor, or call applyTheme / setSettings after ready.

Colors are packed ARGB Int (0xAARRGGBB). Use .toInt() on hex literals above 0x7FFFFFFF.

EditorSettings

FieldDefaultNotes
wrapModeNONECHAR_BREAK, WORD_BREAK
tabSize4
insertSpacestrue
lineSpacingAdd0fExtra pixels
lineSpacingMult1.2f
scale1fVisual zoom seed
fontSizeSp14f
readOnlyfalse
gutterVisibletrue
gutterStickyplatform defaultSticky line numbers
currentLineRenderModeBACKGROUNDBORDER, NONE
foldArrowModeALWAYSAUTO, HIDDEN
renderWhitespaceNONEBOUNDARY, SELECTION, TRAILING, ALL
renderLineBreaksfalse
autoIndentModeKEEP_INDENTor NONE
backspaceUnindenttrue
decorationOverscanViewportMultiplier1fExtra viewport for providers
decorationScrollRefreshMinIntervalMs50Throttle

EditorTheme

EditorTheme.dark() is the default constructor. EditorTheme.light() is a white-background preset.

Notable groups:

  • Surface: backgroundColor, textColor, cursorColor, currentLineColor
  • Gutter: lineNumberColor, currentLineNumberColor, splitLineColor, gutterIconColor
  • Scrollbar: scrollbarTrackColor, scrollbarThumbColor, scrollbarThumbActiveColor
  • Selection / links / CodeLens / search / diagnostics / highlights / linked-editing / brackets
  • Diff: diffAdded* / diffRemoved*
  • Menus and inline suggestion bar
  • fontFamily (FontFamily.Monospace by default)
  • rangeEffects: EditorRangeEffects? — optional per-range overrides

EditorRangeEffectStyle has foregroundColor, backgroundColor, borderColor, underlineColor, underlineStyle (NONE, SOLID, DASHED, WAVY).

If rangeEffects is null, the theme color fields are mapped automatically (selection background, wavy diagnostics, solid IME underline, …).