OSDN Git Service

Backspace一部修正
authoryamat0jp <yamat0jp@yahoo.co.jp>
Sat, 25 Sep 2021 11:41:48 +0000 (20:41 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Sat, 25 Sep 2021 11:41:48 +0000 (20:41 +0900)
Unit1.pas
json_checker.dproj

index b345a12..fc39c30 100644 (file)
--- a/Unit1.pas
+++ b/Unit1.pas
@@ -263,6 +263,8 @@ begin
 end;
 
 procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
+var
+  i: integer;
 begin
   case Ord(Key) of
     VK_BACK:
@@ -277,11 +279,17 @@ begin
           Exit;
         end
         else if Memo1.SelLength = 0 then
-          delstr := Memo1.Text[Memo1.SelStart]
+        begin
+          delstr := Memo1.Text[Memo1.SelStart];
+          i:=Memo1.SelStart-1;
+        end
         else
+        begin
           delstr := Memo1.SelText;
+          i:=Memo1.SelStart;
+        end;
         Undo.ResetDel;
-        Undo.Deleted(delstr, Memo1.SelStart-1, false);
+        Undo.Deleted(delstr, i, false);
         Undo.UpBackCnt;
       end;
     VK_DELETE:
index 348f24e..5ea5979 100644 (file)
@@ -5,7 +5,7 @@
         <FrameworkType>VCL</FrameworkType>
         <MainSource>json_checker.dpr</MainSource>
         <Base>True</Base>
-        <Config Condition="'$(Config)'==''">Debug</Config>
+        <Config Condition="'$(Config)'==''">Release</Config>
         <Platform Condition="'$(Platform)'==''">Win64</Platform>
         <TargetedPlatforms>3</TargetedPlatforms>
         <AppType>Application</AppType>