mirror of https://gitlab.com/basile.b/dexed.git
fix #83, new line insterted after reloading doc
This commit is contained in:
parent
3b6b3c4d65
commit
6d70c3e597
|
@ -6,8 +6,9 @@ interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, RTTIGrids, Forms, Controls, Graphics, ExtCtrls,
|
Classes, SysUtils, FileUtil, RTTIGrids, Forms, Controls, Graphics, ExtCtrls,
|
||||||
Menus, Buttons, process, ce_widget, ce_interfaces, ce_observer, ce_synmemo,
|
Menus, Buttons, process, SynEditKeyCmds, ce_widget, ce_interfaces, ce_observer,
|
||||||
ce_writableComponent, ce_common, ce_sharedres, PropEdits, ObjectInspector;
|
ce_synmemo, ce_writableComponent, ce_common, ce_sharedres, PropEdits,
|
||||||
|
ObjectInspector;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -301,12 +302,15 @@ begin
|
||||||
inp := fDoc.Lines.Text;
|
inp := fDoc.Lines.Text;
|
||||||
prc.Input.Write(inp[1], inp.length);
|
prc.Input.Write(inp[1], inp.length);
|
||||||
prc.CloseInput;
|
prc.CloseInput;
|
||||||
while prc.Running do (*!*);
|
while prc.Running do
|
||||||
|
sleep(1);
|
||||||
try
|
try
|
||||||
str := TStringList.Create;
|
str := TStringList.Create;
|
||||||
processOutputToStrings(prc,str);
|
processOutputToStrings(prc,str);
|
||||||
fDoc.SelectAll;
|
fDoc.ClearAll;
|
||||||
fDoc.SelText:= str.Text;
|
fDoc.InsertTextAtCaret(str.Text);
|
||||||
|
fDoc.SelStart:= high(integer);
|
||||||
|
fDoc.ExecuteCommand(ecDeleteLastChar, #0, nil);
|
||||||
except
|
except
|
||||||
fDoc.Lines.Assign(fBackup);
|
fDoc.Lines.Assign(fBackup);
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -1783,10 +1783,10 @@ begin
|
||||||
str := TStringList.Create;
|
str := TStringList.Create;
|
||||||
try
|
try
|
||||||
str.LoadFromFile(fFilename);
|
str.LoadFromFile(fFilename);
|
||||||
SelectAll;
|
ClearAll;
|
||||||
SelText:= str.Text;
|
InsertTextAtCaret(str.Text);
|
||||||
SelStart:=0;
|
SelStart:= high(integer);
|
||||||
SelEnd:=0;
|
ExecuteCommand(ecDeleteLastChar, #0, nil);
|
||||||
fModified := true;
|
fModified := true;
|
||||||
finally
|
finally
|
||||||
str.Free;
|
str.Free;
|
||||||
|
|
Loading…
Reference in New Issue