[BUG_FIXED] Fix a crash that was occurring when searching in files from a deep path.

Fix Pascal and Scheme syntax highlighting problem (styles.xml).
Add SQL folding capacity.


git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@511 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2009-07-11 13:02:38 +00:00
parent bc6e33c78a
commit 72e20073be
7 changed files with 59 additions and 32 deletions

View File

@ -17,18 +17,18 @@
; Define the application name
!define APPNAME "Notepad++"
!define APPVERSION "5.4.4"
!define APPNAMEANDVERSION "Notepad++ v5.4.4"
!define APPVERSION "5.4.5"
!define APPNAMEANDVERSION "Notepad++ v5.4.5"
!define APPWEBSITE "http://notepad-plus.sourceforge.net/"
!define VERSION_MAJOR 5
!define VERSION_MINOR 44
!define VERSION_MINOR 45
; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\Notepad++"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "..\bin\npp.5.4.4.Installer.exe"
OutFile "..\bin\npp.5.4.5.Installer.exe"
; GetWindowsVersion
;
@ -740,6 +740,10 @@ SubSection "Themes" Themes
File "..\bin\themes\vim Dark Blue.xml"
SectionEnd
Section "Bespin" Bespin
SetOutPath "$INSTDIR\themes"
File "..\bin\themes\Bespin.xml"
SectionEnd
SubSectionEnd
Section /o "As default html viewer" htmlViewer
@ -1059,6 +1063,11 @@ SubSection un.Themes
Delete "$INSTDIR\themes\vim Dark Blue.xml"
RMDir "$INSTDIR\themes\"
SectionEnd
Section un.Bespin
Delete "$INSTDIR\themes\Bespin.xml"
RMDir "$INSTDIR\themes\"
SectionEnd
SubSectionEnd
Section un.htmlViewer

View File

@ -768,9 +768,8 @@ protected:
case L_BATCH:
case L_TXT:
case L_MAKEFILE:
case L_SQL:
//case L_SQL:
case L_ASM:
//case L_TEX:
case L_HASKELL:
case L_PROPS:
case L_SMALLTALK:

View File

@ -402,7 +402,7 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
toolTip.init(_hInst, hwnd);
if (_hoverMPos == posCaption)
{
toolTip.Show(rc, _pszCaption, pt.x, pt.y + 20);
toolTip.Show(rc, _pszCaption.c_str(), pt.x, pt.y + 20);
}
else
{
@ -445,7 +445,7 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
HBITMAP hBmpCur = NULL;
HBITMAP hBmpOld = NULL;
HBITMAP hBmpNew = NULL;
UINT length = lstrlen(_pszCaption);
UINT length = _pszCaption.length();
INT nSavedDC = ::SaveDC(hDc);
@ -490,11 +490,11 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
rc.top += 1;
rc.right -= 16;
hOldFont = (HFONT)::SelectObject(hDc, _hFont);
::DrawText(hDc, _pszCaption, length, &rc, DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
::DrawText(hDc, _pszCaption.c_str(), length, &rc, DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
// calculate text size and if its trankated...
SIZE size = {0};
GetTextExtentPoint32(hDc, _pszCaption, length, &size);
GetTextExtentPoint32(hDc, _pszCaption.c_str(), length, &size);
_bCaptionTT = (((rc.right - rc.left) < size.cx) ? TRUE : FALSE);
::SelectObject(hDc, hOldFont);
@ -541,11 +541,11 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
TEXT("MS Shell Dlg"));
hOldFont = (HFONT)::SelectObject(hDc, hFont);
::DrawText(hDc, _pszCaption, length, &rc, DT_BOTTOM | DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX);
::DrawText(hDc, _pszCaption.c_str(), length, &rc, DT_BOTTOM | DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX);
// calculate text size and if its trankated...
SIZE size = {0};
GetTextExtentPoint32(hDc, _pszCaption, length, &size);
GetTextExtentPoint32(hDc, _pszCaption.c_str(), length, &size);
_bCaptionTT = (((rc.bottom - rc.top) < size.cy) ? TRUE : FALSE);
::SelectObject(hDc, hOldFont);
@ -1362,23 +1362,23 @@ bool DockingCont::updateCaption()
if (!tcItem.lParam) return false;
// update caption text
lstrcpy(_pszCaption, ((tTbData*)tcItem.lParam)->pszName);
_pszCaption = ((tTbData*)tcItem.lParam)->pszName;
// test if additional information are available
if ((((tTbData*)tcItem.lParam)->uMask & DWS_ADDINFO) &&
(lstrlen(((tTbData*)tcItem.lParam)->pszAddInfo) != 0))
{
lstrcat(_pszCaption, TEXT(" - "));
lstrcat(_pszCaption, ((tTbData*)tcItem.lParam)->pszAddInfo);
_pszCaption += TEXT(" - ");
_pszCaption += ((tTbData*)tcItem.lParam)->pszAddInfo;
}
if (_isFloating == true)
{
::SetWindowText(_hSelf, _pszCaption);
::SetWindowText(_hSelf, _pszCaption.c_str());
}
else
{
::SetWindowText(_hCaption, _pszCaption);
::SetWindowText(_hCaption, _pszCaption.c_str());
}
return true;
}

View File

@ -26,6 +26,7 @@
#include <string>
#include <vector>
#include <commctrl.h>
#include "Common.h"
using namespace std;
@ -194,7 +195,8 @@ private:
// caption params
BOOL _isTopCaption;
TCHAR _pszCaption[256];
std::generic_string _pszCaption;
BOOL _isMouseDown;
BOOL _isMouseClose;
BOOL _isMouseOver;

View File

@ -44,7 +44,7 @@ void ToolTip::init(HINSTANCE hInst, HWND hParent)
}
void ToolTip::Show(RECT rectTitle, TCHAR * pszTitle, int iXOff, int iWidthOff)
void ToolTip::Show(RECT rectTitle, const TCHAR * pszTitle, int iXOff, int iWidthOff)
{
if (isVisible())
destroy();
@ -67,7 +67,8 @@ void ToolTip::Show(RECT rectTitle, TCHAR * pszTitle, int iXOff, int iWidthOff)
HFONT _hFont = (HFONT)::SendMessage(_hParent, WM_GETFONT, 0, 0);
::SendMessage(_hSelf, WM_SETFONT, reinterpret_cast<WPARAM>(_hFont), TRUE);
_ti.lpszText = pszTitle;
// Bleuargh... const_cast. Will have to do for now.
_ti.lpszText = const_cast<TCHAR *>(pszTitle);
::SendMessage(_hSelf, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &_ti);
::SendMessage(_hSelf, TTM_TRACKPOSITION, 0, (LPARAM)(DWORD) MAKELONG(_ti.rect.left + iXOff, _ti.rect.top + iWidthOff));
::SendMessage(_hSelf, TTM_TRACKACTIVATE, true, (LPARAM)(LPTOOLINFO) &_ti);

View File

@ -43,14 +43,13 @@ public:
// Implementation
public:
virtual void init(HINSTANCE hInst, HWND hParent);
void Show(RECT rectTitle, TCHAR* pszTitleText, int iXOff = 0, int iWidthOff = 0);
void Show(RECT rectTitle, const TCHAR* pszTitleText, int iXOff = 0, int iWidthOff = 0);
protected:
WNDPROC _defaultProc;
BOOL _bTrackMouse;
TOOLINFO _ti;
static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
return (((ToolTip *)(::GetWindowLongPtr(hwnd, GWL_USERDATA)))->runProc(Message, wParam, lParam));
};

View File

@ -433,16 +433,20 @@
</LexerType>
<LexerType name="pascal" desc="Pascal" ext="">
<WordsStyle name="DEFAULT" styleID="0" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="PREPROCESSOR" styleID="9" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="IDENTIFIER" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="INSTRUCTION WORD" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" keywordClass="instre1" />
<WordsStyle name="NUMBER" styleID="4" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="CHARACTER" styleID="7" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
<WordsStyle name="REGEX" styleID="14" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="COMMENT DOC" styleID="3" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="IDENTIFIER" styleID="1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="COMMENT" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="COMMENT LINE" styleID="3" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="COMMENT DOC" styleID="4" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="PREPROCESSOR" styleID="5" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="PREPROCESSOR2" styleID="6" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="NUMBER" styleID="7" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="HEX NUMBER" styleID="8" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="INSTRUCTION WORD" styleID="9" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" keywordClass="instre1" />
<WordsStyle name="STRING" styleID="10" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="STRING EOL" styleID="10" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="CHARACTER" styleID="12" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="OPERATOR" styleID="13" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
<WordsStyle name="ASM" styleID="14" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
</LexerType>
<LexerType name="perl" desc="Perl" ext="">
<WordsStyle name="PREPROCESSOR" styleID="9" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
@ -560,6 +564,19 @@
<WordsStyle name="BACKTICKS" styleID="18" fgColor="FFFF00" bgColor="A08080" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="DATA SECTION" styleID="19" fgColor="600000" bgColor="FFF0D8" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="STRING Q" styleID="24" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
</LexerType>
<LexerType name="scheme" desc="Schime" ext="">
<WordsStyle name="DEFAULT" styleID="0" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="COMMENTLINE" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="NUMBER" styleID="2" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="FUNCTION WORD" styleID="3" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" keywordClass="instre1" />
<WordsStyle name="SYMBOL" styleID="5" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
<WordsStyle name="STRING" styleID="6" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="STRINGEOL" styleID="8" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="2" fontSize="" />
<WordsStyle name="IDENTIFIER" styleID="9" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="0080C0" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" keywordClass="type1" />
<WordsStyle name="SPECIAL" styleID="11" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="COMMENT" styleID="12" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
</LexerType>
<LexerType name="smalltalk" desc="Smalltalk" ext="">
<WordsStyle name="DEFAULT" styleID="0" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />