From f854d63a6baa37967715f7fb81dd69be07bbc471 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 25 May 2018 23:26:03 +0200 Subject: [PATCH] fix #327 - Block indentation always inserts spaces --- src/ce_editoroptions.pas | 12 +++++++++++- src/ce_synmemo.pas | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/ce_editoroptions.pas b/src/ce_editoroptions.pas index 1d251fd4..add2679b 100644 --- a/src/ce_editoroptions.pas +++ b/src/ce_editoroptions.pas @@ -706,7 +706,6 @@ begin anEditor.HighlightAllColor.Assign(fIdentifierMarkup); anEditor.LineHighlightColor.Assign(fCurrLineAttribs); anEditor.TabWidth := tabulationWidth; - anEditor.BlockIndent := blockIndentation; anEditor.ExtraLineSpacing := lineSpacing; anEditor.ExtraCharSpacing := characterSpacing; anEditor.Options := options1; @@ -727,6 +726,17 @@ begin anEditor.setDscannerOptions(fDscannerEnabled, fDscannerDelay); anEditor.scrollPreview:=fScrollPreview; + if not (eoTabsToSpaces in options1) then + begin + anEditor.BlockIndent := 0; + anEditor.BlockTabIndent := 1; + end + else + begin + anEditor.BlockIndent := blockIndentation; + anEditor.BlockTabIndent := 0; + end; + cs := []; for c in fCloseCompletionCharsWithSpace do include(cs, c); diff --git a/src/ce_synmemo.pas b/src/ce_synmemo.pas index f2d2664f..41ecb940 100644 --- a/src/ce_synmemo.pas +++ b/src/ce_synmemo.pas @@ -3608,6 +3608,16 @@ begin free; end; end; + if not (eoTabsToSpaces in Options) then + begin + BlockIndent := 0; + BlockTabIndent := 1; + end + else + begin + BlockIndent := TabWidth; + BlockTabIndent := 0; + end; end; end;