[BUG_FIXED] (Author: Ivan Radić, aka Loreia) Fix a minor issue of UDL2.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@967 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
4f8122d2ef
commit
cc1c928b8c
@ -2067,6 +2067,7 @@ void Notepad_plus::addHotSpot(bool docIsModifing)
|
|||||||
_pEditView->execute(SCI_SETTARGETEND, endPos);
|
_pEditView->execute(SCI_SETTARGETEND, endPos);
|
||||||
|
|
||||||
vector<pair<int, int> > hotspotStylers;
|
vector<pair<int, int> > hotspotStylers;
|
||||||
|
|
||||||
int style_hotspot = 30;
|
int style_hotspot = 30;
|
||||||
int posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(URL_REG_EXPR), (LPARAM)URL_REG_EXPR);
|
int posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(URL_REG_EXPR), (LPARAM)URL_REG_EXPR);
|
||||||
|
|
||||||
@ -2079,69 +2080,69 @@ void Notepad_plus::addHotSpot(bool docIsModifing)
|
|||||||
|
|
||||||
if (end < posBegin2style - 1)
|
if (end < posBegin2style - 1)
|
||||||
{
|
{
|
||||||
if (style_hotspot > 1)
|
if (style_hotspot > 24)
|
||||||
style_hotspot--;
|
style_hotspot--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int fs = -1;
|
int fs = -1;
|
||||||
for (size_t i = 0 ; i < hotspotStylers.size() ; i++)
|
for (size_t i = 0 ; i < hotspotStylers.size() ; i++)
|
||||||
|
{
|
||||||
|
if (hotspotStylers[i].second == idStyle)
|
||||||
{
|
{
|
||||||
if (hotspotStylers[i].second == idStyle)
|
fs = hotspotStylers[i].first;
|
||||||
{
|
break;
|
||||||
fs = hotspotStylers[i].first;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (fs != -1)
|
if (fs != -1)
|
||||||
{
|
{
|
||||||
_pEditView->execute(SCI_STARTSTYLING, start, 0xFF);
|
_pEditView->execute(SCI_STARTSTYLING, start, 0xFF);
|
||||||
_pEditView->execute(SCI_SETSTYLING, foundTextLen, fs);
|
_pEditView->execute(SCI_SETSTYLING, foundTextLen, fs);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pair<int, int> p(style_hotspot, idStyle);
|
pair<int, int> p(style_hotspot, idStyle);
|
||||||
hotspotStylers.push_back(p);
|
hotspotStylers.push_back(p);
|
||||||
int activeFG = 0xFF0000;
|
int activeFG = 0xFF0000;
|
||||||
char fontNameA[128];
|
char fontNameA[128];
|
||||||
|
|
||||||
Style hotspotStyle;
|
Style hotspotStyle;
|
||||||
|
|
||||||
hotspotStyle._styleID = style_hotspot;
|
hotspotStyle._styleID = style_hotspot;
|
||||||
_pEditView->execute(SCI_STYLEGETFONT, idStyle, (LPARAM)fontNameA);
|
_pEditView->execute(SCI_STYLEGETFONT, idStyle, (LPARAM)fontNameA);
|
||||||
TCHAR *generic_fontname = new TCHAR[128];
|
TCHAR *generic_fontname = new TCHAR[128];
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
|
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
|
||||||
const wchar_t * fontNameW = wmc->char2wchar(fontNameA, _nativeLangSpeaker.getLangEncoding());
|
const wchar_t * fontNameW = wmc->char2wchar(fontNameA, _nativeLangSpeaker.getLangEncoding());
|
||||||
lstrcpy(generic_fontname, fontNameW);
|
lstrcpy(generic_fontname, fontNameW);
|
||||||
#else
|
#else
|
||||||
lstrcpy(generic_fontname, fontNameA);
|
lstrcpy(generic_fontname, fontNameA);
|
||||||
#endif
|
#endif
|
||||||
hotspotStyle._fontName = generic_fontname;
|
hotspotStyle._fontName = generic_fontname;
|
||||||
|
|
||||||
hotspotStyle._fgColor = _pEditView->execute(SCI_STYLEGETFORE, idStyle);
|
hotspotStyle._fgColor = _pEditView->execute(SCI_STYLEGETFORE, idStyle);
|
||||||
hotspotStyle._bgColor = _pEditView->execute(SCI_STYLEGETBACK, idStyle);
|
hotspotStyle._bgColor = _pEditView->execute(SCI_STYLEGETBACK, idStyle);
|
||||||
hotspotStyle._fontSize = _pEditView->execute(SCI_STYLEGETSIZE, idStyle);
|
hotspotStyle._fontSize = _pEditView->execute(SCI_STYLEGETSIZE, idStyle);
|
||||||
|
|
||||||
int isBold = _pEditView->execute(SCI_STYLEGETBOLD, idStyle);
|
int isBold = _pEditView->execute(SCI_STYLEGETBOLD, idStyle);
|
||||||
int isItalic = _pEditView->execute(SCI_STYLEGETITALIC, idStyle);
|
int isItalic = _pEditView->execute(SCI_STYLEGETITALIC, idStyle);
|
||||||
int isUnderline = _pEditView->execute(SCI_STYLEGETUNDERLINE, idStyle);
|
int isUnderline = _pEditView->execute(SCI_STYLEGETUNDERLINE, idStyle);
|
||||||
hotspotStyle._fontStyle = (isBold?FONTSTYLE_BOLD:0) | (isItalic?FONTSTYLE_ITALIC:0) | (isUnderline?FONTSTYLE_UNDERLINE:0);
|
hotspotStyle._fontStyle = (isBold?FONTSTYLE_BOLD:0) | (isItalic?FONTSTYLE_ITALIC:0) | (isUnderline?FONTSTYLE_UNDERLINE:0);
|
||||||
|
|
||||||
int urlAction = (NppParameters::getInstance())->getNppGUI()._styleURL;
|
int urlAction = (NppParameters::getInstance())->getNppGUI()._styleURL;
|
||||||
if (urlAction == 2)
|
if (urlAction == 2)
|
||||||
hotspotStyle._fontStyle |= FONTSTYLE_UNDERLINE;
|
hotspotStyle._fontStyle |= FONTSTYLE_UNDERLINE;
|
||||||
|
|
||||||
_pEditView->setHotspotStyle(hotspotStyle);
|
_pEditView->setHotspotStyle(hotspotStyle);
|
||||||
|
|
||||||
_pEditView->execute(SCI_STYLESETHOTSPOT, style_hotspot, TRUE);
|
_pEditView->execute(SCI_STYLESETHOTSPOT, style_hotspot, TRUE);
|
||||||
_pEditView->execute(SCI_SETHOTSPOTACTIVEFORE, TRUE, activeFG);
|
_pEditView->execute(SCI_SETHOTSPOTACTIVEFORE, TRUE, activeFG);
|
||||||
_pEditView->execute(SCI_SETHOTSPOTSINGLELINE, style_hotspot, 0);
|
_pEditView->execute(SCI_SETHOTSPOTSINGLELINE, style_hotspot, 0);
|
||||||
_pEditView->execute(SCI_STARTSTYLING, start, 0x1F);
|
_pEditView->execute(SCI_STARTSTYLING, start, 0x1F);
|
||||||
_pEditView->execute(SCI_SETSTYLING, foundTextLen, style_hotspot);
|
_pEditView->execute(SCI_SETSTYLING, foundTextLen, style_hotspot);
|
||||||
if (style_hotspot > 1)
|
if (style_hotspot > 24)
|
||||||
style_hotspot--;
|
style_hotspot--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -405,7 +405,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Style _styleArray[SCE_USER_STYLE_TOTAL_STYLES];
|
Style _styleArray[SCE_STYLE_ARRAY_SIZE];
|
||||||
int _nbStyler;
|
int _nbStyler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -259,6 +259,7 @@
|
|||||||
#define SCE_USER_STYLE_IDENTIFIER 24
|
#define SCE_USER_STYLE_IDENTIFIER 24
|
||||||
#define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER
|
#define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER
|
||||||
#define SCE_USER_STYLE_MAPPER_TOTAL 17
|
#define SCE_USER_STYLE_MAPPER_TOTAL 17
|
||||||
|
#define SCE_STYLE_ARRAY_SIZE 30 // must cover sizes of NppParameters::_lexerStyler and NppParameters::_widgetStyle
|
||||||
|
|
||||||
#define SCE_USER_MASK_NESTING_NONE 0
|
#define SCE_USER_MASK_NESTING_NONE 0
|
||||||
#define SCE_USER_MASK_NESTING_DELIMITER1 0x1
|
#define SCE_USER_MASK_NESTING_DELIMITER1 0x1
|
||||||
|
@ -809,8 +809,8 @@ static bool isInListBackward(WordList & list, StyleContext & sc, bool specialMod
|
|||||||
// multi-part keyword is found,
|
// multi-part keyword is found,
|
||||||
// but it must be followed by whitespace (or 'forward' keyword)
|
// but it must be followed by whitespace (or 'forward' keyword)
|
||||||
// otherwise "else if" might wrongly match "else iff"
|
// otherwise "else if" might wrongly match "else iff"
|
||||||
bNext = sc.GetRelative(indexb + offset + 1);
|
bNext = sc.GetRelative(indexb + offset);
|
||||||
if (isWhiteSpace2(b, nlCountTemp, wsChar, bNext))
|
if (isWhiteSpace(bNext))
|
||||||
fwDelimiterFound = FORWARD_WHITESPACE_FOUND;
|
fwDelimiterFound = FORWARD_WHITESPACE_FOUND;
|
||||||
|
|
||||||
if (fwDelimiterFound == NO_DELIMITER)
|
if (fwDelimiterFound == NO_DELIMITER)
|
||||||
|
Loading…
Reference in New Issue
Block a user