summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-04-06 09:11:22 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-04-06 09:11:22 +0200
commite54312ce0df4f6907dd1b09fe0db1c3dbda7d23d (patch)
treefa29035d3dc56da714093b6b34ac5a96fe04489d
parent68635efa545d1ab3f5fd6b530ce314efdd8dad4c (diff)
downloadfpGUI-e54312ce0df4f6907dd1b09fe0db1c3dbda7d23d.tar.xz
memo: Fixed deletion of selected lines.
Thanks to JoshyFun <joshyfun@gmail.com> for suggestions.
-rw-r--r--examples/gui/memo/memotest.lpi7
-rw-r--r--src/gui/fpg_memo.pas5
2 files changed, 6 insertions, 6 deletions
diff --git a/examples/gui/memo/memotest.lpi b/examples/gui/memo/memotest.lpi
index 51f39bef..15317454 100644
--- a/examples/gui/memo/memotest.lpi
+++ b/examples/gui/memo/memotest.lpi
@@ -1,15 +1,14 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="/"/>
- <Version Value="6"/>
+ <Version Value="7"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
+ <LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value="./"/>
<TargetFileExt Value=""/>
</General>
<VersionInfo>
@@ -24,7 +23,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication Use="True" PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas
index 3e972430..bbc4b4ca 100644
--- a/src/gui/fpg_memo.pas
+++ b/src/gui/fpg_memo.pas
@@ -403,8 +403,9 @@ begin
SetLineText(selsl, ls);
end;
- for n := selsl to selel do
- FLines.Delete(n);
+ //delete moves lines up, so delete same line number over and over.
+ for n := (selsl+1) to selel do
+ FLines.Delete(selsl+1);
FCursorPos := selsp;
FCursorLine := selsl;