当lazarus使用中文变量等代码补全时列表没对应的中文变量的:
解决方法:
打开相应文件,添加红字代码,修改后重新编译lazarus就可以。
找到procedure InitCharTable;(lazarus 3.4在63行)
procedure InitCharTable; var c:char; begin for c:=low(char) to high(char) do case c of 'a'..'z','A'..'Z','_',#$80..#$FF:CharTable[c]:=ctWordBegin; '0'..'9':CharTable[c]:=ctWord; else CharTable[c]:=ctNone; end; end;
2、\lazarus\ide\sourceeditor.pp
找到procedure TSourceEditor.StartWordCompletionBox;(lazarus 3.4在5420行)
procedure TSourceEditor.StartWordCompletionBox; var TextS: String; LogCaret: TPoint; i: Integer; TextS2: String; Completion: TSourceEditCompletion; begin if (FEditor.ReadOnly) then exit; Completion := Manager.DefaultCompletionForm; if (Completion.CurrentCompletionType<>ctNone) then exit; Completion.CurrentCompletionType:=ctWordCompletion; TextS := FEditor.LineText; LogCaret:=FEditor.LogicalCaretXY; Completion.Editor:=FEditor; i := LogCaret.X - 1; if i > length(TextS) then TextS2 := '' else begin while (i > 0) and (TextS[i] in ['a'..'z','A'..'Z','0'..'9','_',#$80..#$FF]) do dec(i); TextS2 := Trim(copy(TextS, i + 1, LogCaret.X - i - 1)); end; Completion.Execute (TextS2, Manager.GetScreenRectForToken(FEditor, FEditor.CaretX-length(TextS2), FEditor.CaretY, FEditor.CaretX-1)); end;
修改后中文也可以使用代码补全功能(Ctrl+W):
标签:Completion,中文,补全,..,TextS2,TextS,lazarus,FEditor From: https://www.cnblogs.com/qiufeng2014/p/18422285