SynEdit: smart previous word fix bug:

BUG: abc d|ef -> abc| def
FIX: abc d|ef -> abc |def

git-svn-id: trunk@57894 -
This commit is contained in:
ondrej 2018-05-11 00:14:19 +00:00
parent 3efecb9efa
commit c25de54334

View File

@ -4172,9 +4172,11 @@ begin
CheckLineStart(CX, CY);
end;
swbWordSmart, swbWordSmartSel: begin
if CX>1 then // step over 1 char gap
Dec(CX);
NX := WordBreaker.PrevWordStart(Line, Min(CX, Length(Line) + 1));
Dec(CX); // step over 1 char gap
if WordBreaker.IsAtWordStart(Line, CX) then
NX := CX
else
NX := WordBreaker.PrevWordStart(Line, Min(CX, Length(Line) + 1));
CX := WordBreaker.PrevWordEnd(Line, Min(CX, Length(Line) + 1));
if (NX>CX-1) then // select the nearest