summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/fpg_memo.pas17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas
index 41587135..789da3c3 100644
--- a/src/gui/fpg_memo.pas
+++ b/src/gui/fpg_memo.pas
@@ -246,13 +246,18 @@ var
MaxLine: integer;
yp: integer;
begin
- if (aValue < 0) or (aValue = FCursorLine) then
+ if (aValue < 0) or (aValue = FCursorLine) or (AValue > FLines.Count-1) then
Exit; // wrong value
+
if aValue < FFirstLine then
begin
FFirstLine := aValue; // moves the selected line to the top of the displayed rectangle
FCursorLine := aValue;
FCursorPos := 0;
+ FSelStartPos := FCursorPos;
+ FSelStartLine := FCursorLine;
+ FSelEndLine := -1;
+ AdjustCursor;
RePaint;
Exit;
end;
@@ -272,15 +277,21 @@ begin
FFirstLine := aValue;
FCursorLine := aValue;
FCursorPos := 0;
+ FSelStartPos := FCursorPos;
+ FSelStartLine := FCursorLine;
+ FSelEndLine := -1;
+ AdjustCursor;
RePaint;
- Exit;
end
else
begin
FCursorLine := aValue;
FCursorPos := 0;
+ FSelStartPos := FCursorPos;
+ FSelStartLine := FCursorLine;
+ FSelEndLine := -1;
+ AdjustCursor;
RePaint;
- Exit;
end;
end;