SynEdit: Prevent auto-unindent (on backspace) if a selection exists. Selection must be deleted instead.

git-svn-id: trunk@21681 -
This commit is contained in:
martin 2009-09-13 10:25:47 +00:00
parent 732549fe81
commit 50b14ade3c

View File

@ -146,6 +146,7 @@ type
end;
implementation
uses SynEdit;
{ TSynCustomBeautifier }
@ -220,6 +221,8 @@ begin
if (Command = ecDeleteLastChar) and
(FAutoIndent) and
(ACaret.CharPos > 1) and
( (not TSynEdit(FCurrentEditor).SelAvail) or
(eoPersistentBlock in TSynEdit(FCurrentEditor).Options2) ) and
(GetCurrentIndent(FCurrentEditor, ACaret.LineText, True) = ACaret.CharPos - 1)
then begin
UnIndentLine(ACaret, x);