[ENHANCEMENT] (Author: Andreas Jonsson) Enhance the delimiter selection(Ctrl + double click) feature.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1074 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2013-07-08 20:14:02 +00:00
parent 6264ef03d0
commit 4dd7423f61
2 changed files with 30 additions and 6 deletions

View File

@ -488,8 +488,20 @@ BOOL Notepad_plus::notify(SCNotification *notification)
{ {
if(bufstring.at(i) == nppGUI._leftmostDelimiter) if(bufstring.at(i) == nppGUI._leftmostDelimiter)
{ {
leftmost_position = i; // Respect escaped quotation marks.
break; if(nppGUI._leftmostDelimiter == '"')
{
if(! (i > 0 && bufstring.at(i - 1) == '\\'))
{
leftmost_position = i;
break;
}
}
else
{
leftmost_position = i;
break;
}
} }
} }
@ -501,8 +513,20 @@ BOOL Notepad_plus::notify(SCNotification *notification)
{ {
if(bufstring.at(i) == nppGUI._rightmostDelimiter) if(bufstring.at(i) == nppGUI._rightmostDelimiter)
{ {
rightmost_position = i; // Respect escaped quotation marks.
break; if(nppGUI._rightmostDelimiter == '"')
{
if(! (i > 0 && bufstring.at(i - 1) == '\\'))
{
rightmost_position = i;
break;
}
}
else
{
rightmost_position = i;
break;
}
} }
} }
} }

View File

@ -904,7 +904,7 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
else else
{ {
TCHAR moreInfo[128]; TCHAR moreInfo[128];
if(nbCounted <= 1) if (nbCounted == 1)
wsprintf(moreInfo, TEXT("Count: %d match."), nbCounted); wsprintf(moreInfo, TEXT("Count: %d match."), nbCounted);
else else
wsprintf(moreInfo, TEXT("Count: %d matches."), nbCounted); wsprintf(moreInfo, TEXT("Count: %d matches."), nbCounted);
@ -2120,7 +2120,7 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
else else
{ {
TCHAR moreInfo[128]; TCHAR moreInfo[128];
if (nbCounted <= 1) if (nbCounted == 1)
wsprintf(moreInfo, TEXT("Count: %d match."), nbCounted); wsprintf(moreInfo, TEXT("Count: %d match."), nbCounted);
else else
wsprintf(moreInfo, TEXT("Count: %d matches."), nbCounted); wsprintf(moreInfo, TEXT("Count: %d matches."), nbCounted);