aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2019-12-14 08:09:58 +1100
committerNeil <nyamatongwe@gmail.com>2019-12-14 08:09:58 +1100
commita8141c4c11ad77014802d003d649abc8335a4f70 (patch)
tree25d837bc62a0f1e78258c5f725e6089e171c5256
parentf142d93df48c3b9e07edd25425627ddeeb071520 (diff)
downloadscintilla-mirror-a8141c4c11ad77014802d003d649abc8335a4f70.tar.gz
Remove links to lexers with SCI_EMPTYCATALOGUE definition.
This allows building a version of SciTE that is statically linked to Scintilla and does not include any lexers but allows the use of lexers provided by loading a DLL.
-rw-r--r--doc/ScintillaDoc.html3
-rw-r--r--doc/ScintillaHistory.html3
-rw-r--r--src/Catalogue.cxx4
3 files changed, 10 insertions, 0 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index fa75790eb..cb237264a 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -6857,6 +6857,9 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
styling and fold points for an unsupported language you can either do this in the container or
better still, write your own lexer following the pattern of one of the existing ones.</p>
+ <p>If the symbol <code>SCI_EMPTYCATALOGUE</code> is defined when building
+ Scintilla, then no lexers are made available but other lexing support code may be present.</p>
+
<p>Scintilla also supports external lexers. These are DLLs (on Windows), .dylib modules (on macOS),
or .so modules (on GTK/Linux) that export three
functions: <code>GetLexerCount</code>, <code>GetLexerName</code>, and
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 9f729fb45..3354bcb3d 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -569,6 +569,9 @@
<li>
SCI_LOADLEXERLIBRARY implemented on Cocoa.
</li>
+ <li>
+ Build Scintilla with SCI_EMPTYCATALOGUE to avoid making lexers available.
+ </li>
</ul>
<h3>
<a href="https://www.scintilla.org/scite423.zip">Release 4.2.3</a>
diff --git a/src/Catalogue.cxx b/src/Catalogue.cxx
index d9e0172d5..e3fcddafb 100644
--- a/src/Catalogue.cxx
+++ b/src/Catalogue.cxx
@@ -53,6 +53,8 @@ int Scintilla_LinkLexers() {
return 0;
initialised = 1;
+#if !defined(SCI_EMPTYCATALOGUE)
+
// Shorten the code that declares a lexer and ensures it is linked in by calling a method.
#define LINK_LEXER(lexer) extern LexerModule lexer; catalogueDefault.AddLexerModule(&lexer);
@@ -188,5 +190,7 @@ int Scintilla_LinkLexers() {
//--Autogenerated -- end of automatically generated section
+#endif
+
return 1;
}