From c48d05bde9d6480a3f78dc73fe25d0daa89f8626 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 4 Jun 2009 23:59:43 +0000 Subject: [PATCH] EditorOptions/Mouse: Added more Fold Actions templates (missed a file) git-svn-id: trunk@20414 - --- components/synedit/synguttercodefolding.pp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/components/synedit/synguttercodefolding.pp b/components/synedit/synguttercodefolding.pp index 0c1fee76d2..75fb8d1730 100644 --- a/components/synedit/synguttercodefolding.pp +++ b/components/synedit/synguttercodefolding.pp @@ -188,6 +188,25 @@ begin FFoldView.FoldAtTextIndex(Line-1, -1, 1, True); emcoCodeFoldCollapsAll: FFoldView.FoldAtTextIndex(Line-1, -1, 0); + emcoCodeFoldCollapsAtCaret: + begin + i := FFoldView.LogicalPosToNodeIndex(Line-1, AnInfo.NewCaret.BytePos, False); + if i >= 0 then + FFoldView.FoldAtTextIndex(Line-1, i, 1, False) + else + Result := False; + end; + emcoCodeFoldCollapsPreCaret: + begin + i := FFoldView.LogicalPosToNodeIndex(Line-1, AnInfo.NewCaret.BytePos, True); + if i >= 0 then + FFoldView.FoldAtTextIndex(Line-1, i, 1, False) + else begin + i := FFoldView.ExpandedLineForBlockAtLine(Line); + if i > 0 then + FFoldView.FoldAtTextIndex(i-1, -1, 1, True); + end; + end; end; end; emcCodeFoldExpand: