mirror of https://gitlab.com/basile.b/dexed.git
fix #345 - Auto insertion of leading `+` or `*` sometimes fails for the first line following `/**` / `/++`
This commit is contained in:
parent
c8c69e3f40
commit
e0d651b99a
|
@ -3007,7 +3007,6 @@ var
|
||||||
p: TPoint;
|
p: TPoint;
|
||||||
tk1: PLexToken = nil;
|
tk1: PLexToken = nil;
|
||||||
tk2: PLexToken = nil;
|
tk2: PLexToken = nil;
|
||||||
r: TStringRange = (ptr:nil; pos:0; len: 0);
|
|
||||||
begin
|
begin
|
||||||
// note: never use SelStart here. SelStart is updated too early
|
// note: never use SelStart here. SelStart is updated too early
|
||||||
// and matches to the future position, e.g the one after auto-indentation.
|
// and matches to the future position, e.g the one after auto-indentation.
|
||||||
|
@ -3022,18 +3021,7 @@ begin
|
||||||
if (tk1^.position < p) and (tk1^.kind in [ltkComment, ltkIllegal])
|
if (tk1^.position < p) and (tk1^.kind in [ltkComment, ltkIllegal])
|
||||||
and (p <= tk2^.position) and (tk1^.Data[1] in ['*','+']) then
|
and (p <= tk2^.position) and (tk1^.Data[1] in ['*','+']) then
|
||||||
begin
|
begin
|
||||||
r.init(tk1^.Data);
|
exit(tk1^.Data[1]);
|
||||||
r.popUntil(#10)^.popFront;
|
|
||||||
if not r.empty then
|
|
||||||
r.popWhile([' ', #9]);
|
|
||||||
if not r.empty then
|
|
||||||
begin
|
|
||||||
if r.front in ['*','+'] then
|
|
||||||
exit(r.front)
|
|
||||||
else
|
|
||||||
exit(#0);
|
|
||||||
end
|
|
||||||
else exit(tk1^.Data[1])
|
|
||||||
end
|
end
|
||||||
else if (tk1^.position > p) then
|
else if (tk1^.position > p) then
|
||||||
exit;
|
exit;
|
||||||
|
|
Loading…
Reference in New Issue