소스 검색

Opening same file in a second window don't destroy any changes

Margers 1 년 전
부모
커밋
cf81682bbb
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      packages/ide/fpviews.pas

+ 3 - 1
packages/ide/fpviews.pas

@@ -2217,7 +2217,9 @@ begin
     AFileName:='';
     AFileName:='';
   New(Editor, Init(R, HSB, VSB, Indicator,AFileName));
   New(Editor, Init(R, HSB, VSB, Indicator,AFileName));
   Editor^.GrowMode:=gfGrowHiX+gfGrowHiY;
   Editor^.GrowMode:=gfGrowHiX+gfGrowHiY;
-  if LoadFile then
+  {load from file if there is no other window with the same file }
+  if Editor^.Core^.GetBindingCount = 1 then
+    if LoadFile then
     begin
     begin
       if Editor^.LoadFile=false then
       if Editor^.LoadFile=false then
         ErrorBox(FormatStrStr(msg_errorreadingfile,AFileName),nil)
         ErrorBox(FormatStrStr(msg_errorreadingfile,AFileName),nil)