diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 9832c9d0..13701084 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -290,6 +290,7 @@ void Notepad_plus::command(int id) TCHAR str[strSize]; _pEditView->getGenericSelectedText(str, strSize); _findReplaceDlg.setSearchText(str); + _findReplaceDlg._env->_str2Search = str; setFindReplaceFolderFilter(NULL, NULL); if (isFirstTime) _nativeLangSpeaker.changeFindReplaceDlgLang(_findReplaceDlg); diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 6bcc0c78..631fbb14 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -937,6 +937,11 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP { if (_currentStatus == FIND_DLG) { + bool isUnicode = (*_ppEditView)->getCurrentBuffer()->getUnicodeMode() != uni8Bit; + HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT); + updateCombo(IDFINDWHAT); + _options._str2Search = getTextFromCombo(hFindCombo, isUnicode); + int nbCounted = processAll(ProcessCountAll, &_options); generic_string result = TEXT(""); @@ -2303,6 +2308,7 @@ void Finder::finishFilesSearch(int count) _scintView.execute(SCI_SETSEL, 0, 0); _scintView.execute(SCI_SETLEXER, SCLEX_SEARCHRESULT); + _scintView.execute(SCI_SETPROPERTY, reinterpret_cast("fold"), reinterpret_cast("1")); } diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index df606027..becc6872 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -761,7 +761,8 @@ void ScintillaEditView::setCppLexer(LangType langType) execute(SCI_SETPROPERTY, reinterpret_cast("fold.comment"), reinterpret_cast("1")); execute(SCI_SETPROPERTY, reinterpret_cast("fold.preprocessor"), reinterpret_cast("1")); - // "#if 1 //" make CppLexer crash, so we disable it. + // Disable track preprocessor to avoid incorrect detection. + // In the most of cases, the symbols are defined outside of file. execute(SCI_SETPROPERTY, reinterpret_cast("lexer.cpp.track.preprocessor"), reinterpret_cast("0")); } @@ -872,6 +873,12 @@ void ScintillaEditView::setObjCLexer(LangType langType) execute(SCI_SETKEYWORDS, 2, (LPARAM)doxygenKeyWords); execute(SCI_SETKEYWORDS, 3, (LPARAM)objCDirective); execute(SCI_SETKEYWORDS, 4, (LPARAM)objCQualifier); + + execute(SCI_SETPROPERTY, reinterpret_cast("fold"), reinterpret_cast("1")); + execute(SCI_SETPROPERTY, reinterpret_cast("fold.compact"), reinterpret_cast("0")); + + execute(SCI_SETPROPERTY, reinterpret_cast("fold.comment"), reinterpret_cast("1")); + execute(SCI_SETPROPERTY, reinterpret_cast("fold.preprocessor"), reinterpret_cast("1")); } void ScintillaEditView::setKeywords(LangType langType, const char *keywords, int index) @@ -966,7 +973,6 @@ void ScintillaEditView::setLexer(int lexerID, LangType langType, int whichList) execute(SCI_SETPROPERTY, reinterpret_cast("fold.compact"), reinterpret_cast("0")); execute(SCI_SETPROPERTY, reinterpret_cast("fold.comment"), reinterpret_cast("1")); - execute(SCI_SETPROPERTY, reinterpret_cast("fold.preprocessor"), reinterpret_cast("1")); } void ScintillaEditView::makeStyle(LangType language, const TCHAR **keywordArray) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 268641b0..d00b70c2 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -695,6 +695,8 @@ protected: execute(SCI_SETLEXER, SCLEX_PROPERTIES); execute(SCI_STYLESETEOLFILLED, SCE_PROPS_SECTION, true); makeStyle(L_INI); + execute(SCI_SETPROPERTY, reinterpret_cast("fold"), reinterpret_cast("1")); + execute(SCI_SETPROPERTY, reinterpret_cast("fold.compact"), reinterpret_cast("0")); }; @@ -713,6 +715,7 @@ protected: void setPascalLexer() { setLexer(SCLEX_PASCAL, L_PASCAL, LIST_0); + execute(SCI_SETPROPERTY, reinterpret_cast("fold.preprocessor"), reinterpret_cast("1")); }; void setPerlLexer() { @@ -784,6 +787,7 @@ protected: void setAutoItLexer(){ setLexer(SCLEX_AU3, L_AU3, LIST_0 | LIST_1 | LIST_2 | LIST_3 | LIST_4 | LIST_5 | LIST_6); + execute(SCI_SETPROPERTY, reinterpret_cast("fold.preprocessor"), reinterpret_cast("1")); }; void setCamlLexer(){ @@ -796,6 +800,7 @@ protected: void setVerilogLexer(){ setLexer(SCLEX_VERILOG, L_VERILOG, LIST_0 | LIST_1); + execute(SCI_SETPROPERTY, reinterpret_cast("fold.preprocessor"), reinterpret_cast("1")); }; void setMatlabLexer(){ diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.cpp b/PowerEditor/src/WinControls/shortcut/shortcut.cpp index 812e0651..22771dc6 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.cpp +++ b/PowerEditor/src/WinControls/shortcut/shortcut.cpp @@ -563,6 +563,10 @@ recordedMacroStep::recordedMacroStep(int iMessage, long wParam, long lParam) case IDD_FINDINFILES_DIR_COMBO: case IDD_FINDINFILES_FILTERS_COMBO: sParameter = *reinterpret_cast(lParameter); + //::MessageBoxA(NULL, (LPCSTR)(*reinterpret_cast(lParameter)), "A", MB_OK); + //::MessageBoxW(NULL, (LPCWSTR)(*reinterpret_cast(lParameter)), TEXT("W"), MB_OK); + + //printStr(sParameter.c_str()); MacroType = mtUseSParameter; lParameter = 0; break; @@ -582,7 +586,7 @@ void recordedMacroStep::PlayBack(Window* pNotepad, ScintillaEditView *pEditView) { long lParam = lParameter; if (MacroType == mtUseSParameter) - lParam = reinterpret_cast(sParameter.c_str()); + lParam = reinterpret_cast(sParameter.c_str()); pEditView->execute(message, wParameter, lParam); if ( (message == SCI_SETTEXT) || (message == SCI_REPLACESEL)