You've already forked lazarus-ccr
chelper: fix code replacement. the header's code could be corrupted if user changes cursor position, while converting process works
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1278 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -165,8 +165,8 @@ begin
|
|||||||
|
|
||||||
if Assigned(CtoPasConfig) then CtoPasConfig.UIToSettings;
|
if Assigned(CtoPasConfig) then CtoPasConfig.UIToSettings;
|
||||||
|
|
||||||
i:=editor.CursorTextXY.Y;
|
st:=editor.CursorTextXY;
|
||||||
dec(i);
|
i:=st.Y-1;
|
||||||
if i<0 then i:=0;
|
if i<0 then i:=0;
|
||||||
txt:='';
|
txt:='';
|
||||||
for i:=i to editor.Lines.Count-1 do
|
for i:=i to editor.Lines.Count-1 do
|
||||||
@@ -174,8 +174,7 @@ begin
|
|||||||
|
|
||||||
if DoConvertCode(txt, p, s) then
|
if DoConvertCode(txt, p, s) then
|
||||||
begin
|
begin
|
||||||
inc(p.Y, editor.CursorTextXY.Y-1);
|
inc(p.Y, st.Y-1);
|
||||||
st:=editor.CursorTextXY;
|
|
||||||
st.X:=1;
|
st.X:=1;
|
||||||
editor.ReplaceText(st, p, s);
|
editor.ReplaceText(st, p, s);
|
||||||
if Assigned(CtoPasConfig) then
|
if Assigned(CtoPasConfig) then
|
||||||
|
Reference in New Issue
Block a user