You've already forked lazarus-ccr
chelper: *fix enum type converting, if used as function return type* improve expression converting* improve enumeration value assignment* implement writting unions* fixes type name and variable name selection (to avoid pascal names conflicts)* fix function converting with single void* parameter
* c-parsing fixes* IDE lock for multiple ctrl+b presses git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1272 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -144,6 +144,9 @@ begin
|
||||
txt:='';
|
||||
end;
|
||||
|
||||
var
|
||||
parsing : Boolean = False;
|
||||
|
||||
procedure TryParse;
|
||||
var
|
||||
editor : TSourceEditorInterface;
|
||||
@@ -153,26 +156,33 @@ var
|
||||
p : TPoint;
|
||||
st : TPoint;
|
||||
begin
|
||||
if parsing then Exit;
|
||||
if not Assigned(SourceEditorManagerIntf) or not Assigned(SourceEditorManagerIntf.ActiveEditor) then Exit;
|
||||
editor:=SourceEditorManagerIntf.ActiveEditor;
|
||||
|
||||
if Assigned(CtoPasConfig) then CtoPasConfig.UIToSettings;
|
||||
parsing:=True;
|
||||
try
|
||||
editor:=SourceEditorManagerIntf.ActiveEditor;
|
||||
|
||||
i:=editor.CursorTextXY.Y;
|
||||
dec(i);
|
||||
if i<0 then i:=0;
|
||||
txt:='';
|
||||
for i:=i to editor.Lines.Count-1 do
|
||||
txt:=txt+editor.Lines[i]+#10;
|
||||
if Assigned(CtoPasConfig) then CtoPasConfig.UIToSettings;
|
||||
|
||||
if DoConvertCode(txt, p, s) then
|
||||
begin
|
||||
inc(p.Y, editor.CursorTextXY.Y-1);
|
||||
st:=editor.CursorTextXY;
|
||||
st.X:=1;
|
||||
editor.ReplaceText(st, p, s);
|
||||
if Assigned(CtoPasConfig) then
|
||||
CtoPasConfig.SettingsToUI;
|
||||
i:=editor.CursorTextXY.Y;
|
||||
dec(i);
|
||||
if i<0 then i:=0;
|
||||
txt:='';
|
||||
for i:=i to editor.Lines.Count-1 do
|
||||
txt:=txt+editor.Lines[i]+#10;
|
||||
|
||||
if DoConvertCode(txt, p, s) then
|
||||
begin
|
||||
inc(p.Y, editor.CursorTextXY.Y-1);
|
||||
st:=editor.CursorTextXY;
|
||||
st.X:=1;
|
||||
editor.ReplaceText(st, p, s);
|
||||
if Assigned(CtoPasConfig) then
|
||||
CtoPasConfig.SettingsToUI;
|
||||
end;
|
||||
finally
|
||||
parsing:=False;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user