Merge pull request #3346 from RaiKoHoff/Dev_RC1

Fix Stream Comment for .AU3 and Scintilla text rendering problem
This commit is contained in:
Pairi Daiza 2021-04-19 10:04:46 +02:00 committed by GitHub
commit cdf4e21dfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 285 additions and 280 deletions

View File

@ -1361,7 +1361,7 @@ public:
std::unique_ptr<IScreenLineLayout> Layout(const IScreenLine *screenLine) override;
void DrawTextCommon(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, int codePageDraw, UINT fuOptions);
void DrawTextCommon(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, int codePageOverride, UINT fuOptions);
void DrawTextNoClip(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore, ColourAlpha back) override;
void DrawTextClipped(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, ColourAlpha fore, ColourAlpha back) override;
@ -2310,10 +2310,11 @@ std::unique_ptr<IScreenLineLayout> SurfaceD2D::Layout(const IScreenLine *screenL
return std::make_unique<ScreenLineLayout>(screenLine);
}
void SurfaceD2D::DrawTextCommon(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, int codePageDraw, UINT fuOptions) {
void SurfaceD2D::DrawTextCommon(PRectangle rc, const Font *font_, XYPOSITION ybase, std::string_view text, int codePageOverride, UINT fuOptions) {
SetFont(font_);
// Use Unicode calls
const int codePageDraw = codePageOverride ? codePageOverride : codePageText;
const TextWide tbuf(text, codePageDraw);
if (pRenderTarget && pTextFormat && pBrush) {
if (fuOptions & ETO_CLIPPED) {
@ -2347,7 +2348,7 @@ void SurfaceD2D::DrawTextNoClip(PRectangle rc, const Font *font_, XYPOSITION yba
if (pRenderTarget) {
FillRectangleAligned(rc, back);
D2DPenColourAlpha(fore);
DrawTextCommon(rc, font_, ybase, text, codePageText, ETO_OPAQUE);
DrawTextCommon(rc, font_, ybase, text, 0, ETO_OPAQUE);
}
}
@ -2356,7 +2357,7 @@ void SurfaceD2D::DrawTextClipped(PRectangle rc, const Font *font_, XYPOSITION yb
if (pRenderTarget) {
FillRectangleAligned(rc, back);
D2DPenColourAlpha(fore);
DrawTextCommon(rc, font_, ybase, text, codePageText, ETO_OPAQUE | ETO_CLIPPED);
DrawTextCommon(rc, font_, ybase, text, 0, ETO_OPAQUE | ETO_CLIPPED);
}
}
@ -2367,7 +2368,7 @@ void SurfaceD2D::DrawTextTransparent(PRectangle rc, const Font *font_, XYPOSITIO
if (ch != ' ') {
if (pRenderTarget) {
D2DPenColourAlpha(fore);
DrawTextCommon(rc, font_, ybase, text, codePageText, 0);
DrawTextCommon(rc, font_, ybase, text, 0, 0);
}
return;
}

View File

@ -30,7 +30,6 @@
#include "crypto/crypto.h"
#include "uthash/utarray.h"
#include "uthash/utlist.h"
//#include "uthash/utstring.h"
#include "tinyexpr/tinyexpr.h"
#include "Encoding.h"
#include "MuiLanguage.h"
@ -39,7 +38,6 @@
#include "DarkMode/DarkMode.h"
#include "SciCall.h"
//#include "SciLexer.h"
#include "Edit.h"
@ -7898,9 +7896,9 @@ void EditFoldMarkedLineRange(HWND hwnd, bool bHideLines)
if (!bHideLines) {
// reset
SciCall_FoldAll(EXPAND);
Style_SetFoldingAvailability(Style_GetCurrentLexerPtr());
Lexer_SetFoldingAvailability(Style_GetCurrentLexerPtr());
FocusedView.ShowCodeFolding = Settings.ShowCodeFolding;
Style_SetFoldingProperties(FocusedView.CodeFoldingAvailable);
Lexer_SetFoldingProperties(FocusedView.CodeFoldingAvailable);
Style_SetFolding(hwnd, FocusedView.CodeFoldingAvailable && FocusedView.ShowCodeFolding);
Sci_ColouriseAll();
EditMarkAllOccurrences(hwnd, true);
@ -7908,7 +7906,7 @@ void EditFoldMarkedLineRange(HWND hwnd, bool bHideLines)
// prepare hidden (folding) settings
FocusedView.CodeFoldingAvailable = true;
FocusedView.ShowCodeFolding = true;
Style_SetFoldingFocusedView();
Lexer_SetFoldingFocusedView();
Style_SetFolding(hwnd, true);
int const baseLevel = SC_FOLDLEVELBASE;

View File

@ -41,8 +41,7 @@
#include "Notepad3.h"
#include "Config/Config.h"
#include "DarkMode/DarkMode.h"
#include "lexers_x/SciXLexer.h"
#include "StyleLexers/EditLexer.h"
// ============================================================================
//
@ -3460,153 +3459,6 @@ LRESULT MsgExitMenuLoop(HWND hwnd, WPARAM wParam)
}
static void _GetStreamCommentStrgs(LPWSTR beg_out, LPWSTR end_out, size_t maxlen)
{
if (beg_out && end_out && maxlen) {
switch (SciCall_GetLexer()) {
case SCLEX_AVS:
case SCLEX_CPP:
case SCLEX_CSS:
case SCLEX_D: // L"/+", L"+/" could also be used instead
case SCLEX_DART:
case SCLEX_HTML:
case SCLEX_JSON:
case SCLEX_KOTLIN:
case SCLEX_NSIS:
case SCLEX_RUST:
case SCLEX_SQL:
case SCLEX_VHDL:
case SCLEX_XML:
StringCchCopy(beg_out, maxlen, L"/*");
StringCchCopy(end_out, maxlen, L"*/");
break;
case SCLEX_INNOSETUP:
case SCLEX_PASCAL:
StringCchCopy(beg_out, maxlen, L"{");
StringCchCopy(end_out, maxlen, L"}");
break;
case SCLEX_LUA:
StringCchCopy(beg_out, maxlen, L"--[[");
StringCchCopy(end_out, maxlen, L"]]");
break;
case SCLEX_COFFEESCRIPT:
StringCchCopy(beg_out, maxlen, L"###");
StringCchCopy(end_out, maxlen, L"###");
break;
case SCLEX_MATLAB:
StringCchCopy(beg_out, maxlen, L"%{");
StringCchCopy(end_out, maxlen, L"%}");
break;
// ------------------
case SCLEX_NULL:
case SCLEX_AHKL:
case SCLEX_ASM:
case SCLEX_AU3:
case SCLEX_BASH:
case SCLEX_BATCH:
case SCLEX_CMAKE:
case SCLEX_CONF:
case SCLEX_DIFF:
case SCLEX_LATEX:
case SCLEX_MAKEFILE:
case SCLEX_MARKDOWN:
case SCLEX_NIM:
case SCLEX_PERL:
case SCLEX_POWERSHELL:
case SCLEX_PROPERTIES:
case SCLEX_PYTHON:
case SCLEX_R:
case SCLEX_REGISTRY:
case SCLEX_RUBY:
case SCLEX_TCL:
case SCLEX_TOML:
case SCLEX_VB:
case SCLEX_VBSCRIPT:
case SCLEX_YAML:
default:
StringCchCopy(beg_out, maxlen, L"");
StringCchCopy(end_out, maxlen, L"");
break;
}
}
}
static bool _GetLineCommentStrg(LPWSTR pre_out, size_t maxlen)
{
if (pre_out && maxlen) {
switch (SciCall_GetLexer()) {
case SCLEX_CPP:
case SCLEX_D:
case SCLEX_DART:
case SCLEX_HTML:
case SCLEX_JSON:
case SCLEX_KOTLIN:
case SCLEX_PASCAL:
case SCLEX_RUST:
case SCLEX_XML:
StringCchCopy(pre_out, maxlen, L"//");
return false;
case SCLEX_VB:
case SCLEX_VBSCRIPT:
StringCchCopy(pre_out, maxlen, L"'");
return false;
case SCLEX_AVS:
case SCLEX_BASH:
case SCLEX_CMAKE:
case SCLEX_COFFEESCRIPT:
case SCLEX_CONF:
case SCLEX_MAKEFILE:
case SCLEX_NIM:
case SCLEX_PERL:
case SCLEX_POWERSHELL:
case SCLEX_PYTHON:
case SCLEX_R:
case SCLEX_RUBY:
case SCLEX_TCL:
case SCLEX_TOML:
case SCLEX_YAML:
StringCchCopy(pre_out, maxlen, L"#");
return true;
case SCLEX_AHKL:
case SCLEX_ASM:
case SCLEX_AU3:
case SCLEX_INNOSETUP:
case SCLEX_NSIS: // "#" could also be used instead
case SCLEX_PROPERTIES:
case SCLEX_REGISTRY:
StringCchCopy(pre_out, maxlen, L";");
return true;
case SCLEX_LUA:
case SCLEX_SQL:
case SCLEX_VHDL:
StringCchCopy(pre_out, maxlen, L"--");
return true;
case SCLEX_BATCH: // "::" could also be used instead
StringCchCopy(pre_out, maxlen, L"rem ");
return true;
case SCLEX_LATEX:
case SCLEX_MATLAB:
StringCchCopy(pre_out, maxlen, L"%");
return true;
// ------------------
case SCLEX_NULL:
case SCLEX_CSS:
case SCLEX_DIFF:
case SCLEX_MARKDOWN:
default:
StringCchCopy(pre_out, maxlen, L"");
break;
}
}
return false;
}
//=============================================================================
//
// MsgInitMenu() - Handles WM_INITMENU
@ -3792,10 +3644,10 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
EnableCmd(hmenu, IDM_VIEW_SHOWEXCERPT, !se);
WCHAR cmnt[8];
_GetLineCommentStrg(cmnt, COUNTOF(cmnt));
Lexer_GetLineCommentStrg(cmnt, COUNTOF(cmnt));
EnableCmd(hmenu, IDM_EDIT_LINECOMMENT, StrIsNotEmpty(cmnt) && !ro);
_GetStreamCommentStrgs(cmnt, cmnt, COUNTOF(cmnt));
Lexer_GetStreamCommentStrgs(cmnt, cmnt, COUNTOF(cmnt));
EnableCmd(hmenu, IDM_EDIT_STREAMCOMMENT, StrIsNotEmpty(cmnt) && !ro);
EnableCmd(hmenu, CMD_INSERTNEWLINE, !ro);
@ -4980,7 +4832,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
case IDM_EDIT_LINECOMMENT: {
WCHAR comment[8] = { L'\0' };
bool const bAtStart = _GetLineCommentStrg(comment, COUNTOF(comment));
bool const bAtStart = Lexer_GetLineCommentStrg(comment, COUNTOF(comment));
if (StrIsNotEmpty(comment)) {
EditToggleLineCommentsSimple(comment, bAtStart);
}
@ -4990,7 +4842,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
case IDM_EDIT_LINECOMMENT_BLOCKEDIT: {
WCHAR comment[8] = { L'\0' };
bool const bAtStart = _GetLineCommentStrg(comment, COUNTOF(comment));
bool const bAtStart = Lexer_GetLineCommentStrg(comment, COUNTOF(comment));
if (StrIsNotEmpty(comment)) {
EditToggleLineCommentsExtended(comment, bAtStart);
}
@ -5001,7 +4853,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
case IDM_EDIT_STREAMCOMMENT: {
WCHAR cmnt_beg[8] = { L'\0' };
WCHAR cmnt_end[8] = { L'\0' };
_GetStreamCommentStrgs(cmnt_beg, cmnt_end, COUNTOF(cmnt_beg));
Lexer_GetStreamCommentStrgs(cmnt_beg, cmnt_end, COUNTOF(cmnt_beg));
if (StrIsNotEmpty(cmnt_beg)) {
EditEncloseSelection(cmnt_beg, cmnt_end);
}
@ -9238,8 +9090,7 @@ void UpdateMarginWidth(const bool bForce)
SciCall_SetMarginWidthN(MARGIN_SCI_LINENUM, iLineMarginWidthFit);
}
} else {
// TODO: SCI Bug if set to 0 (=invisible), workaround use 1px
SciCall_SetMarginWidthN(MARGIN_SCI_LINENUM, +1);
SciCall_SetMarginWidthN(MARGIN_SCI_LINENUM, 0);
}
Style_SetBookmark(Globals.hwndEdit, Settings.ShowBookmarkMargin);
Style_SetFolding(Globals.hwndEdit, (FocusedView.CodeFoldingAvailable && FocusedView.ShowCodeFolding));

View File

@ -604,6 +604,7 @@
<ClCompile Include="crypto\rijndael-alg-fst.c" />
<ClCompile Include="crypto\rijndael-api-fst.c" />
<ClCompile Include="crypto\sha-256.c" />
<ClCompile Include="StyleLexers\EditLexer.c" />
<ClCompile Include="StyleLexers\styleLexDart.c" />
<ClCompile Include="StyleLexers\styleLexKotlin.c" />
<ClCompile Include="tinyexpr\tinyexpr.c" />

View File

@ -411,6 +411,9 @@
<ClCompile Include="StyleLexers\styleLexKotlin.c">
<Filter>Source Files\StyleLexers</Filter>
</ClCompile>
<ClCompile Include="StyleLexers\EditLexer.c">
<Filter>Source Files\StyleLexers</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Dlapi.h">

253
src/StyleLexers/EditLexer.c Normal file
View File

@ -0,0 +1,253 @@
#include "lexers_x/SciXLexer.h"
#include "SciCall.h"
#include "EditLexer.h"
void Lexer_GetStreamCommentStrgs(LPWSTR beg_out, LPWSTR end_out, size_t maxlen)
{
if (beg_out && end_out && maxlen) {
switch (SciCall_GetLexer()) {
case SCLEX_AU3:
StringCchCopy(beg_out, maxlen, L"#cs");
StringCchCopy(end_out, maxlen, L"#ce");
break;
case SCLEX_AVS:
case SCLEX_CPP:
case SCLEX_CSS:
case SCLEX_D: // L"/+", L"+/" could also be used instead
case SCLEX_DART:
case SCLEX_HTML:
case SCLEX_JSON:
case SCLEX_KOTLIN:
case SCLEX_NSIS:
case SCLEX_RUST:
case SCLEX_SQL:
case SCLEX_VHDL:
case SCLEX_XML:
StringCchCopy(beg_out, maxlen, L"/*");
StringCchCopy(end_out, maxlen, L"*/");
break;
case SCLEX_INNOSETUP:
case SCLEX_PASCAL:
StringCchCopy(beg_out, maxlen, L"{");
StringCchCopy(end_out, maxlen, L"}");
break;
case SCLEX_LUA:
StringCchCopy(beg_out, maxlen, L"--[[");
StringCchCopy(end_out, maxlen, L"]]");
break;
case SCLEX_COFFEESCRIPT:
StringCchCopy(beg_out, maxlen, L"###");
StringCchCopy(end_out, maxlen, L"###");
break;
case SCLEX_MATLAB:
StringCchCopy(beg_out, maxlen, L"%{");
StringCchCopy(end_out, maxlen, L"%}");
break;
// ------------------
case SCLEX_NULL:
case SCLEX_AHKL:
case SCLEX_ASM:
case SCLEX_BASH:
case SCLEX_BATCH:
case SCLEX_CMAKE:
case SCLEX_CONF:
case SCLEX_DIFF:
case SCLEX_LATEX:
case SCLEX_MAKEFILE:
case SCLEX_MARKDOWN:
case SCLEX_NIM:
case SCLEX_PERL:
case SCLEX_POWERSHELL:
case SCLEX_PROPERTIES:
case SCLEX_PYTHON:
case SCLEX_R:
case SCLEX_REGISTRY:
case SCLEX_RUBY:
case SCLEX_TCL:
case SCLEX_TOML:
case SCLEX_VB:
case SCLEX_VBSCRIPT:
case SCLEX_YAML:
default:
StringCchCopy(beg_out, maxlen, L"");
StringCchCopy(end_out, maxlen, L"");
break;
}
}
}
bool Lexer_GetLineCommentStrg(LPWSTR pre_out, size_t maxlen)
{
if (pre_out && maxlen) {
switch (SciCall_GetLexer()) {
case SCLEX_CPP:
case SCLEX_D:
case SCLEX_DART:
case SCLEX_HTML:
case SCLEX_JSON:
case SCLEX_KOTLIN:
case SCLEX_PASCAL:
case SCLEX_RUST:
case SCLEX_XML:
StringCchCopy(pre_out, maxlen, L"//");
return false;
case SCLEX_VB:
case SCLEX_VBSCRIPT:
StringCchCopy(pre_out, maxlen, L"'");
return false;
case SCLEX_AVS:
case SCLEX_BASH:
case SCLEX_CMAKE:
case SCLEX_COFFEESCRIPT:
case SCLEX_CONF:
case SCLEX_MAKEFILE:
case SCLEX_NIM:
case SCLEX_PERL:
case SCLEX_POWERSHELL:
case SCLEX_PYTHON:
case SCLEX_R:
case SCLEX_RUBY:
case SCLEX_TCL:
case SCLEX_TOML:
case SCLEX_YAML:
StringCchCopy(pre_out, maxlen, L"#");
return true;
case SCLEX_AHKL:
case SCLEX_ASM:
case SCLEX_AU3:
case SCLEX_INNOSETUP:
case SCLEX_NSIS: // "#" could also be used instead
case SCLEX_PROPERTIES:
case SCLEX_REGISTRY:
StringCchCopy(pre_out, maxlen, L";");
return true;
case SCLEX_LUA:
case SCLEX_SQL:
case SCLEX_VHDL:
StringCchCopy(pre_out, maxlen, L"--");
return true;
case SCLEX_BATCH: // "::" could also be used instead
StringCchCopy(pre_out, maxlen, L"rem ");
return true;
case SCLEX_LATEX:
case SCLEX_MATLAB:
StringCchCopy(pre_out, maxlen, L"%");
return true;
// ------------------
case SCLEX_NULL:
case SCLEX_CSS:
case SCLEX_DIFF:
case SCLEX_MARKDOWN:
default:
StringCchCopy(pre_out, maxlen, L"");
break;
}
}
return false;
}
//=============================================================================
//
// Lexer_SetFoldingAvailability()
//
void Lexer_SetFoldingAvailability(PEDITLEXER pLexer) {
switch (pLexer->lexerID) {
case SCLEX_NULL:
case SCLEX_CONTAINER:
case SCLEX_BATCH:
case SCLEX_CONF:
case SCLEX_MAKEFILE:
case SCLEX_MARKDOWN:
FocusedView.CodeFoldingAvailable = false;
break;
default:
FocusedView.CodeFoldingAvailable = true;
break;
}
}
//=============================================================================
//
// Lexer_SetFoldingProperties()
//
void Lexer_SetFoldingProperties(bool active) {
if (active) {
SciCall_SetProperty("fold", "1");
SciCall_SetProperty("fold.comment", "1");
SciCall_SetProperty("fold.compact", "0");
SciCall_SetProperty("fold.foldsyntaxbased", "1");
SciCall_SetProperty("fold.html", "1");
SciCall_SetProperty("fold.preprocessor", "1");
SciCall_SetProperty("fold.cpp.comment.explicit", "0");
} else {
SciCall_SetProperty("fold", "0");
}
}
//=============================================================================
//
// Lexer_SetFoldingFocusedView()
//
void Lexer_SetFoldingFocusedView() {
SciCall_SetProperty("fold", "0"); // disable folding by lexers
SciCall_SetProperty("fold.comment", "1");
SciCall_SetProperty("fold.compact", "0");
}
//=============================================================================
//
// void Lexer_SetLexerSpecificProperties()
//
void Lexer_SetLexerSpecificProperties(const int lexerId) {
switch (lexerId) {
case SCLEX_CPP:
SciCall_SetProperty("styling.within.preprocessor", "1");
SciCall_SetProperty("lexer.cpp.track.preprocessor", "0");
SciCall_SetProperty("lexer.cpp.update.preprocessor", "0");
break;
case SCLEX_PASCAL:
SciCall_SetProperty("lexer.pascal.smart.highlighting", "1");
break;
case SCLEX_SQL:
SciCall_SetProperty("sql.backslash.escapes", "1");
SciCall_SetProperty("lexer.sql.backticks.identifier", "1");
SciCall_SetProperty("lexer.sql.numbersign.comment", Settings2.LexerSQLNumberSignAsComment ? "1" : "0");
break;
case SCLEX_NSIS:
SciCall_SetProperty("nsis.ignorecase", "1");
break;
case SCLEX_CSS:
SciCall_SetProperty("lexer.css.scss.language", "1");
SciCall_SetProperty("lexer.css.less.language", "1");
break;
case SCLEX_JSON:
SciCall_SetProperty("json.allow.comments", "1");
SciCall_SetProperty("json.escape.sequence", "1");
break;
case SCLEX_PYTHON:
SciCall_SetProperty("tab.timmy.whinge.level", "1");
SciCall_SetProperty("lexer.python.strings.f", "1");
break;
case SCLEX_XML:
SciCall_SetProperty("lexer.xml.allow.scripts", "1");
break;
default:
break;
}
}

View File

@ -166,3 +166,12 @@ extern EDITLEXER lexYAML; // YAML
"variant wend when while with withevents writeonly xor"
// -----------------------------------------------------------------------------
void Lexer_GetStreamCommentStrgs(LPWSTR beg_out, LPWSTR end_out, size_t maxlen);
bool Lexer_GetLineCommentStrg(LPWSTR pre_out, size_t maxlen);
void Lexer_SetFoldingAvailability(PEDITLEXER pLexer);
void Lexer_SetFoldingProperties(bool active);
void Lexer_SetFoldingFocusedView();
void Lexer_SetLexerSpecificProperties(const int lexerId);
// -----------------------------------------------------------------------------

View File

@ -12,7 +12,6 @@
// ----------------------------------------------------------------------------
#define MULTI_STYLE(a,b,c,d) ((a)|(b<<8)|(c<<16)|(d<<24))
#define EMPTY_KEYWORDLIST { NULL, }

View File

@ -879,113 +879,6 @@ bool Style_ExportToFile(const WCHAR* szFile, bool bForceAll)
}
//=============================================================================
//
// Style_SetFoldingAvailability()
//
void Style_SetFoldingAvailability(PEDITLEXER pLexer)
{
switch (pLexer->lexerID) {
case SCLEX_NULL:
case SCLEX_CONTAINER:
case SCLEX_BATCH:
case SCLEX_CONF:
case SCLEX_MAKEFILE:
case SCLEX_MARKDOWN:
FocusedView.CodeFoldingAvailable = false;
break;
default:
FocusedView.CodeFoldingAvailable = true;
break;
}
}
//=============================================================================
//
// Style_SetFoldingProperties()
//
void Style_SetFoldingProperties(bool active)
{
if (active) {
SciCall_SetProperty("fold", "1");
SciCall_SetProperty("fold.comment", "1");
SciCall_SetProperty("fold.compact", "0");
SciCall_SetProperty("fold.foldsyntaxbased", "1");
SciCall_SetProperty("fold.html", "1");
SciCall_SetProperty("fold.preprocessor", "1");
SciCall_SetProperty("fold.cpp.comment.explicit", "0");
} else {
SciCall_SetProperty("fold", "0");
}
}
//=============================================================================
//
// Style_SetFoldingFocusedView()
//
void Style_SetFoldingFocusedView()
{
SciCall_SetProperty("fold", "0"); // disable folding by lexers
SciCall_SetProperty("fold.comment", "1");
SciCall_SetProperty("fold.compact", "0");
}
//=============================================================================
//
// void Style_SetLexerSpecificProperties()
//
void Style_SetLexerSpecificProperties(const int lexerId)
{
switch (lexerId) {
case SCLEX_CPP:
SciCall_SetProperty("styling.within.preprocessor", "1");
SciCall_SetProperty("lexer.cpp.track.preprocessor", "0");
SciCall_SetProperty("lexer.cpp.update.preprocessor", "0");
break;
case SCLEX_PASCAL:
SciCall_SetProperty("lexer.pascal.smart.highlighting", "1");
break;
case SCLEX_SQL:
SciCall_SetProperty("sql.backslash.escapes", "1");
SciCall_SetProperty("lexer.sql.backticks.identifier", "1");
SciCall_SetProperty("lexer.sql.numbersign.comment", Settings2.LexerSQLNumberSignAsComment ? "1" : "0");
break;
case SCLEX_NSIS:
SciCall_SetProperty("nsis.ignorecase", "1");
break;
case SCLEX_CSS:
SciCall_SetProperty("lexer.css.scss.language", "1");
SciCall_SetProperty("lexer.css.less.language", "1");
break;
case SCLEX_JSON:
SciCall_SetProperty("json.allow.comments", "1");
SciCall_SetProperty("json.escape.sequence", "1");
break;
case SCLEX_PYTHON:
SciCall_SetProperty("tab.timmy.whinge.level", "1");
SciCall_SetProperty("lexer.python.strings.f", "1");
break;
case SCLEX_XML:
SciCall_SetProperty("lexer.xml.allow.scripts", "1");
break;
default:
break;
}
}
//=============================================================================
//
// Style_StrGetAttributeEx()
@ -1104,11 +997,11 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
#endif
// Lexer very specific styles
Style_SetLexerSpecificProperties(pLexNew->lexerID);
Lexer_SetLexerSpecificProperties(pLexNew->lexerID);
// Code folding
Style_SetFoldingAvailability(pLexNew);
Style_SetFoldingProperties(FocusedView.CodeFoldingAvailable);
Lexer_SetFoldingAvailability(pLexNew);
Lexer_SetFoldingProperties(FocusedView.CodeFoldingAvailable);
// Add KeyWord Lists
for (int i = 0; i <= KEYWORDSET_MAX; ++i) {

View File

@ -47,9 +47,6 @@ bool Style_InsertThemesMenu(HMENU hMenuBar);
void Style_DynamicThemesMenuCmd(int cmd, unsigned iCurThemeIdx);
float Style_GetCurrentFontSize();
void Style_SetFoldingAvailability(PEDITLEXER pLexer);
void Style_SetFoldingProperties(bool active);
void Style_SetFoldingFocusedView();
void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew);
void Style_FillRelatedStyles(HWND hwnd, const PEDITLEXER pLexer);
void Style_SetUrlHotSpot(HWND hwnd);