[NEW_FEATURE] (Author: Andreas Jonsson) Add case sensitive option for smart highlighting feature.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@945 f5eea248-9336-0410-98b8-ebc06183d4e3remotes/trunk
parent
e86940390f
commit
4d11f5d26a
|
@ -3183,6 +3183,22 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (!lstrcmp(nm, TEXT("SmartHighLightCaseSensitive")))
|
||||||
|
{
|
||||||
|
TiXmlNode *n = childNode->FirstChild();
|
||||||
|
if (n)
|
||||||
|
{
|
||||||
|
val = n->Value();
|
||||||
|
if (val)
|
||||||
|
{
|
||||||
|
if (!lstrcmp(val, TEXT("yes")))
|
||||||
|
_nppGUI._smartHiliteCaseSensitive = true;
|
||||||
|
else
|
||||||
|
_nppGUI._smartHiliteCaseSensitive = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if (!lstrcmp(nm, TEXT("TagsMatchHighLight")))
|
else if (!lstrcmp(nm, TEXT("TagsMatchHighLight")))
|
||||||
{
|
{
|
||||||
TiXmlNode *n = childNode->FirstChild();
|
TiXmlNode *n = childNode->FirstChild();
|
||||||
|
@ -4059,6 +4075,7 @@ bool NppParameters::writeGUIParams()
|
||||||
bool noUpdateExist = false;
|
bool noUpdateExist = false;
|
||||||
bool menuBarExist = false;
|
bool menuBarExist = false;
|
||||||
bool smartHighLightExist = false;
|
bool smartHighLightExist = false;
|
||||||
|
bool smartHighLightCaseSensitiveExist = false;
|
||||||
bool tagsMatchHighLightExist = false;
|
bool tagsMatchHighLightExist = false;
|
||||||
bool caretExist = false;
|
bool caretExist = false;
|
||||||
bool ScintillaGlobalSettingsExist = false;
|
bool ScintillaGlobalSettingsExist = false;
|
||||||
|
@ -4242,6 +4259,16 @@ bool NppParameters::writeGUIParams()
|
||||||
else
|
else
|
||||||
childNode->InsertEndChild(TiXmlText(pStr));
|
childNode->InsertEndChild(TiXmlText(pStr));
|
||||||
}
|
}
|
||||||
|
else if (!lstrcmp(nm, TEXT("SmartHighLightCaseSensitive")))
|
||||||
|
{
|
||||||
|
smartHighLightCaseSensitiveExist = true;
|
||||||
|
const TCHAR *pStr = _nppGUI._smartHiliteCaseSensitive?TEXT("yes"):TEXT("no");
|
||||||
|
TiXmlNode *n = childNode->FirstChild();
|
||||||
|
if (n)
|
||||||
|
n->SetValue(pStr);
|
||||||
|
else
|
||||||
|
childNode->InsertEndChild(TiXmlText(pStr));
|
||||||
|
}
|
||||||
|
|
||||||
else if (!lstrcmp(nm, TEXT("TagsMatchHighLight")))
|
else if (!lstrcmp(nm, TEXT("TagsMatchHighLight")))
|
||||||
{
|
{
|
||||||
|
@ -4466,6 +4493,10 @@ bool NppParameters::writeGUIParams()
|
||||||
{
|
{
|
||||||
insertGUIConfigBoolNode(GUIRoot, TEXT("SmartHighLight"), _nppGUI._enableSmartHilite);
|
insertGUIConfigBoolNode(GUIRoot, TEXT("SmartHighLight"), _nppGUI._enableSmartHilite);
|
||||||
}
|
}
|
||||||
|
if( !smartHighLightCaseSensitiveExist)
|
||||||
|
{
|
||||||
|
insertGUIConfigBoolNode(GUIRoot, TEXT("SmartHighLightCaseSensitive"), _nppGUI._smartHiliteCaseSensitive);
|
||||||
|
}
|
||||||
if (!tagsMatchHighLightExist)
|
if (!tagsMatchHighLightExist)
|
||||||
{
|
{
|
||||||
TiXmlElement * ele = insertGUIConfigBoolNode(GUIRoot, TEXT("TagsMatchHighLight"), _nppGUI._enableTagsMatchHilite);
|
TiXmlElement * ele = insertGUIConfigBoolNode(GUIRoot, TEXT("TagsMatchHighLight"), _nppGUI._enableTagsMatchHilite);
|
||||||
|
|
|
@ -671,7 +671,8 @@ struct NppGUI
|
||||||
_isMaximized(false), _isMinimizedToTray(false), _rememberLastSession(true), _backup(bak_none), _useDir(false), _backupDir(TEXT("")),\
|
_isMaximized(false), _isMinimizedToTray(false), _rememberLastSession(true), _backup(bak_none), _useDir(false), _backupDir(TEXT("")),\
|
||||||
_doTaskList(true), _maitainIndent(true), _openSaveDir(dir_followCurrent), _styleMRU(true), _styleURL(0),\
|
_doTaskList(true), _maitainIndent(true), _openSaveDir(dir_followCurrent), _styleMRU(true), _styleURL(0),\
|
||||||
_autocStatus(autoc_none), _autocFromLen(1), _funcParams(false), _definedSessionExt(TEXT("")),\
|
_autocStatus(autoc_none), _autocFromLen(1), _funcParams(false), _definedSessionExt(TEXT("")),\
|
||||||
_doesExistUpdater(false), _caretBlinkRate(250), _caretWidth(1), _enableMultiSelection(false), _shortTitlebar(false), _themeName(TEXT("")), _isLangMenuCompact(false) {
|
_doesExistUpdater(false), _caretBlinkRate(250), _caretWidth(1), _enableMultiSelection(false), _shortTitlebar(false), _themeName(TEXT("")), _isLangMenuCompact(false),
|
||||||
|
_smartHiliteCaseSensitive(false) {
|
||||||
_appPos.left = 0;
|
_appPos.left = 0;
|
||||||
_appPos.top = 0;
|
_appPos.top = 0;
|
||||||
_appPos.right = 700;
|
_appPos.right = 700;
|
||||||
|
@ -713,6 +714,7 @@ struct NppGUI
|
||||||
bool _doTaskList;
|
bool _doTaskList;
|
||||||
bool _maitainIndent;
|
bool _maitainIndent;
|
||||||
bool _enableSmartHilite;
|
bool _enableSmartHilite;
|
||||||
|
bool _smartHiliteCaseSensitive;
|
||||||
bool _disableSmartHiliteTmp;
|
bool _disableSmartHiliteTmp;
|
||||||
bool _enableTagsMatchHilite;
|
bool _enableTagsMatchHilite;
|
||||||
bool _enableTagAttrsHilite;
|
bool _enableTagAttrsHilite;
|
||||||
|
|
|
@ -97,8 +97,10 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView)
|
||||||
int currentLine = firstLine;
|
int currentLine = firstLine;
|
||||||
int prevDocLineChecked = -1; //invalid start
|
int prevDocLineChecked = -1; //invalid start
|
||||||
|
|
||||||
|
const NppGUI & nppGUI = NppParameters::getInstance()->getNppGUI();
|
||||||
|
|
||||||
FindOption fo;
|
FindOption fo;
|
||||||
fo._isMatchCase = false;
|
fo._isMatchCase = nppGUI._smartHiliteCaseSensitive;
|
||||||
fo._isWholeWord = true;
|
fo._isWholeWord = true;
|
||||||
|
|
||||||
const TCHAR * searchText = NULL;
|
const TCHAR * searchText = NULL;
|
||||||
|
|
|
@ -117,35 +117,36 @@ IDD_PREFERENCE_SETTING_BOX DIALOGEX 0, 0, 455, 185
|
||||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
|
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
|
||||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
GROUPBOX "Document Switcher (Ctrl+TAB)",IDC_DOCUMENTSWITCHER_STATIC,37,4,155,39,BS_CENTER
|
|
||||||
CONTROL "Enable",IDC_CHECK_ENABLEDOCSWITCHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,15,69,10
|
CONTROL "Enable",IDC_CHECK_ENABLEDOCSWITCHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,15,69,10
|
||||||
CONTROL "Enable MRU behaviour",IDC_CHECK_STYLEMRU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,28,140,10
|
CONTROL "Enable MRU behaviour",IDC_CHECK_STYLEMRU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,28,140,10
|
||||||
CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE,
|
CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE,
|
||||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,94,150,10
|
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,94,150,10
|
||||||
CONTROL "Smart highlighting",IDC_CHECK_ENABLSMARTHILITE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,136,150,10
|
CONTROL "Auto-indent",IDC_CHECK_MAINTAININDENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,94,150,10
|
||||||
CONTROL "Auto-indent",IDC_CHECK_MAINTAININDENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,108,150,10
|
CONTROL "Minimize to system tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,108,150,10
|
||||||
CONTROL "Minimize to system tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,122,150,10
|
CONTROL "Smart highlighting",IDC_CHECK_ENABLSMARTHILITE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,122,150,10
|
||||||
|
CONTROL "Highlighting is case sensitive",IDC_CHECK_SMARTHILITECASESENSITIVE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,136,150,10
|
||||||
CONTROL "Show only filename in title bar",IDC_CHECK_SHORTTITLE,
|
CONTROL "Show only filename in title bar",IDC_CHECK_SHORTTITLE,
|
||||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,150,217,10
|
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,150,217,10
|
||||||
CONTROL "Remember current session for next launch",IDC_CHECK_REMEMBERSESSION,
|
CONTROL "Remember current session for next launch",IDC_CHECK_REMEMBERSESSION,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,164,217,10
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,164,217,10
|
||||||
GROUPBOX "Clickable Link Settings",IDC_CLICKABLELINK_STATIC,259,4,155,39,BS_CENTER
|
|
||||||
CONTROL "Enable",IDC_CHECK_CLICKABLELINK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,15,140,10
|
CONTROL "Enable",IDC_CHECK_CLICKABLELINK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,15,140,10
|
||||||
CONTROL "No underline",IDC_CHECK_CLICKABLELINK_NOUNDERLINE,
|
CONTROL "No underline",IDC_CHECK_CLICKABLELINK_NOUNDERLINE,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,28,140,10
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,28,140,10
|
||||||
GROUPBOX "File Status Auto-Detection",IDC_FILEAUTODETECTION_STATIC,259,47,155,50,BS_CENTER
|
|
||||||
CONTROL "Enable",IDC_CHECK_FILEAUTODETECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,57,140,10
|
CONTROL "Enable",IDC_CHECK_FILEAUTODETECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,57,140,10
|
||||||
CONTROL "Update silently",IDC_CHECK_UPDATESILENTLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,69,140,10
|
CONTROL "Update silently",IDC_CHECK_UPDATESILENTLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,69,140,10
|
||||||
CONTROL "Scroll to the last line after update",IDC_CHECK_UPDATEGOTOEOF,
|
CONTROL "Scroll to the last line after update",IDC_CHECK_UPDATEGOTOEOF,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,81,140,10
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,81,140,10
|
||||||
GROUPBOX "Highlight Matching Tags",IDC_TAGMATCHEDHILITE_STATIC,259,101,155,50,BS_CENTER
|
|
||||||
CONTROL "Enable",IDC_CHECK_ENABLTAGSMATCHHILITE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,111,140,10
|
CONTROL "Enable",IDC_CHECK_ENABLTAGSMATCHHILITE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,111,140,10
|
||||||
CONTROL "Highlight tag attributes",IDC_CHECK_ENABLTAGATTRHILITE,
|
CONTROL "Highlight tag attributes",IDC_CHECK_ENABLTAGATTRHILITE,
|
||||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,123,140,10
|
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,123,140,10
|
||||||
CONTROL "Highlight comment/php/asp zone",IDC_CHECK_HIGHLITENONEHTMLZONE,
|
CONTROL "Highlight comment/php/asp zone",IDC_CHECK_HIGHLITENONEHTMLZONE,
|
||||||
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,136,140,10
|
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,136,140,10
|
||||||
RTEXT "Session file ext.:",IDC_SESSIONFILEEXT_STATIC,271,160,108,8
|
|
||||||
EDITTEXT IDC_EDIT_SESSIONFILEEXT,381,157,34,14,ES_AUTOHSCROLL
|
EDITTEXT IDC_EDIT_SESSIONFILEEXT,381,157,34,14,ES_AUTOHSCROLL
|
||||||
|
GROUPBOX "Document Switcher (Ctrl+TAB)",IDC_DOCUMENTSWITCHER_STATIC,37,4,155,39,BS_CENTER
|
||||||
|
GROUPBOX "Clickable Link Settings",IDC_CLICKABLELINK_STATIC,259,4,155,39,BS_CENTER
|
||||||
|
GROUPBOX "File Status Auto-Detection",IDC_FILEAUTODETECTION_STATIC,259,47,155,50,BS_CENTER
|
||||||
|
GROUPBOX "Highlight Matching Tags",IDC_TAGMATCHEDHILITE_STATIC,259,101,155,50,BS_CENTER
|
||||||
|
RTEXT "Session file ext.:",IDC_SESSIONFILEEXT_STATIC,271,160,108,8
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_PREFERENCE_NEWDOCSETTING_BOX DIALOGEX 0, 0, 455, 185
|
IDD_PREFERENCE_NEWDOCSETTING_BOX DIALOGEX 0, 0, 455, 185
|
||||||
|
|
|
@ -753,12 +753,14 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_MAINTAININDENT, BM_SETCHECK, nppGUI._maitainIndent, 0);
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_MAINTAININDENT, BM_SETCHECK, nppGUI._maitainIndent, 0);
|
||||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_STYLEMRU, BM_SETCHECK, nppGUI._styleMRU, 0);
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_STYLEMRU, BM_SETCHECK, nppGUI._styleMRU, 0);
|
||||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLSMARTHILITE, BM_SETCHECK, nppGUI._enableSmartHilite, 0);
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLSMARTHILITE, BM_SETCHECK, nppGUI._enableSmartHilite, 0);
|
||||||
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_SMARTHILITECASESENSITIVE, BM_SETCHECK, nppGUI._smartHiliteCaseSensitive, 0);
|
||||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLTAGSMATCHHILITE, BM_SETCHECK, nppGUI._enableTagsMatchHilite, 0);
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLTAGSMATCHHILITE, BM_SETCHECK, nppGUI._enableTagsMatchHilite, 0);
|
||||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLTAGATTRHILITE, BM_SETCHECK, nppGUI._enableTagAttrsHilite, 0);
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLTAGATTRHILITE, BM_SETCHECK, nppGUI._enableTagAttrsHilite, 0);
|
||||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_HIGHLITENONEHTMLZONE, BM_SETCHECK, nppGUI._enableHiliteNonHTMLZone, 0);
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_HIGHLITENONEHTMLZONE, BM_SETCHECK, nppGUI._enableHiliteNonHTMLZone, 0);
|
||||||
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_ENABLTAGATTRHILITE), nppGUI._enableTagsMatchHilite);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_ENABLTAGATTRHILITE), nppGUI._enableTagsMatchHilite);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_HIGHLITENONEHTMLZONE), nppGUI._enableTagsMatchHilite);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_HIGHLITENONEHTMLZONE), nppGUI._enableTagsMatchHilite);
|
||||||
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_SMARTHILITECASESENSITIVE), nppGUI._enableSmartHilite);
|
||||||
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_SHORTTITLE, BM_SETCHECK, nppGUI._shortTitlebar, 0);
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_SHORTTITLE, BM_SETCHECK, nppGUI._shortTitlebar, 0);
|
||||||
|
|
||||||
|
@ -884,8 +886,20 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||||
HWND grandParent = ::GetParent(_hParent);
|
HWND grandParent = ::GetParent(_hParent);
|
||||||
::SendMessage(grandParent, NPPM_INTERNAL_CLEARINDICATOR, 0, 0);
|
::SendMessage(grandParent, NPPM_INTERNAL_CLEARINDICATOR, 0, 0);
|
||||||
}
|
}
|
||||||
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_SMARTHILITECASESENSITIVE), nppGUI._enableSmartHilite);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
case IDC_CHECK_SMARTHILITECASESENSITIVE:
|
||||||
|
{
|
||||||
|
nppGUI._smartHiliteCaseSensitive = !nppGUI._smartHiliteCaseSensitive;
|
||||||
|
if (!nppGUI._smartHiliteCaseSensitive)
|
||||||
|
{
|
||||||
|
HWND grandParent = ::GetParent(_hParent);
|
||||||
|
::SendMessage(grandParent, NPPM_INTERNAL_CLEARINDICATOR, 0, 0);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case IDC_CHECK_ENABLTAGSMATCHHILITE:
|
case IDC_CHECK_ENABLTAGSMATCHHILITE:
|
||||||
{
|
{
|
||||||
nppGUI._enableTagsMatchHilite = !nppGUI._enableTagsMatchHilite;
|
nppGUI._enableTagsMatchHilite = !nppGUI._enableTagsMatchHilite;
|
||||||
|
|
|
@ -135,6 +135,7 @@
|
||||||
#define IDC_TAGMATCHEDHILITE_STATIC (IDD_PREFERENCE_SETTING_BOX + 29)
|
#define IDC_TAGMATCHEDHILITE_STATIC (IDD_PREFERENCE_SETTING_BOX + 29)
|
||||||
#define IDC_CHECK_HIGHLITENONEHTMLZONE (IDD_PREFERENCE_SETTING_BOX + 30)
|
#define IDC_CHECK_HIGHLITENONEHTMLZONE (IDD_PREFERENCE_SETTING_BOX + 30)
|
||||||
#define IDC_CHECK_SHORTTITLE (IDD_PREFERENCE_SETTING_BOX + 31)
|
#define IDC_CHECK_SHORTTITLE (IDD_PREFERENCE_SETTING_BOX + 31)
|
||||||
|
#define IDC_CHECK_SMARTHILITECASESENSITIVE (IDD_PREFERENCE_SETTING_BOX + 32)
|
||||||
|
|
||||||
#define IDD_PREFERENCE_NEWDOCSETTING_BOX 6400 //(IDD_PREFERENCE_BOX + 400)
|
#define IDD_PREFERENCE_NEWDOCSETTING_BOX 6400 //(IDD_PREFERENCE_BOX + 400)
|
||||||
#define IDC_FORMAT_GB_STATIC (IDD_PREFERENCE_NEWDOCSETTING_BOX + 1)
|
#define IDC_FORMAT_GB_STATIC (IDD_PREFERENCE_NEWDOCSETTING_BOX + 1)
|
||||||
|
|
Loading…
Reference in New Issue