From e54312ce0df4f6907dd1b09fe0db1c3dbda7d23d Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 6 Apr 2010 09:11:22 +0200 Subject: memo: Fixed deletion of selected lines. Thanks to JoshyFun for suggestions. --- examples/gui/memo/memotest.lpi | 7 +++---- src/gui/fpg_memo.pas | 5 +++-- 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 @@ - - + + - @@ -24,7 +23,7 @@ - + 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; -- cgit v1.2.3-70-g09d2