From 7d76a18ec854ebbf3d0d14d372414698cae368ff Mon Sep 17 00:00:00 2001 From: dail8859 Date: Fri, 19 Feb 2016 17:48:16 -0500 Subject: [PATCH] Let Scintilla deal with some of the folding functionality --- PowerEditor/src/Notepad_plus.cpp | 4 ++++ PowerEditor/src/NppNotification.cpp | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 6d24ef6d3..fc09bb256 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -323,6 +323,10 @@ LRESULT Notepad_plus::init(HWND hwnd) _mainEditView.execute(SCI_SETMULTIPASTE, SC_MULTIPASTE_EACH); _subEditView.execute(SCI_SETMULTIPASTE, SC_MULTIPASTE_EACH); + // Let Scintilla deal with some of the folding functionality + _mainEditView.execute(SCI_SETAUTOMATICFOLD, SC_AUTOMATICFOLD_SHOW); + _subEditView.execute(SCI_SETAUTOMATICFOLD, SC_AUTOMATICFOLD_SHOW); + TabBarPlus::doDragNDrop(true); if (_toReduceTabBar) diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index ca3831536..ca7d2f3e4 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -887,13 +887,6 @@ BOOL Notepad_plus::notify(SCNotification *notification) case SCN_NEEDSHOWN: { - int begin = notifyView->execute(SCI_LINEFROMPOSITION, notification->position); - int end = notifyView->execute(SCI_LINEFROMPOSITION, notification->position + notification->length); - int firstLine = begin < end ? begin : end; - int lastLine = begin > end ? begin : end; - - for (int line = firstLine; line <= lastLine; ++line) - notifyView->execute(SCI_ENSUREVISIBLE, line, 0); break; }