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