SynEdit: fixed delete-next-word, if caret past eol. Issue #0022890

git-svn-id: trunk@38672 -
This commit is contained in:
martin 2012-09-15 16:17:57 +00:00
parent da1c21cc33
commit e6d8010f3c
2 changed files with 10 additions and 4 deletions

View File

@ -6294,10 +6294,8 @@ begin
FInternalBlockSelection.StartLineBytePos := WP;
FInternalBlockSelection.EndLineBytePos := LogicalCaretXY;
FInternalBlockSelection.ActiveSelectionMode := smNormal;
FInternalBlockSelection.SetSelTextPrimitive(smNormal, nil);
if Helper <> '' then
FTabbedLinesView.EditInsert(CaretX, CaretY, Helper);
FCaret.BytePos := FInternalBlockSelection.StartBytePos + length(Helper);
FInternalBlockSelection.SetSelTextPrimitive(smNormal, PChar(Helper));
FCaret.BytePos := FInternalBlockSelection.StartBytePos;
end;
end;
ecDeleteLastWord, ecDeleteBOL:

View File

@ -742,6 +742,8 @@ begin
end;
procedure TTestBasicSynEdit.TestCaretDeleteWord_LastWord;
var
AllowPastEOL: Boolean;
function TestLines: TStringArray;
begin
@ -779,6 +781,9 @@ procedure TTestBasicSynEdit.TestCaretDeleteWord_LastWord;
TrimEnabled := False;;
ReCreateEdit;
if AllowPastEOL
then SynEdit.Options := SynEdit.Options + [eoScrollPastEol]
else SynEdit.Options := SynEdit.Options - [eoScrollPastEol];
SynEdit.TabWidth := 7;
// 1 6 11 14
SetLines(TestLines);
@ -823,6 +828,7 @@ procedure TTestBasicSynEdit.TestCaretDeleteWord_LastWord;
end;
begin
AllowPastEOL := True;
{%region word left}
TestWordLeft('simple "te|st"', 16, 1, 14, 1, [1,'Some text to st'],
11, 1, [1,'Some text st']);
@ -933,6 +939,8 @@ begin
8, 6, [6, 'umlaute in text']);
TestWordRight('After Umlaut > EOL, next line', 18, 6, 18, 6, [6, 'umlaute äää in te'],
18, 6, [6, 6, 'umlaute äää in te'+TestLines[6]]);
// past eol
TestWordRight('Umlaut EOW "äää in text |"', 21, 6, 21, 6, [6, 6, 'umlaute äää in text normal line']);
//TestWordRight('Before untrimmed > next', 12, 7, 4, 8,
// 14, 8);