diff --git a/src/Notepad3.c b/src/Notepad3.c index 4d3757d90..610807a11 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -2520,6 +2520,9 @@ static void _InitializeSciEditCtrl(HWND hwndEditCtrl) SciCall_SetMarginTypeN(MARGIN_SCI_FOLDING, SC_MARGIN_COLOUR); SciCall_SetMarginMaskN(MARGIN_SCI_FOLDING, SC_MASK_FOLDERS); + //~SciCall_SetMarginLeft(1); ~ set by STYLE_INDENTGUIDE + //~SciCall_SetMarginRight(1); + SciCall_SetEOLMode(Settings.DefaultEOLMode); SciCall_SetPasteConvertEndings(true); SciCall_UsePopUp(SC_POPUP_TEXT); diff --git a/src/SciCall.h b/src/SciCall.h index 54d045ced..ec75f18d2 100644 --- a/src/SciCall.h +++ b/src/SciCall.h @@ -662,6 +662,8 @@ DeclareSciCallV2(SetMarginCursorN, SETMARGINCURSORN, uintptr_t, margin, int, cur DeclareSciCallV2(SetFoldMarginColour, SETFOLDMARGINCOLOUR, bool, useSetting, COLORREF, colour); DeclareSciCallV2(SetFoldMarginHiColour, SETFOLDMARGINHICOLOUR, bool, useSetting, COLORREF, colour); DeclareSciCallV01(SetDefaultFoldDisplayText, SETDEFAULTFOLDDISPLAYTEXT, const char*, text); +DeclareSciCallV01(SetMarginLeft, SETMARGINLEFT, int, width); +DeclareSciCallV01(SetMarginRight, SETMARGINRIGHT, int, width); DeclareSciCallR2(TextWidth, TEXTWIDTH, int, int, styleNumber, const char *, text); diff --git a/src/Styles.c b/src/Styles.c index 4c7f2c1c2..254ae7182 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -4100,9 +4100,17 @@ void Style_SetStyles(HWND hwnd, const int iStyle, LPCWSTR lpszStyle, const float } // Size values are relative to BaseFontSize/CurrentFontSize - float fFontSize = fBaseFontSize; - Style_StrGetSizeFloatEx(lpszStyle, &fFontSize); - SendMessage(hwnd, SCI_STYLESETSIZEFRACTIONAL, iStyle, f2int(fFontSize * SC_FONT_SIZE_MULTIPLIER)); + if (iStyle != STYLE_INDENTGUIDE) { + float fFontSize = fBaseFontSize; + Style_StrGetSizeFloatEx(lpszStyle, &fFontSize); + SendMessage(hwnd, SCI_STYLESETSIZEFRACTIONAL, iStyle, f2int(fFontSize * SC_FONT_SIZE_MULTIPLIER)); + } + else { + float fWidth = 1.0; + Style_StrGetSizeFloatEx(lpszStyle, &fWidth); + int const width = clampi(f2int(fWidth), 0, 256); + SciCall_SetMarginLeft(width); + } char localeNameA[LOCALE_NAME_MAX_LENGTH] = "en-us\0"; #if defined(HAVE_DYN_LOAD_LIBS_MUI_LNGS)