mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 03:39:21 +02:00
SynEdit: clean up completion IsIdentifierChar
This commit is contained in:
parent
7d0db6e423
commit
57240dc768
@ -485,16 +485,11 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := p^ in ['a'..'z','A'..'Z','0'..'9','_'];
|
Result := p^ in ['a'..'z','A'..'Z','0'..'9','_'];
|
||||||
if Result then exit;
|
if Result then exit;
|
||||||
if p^ <= #127 then exit;
|
|
||||||
i := UTF8CodepointSize(p);
|
i := UTF8CodepointSize(p);
|
||||||
SetLength(u, i);
|
if i <= 1 then exit;
|
||||||
// wide chars of UTF-16 <= bytes of UTF-8 string
|
SetLength(u{%H-}, 3); // surrogate and trailing #0
|
||||||
if ConvertUTF8ToUTF16(PWideChar(u), i + 1, p, i, [toInvalidCharToSymbol], L) = trNoError
|
if ConvertUTF8ToUTF16(PWideChar(u), 3, p, i, [toInvalidCharToSymbol], L) = trNoError then
|
||||||
then begin
|
Result := TCharacter.IsLetterOrDigit(u, 1);
|
||||||
SetLength(u, L - 1);
|
|
||||||
if L > 1 then
|
|
||||||
Result := TCharacter.IsLetterOrDigit(u, 1);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSynBaseCompletionFormScrollBar }
|
{ TSynBaseCompletionFormScrollBar }
|
||||||
|
Loading…
Reference in New Issue
Block a user