diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index bfcb410f3..0fce12373 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -549,12 +549,12 @@ The comments are here for explanation, it's not necessary to translate them. - - + + - + @@ -562,8 +562,8 @@ The comments are here for explanation, it's not necessary to translate them. - - + + @@ -668,12 +668,12 @@ The comments are here for explanation, it's not necessary to translate them. - - - - - - + + + + + + @@ -708,8 +708,8 @@ The comments are here for explanation, it's not necessary to translate them. - - + + @@ -881,7 +881,7 @@ The comments are here for explanation, it's not necessary to translate them. - + @@ -1036,11 +1036,11 @@ You can define several column markers by using white space to separate the diffe - + - + @@ -1158,7 +1158,6 @@ You can define several column markers by using white space to separate the diffe - @@ -1166,6 +1165,7 @@ You can define several column markers by using white space to separate the diffe + @@ -1605,9 +1605,12 @@ Find in all files but exclude all folders log or logs recursively: - - - + diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index d86d8d982..d141c3be8 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -1158,7 +1158,6 @@ Vous pouvez définir plusieurs marqueurs de colonne en utilisant un espace pour - @@ -1166,6 +1165,7 @@ Vous pouvez définir plusieurs marqueurs de colonne en utilisant un espace pour + @@ -1606,9 +1606,12 @@ Rechercher dans tous les fichiers mais pas dans les dossiers log ou logs récurs - - - + diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml index 80bd27c71..0bb9349c8 100644 --- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml +++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml @@ -1143,7 +1143,6 @@ - @@ -1151,6 +1150,7 @@ + @@ -1547,9 +1547,12 @@ - - - + diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 04d4d7c4e..e627cdc84 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3011,12 +3011,12 @@ bool isUrl(TCHAR * text, int textLen, int start, int* segmentLen) void Notepad_plus::addHotSpot(ScintillaEditView* view) { - Buffer* currentBuf = _pEditView->getCurrentBuffer(); - if (currentBuf->isLargeFile()) - return; - ScintillaEditView* pView = view ? view : _pEditView; + Buffer* currentBuf = pView->getCurrentBuffer(); + if (!currentBuf->allowClickableLink()) + return; + int urlAction = (NppParameters::getInstance()).getNppGUI()._styleURL; LPARAM indicStyle = (urlAction == urlNoUnderLineFg) || (urlAction == urlNoUnderLineBg) ? INDIC_HIDDEN : INDIC_PLAIN; LPARAM indicHoverStyle = (urlAction == urlNoUnderLineBg) || (urlAction == urlUnderLineBg) ? INDIC_FULLBOX : INDIC_EXPLORERLINK; diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index 5c761a323..73ce31d7d 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -499,7 +499,7 @@ private: intptr_t findMachedBracePos(size_t startPos, size_t endPos, char targetSymbol, char matchedSymbol); void maintainIndentation(TCHAR ch); - void addHotSpot(ScintillaEditView* view = NULL); + void addHotSpot(ScintillaEditView* view = nullptr); void bookmarkAdd(intptr_t lineno) const { if (lineno == -1) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index e247d05f8..641dfa3a4 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -5418,6 +5418,12 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) else _nppGUI._largeFileRestriction._allowSmartHilite = false; + boolVal = element->Attribute(TEXT("allowClickableLink")); + if (boolVal != NULL && !lstrcmp(boolVal, TEXT("yes"))) + _nppGUI._largeFileRestriction._allowClickableLink = true; + else + _nppGUI._largeFileRestriction._allowClickableLink = false; + boolVal = element->Attribute(TEXT("deactivateWordWrap")); if (boolVal != NULL && !lstrcmp(boolVal, TEXT("no"))) _nppGUI._largeFileRestriction._deactivateWordWrap = false; @@ -6644,7 +6650,7 @@ void NppParameters::createXmlTreeFromGUIParams() GUIConfigElement->SetAttribute(TEXT("delimiterSelectionOnEntireDocument"), _nppGUI._delimiterSelectionOnEntireDocument ? TEXT("yes") : TEXT("no")); } - // + // { TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); GUIConfigElement->SetAttribute(TEXT("name"), TEXT("largeFileRestriction")); @@ -6653,6 +6659,7 @@ void NppParameters::createXmlTreeFromGUIParams() GUIConfigElement->SetAttribute(TEXT("allowAutoCompletion"), _nppGUI._largeFileRestriction._allowAutoCompletion ? TEXT("yes") : TEXT("no")); GUIConfigElement->SetAttribute(TEXT("allowBraceMatch"), _nppGUI._largeFileRestriction._allowBraceMatch ? TEXT("yes") : TEXT("no")); GUIConfigElement->SetAttribute(TEXT("allowSmartHilite"), _nppGUI._largeFileRestriction._allowSmartHilite ? TEXT("yes") : TEXT("no")); + GUIConfigElement->SetAttribute(TEXT("allowClickableLink"), _nppGUI._largeFileRestriction._allowClickableLink ? TEXT("yes") : TEXT("no")); GUIConfigElement->SetAttribute(TEXT("deactivateWordWrap"), _nppGUI._largeFileRestriction._deactivateWordWrap ? TEXT("yes") : TEXT("no")); } diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index d660f1ebc..e5dce4082 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -733,6 +733,7 @@ struct LargeFileRestriction final bool _allowBraceMatch = false; bool _allowAutoCompletion = false; bool _allowSmartHilite = false; + bool _allowClickableLink = false; }; struct NppGUI final diff --git a/PowerEditor/src/ScintillaComponent/Buffer.cpp b/PowerEditor/src/ScintillaComponent/Buffer.cpp index 5629a680e..d08160ef3 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScintillaComponent/Buffer.cpp @@ -562,6 +562,12 @@ bool Buffer::allowSmartHilite() const return (!_isLargeFile || nppGui._largeFileRestriction._allowSmartHilite) || !nppGui._largeFileRestriction._isEnabled; } +bool Buffer::allowClickableLink() const +{ + NppGUI& nppGui = NppParameters::getInstance().getNppGUI(); + return (!_isLargeFile || nppGui._largeFileRestriction._allowClickableLink) || !nppGui._largeFileRestriction._isEnabled; +} + //filemanager FileManager::~FileManager() diff --git a/PowerEditor/src/ScintillaComponent/Buffer.h b/PowerEditor/src/ScintillaComponent/Buffer.h index f777eee36..c479fddab 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.h +++ b/PowerEditor/src/ScintillaComponent/Buffer.h @@ -318,6 +318,7 @@ public: bool allowBraceMach() const; bool allowAutoCompletion() const; bool allowSmartHilite() const; + bool allowClickableLink() const; private: int indexOfReference(const ScintillaEditView * identifier) const; diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 75723f39a..b02c1070e 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -479,8 +479,8 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Large File Restriction",IDC_GROUPSTATIC_PERFORMANCE_RESTRICTION,73,7,301,151,BS_CENTER - LTEXT "While opening a large file, some features are turned off for optimizing the performance. You can customize them here.",IDC_STATIC_PERFORMANCE_TIP,90,19,280,16 - CONTROL "Enable Large File Restriction (no syntax highlighting)",IDC_CHECK_PERFORMANCE_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,100,41,260,10 + PUSHBUTTON "?",IDD_PERFORMANCE_TIP_QUESTION_BUTTON,215,21,16,14 + CONTROL "Enable Large File Restriction (no syntax highlighting)",IDC_CHECK_PERFORMANCE_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,100,41,260,10 RTEXT "Define Large File Size:",IDC_STATIC_PERFORMANCE_FILESIZE,75,59,125,8 EDITTEXT IDC_EDIT_PERFORMANCE_FILESIZE,201,57,24,14,ES_RIGHT | ES_NUMBER LTEXT "MB (1 - 4096)",IDC_STATIC_PERFORMANCE_MB,228,59,90,8 @@ -488,6 +488,7 @@ BEGIN CONTROL "Allow Auto-Completion",IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,95,200,10 CONTROL "Allow Smart Highlighting",IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,110,200,10 CONTROL "Allow Brace Match", IDC_CHECK_PERFORMANCE_ALLOWBRACEMATCH, "Button", BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP, 127, 125, 200, 10 + CONTROL "Allow URL Clickable Link", IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK, "Button", BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP, 127, 140, 200, 10 END IDD_PREFERENCE_SUB_MISC DIALOGEX 0, 0, 455, 200 diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 7192dde39..c44d3885a 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -264,10 +264,8 @@ intptr_t CALLBACK PreferenceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM { NppDarkMode::autoThemeChildControls(_hSelf); - if (_performanceSubDlg._enableLargeFileRestrictionTip) - NppDarkMode::setDarkTooltips(_performanceSubDlg._enableLargeFileRestrictionTip, NppDarkMode::ToolTipsType::tooltip); - if (_performanceSubDlg._changeLargeFileLengthTip) - NppDarkMode::setDarkTooltips(_performanceSubDlg._changeLargeFileLengthTip, NppDarkMode::ToolTipsType::tooltip); + if (_performanceSubDlg._largeFileRestrictionTip) + NppDarkMode::setDarkTooltips(_performanceSubDlg._largeFileRestrictionTip, NppDarkMode::ToolTipsType::tooltip); return TRUE; } @@ -4928,6 +4926,7 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L ::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWBRACEMATCH, BM_SETCHECK, nppGUI._largeFileRestriction._allowBraceMatch ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION, BM_SETCHECK, nppGUI._largeFileRestriction._allowAutoCompletion ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE, BM_SETCHECK, nppGUI._largeFileRestriction._allowSmartHilite ? BST_CHECKED : BST_UNCHECKED, 0); + ::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK, BM_SETCHECK, nppGUI._largeFileRestriction._allowClickableLink ? BST_CHECKED : BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP, BM_SETCHECK, nppGUI._largeFileRestriction._deactivateWordWrap ? BST_CHECKED : BST_UNCHECKED, 0); bool largeFileRestrictionEnabled = isCheckedOrNot(IDC_CHECK_PERFORMANCE_ENABLE); @@ -4935,15 +4934,12 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWBRACEMATCH), largeFileRestrictionEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION), largeFileRestrictionEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE), largeFileRestrictionEnabled); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK), largeFileRestrictionEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP), largeFileRestrictionEnabled); NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); - generic_string enablePerfTip = pNativeSpeaker->getLocalizedStrFromID("enable-disable-largeFileRestriction-tip", TEXT("Toggling \"Enable Large File Restriction\" takes effect only after closing and re-opening the large file")); - generic_string fileLenTip = pNativeSpeaker->getLocalizedStrFromID("change-largeFileRestriction_fileLength-tip", TEXT("Modifying file size value takes effect only after closing and re-opening the large file")); - generic_string wordWrapLenTip = pNativeSpeaker->getLocalizedStrFromID("largeFileRestriction_wordWrap-tip", TEXT("Enabling \"Deactivate Word Wrap globally\" option will deactivate Word Wrap for all opened documents after opening a large file. You can reactivate Word Wrap feature manually.")); - _enableLargeFileRestrictionTip = CreateToolTip(IDC_CHECK_PERFORMANCE_ENABLE, _hSelf, _hInst, const_cast(enablePerfTip.c_str()), false); - _changeLargeFileLengthTip = CreateToolTip(IDC_EDIT_PERFORMANCE_FILESIZE, _hSelf, _hInst, const_cast(fileLenTip.c_str()), false); - _deactivateWordWrapTip = CreateToolTip(IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP, _hSelf, _hInst, const_cast(wordWrapLenTip.c_str()), false); + generic_string enablePerfTip = pNativeSpeaker->getLocalizedStrFromID("largeFileRestriction-tip", TEXT("Some features may slow performance in large files. These features can be auto-disabled on opening a large file. You can customize them here.\n\nNOTE:\n1. Modifying options here requires re-open currently opened large files to get proper behavior.\n\n2. If \"Deactivate Word Wrap globally\" is checked and you open a large file, \"Word Wrap\" will be disabled for all files. You can re-enable it via menu \"View->Word Wrap\"")); + _largeFileRestrictionTip = CreateToolTip(IDD_PERFORMANCE_TIP_QUESTION_BUTTON, _hSelf, _hInst, const_cast(enablePerfTip.c_str()), false); } break; @@ -5011,6 +5007,7 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWBRACEMATCH), largeFileRestrictionEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION), largeFileRestrictionEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE), largeFileRestrictionEnabled); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK), largeFileRestrictionEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP), largeFileRestrictionEnabled); redraw(); @@ -5020,6 +5017,10 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_CLEANSMARTHILITING, 0, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_CLEANBRACEMATCH, 0, 0); } + else + { + SendMessage(::GetParent(_hParent), NPPM_INTERNAL_UPDATECLICKABLELINKS, 0, 0); + } } return TRUE; @@ -5048,6 +5049,15 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L } return TRUE; + case IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK: + { + bool isAllowed = isCheckedOrNot(int(wParam)); + nppGUI._largeFileRestriction._allowClickableLink = isAllowed; + if (isAllowed) + SendMessage(::GetParent(_hParent), NPPM_INTERNAL_UPDATECLICKABLELINKS, 0, 0); + } + return TRUE; + case IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP: { bool isDeactivated = isCheckedOrNot(int(wParam)); diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.h b/PowerEditor/src/WinControls/Preference/preferenceDlg.h index fa8618ae0..a1aecca32 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.h +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.h @@ -258,20 +258,14 @@ friend class PreferenceDlg; public : PerformanceSubDlg() = default; ~PerformanceSubDlg() { - if (_enableLargeFileRestrictionTip) - ::DestroyWindow(_enableLargeFileRestrictionTip); - if (_changeLargeFileLengthTip) - ::DestroyWindow(_changeLargeFileLengthTip); - if (_deactivateWordWrapTip) - ::DestroyWindow(_deactivateWordWrapTip); + if (_largeFileRestrictionTip) + ::DestroyWindow(_largeFileRestrictionTip); }; private : intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); - HWND _enableLargeFileRestrictionTip = nullptr; - HWND _changeLargeFileLengthTip = nullptr; - HWND _deactivateWordWrapTip = nullptr; + HWND _largeFileRestrictionTip = nullptr; }; class PreferenceDlg : public StaticDialog diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index 01ecba8b7..558b1ed1a 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -437,7 +437,7 @@ #define IDD_PREFERENCE_SUB_PERFORMANCE 7140 //(IDD_PREFERENCE_BOX + 1100) #define IDC_GROUPSTATIC_PERFORMANCE_RESTRICTION (IDD_PREFERENCE_SUB_PERFORMANCE + 1) - #define IDC_STATIC_PERFORMANCE_TIP (IDD_PREFERENCE_SUB_PERFORMANCE + 2) + #define IDD_PERFORMANCE_TIP_QUESTION_BUTTON (IDD_PREFERENCE_SUB_PERFORMANCE + 2) #define IDC_CHECK_PERFORMANCE_ENABLE (IDD_PREFERENCE_SUB_PERFORMANCE + 3) #define IDC_STATIC_PERFORMANCE_FILESIZE (IDD_PREFERENCE_SUB_PERFORMANCE + 4) #define IDC_EDIT_PERFORMANCE_FILESIZE (IDD_PREFERENCE_SUB_PERFORMANCE + 5) @@ -446,4 +446,5 @@ #define IDC_CHECK_PERFORMANCE_ALLOWAUTOCOMPLETION (IDD_PREFERENCE_SUB_PERFORMANCE + 8) #define IDC_CHECK_PERFORMANCE_ALLOWSMARTHILITE (IDD_PREFERENCE_SUB_PERFORMANCE + 9) #define IDC_CHECK_PERFORMANCE_DEACTIVATEWORDWRAP (IDD_PREFERENCE_SUB_PERFORMANCE + 10) + #define IDC_CHECK_PERFORMANCE_ALLOWCLICKABLELINK (IDD_PREFERENCE_SUB_PERFORMANCE + 11) #endif //PREFERENCE_RC_H