Explorar o código

* use always insert mode when replacing text, resolves #9476

git-svn-id: trunk@8798 -
florian %!s(int64=18) %!d(string=hai) anos
pai
achega
792f07c7c8
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      ide/weditor.pas

+ 6 - 0
ide/weditor.pas

@@ -6051,6 +6051,7 @@ var S: string;
     Re: word;
     IFindStr : string;
     BT : BTable;
+    Overwriting : boolean;
 
   function ContainsText(const SubS:string;var S: string; Start: Sw_integer): Sw_integer;
   var
@@ -6302,6 +6303,9 @@ begin
               if CanReplace then
                 begin
                   Lock;
+                  { don't use SetInsertMode here because it changes the cursor shape }
+                  overwriting:=(GetFlags and efInsertMode)=0;
+                  SetFlags(GetFlags or efInsertMode);
                   SetSelection(A,B);
                   DelSelect;
                   InsertText(ReplaceStr);
@@ -6315,6 +6319,8 @@ begin
                       X:=A.X;
                       Y:=A.Y;
                     end;
+                  if overwriting then
+                    SetFlags(GetFlags and (not efInsertMode));
                   UnLock;
                 end
               else