Forráskód Böngészése

Editor mouse click selection fix, year update, paste fix

Arthur Yefimov 4 éve
szülő
commit
5a59cb23f3
11 módosított fájl, 36 hozzáadás és 36 törlés
  1. 3 5
      src/Editor.Mod
  2. 21 19
      src/EditorText.Mod
  3. 1 1
      src/FreeOberon.Mod
  4. 1 1
      src/Graph.Mod
  5. 1 1
      src/OV.Mod
  6. 1 1
      src/SDL2.Mod
  7. 1 1
      src/Term.Mod
  8. 2 2
      src/Terminal.Mod
  9. 3 3
      src/resources.rc
  10. 1 1
      src/term/term_linux.c
  11. 1 1
      src/term/term_win32.c

+ 3 - 5
src/Editor.Mod

@@ -1,5 +1,5 @@
 MODULE Editor;
-(* Copyright 2017-2019 Arthur Yefimov
+(* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.
 
@@ -729,10 +729,8 @@ BEGIN
   IF (c.app.windows # NIL) & (c.app.windows IS Editor) &
       (clipboard[0] # 0X) THEN
     e := c.app.windows(Editor);
-    e.text.selL := e.text.x; e.text.selT := e.text.y;
+    e.text.DeleteSelection;
     e.text.Insert(clipboard, FALSE);
-    e.text.selR := e.text.x; e.text.selB := e.text.y;
-    e.text.selected := TRUE;
     IF e.text.y >= e.text.scrY + e.h - 2 THEN
       MoveScreen(e, e.text.y - e.h + 3 - e.text.scrY)
     END;
@@ -771,7 +769,7 @@ BEGIN OV.WindowMouseDown(c, x, y, button);
     t.selected := FALSE; L := t.scrFirst; i := y;
     WHILE (i > 0) & (L # NIL) DO DEC(i); L := L.next END;
     IF L # NIL THEN
-      t.cur := L; t.y := y - t.scrY;
+      t.cur := L; t.y := y + t.scrY;
       IF x > L.len THEN x := L.len END;
       t.x := x;
       T.GoToXY(c.x + x + 1, c.y + y + 1)

+ 21 - 19
src/EditorText.Mod

@@ -1,5 +1,5 @@
 MODULE EditorText;
-(* Copyright 2017-2019 Arthur Yefimov
+(* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.
 
@@ -152,24 +152,26 @@ END SelectAll;
 PROCEDURE (t: Text) DeleteSelection*;
 VAR x0, x, y: INTEGER; L0, L: Line;
 BEGIN
-  L := t.GetFirstSelLine();
-  L0 := L; y := t.selT; 
-  WHILE y < t.selB DO L := L.next; INC(y) END;
-  L0.next := L.next;
-  IF L.next = NIL THEN t.last := L0
-  ELSE L.next.prev := L0 END;
-
-  x0 := t.selL; x := t.selR;
-  WHILE L.s[x] # 0X
-  DO L0.s[x0] := L.s[x]; INC(x0); INC(x) END;
-  L0.s[x0] := 0X; L0.len := x0;
-
-  t.cur := L0; t.y := t.selT; t.x := t.selL;
-  IF (t.scrY >= t.selT) & (t.scrY <= t.selB) THEN
-    t.scrFirst := t.cur; t.scrY := t.y
-  END;
-  t.selected := FALSE;
-  t.changed := TRUE
+  IF t.selected THEN
+    L := t.GetFirstSelLine();
+    L0 := L; y := t.selT; 
+    WHILE y < t.selB DO L := L.next; INC(y) END;
+    L0.next := L.next;
+    IF L.next = NIL THEN t.last := L0
+    ELSE L.next.prev := L0 END;
+
+    x0 := t.selL; x := t.selR;
+    WHILE L.s[x] # 0X
+    DO L0.s[x0] := L.s[x]; INC(x0); INC(x) END;
+    L0.s[x0] := 0X; L0.len := x0;
+
+    t.cur := L0; t.y := t.selT; t.x := t.selL;
+    IF (t.scrY >= t.selT) & (t.scrY <= t.selB) THEN
+      t.scrFirst := t.cur; t.scrY := t.y
+    END;
+    t.selected := FALSE;
+    t.changed := TRUE
+  END
 END DeleteSelection;
 
 PROCEDURE (t: Text) HandleDelete*;

+ 1 - 1
src/FreeOberon.Mod

@@ -1,5 +1,5 @@
 MODULE FreeOberon;
-(* Copyright 2017-2019 Arthur Yefimov
+(* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/Graph.Mod

@@ -1,5 +1,5 @@
 MODULE Graph;
-(* Copyright 2017-2019 Arthur Yefimov
+(* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/OV.Mod

@@ -1,5 +1,5 @@
 MODULE OV;
-(* Copyright 2017-2019 Arthur Yefimov
+(* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/SDL2.Mod

@@ -1,5 +1,5 @@
 MODULE SDL2;
-(* Copyright 2017-2019 Arthur Yefimov
+(* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/Term.Mod

@@ -1,5 +1,5 @@
 MODULE Term;
-(* Copyright 2017-2019 Arthur Yefimov
+(* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 2 - 2
src/Terminal.Mod

@@ -1,5 +1,5 @@
 MODULE Terminal;
-(* Copyright 2017-2019 Arthur Yefimov
+(* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.
 
@@ -112,7 +112,7 @@ BEGIN
 END DrawMouse;
 
 (* Draws characters that have been changed, and the mouse.
-   Returns TRUE if something has been drawn. *)
+   Returns TRUE if anything has been drawn. *)
 PROCEDURE Draw*(): BOOLEAN;
 VAR x, y, color: INTEGER;
     drawn: BOOLEAN;

+ 3 - 3
src/resources.rc

@@ -1,20 +1,20 @@
 id ICON "../data/images/icon.ico"
 1 VERSIONINFO
 FILEVERSION     1,0,0,0
-PRODUCTVERSION  0,1,0,0
+PRODUCTVERSION  0,1,0,4
 BEGIN
   BLOCK "StringFileInfo"
   BEGIN
     BLOCK "080904E4"
     BEGIN
-      VALUE "CompanyName", "Free Oberon team"
+      VALUE "CompanyName", "Free Oberon Team"
       VALUE "FileDescription", "Oberon programming environment"
       VALUE "FileVersion", "1.0"
       VALUE "InternalName", "freeoberon"
       VALUE "LegalCopyright", "Free Oberon"
       VALUE "OriginalFilename", "FreeOberon.exe"
       VALUE "ProductName", "Free Oberon"
-      VALUE "ProductVersion", "1.0.3"
+      VALUE "ProductVersion", "1.0.4"
     END
   END
   BLOCK "VarFileInfo"

+ 1 - 1
src/term/term_linux.c

@@ -1,4 +1,4 @@
-/* Copyright 2017-2019 Arthur Yefimov
+/* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.
 

+ 1 - 1
src/term/term_win32.c

@@ -1,4 +1,4 @@
-/* Copyright 2017-2019 Arthur Yefimov
+/* Copyright 2017-2021 Arthur Yefimov
 
 This file is part of Free Oberon.