From 1e9bafca0f56de34638d4c3fef8cf74fe9351193 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 8 Mar 2006 01:48:03 +0000 Subject: [PATCH] Updated to Scintilla 1.67 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/build/stc/makefile.bcc | 64 + contrib/build/stc/makefile.gcc | 64 + contrib/build/stc/makefile.vc | 64 + contrib/build/stc/makefile.wat | 64 + contrib/build/stc/stc.bkl | 8 + contrib/build/stc/stc.dsp | 32 + contrib/include/wx/stc/stc.h | 327 +++- contrib/src/stc/Makefile.in | 64 + contrib/src/stc/PlatWX.cpp | 52 +- contrib/src/stc/gen_iface.py | 47 +- contrib/src/stc/scintilla/README.txt | 2 +- contrib/src/stc/scintilla/include/KeyWords.h | 14 +- contrib/src/stc/scintilla/include/Platform.h | 4 +- contrib/src/stc/scintilla/include/PropSet.h | 11 +- contrib/src/stc/scintilla/include/SString.h | 4 +- contrib/src/stc/scintilla/include/SciLexer.h | 240 ++- contrib/src/stc/scintilla/include/Scintilla.h | 42 +- .../src/stc/scintilla/include/Scintilla.iface | 329 +++- .../stc/scintilla/include/ScintillaWidget.h | 4 +- .../src/stc/scintilla/src/AutoComplete.cxx | 54 +- contrib/src/stc/scintilla/src/AutoComplete.h | 8 +- contrib/src/stc/scintilla/src/CallTip.cxx | 34 +- contrib/src/stc/scintilla/src/CallTip.h | 4 +- contrib/src/stc/scintilla/src/CellBuffer.cxx | 40 +- contrib/src/stc/scintilla/src/CellBuffer.h | 1 - contrib/src/stc/scintilla/src/Document.cxx | 354 ++-- contrib/src/stc/scintilla/src/Document.h | 15 +- .../stc/scintilla/src/DocumentAccessor.cxx | 5 +- .../src/stc/scintilla/src/DocumentAccessor.h | 4 +- contrib/src/stc/scintilla/src/Editor.cxx | 573 +++--- contrib/src/stc/scintilla/src/Editor.h | 17 +- contrib/src/stc/scintilla/src/KeyMap.cxx | 2 +- contrib/src/stc/scintilla/src/KeyWords.cxx | 57 +- contrib/src/stc/scintilla/src/LexAU3.cxx | 340 +++- contrib/src/stc/scintilla/src/LexAVE.cxx | 5 +- contrib/src/stc/scintilla/src/LexAsn1.cxx | 2 +- contrib/src/stc/scintilla/src/LexBash.cxx | 45 +- contrib/src/stc/scintilla/src/LexBasic.cxx | 364 ++++ contrib/src/stc/scintilla/src/LexCLW.cxx | 362 +++- contrib/src/stc/scintilla/src/LexCPP.cxx | 335 ++-- contrib/src/stc/scintilla/src/LexCSS.cxx | 26 +- contrib/src/stc/scintilla/src/LexCaml.cxx | 399 ++++ contrib/src/stc/scintilla/src/LexCsound.cxx | 207 ++ contrib/src/stc/scintilla/src/LexEiffel.cxx | 1 - contrib/src/stc/scintilla/src/LexFlagship.cxx | 226 +++ contrib/src/stc/scintilla/src/LexFortran.cxx | 6 +- contrib/src/stc/scintilla/src/LexGui4Cli.cxx | 2 +- contrib/src/stc/scintilla/src/LexHTML.cxx | 173 +- contrib/src/stc/scintilla/src/LexHaskell.cxx | 263 +++ contrib/src/stc/scintilla/src/LexLisp.cxx | 107 +- contrib/src/stc/scintilla/src/LexLua.cxx | 149 +- contrib/src/stc/scintilla/src/LexMSSQL.cxx | 100 +- contrib/src/stc/scintilla/src/LexMetapost.cxx | 4 +- contrib/src/stc/scintilla/src/LexNsis.cxx | 269 ++- contrib/src/stc/scintilla/src/LexOthers.cxx | 655 +++++-- contrib/src/stc/scintilla/src/LexPOV.cxx | 18 +- contrib/src/stc/scintilla/src/LexPS.cxx | 1 - contrib/src/stc/scintilla/src/LexPerl.cxx | 499 +++-- contrib/src/stc/scintilla/src/LexPython.cxx | 14 +- contrib/src/stc/scintilla/src/LexRebol.cxx | 319 +++ contrib/src/stc/scintilla/src/LexRuby.cxx | 1709 ++++++++++++++--- contrib/src/stc/scintilla/src/LexSQL.cxx | 443 +++-- .../src/stc/scintilla/src/LexSmalltalk.cxx | 317 +++ contrib/src/stc/scintilla/src/LexTADS3.cxx | 837 ++++++++ contrib/src/stc/scintilla/src/LexTeX.cxx | 2 +- contrib/src/stc/scintilla/src/LexVB.cxx | 77 +- contrib/src/stc/scintilla/src/LineMarker.cxx | 4 +- contrib/src/stc/scintilla/src/PropSet.cxx | 115 +- contrib/src/stc/scintilla/src/RESearch.h | 2 + .../src/stc/scintilla/src/ScintillaBase.cxx | 147 +- contrib/src/stc/scintilla/src/ScintillaBase.h | 5 +- contrib/src/stc/scintilla/src/StyleContext.h | 7 +- contrib/src/stc/scintilla/src/XPM.cxx | 6 + contrib/src/stc/stc.cpp | 119 +- contrib/src/stc/stc.cpp.in | 13 + contrib/src/stc/stc.h.in | 12 +- include/wx/stc/stc.h | 327 +++- src/stc/Makefile.in | 64 + src/stc/PlatWX.cpp | 52 +- src/stc/gen_iface.py | 47 +- src/stc/scintilla/README.txt | 2 +- src/stc/scintilla/include/KeyWords.h | 14 +- src/stc/scintilla/include/Platform.h | 4 +- src/stc/scintilla/include/PropSet.h | 11 +- src/stc/scintilla/include/SString.h | 4 +- src/stc/scintilla/include/SciLexer.h | 240 ++- src/stc/scintilla/include/Scintilla.h | 42 +- src/stc/scintilla/include/Scintilla.iface | 329 +++- src/stc/scintilla/include/ScintillaWidget.h | 4 +- src/stc/scintilla/src/AutoComplete.cxx | 54 +- src/stc/scintilla/src/AutoComplete.h | 8 +- src/stc/scintilla/src/CallTip.cxx | 34 +- src/stc/scintilla/src/CallTip.h | 4 +- src/stc/scintilla/src/CellBuffer.cxx | 40 +- src/stc/scintilla/src/CellBuffer.h | 1 - src/stc/scintilla/src/Document.cxx | 354 ++-- src/stc/scintilla/src/Document.h | 15 +- src/stc/scintilla/src/DocumentAccessor.cxx | 5 +- src/stc/scintilla/src/DocumentAccessor.h | 4 +- src/stc/scintilla/src/Editor.cxx | 573 +++--- src/stc/scintilla/src/Editor.h | 17 +- src/stc/scintilla/src/KeyMap.cxx | 2 +- src/stc/scintilla/src/KeyWords.cxx | 57 +- src/stc/scintilla/src/LexAU3.cxx | 340 +++- src/stc/scintilla/src/LexAVE.cxx | 5 +- src/stc/scintilla/src/LexAsn1.cxx | 2 +- src/stc/scintilla/src/LexBash.cxx | 45 +- src/stc/scintilla/src/LexBasic.cxx | 364 ++++ src/stc/scintilla/src/LexCLW.cxx | 362 +++- src/stc/scintilla/src/LexCPP.cxx | 335 ++-- src/stc/scintilla/src/LexCSS.cxx | 26 +- src/stc/scintilla/src/LexCaml.cxx | 399 ++++ src/stc/scintilla/src/LexCsound.cxx | 207 ++ src/stc/scintilla/src/LexEiffel.cxx | 1 - src/stc/scintilla/src/LexFlagship.cxx | 226 +++ src/stc/scintilla/src/LexFortran.cxx | 6 +- src/stc/scintilla/src/LexGui4Cli.cxx | 2 +- src/stc/scintilla/src/LexHTML.cxx | 173 +- src/stc/scintilla/src/LexHaskell.cxx | 263 +++ src/stc/scintilla/src/LexLisp.cxx | 107 +- src/stc/scintilla/src/LexLua.cxx | 149 +- src/stc/scintilla/src/LexMSSQL.cxx | 100 +- src/stc/scintilla/src/LexMetapost.cxx | 4 +- src/stc/scintilla/src/LexNsis.cxx | 269 ++- src/stc/scintilla/src/LexOthers.cxx | 655 +++++-- src/stc/scintilla/src/LexPOV.cxx | 18 +- src/stc/scintilla/src/LexPS.cxx | 1 - src/stc/scintilla/src/LexPerl.cxx | 499 +++-- src/stc/scintilla/src/LexPython.cxx | 14 +- src/stc/scintilla/src/LexRebol.cxx | 319 +++ src/stc/scintilla/src/LexRuby.cxx | 1709 ++++++++++++++--- src/stc/scintilla/src/LexSQL.cxx | 443 +++-- src/stc/scintilla/src/LexSmalltalk.cxx | 317 +++ src/stc/scintilla/src/LexTADS3.cxx | 837 ++++++++ src/stc/scintilla/src/LexTeX.cxx | 2 +- src/stc/scintilla/src/LexVB.cxx | 77 +- src/stc/scintilla/src/LineMarker.cxx | 4 +- src/stc/scintilla/src/PropSet.cxx | 115 +- src/stc/scintilla/src/RESearch.h | 2 + src/stc/scintilla/src/ScintillaBase.cxx | 147 +- src/stc/scintilla/src/ScintillaBase.h | 5 +- src/stc/scintilla/src/StyleContext.h | 7 +- src/stc/scintilla/src/XPM.cxx | 6 + src/stc/stc.cpp | 119 +- src/stc/stc.cpp.in | 13 + src/stc/stc.h.in | 12 +- wxPython/contrib/stc/_stc_gendocs.i | 54 +- wxPython/contrib/stc/_stc_rename.i | 235 ++- wxPython/contrib/stc/stc.i | 1 + 149 files changed, 19003 insertions(+), 3611 deletions(-) create mode 100644 contrib/src/stc/scintilla/src/LexBasic.cxx create mode 100644 contrib/src/stc/scintilla/src/LexCaml.cxx create mode 100644 contrib/src/stc/scintilla/src/LexCsound.cxx create mode 100644 contrib/src/stc/scintilla/src/LexFlagship.cxx create mode 100644 contrib/src/stc/scintilla/src/LexHaskell.cxx create mode 100644 contrib/src/stc/scintilla/src/LexRebol.cxx create mode 100644 contrib/src/stc/scintilla/src/LexSmalltalk.cxx create mode 100644 contrib/src/stc/scintilla/src/LexTADS3.cxx create mode 100644 src/stc/scintilla/src/LexBasic.cxx create mode 100644 src/stc/scintilla/src/LexCaml.cxx create mode 100644 src/stc/scintilla/src/LexCsound.cxx create mode 100644 src/stc/scintilla/src/LexFlagship.cxx create mode 100644 src/stc/scintilla/src/LexHaskell.cxx create mode 100644 src/stc/scintilla/src/LexRebol.cxx create mode 100644 src/stc/scintilla/src/LexSmalltalk.cxx create mode 100644 src/stc/scintilla/src/LexTADS3.cxx diff --git a/contrib/build/stc/makefile.bcc b/contrib/build/stc/makefile.bcc index 9312ecbf82..4f248ea7c5 100644 --- a/contrib/build/stc/makefile.bcc +++ b/contrib/build/stc/makefile.bcc @@ -59,19 +59,24 @@ STCDLL_OBJECTS = \ $(OBJS)\stcdll_LexAsn1.obj \ $(OBJS)\stcdll_LexBaan.obj \ $(OBJS)\stcdll_LexBash.obj \ + $(OBJS)\stcdll_LexBasic.obj \ $(OBJS)\stcdll_LexBullant.obj \ $(OBJS)\stcdll_LexCLW.obj \ $(OBJS)\stcdll_LexCPP.obj \ $(OBJS)\stcdll_LexCSS.obj \ + $(OBJS)\stcdll_LexCaml.obj \ + $(OBJS)\stcdll_LexCsound.obj \ $(OBJS)\stcdll_LexConf.obj \ $(OBJS)\stcdll_LexCrontab.obj \ $(OBJS)\stcdll_LexEScript.obj \ $(OBJS)\stcdll_LexEiffel.obj \ $(OBJS)\stcdll_LexErlang.obj \ + $(OBJS)\stcdll_LexFlagship.obj \ $(OBJS)\stcdll_LexForth.obj \ $(OBJS)\stcdll_LexFortran.obj \ $(OBJS)\stcdll_LexGui4Cli.obj \ $(OBJS)\stcdll_LexHTML.obj \ + $(OBJS)\stcdll_LexHaskell.obj \ $(OBJS)\stcdll_LexKix.obj \ $(OBJS)\stcdll_LexLisp.obj \ $(OBJS)\stcdll_LexLout.obj \ @@ -89,8 +94,11 @@ STCDLL_OBJECTS = \ $(OBJS)\stcdll_LexPascal.obj \ $(OBJS)\stcdll_LexPerl.obj \ $(OBJS)\stcdll_LexPython.obj \ + $(OBJS)\stcdll_LexRebol.obj \ $(OBJS)\stcdll_LexRuby.obj \ $(OBJS)\stcdll_LexSQL.obj \ + $(OBJS)\stcdll_LexSmalltalk.obj \ + $(OBJS)\stcdll_LexTADS3.obj \ $(OBJS)\stcdll_LexScriptol.obj \ $(OBJS)\stcdll_LexSpecman.obj \ $(OBJS)\stcdll_LexTeX.obj \ @@ -139,19 +147,24 @@ STCLIB_OBJECTS = \ $(OBJS)\stclib_LexAsn1.obj \ $(OBJS)\stclib_LexBaan.obj \ $(OBJS)\stclib_LexBash.obj \ + $(OBJS)\stclib_LexBasic.obj \ $(OBJS)\stclib_LexBullant.obj \ $(OBJS)\stclib_LexCLW.obj \ $(OBJS)\stclib_LexCPP.obj \ $(OBJS)\stclib_LexCSS.obj \ + $(OBJS)\stclib_LexCaml.obj \ + $(OBJS)\stclib_LexCsound.obj \ $(OBJS)\stclib_LexConf.obj \ $(OBJS)\stclib_LexCrontab.obj \ $(OBJS)\stclib_LexEScript.obj \ $(OBJS)\stclib_LexEiffel.obj \ $(OBJS)\stclib_LexErlang.obj \ + $(OBJS)\stclib_LexFlagship.obj \ $(OBJS)\stclib_LexForth.obj \ $(OBJS)\stclib_LexFortran.obj \ $(OBJS)\stclib_LexGui4Cli.obj \ $(OBJS)\stclib_LexHTML.obj \ + $(OBJS)\stclib_LexHaskell.obj \ $(OBJS)\stclib_LexKix.obj \ $(OBJS)\stclib_LexLisp.obj \ $(OBJS)\stclib_LexLout.obj \ @@ -169,8 +182,11 @@ STCLIB_OBJECTS = \ $(OBJS)\stclib_LexPascal.obj \ $(OBJS)\stclib_LexPerl.obj \ $(OBJS)\stclib_LexPython.obj \ + $(OBJS)\stclib_LexRebol.obj \ $(OBJS)\stclib_LexRuby.obj \ $(OBJS)\stclib_LexSQL.obj \ + $(OBJS)\stclib_LexSmalltalk.obj \ + $(OBJS)\stclib_LexTADS3.obj \ $(OBJS)\stclib_LexScriptol.obj \ $(OBJS)\stclib_LexSpecman.obj \ $(OBJS)\stclib_LexTeX.obj \ @@ -460,6 +476,9 @@ $(OBJS)\stcdll_LexBaan.obj: ../../src/stc\scintilla\src\LexBaan.cxx $(OBJS)\stcdll_LexBash.obj: ../../src/stc\scintilla\src\LexBash.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexBasic.obj: ../../src/stc\scintilla\src\LexBasic.cxx + $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexBullant.obj: ../../src/stc\scintilla\src\LexBullant.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** @@ -472,6 +491,12 @@ $(OBJS)\stcdll_LexCPP.obj: ../../src/stc\scintilla\src\LexCPP.cxx $(OBJS)\stcdll_LexCSS.obj: ../../src/stc\scintilla\src\LexCSS.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexCaml.obj: ../../src/stc\scintilla\src\LexCaml.cxx + $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** + +$(OBJS)\stcdll_LexCsound.obj: ../../src/stc\scintilla\src\LexCsound.cxx + $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexConf.obj: ../../src/stc\scintilla\src\LexConf.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** @@ -487,6 +512,9 @@ $(OBJS)\stcdll_LexEiffel.obj: ../../src/stc\scintilla\src\LexEiffel.cxx $(OBJS)\stcdll_LexErlang.obj: ../../src/stc\scintilla\src\LexErlang.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexFlagship.obj: ../../src/stc\scintilla\src\LexFlagship.cxx + $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexForth.obj: ../../src/stc\scintilla\src\LexForth.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** @@ -499,6 +527,9 @@ $(OBJS)\stcdll_LexGui4Cli.obj: ../../src/stc\scintilla\src\LexGui4Cli.cxx $(OBJS)\stcdll_LexHTML.obj: ../../src/stc\scintilla\src\LexHTML.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx + $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** @@ -550,12 +581,21 @@ $(OBJS)\stcdll_LexPerl.obj: ../../src/stc\scintilla\src\LexPerl.cxx $(OBJS)\stcdll_LexPython.obj: ../../src/stc\scintilla\src\LexPython.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexRebol.obj: ../../src/stc\scintilla\src\LexRebol.cxx + $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexRuby.obj: ../../src/stc\scintilla\src\LexRuby.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** $(OBJS)\stcdll_LexSQL.obj: ../../src/stc\scintilla\src\LexSQL.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexSmalltalk.obj: ../../src/stc\scintilla\src\LexSmalltalk.cxx + $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** + +$(OBJS)\stcdll_LexTADS3.obj: ../../src/stc\scintilla\src\LexTADS3.cxx + $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexScriptol.obj: ../../src/stc\scintilla\src\LexScriptol.cxx $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** @@ -673,6 +713,9 @@ $(OBJS)\stclib_LexBaan.obj: ../../src/stc\scintilla\src\LexBaan.cxx $(OBJS)\stclib_LexBash.obj: ../../src/stc\scintilla\src\LexBash.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexBasic.obj: ../../src/stc\scintilla\src\LexBasic.cxx + $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexBullant.obj: ../../src/stc\scintilla\src\LexBullant.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** @@ -685,6 +728,12 @@ $(OBJS)\stclib_LexCPP.obj: ../../src/stc\scintilla\src\LexCPP.cxx $(OBJS)\stclib_LexCSS.obj: ../../src/stc\scintilla\src\LexCSS.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexCaml.obj: ../../src/stc\scintilla\src\LexCaml.cxx + $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** + +$(OBJS)\stclib_LexCsound.obj: ../../src/stc\scintilla\src\LexCsound.cxx + $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexConf.obj: ../../src/stc\scintilla\src\LexConf.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** @@ -700,6 +749,9 @@ $(OBJS)\stclib_LexEiffel.obj: ../../src/stc\scintilla\src\LexEiffel.cxx $(OBJS)\stclib_LexErlang.obj: ../../src/stc\scintilla\src\LexErlang.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexFlagship.obj: ../../src/stc\scintilla\src\LexFlagship.cxx + $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexForth.obj: ../../src/stc\scintilla\src\LexForth.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** @@ -712,6 +764,9 @@ $(OBJS)\stclib_LexGui4Cli.obj: ../../src/stc\scintilla\src\LexGui4Cli.cxx $(OBJS)\stclib_LexHTML.obj: ../../src/stc\scintilla\src\LexHTML.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx + $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** @@ -763,12 +818,21 @@ $(OBJS)\stclib_LexPerl.obj: ../../src/stc\scintilla\src\LexPerl.cxx $(OBJS)\stclib_LexPython.obj: ../../src/stc\scintilla\src\LexPython.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexRebol.obj: ../../src/stc\scintilla\src\LexRebol.cxx + $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexRuby.obj: ../../src/stc\scintilla\src\LexRuby.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** $(OBJS)\stclib_LexSQL.obj: ../../src/stc\scintilla\src\LexSQL.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexSmalltalk.obj: ../../src/stc\scintilla\src\LexSmalltalk.cxx + $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** + +$(OBJS)\stclib_LexTADS3.obj: ../../src/stc\scintilla\src\LexTADS3.cxx + $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexScriptol.obj: ../../src/stc\scintilla\src\LexScriptol.cxx $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** diff --git a/contrib/build/stc/makefile.gcc b/contrib/build/stc/makefile.gcc index e50ecf3830..8627eda8dd 100644 --- a/contrib/build/stc/makefile.gcc +++ b/contrib/build/stc/makefile.gcc @@ -52,19 +52,24 @@ STCDLL_OBJECTS = \ $(OBJS)\stcdll_LexAsn1.o \ $(OBJS)\stcdll_LexBaan.o \ $(OBJS)\stcdll_LexBash.o \ + $(OBJS)\stcdll_LexBasic.o \ $(OBJS)\stcdll_LexBullant.o \ $(OBJS)\stcdll_LexCLW.o \ $(OBJS)\stcdll_LexCPP.o \ $(OBJS)\stcdll_LexCSS.o \ + $(OBJS)\stcdll_LexCaml.o \ + $(OBJS)\stcdll_LexCsound.o \ $(OBJS)\stcdll_LexConf.o \ $(OBJS)\stcdll_LexCrontab.o \ $(OBJS)\stcdll_LexEScript.o \ $(OBJS)\stcdll_LexEiffel.o \ $(OBJS)\stcdll_LexErlang.o \ + $(OBJS)\stcdll_LexFlagship.o \ $(OBJS)\stcdll_LexForth.o \ $(OBJS)\stcdll_LexFortran.o \ $(OBJS)\stcdll_LexGui4Cli.o \ $(OBJS)\stcdll_LexHTML.o \ + $(OBJS)\stcdll_LexHaskell.o \ $(OBJS)\stcdll_LexKix.o \ $(OBJS)\stcdll_LexLisp.o \ $(OBJS)\stcdll_LexLout.o \ @@ -82,8 +87,11 @@ STCDLL_OBJECTS = \ $(OBJS)\stcdll_LexPascal.o \ $(OBJS)\stcdll_LexPerl.o \ $(OBJS)\stcdll_LexPython.o \ + $(OBJS)\stcdll_LexRebol.o \ $(OBJS)\stcdll_LexRuby.o \ $(OBJS)\stcdll_LexSQL.o \ + $(OBJS)\stcdll_LexSmalltalk.o \ + $(OBJS)\stcdll_LexTADS3.o \ $(OBJS)\stcdll_LexScriptol.o \ $(OBJS)\stcdll_LexSpecman.o \ $(OBJS)\stcdll_LexTeX.o \ @@ -132,19 +140,24 @@ STCLIB_OBJECTS = \ $(OBJS)\stclib_LexAsn1.o \ $(OBJS)\stclib_LexBaan.o \ $(OBJS)\stclib_LexBash.o \ + $(OBJS)\stclib_LexBasic.o \ $(OBJS)\stclib_LexBullant.o \ $(OBJS)\stclib_LexCLW.o \ $(OBJS)\stclib_LexCPP.o \ $(OBJS)\stclib_LexCSS.o \ + $(OBJS)\stclib_LexCaml.o \ + $(OBJS)\stclib_LexCsound.o \ $(OBJS)\stclib_LexConf.o \ $(OBJS)\stclib_LexCrontab.o \ $(OBJS)\stclib_LexEScript.o \ $(OBJS)\stclib_LexEiffel.o \ $(OBJS)\stclib_LexErlang.o \ + $(OBJS)\stclib_LexFlagship.o \ $(OBJS)\stclib_LexForth.o \ $(OBJS)\stclib_LexFortran.o \ $(OBJS)\stclib_LexGui4Cli.o \ $(OBJS)\stclib_LexHTML.o \ + $(OBJS)\stclib_LexHaskell.o \ $(OBJS)\stclib_LexKix.o \ $(OBJS)\stclib_LexLisp.o \ $(OBJS)\stclib_LexLout.o \ @@ -162,8 +175,11 @@ STCLIB_OBJECTS = \ $(OBJS)\stclib_LexPascal.o \ $(OBJS)\stclib_LexPerl.o \ $(OBJS)\stclib_LexPython.o \ + $(OBJS)\stclib_LexRebol.o \ $(OBJS)\stclib_LexRuby.o \ $(OBJS)\stclib_LexSQL.o \ + $(OBJS)\stclib_LexSmalltalk.o \ + $(OBJS)\stclib_LexTADS3.o \ $(OBJS)\stclib_LexScriptol.o \ $(OBJS)\stclib_LexSpecman.o \ $(OBJS)\stclib_LexTeX.o \ @@ -450,6 +466,9 @@ $(OBJS)\stcdll_LexBaan.o: ../../src/stc/scintilla/src/LexBaan.cxx $(OBJS)\stcdll_LexBash.o: ../../src/stc/scintilla/src/LexBash.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stcdll_LexBasic.o: ../../src/stc/scintilla/src/LexBasic.cxx + $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stcdll_LexBullant.o: ../../src/stc/scintilla/src/LexBullant.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< @@ -462,6 +481,12 @@ $(OBJS)\stcdll_LexCPP.o: ../../src/stc/scintilla/src/LexCPP.cxx $(OBJS)\stcdll_LexCSS.o: ../../src/stc/scintilla/src/LexCSS.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stcdll_LexCaml.o: ../../src/stc/scintilla/src/LexCaml.cxx + $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< + +$(OBJS)\stcdll_LexCsound.o: ../../src/stc/scintilla/src/LexCsound.cxx + $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stcdll_LexConf.o: ../../src/stc/scintilla/src/LexConf.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< @@ -477,6 +502,9 @@ $(OBJS)\stcdll_LexEiffel.o: ../../src/stc/scintilla/src/LexEiffel.cxx $(OBJS)\stcdll_LexErlang.o: ../../src/stc/scintilla/src/LexErlang.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stcdll_LexFlagship.o: ../../src/stc/scintilla/src/LexFlagship.cxx + $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stcdll_LexForth.o: ../../src/stc/scintilla/src/LexForth.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< @@ -489,6 +517,9 @@ $(OBJS)\stcdll_LexGui4Cli.o: ../../src/stc/scintilla/src/LexGui4Cli.cxx $(OBJS)\stcdll_LexHTML.o: ../../src/stc/scintilla/src/LexHTML.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stcdll_LexHaskell.o: ../../src/stc/scintilla/src/LexHaskell.cxx + $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stcdll_LexKix.o: ../../src/stc/scintilla/src/LexKix.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< @@ -540,12 +571,21 @@ $(OBJS)\stcdll_LexPerl.o: ../../src/stc/scintilla/src/LexPerl.cxx $(OBJS)\stcdll_LexPython.o: ../../src/stc/scintilla/src/LexPython.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stcdll_LexRebol.o: ../../src/stc/scintilla/src/LexRebol.cxx + $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stcdll_LexRuby.o: ../../src/stc/scintilla/src/LexRuby.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\stcdll_LexSQL.o: ../../src/stc/scintilla/src/LexSQL.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stcdll_LexSmalltalk.o: ../../src/stc/scintilla/src/LexSmalltalk.cxx + $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< + +$(OBJS)\stcdll_LexTADS3.o: ../../src/stc/scintilla/src/LexTADS3.cxx + $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stcdll_LexScriptol.o: ../../src/stc/scintilla/src/LexScriptol.cxx $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< @@ -663,6 +703,9 @@ $(OBJS)\stclib_LexBaan.o: ../../src/stc/scintilla/src/LexBaan.cxx $(OBJS)\stclib_LexBash.o: ../../src/stc/scintilla/src/LexBash.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stclib_LexBasic.o: ../../src/stc/scintilla/src/LexBasic.cxx + $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stclib_LexBullant.o: ../../src/stc/scintilla/src/LexBullant.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< @@ -675,6 +718,12 @@ $(OBJS)\stclib_LexCPP.o: ../../src/stc/scintilla/src/LexCPP.cxx $(OBJS)\stclib_LexCSS.o: ../../src/stc/scintilla/src/LexCSS.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stclib_LexCaml.o: ../../src/stc/scintilla/src/LexCaml.cxx + $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< + +$(OBJS)\stclib_LexCsound.o: ../../src/stc/scintilla/src/LexCsound.cxx + $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stclib_LexConf.o: ../../src/stc/scintilla/src/LexConf.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< @@ -690,6 +739,9 @@ $(OBJS)\stclib_LexEiffel.o: ../../src/stc/scintilla/src/LexEiffel.cxx $(OBJS)\stclib_LexErlang.o: ../../src/stc/scintilla/src/LexErlang.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stclib_LexFlagship.o: ../../src/stc/scintilla/src/LexFlagship.cxx + $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stclib_LexForth.o: ../../src/stc/scintilla/src/LexForth.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< @@ -702,6 +754,9 @@ $(OBJS)\stclib_LexGui4Cli.o: ../../src/stc/scintilla/src/LexGui4Cli.cxx $(OBJS)\stclib_LexHTML.o: ../../src/stc/scintilla/src/LexHTML.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stclib_LexHaskell.o: ../../src/stc/scintilla/src/LexHaskell.cxx + $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stclib_LexKix.o: ../../src/stc/scintilla/src/LexKix.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< @@ -753,12 +808,21 @@ $(OBJS)\stclib_LexPerl.o: ../../src/stc/scintilla/src/LexPerl.cxx $(OBJS)\stclib_LexPython.o: ../../src/stc/scintilla/src/LexPython.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stclib_LexRebol.o: ../../src/stc/scintilla/src/LexRebol.cxx + $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stclib_LexRuby.o: ../../src/stc/scintilla/src/LexRuby.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< $(OBJS)\stclib_LexSQL.o: ../../src/stc/scintilla/src/LexSQL.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\stclib_LexSmalltalk.o: ../../src/stc/scintilla/src/LexSmalltalk.cxx + $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< + +$(OBJS)\stclib_LexTADS3.o: ../../src/stc/scintilla/src/LexTADS3.cxx + $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\stclib_LexScriptol.o: ../../src/stc/scintilla/src/LexScriptol.cxx $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< diff --git a/contrib/build/stc/makefile.vc b/contrib/build/stc/makefile.vc index 7f7da0796f..5a1cdd1e90 100644 --- a/contrib/build/stc/makefile.vc +++ b/contrib/build/stc/makefile.vc @@ -55,19 +55,24 @@ STCDLL_OBJECTS = \ $(OBJS)\stcdll_LexAsn1.obj \ $(OBJS)\stcdll_LexBaan.obj \ $(OBJS)\stcdll_LexBash.obj \ + $(OBJS)\stcdll_LexBasic.obj \ $(OBJS)\stcdll_LexBullant.obj \ $(OBJS)\stcdll_LexCLW.obj \ $(OBJS)\stcdll_LexCPP.obj \ $(OBJS)\stcdll_LexCSS.obj \ + $(OBJS)\stcdll_LexCaml.obj \ + $(OBJS)\stcdll_LexCsound.obj \ $(OBJS)\stcdll_LexConf.obj \ $(OBJS)\stcdll_LexCrontab.obj \ $(OBJS)\stcdll_LexEScript.obj \ $(OBJS)\stcdll_LexEiffel.obj \ $(OBJS)\stcdll_LexErlang.obj \ + $(OBJS)\stcdll_LexFlagship.obj \ $(OBJS)\stcdll_LexForth.obj \ $(OBJS)\stcdll_LexFortran.obj \ $(OBJS)\stcdll_LexGui4Cli.obj \ $(OBJS)\stcdll_LexHTML.obj \ + $(OBJS)\stcdll_LexHaskell.obj \ $(OBJS)\stcdll_LexKix.obj \ $(OBJS)\stcdll_LexLisp.obj \ $(OBJS)\stcdll_LexLout.obj \ @@ -85,8 +90,11 @@ STCDLL_OBJECTS = \ $(OBJS)\stcdll_LexPascal.obj \ $(OBJS)\stcdll_LexPerl.obj \ $(OBJS)\stcdll_LexPython.obj \ + $(OBJS)\stcdll_LexRebol.obj \ $(OBJS)\stcdll_LexRuby.obj \ $(OBJS)\stcdll_LexSQL.obj \ + $(OBJS)\stcdll_LexSmalltalk.obj \ + $(OBJS)\stcdll_LexTADS3.obj \ $(OBJS)\stcdll_LexScriptol.obj \ $(OBJS)\stcdll_LexSpecman.obj \ $(OBJS)\stcdll_LexTeX.obj \ @@ -137,19 +145,24 @@ STCLIB_OBJECTS = \ $(OBJS)\stclib_LexAsn1.obj \ $(OBJS)\stclib_LexBaan.obj \ $(OBJS)\stclib_LexBash.obj \ + $(OBJS)\stclib_LexBasic.obj \ $(OBJS)\stclib_LexBullant.obj \ $(OBJS)\stclib_LexCLW.obj \ $(OBJS)\stclib_LexCPP.obj \ $(OBJS)\stclib_LexCSS.obj \ + $(OBJS)\stclib_LexCaml.obj \ + $(OBJS)\stclib_LexCsound.obj \ $(OBJS)\stclib_LexConf.obj \ $(OBJS)\stclib_LexCrontab.obj \ $(OBJS)\stclib_LexEScript.obj \ $(OBJS)\stclib_LexEiffel.obj \ $(OBJS)\stclib_LexErlang.obj \ + $(OBJS)\stclib_LexFlagship.obj \ $(OBJS)\stclib_LexForth.obj \ $(OBJS)\stclib_LexFortran.obj \ $(OBJS)\stclib_LexGui4Cli.obj \ $(OBJS)\stclib_LexHTML.obj \ + $(OBJS)\stclib_LexHaskell.obj \ $(OBJS)\stclib_LexKix.obj \ $(OBJS)\stclib_LexLisp.obj \ $(OBJS)\stclib_LexLout.obj \ @@ -167,8 +180,11 @@ STCLIB_OBJECTS = \ $(OBJS)\stclib_LexPascal.obj \ $(OBJS)\stclib_LexPerl.obj \ $(OBJS)\stclib_LexPython.obj \ + $(OBJS)\stclib_LexRebol.obj \ $(OBJS)\stclib_LexRuby.obj \ $(OBJS)\stclib_LexSQL.obj \ + $(OBJS)\stclib_LexSmalltalk.obj \ + $(OBJS)\stclib_LexTADS3.obj \ $(OBJS)\stclib_LexScriptol.obj \ $(OBJS)\stclib_LexSpecman.obj \ $(OBJS)\stclib_LexTeX.obj \ @@ -544,6 +560,9 @@ $(OBJS)\stcdll_LexBaan.obj: ../../src/stc\scintilla\src\LexBaan.cxx $(OBJS)\stcdll_LexBash.obj: ../../src/stc\scintilla\src\LexBash.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexBasic.obj: ../../src/stc\scintilla\src\LexBasic.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexBullant.obj: ../../src/stc\scintilla\src\LexBullant.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** @@ -556,6 +575,12 @@ $(OBJS)\stcdll_LexCPP.obj: ../../src/stc\scintilla\src\LexCPP.cxx $(OBJS)\stcdll_LexCSS.obj: ../../src/stc\scintilla\src\LexCSS.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexCaml.obj: ../../src/stc\scintilla\src\LexCaml.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** + +$(OBJS)\stcdll_LexCsound.obj: ../../src/stc\scintilla\src\LexCsound.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexConf.obj: ../../src/stc\scintilla\src\LexConf.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** @@ -571,6 +596,9 @@ $(OBJS)\stcdll_LexEiffel.obj: ../../src/stc\scintilla\src\LexEiffel.cxx $(OBJS)\stcdll_LexErlang.obj: ../../src/stc\scintilla\src\LexErlang.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexFlagship.obj: ../../src/stc\scintilla\src\LexFlagship.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexForth.obj: ../../src/stc\scintilla\src\LexForth.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** @@ -583,6 +611,9 @@ $(OBJS)\stcdll_LexGui4Cli.obj: ../../src/stc\scintilla\src\LexGui4Cli.cxx $(OBJS)\stcdll_LexHTML.obj: ../../src/stc\scintilla\src\LexHTML.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** @@ -634,12 +665,21 @@ $(OBJS)\stcdll_LexPerl.obj: ../../src/stc\scintilla\src\LexPerl.cxx $(OBJS)\stcdll_LexPython.obj: ../../src/stc\scintilla\src\LexPython.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexRebol.obj: ../../src/stc\scintilla\src\LexRebol.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexRuby.obj: ../../src/stc\scintilla\src\LexRuby.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** $(OBJS)\stcdll_LexSQL.obj: ../../src/stc\scintilla\src\LexSQL.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** +$(OBJS)\stcdll_LexSmalltalk.obj: ../../src/stc\scintilla\src\LexSmalltalk.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** + +$(OBJS)\stcdll_LexTADS3.obj: ../../src/stc\scintilla\src\LexTADS3.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** + $(OBJS)\stcdll_LexScriptol.obj: ../../src/stc\scintilla\src\LexScriptol.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** @@ -757,6 +797,9 @@ $(OBJS)\stclib_LexBaan.obj: ../../src/stc\scintilla\src\LexBaan.cxx $(OBJS)\stclib_LexBash.obj: ../../src/stc\scintilla\src\LexBash.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexBasic.obj: ../../src/stc\scintilla\src\LexBasic.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexBullant.obj: ../../src/stc\scintilla\src\LexBullant.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** @@ -769,6 +812,12 @@ $(OBJS)\stclib_LexCPP.obj: ../../src/stc\scintilla\src\LexCPP.cxx $(OBJS)\stclib_LexCSS.obj: ../../src/stc\scintilla\src\LexCSS.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexCaml.obj: ../../src/stc\scintilla\src\LexCaml.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** + +$(OBJS)\stclib_LexCsound.obj: ../../src/stc\scintilla\src\LexCsound.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexConf.obj: ../../src/stc\scintilla\src\LexConf.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** @@ -784,6 +833,9 @@ $(OBJS)\stclib_LexEiffel.obj: ../../src/stc\scintilla\src\LexEiffel.cxx $(OBJS)\stclib_LexErlang.obj: ../../src/stc\scintilla\src\LexErlang.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexFlagship.obj: ../../src/stc\scintilla\src\LexFlagship.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexForth.obj: ../../src/stc\scintilla\src\LexForth.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** @@ -796,6 +848,9 @@ $(OBJS)\stclib_LexGui4Cli.obj: ../../src/stc\scintilla\src\LexGui4Cli.cxx $(OBJS)\stclib_LexHTML.obj: ../../src/stc\scintilla\src\LexHTML.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** @@ -847,12 +902,21 @@ $(OBJS)\stclib_LexPerl.obj: ../../src/stc\scintilla\src\LexPerl.cxx $(OBJS)\stclib_LexPython.obj: ../../src/stc\scintilla\src\LexPython.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexRebol.obj: ../../src/stc\scintilla\src\LexRebol.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexRuby.obj: ../../src/stc\scintilla\src\LexRuby.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** $(OBJS)\stclib_LexSQL.obj: ../../src/stc\scintilla\src\LexSQL.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** +$(OBJS)\stclib_LexSmalltalk.obj: ../../src/stc\scintilla\src\LexSmalltalk.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** + +$(OBJS)\stclib_LexTADS3.obj: ../../src/stc\scintilla\src\LexTADS3.cxx + $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** + $(OBJS)\stclib_LexScriptol.obj: ../../src/stc\scintilla\src\LexScriptol.cxx $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** diff --git a/contrib/build/stc/makefile.wat b/contrib/build/stc/makefile.wat index 99c5014529..3d1554b729 100644 --- a/contrib/build/stc/makefile.wat +++ b/contrib/build/stc/makefile.wat @@ -252,19 +252,24 @@ STCDLL_OBJECTS = & $(OBJS)\stcdll_LexAsn1.obj & $(OBJS)\stcdll_LexBaan.obj & $(OBJS)\stcdll_LexBash.obj & + $(OBJS)\stcdll_LexBasic.obj & $(OBJS)\stcdll_LexBullant.obj & $(OBJS)\stcdll_LexCLW.obj & $(OBJS)\stcdll_LexCPP.obj & $(OBJS)\stcdll_LexCSS.obj & + $(OBJS)\stcdll_LexCaml.obj & + $(OBJS)\stcdll_LexCsound.obj & $(OBJS)\stcdll_LexConf.obj & $(OBJS)\stcdll_LexCrontab.obj & $(OBJS)\stcdll_LexEScript.obj & $(OBJS)\stcdll_LexEiffel.obj & $(OBJS)\stcdll_LexErlang.obj & + $(OBJS)\stcdll_LexFlagship.obj & $(OBJS)\stcdll_LexForth.obj & $(OBJS)\stcdll_LexFortran.obj & $(OBJS)\stcdll_LexGui4Cli.obj & $(OBJS)\stcdll_LexHTML.obj & + $(OBJS)\stcdll_LexHaskell.obj & $(OBJS)\stcdll_LexKix.obj & $(OBJS)\stcdll_LexLisp.obj & $(OBJS)\stcdll_LexLout.obj & @@ -282,8 +287,11 @@ STCDLL_OBJECTS = & $(OBJS)\stcdll_LexPascal.obj & $(OBJS)\stcdll_LexPerl.obj & $(OBJS)\stcdll_LexPython.obj & + $(OBJS)\stcdll_LexRebol.obj & $(OBJS)\stcdll_LexRuby.obj & $(OBJS)\stcdll_LexSQL.obj & + $(OBJS)\stcdll_LexSmalltalk.obj & + $(OBJS)\stcdll_LexTADS3.obj & $(OBJS)\stcdll_LexScriptol.obj & $(OBJS)\stcdll_LexSpecman.obj & $(OBJS)\stcdll_LexTeX.obj & @@ -332,19 +340,24 @@ STCLIB_OBJECTS = & $(OBJS)\stclib_LexAsn1.obj & $(OBJS)\stclib_LexBaan.obj & $(OBJS)\stclib_LexBash.obj & + $(OBJS)\stclib_LexBasic.obj & $(OBJS)\stclib_LexBullant.obj & $(OBJS)\stclib_LexCLW.obj & $(OBJS)\stclib_LexCPP.obj & $(OBJS)\stclib_LexCSS.obj & + $(OBJS)\stclib_LexCaml.obj & + $(OBJS)\stclib_LexCsound.obj & $(OBJS)\stclib_LexConf.obj & $(OBJS)\stclib_LexCrontab.obj & $(OBJS)\stclib_LexEScript.obj & $(OBJS)\stclib_LexEiffel.obj & $(OBJS)\stclib_LexErlang.obj & + $(OBJS)\stclib_LexFlagship.obj & $(OBJS)\stclib_LexForth.obj & $(OBJS)\stclib_LexFortran.obj & $(OBJS)\stclib_LexGui4Cli.obj & $(OBJS)\stclib_LexHTML.obj & + $(OBJS)\stclib_LexHaskell.obj & $(OBJS)\stclib_LexKix.obj & $(OBJS)\stclib_LexLisp.obj & $(OBJS)\stclib_LexLout.obj & @@ -362,8 +375,11 @@ STCLIB_OBJECTS = & $(OBJS)\stclib_LexPascal.obj & $(OBJS)\stclib_LexPerl.obj & $(OBJS)\stclib_LexPython.obj & + $(OBJS)\stclib_LexRebol.obj & $(OBJS)\stclib_LexRuby.obj & $(OBJS)\stclib_LexSQL.obj & + $(OBJS)\stclib_LexSmalltalk.obj & + $(OBJS)\stclib_LexTADS3.obj & $(OBJS)\stclib_LexScriptol.obj & $(OBJS)\stclib_LexSpecman.obj & $(OBJS)\stclib_LexTeX.obj & @@ -492,6 +508,9 @@ $(OBJS)\stcdll_LexBaan.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexBaan.cx $(OBJS)\stcdll_LexBash.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexBash.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< +$(OBJS)\stcdll_LexBasic.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexBasic.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< + $(OBJS)\stcdll_LexBullant.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexBullant.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< @@ -504,6 +523,12 @@ $(OBJS)\stcdll_LexCPP.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexCPP.cxx $(OBJS)\stcdll_LexCSS.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexCSS.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< +$(OBJS)\stcdll_LexCaml.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexCaml.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< + +$(OBJS)\stcdll_LexCsound.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexCsound.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< + $(OBJS)\stcdll_LexConf.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexConf.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< @@ -519,6 +544,9 @@ $(OBJS)\stcdll_LexEiffel.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexEiffe $(OBJS)\stcdll_LexErlang.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexErlang.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< +$(OBJS)\stcdll_LexFlagship.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexFlagship.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< + $(OBJS)\stcdll_LexForth.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexForth.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< @@ -531,6 +559,9 @@ $(OBJS)\stcdll_LexGui4Cli.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexGui4 $(OBJS)\stcdll_LexHTML.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHTML.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< +$(OBJS)\stcdll_LexHaskell.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHaskell.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< + $(OBJS)\stcdll_LexKix.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexKix.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< @@ -582,12 +613,21 @@ $(OBJS)\stcdll_LexPerl.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexPerl.cx $(OBJS)\stcdll_LexPython.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexPython.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< +$(OBJS)\stcdll_LexRebol.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexRebol.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< + $(OBJS)\stcdll_LexRuby.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexRuby.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< $(OBJS)\stcdll_LexSQL.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSQL.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< +$(OBJS)\stcdll_LexSmalltalk.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSmalltalk.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< + +$(OBJS)\stcdll_LexTADS3.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexTADS3.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< + $(OBJS)\stcdll_LexScriptol.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexScriptol.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< @@ -705,6 +745,9 @@ $(OBJS)\stclib_LexBaan.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexBaan.cx $(OBJS)\stclib_LexBash.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexBash.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< +$(OBJS)\stclib_LexBasic.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexBasic.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< + $(OBJS)\stclib_LexBullant.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexBullant.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< @@ -717,6 +760,12 @@ $(OBJS)\stclib_LexCPP.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexCPP.cxx $(OBJS)\stclib_LexCSS.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexCSS.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< +$(OBJS)\stclib_LexCaml.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexCaml.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< + +$(OBJS)\stclib_LexCsound.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexCsound.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< + $(OBJS)\stclib_LexConf.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexConf.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< @@ -732,6 +781,9 @@ $(OBJS)\stclib_LexEiffel.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexEiffe $(OBJS)\stclib_LexErlang.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexErlang.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< +$(OBJS)\stclib_LexFlagship.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexFlagship.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< + $(OBJS)\stclib_LexForth.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexForth.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< @@ -744,6 +796,9 @@ $(OBJS)\stclib_LexGui4Cli.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexGui4 $(OBJS)\stclib_LexHTML.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHTML.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< +$(OBJS)\stclib_LexHaskell.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHaskell.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< + $(OBJS)\stclib_LexKix.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexKix.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< @@ -795,12 +850,21 @@ $(OBJS)\stclib_LexPerl.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexPerl.cx $(OBJS)\stclib_LexPython.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexPython.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< +$(OBJS)\stclib_LexRebol.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexRebol.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< + $(OBJS)\stclib_LexRuby.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexRuby.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< $(OBJS)\stclib_LexSQL.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSQL.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< +$(OBJS)\stclib_LexSmalltalk.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSmalltalk.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< + +$(OBJS)\stclib_LexTADS3.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexTADS3.cxx + $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< + $(OBJS)\stclib_LexScriptol.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexScriptol.cxx $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< diff --git a/contrib/build/stc/stc.bkl b/contrib/build/stc/stc.bkl index 0e1fe5abbe..2e98036e0e 100644 --- a/contrib/build/stc/stc.bkl +++ b/contrib/build/stc/stc.bkl @@ -31,19 +31,24 @@ scintilla/src/LexAsn1.cxx scintilla/src/LexBaan.cxx scintilla/src/LexBash.cxx + scintilla/src/LexBasic.cxx scintilla/src/LexBullant.cxx scintilla/src/LexCLW.cxx scintilla/src/LexCPP.cxx scintilla/src/LexCSS.cxx + scintilla/src/LexCaml.cxx + scintilla/src/LexCsound.cxx scintilla/src/LexConf.cxx scintilla/src/LexCrontab.cxx scintilla/src/LexEScript.cxx scintilla/src/LexEiffel.cxx scintilla/src/LexErlang.cxx + scintilla/src/LexFlagship.cxx scintilla/src/LexForth.cxx scintilla/src/LexFortran.cxx scintilla/src/LexGui4Cli.cxx scintilla/src/LexHTML.cxx + scintilla/src/LexHaskell.cxx scintilla/src/LexKix.cxx scintilla/src/LexLisp.cxx scintilla/src/LexLout.cxx @@ -61,8 +66,11 @@ scintilla/src/LexPascal.cxx scintilla/src/LexPerl.cxx scintilla/src/LexPython.cxx + scintilla/src/LexRebol.cxx scintilla/src/LexRuby.cxx scintilla/src/LexSQL.cxx + scintilla/src/LexSmalltalk.cxx + scintilla/src/LexTADS3.cxx scintilla/src/LexScriptol.cxx scintilla/src/LexSpecman.cxx scintilla/src/LexTeX.cxx diff --git a/contrib/build/stc/stc.dsp b/contrib/build/stc/stc.dsp index cc4c3f5179..dc3e0a8e3f 100644 --- a/contrib/build/stc/stc.dsp +++ b/contrib/build/stc/stc.dsp @@ -528,6 +528,10 @@ SOURCE=../../src/stc\scintilla\src\LexBash.cxx # End Source File # Begin Source File +SOURCE=../../src/stc\scintilla\src\LexBasic.cxx +# End Source File +# Begin Source File + SOURCE=../../src/stc\scintilla\src\LexBullant.cxx # End Source File # Begin Source File @@ -544,6 +548,10 @@ SOURCE=../../src/stc\scintilla\src\LexCSS.cxx # End Source File # Begin Source File +SOURCE=../../src/stc\scintilla\src\LexCaml.cxx +# End Source File +# Begin Source File + SOURCE=../../src/stc\scintilla\src\LexConf.cxx # End Source File # Begin Source File @@ -552,6 +560,10 @@ SOURCE=../../src/stc\scintilla\src\LexCrontab.cxx # End Source File # Begin Source File +SOURCE=../../src/stc\scintilla\src\LexCsound.cxx +# End Source File +# Begin Source File + SOURCE=../../src/stc\scintilla\src\LexEScript.cxx # End Source File # Begin Source File @@ -564,6 +576,10 @@ SOURCE=../../src/stc\scintilla\src\LexErlang.cxx # End Source File # Begin Source File +SOURCE=../../src/stc\scintilla\src\LexFlagship.cxx +# End Source File +# Begin Source File + SOURCE=../../src/stc\scintilla\src\LexForth.cxx # End Source File # Begin Source File @@ -580,6 +596,10 @@ SOURCE=../../src/stc\scintilla\src\LexHTML.cxx # End Source File # Begin Source File +SOURCE=../../src/stc\scintilla\src\LexHaskell.cxx +# End Source File +# Begin Source File + SOURCE=../../src/stc\scintilla\src\LexKix.cxx # End Source File # Begin Source File @@ -648,6 +668,10 @@ SOURCE=../../src/stc\scintilla\src\LexPython.cxx # End Source File # Begin Source File +SOURCE=../../src/stc\scintilla\src\LexRebol.cxx +# End Source File +# Begin Source File + SOURCE=../../src/stc\scintilla\src\LexRuby.cxx # End Source File # Begin Source File @@ -660,10 +684,18 @@ SOURCE=../../src/stc\scintilla\src\LexScriptol.cxx # End Source File # Begin Source File +SOURCE=../../src/stc\scintilla\src\LexSmalltalk.cxx +# End Source File +# Begin Source File + SOURCE=../../src/stc\scintilla\src\LexSpecman.cxx # End Source File # Begin Source File +SOURCE=../../src/stc\scintilla\src\LexTADS3.cxx +# End Source File +# Begin Source File + SOURCE=../../src/stc\scintilla\src\LexTeX.cxx # End Source File # Begin Source File diff --git a/contrib/include/wx/stc/stc.h b/contrib/include/wx/stc/stc.h index 5bf0cc31de..3a1132d020 100644 --- a/contrib/include/wx/stc/stc.h +++ b/contrib/include/wx/stc/stc.h @@ -106,6 +106,7 @@ #define wxSTC_MARK_DOTDOTDOT 23 #define wxSTC_MARK_ARROWS 24 #define wxSTC_MARK_PIXMAP 25 +#define wxSTC_MARK_FULLRECT 26 #define wxSTC_MARK_CHARACTER 10000 // Markers used for outlining column. @@ -144,6 +145,7 @@ #define wxSTC_CHARSET_MAC 77 #define wxSTC_CHARSET_OEM 255 #define wxSTC_CHARSET_RUSSIAN 204 +#define wxSTC_CHARSET_CYRILLIC 1251 #define wxSTC_CHARSET_SHIFTJIS 128 #define wxSTC_CHARSET_SYMBOL 2 #define wxSTC_CHARSET_TURKISH 162 @@ -152,6 +154,7 @@ #define wxSTC_CHARSET_ARABIC 178 #define wxSTC_CHARSET_VIETNAMESE 163 #define wxSTC_CHARSET_THAI 222 +#define wxSTC_CHARSET_8859_15 1000 #define wxSTC_CASE_MIXED 0 #define wxSTC_CASE_UPPER 1 #define wxSTC_CASE_LOWER 2 @@ -204,6 +207,7 @@ #define wxSTC_TIME_FOREVER 10000000 #define wxSTC_WRAP_NONE 0 #define wxSTC_WRAP_WORD 1 +#define wxSTC_WRAP_CHAR 2 #define wxSTC_WRAPVISUALFLAG_NONE 0x0000 #define wxSTC_WRAPVISUALFLAG_END 0x0001 #define wxSTC_WRAPVISUALFLAG_START 0x0002 @@ -269,11 +273,13 @@ #define wxSTC_PERFORMED_USER 0x10 #define wxSTC_PERFORMED_UNDO 0x20 #define wxSTC_PERFORMED_REDO 0x40 +#define wxSTC_MULTISTEPUNDOREDO 0x80 #define wxSTC_LASTSTEPINUNDOREDO 0x100 #define wxSTC_MOD_CHANGEMARKER 0x200 #define wxSTC_MOD_BEFOREINSERT 0x400 #define wxSTC_MOD_BEFOREDELETE 0x800 -#define wxSTC_MODEVENTMASKALL 0xF77 +#define wxSTC_MULTILINEUNDOREDO 0x1000 +#define wxSTC_MODEVENTMASKALL 0x1FFF // Symbolic key codes and modifier flags. // ASCII and other printable characters below 256. @@ -295,6 +301,7 @@ #define wxSTC_KEY_ADD 310 #define wxSTC_KEY_SUBTRACT 311 #define wxSTC_KEY_DIVIDE 312 +#define wxSTC_SCMOD_NORM 0 #define wxSTC_SCMOD_SHIFT 1 #define wxSTC_SCMOD_CTRL 2 #define wxSTC_SCMOD_ALT 4 @@ -329,8 +336,6 @@ #define wxSTC_LEX_NNCRONTAB 26 #define wxSTC_LEX_BULLANT 27 #define wxSTC_LEX_VBSCRIPT 28 -#define wxSTC_LEX_ASP 29 -#define wxSTC_LEX_PHP 30 #define wxSTC_LEX_BAAN 31 #define wxSTC_LEX_MATLAB 32 #define wxSTC_LEX_SCRIPTOL 33 @@ -365,6 +370,17 @@ #define wxSTC_LEX_BASH 62 #define wxSTC_LEX_ASN1 63 #define wxSTC_LEX_VHDL 64 +#define wxSTC_LEX_CAML 65 +#define wxSTC_LEX_BLITZBASIC 66 +#define wxSTC_LEX_PUREBASIC 67 +#define wxSTC_LEX_HASKELL 68 +#define wxSTC_LEX_PHPSCRIPT 69 +#define wxSTC_LEX_TADS3 70 +#define wxSTC_LEX_REBOL 71 +#define wxSTC_LEX_SMALLTALK 72 +#define wxSTC_LEX_FLAGSHIP 73 +#define wxSTC_LEX_CSOUND 74 +#define wxSTC_LEX_FREEBASIC 75 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a // value assigned in sequence from SCLEX_AUTOMATIC+1. @@ -385,6 +401,8 @@ #define wxSTC_P_IDENTIFIER 11 #define wxSTC_P_COMMENTBLOCK 12 #define wxSTC_P_STRINGEOL 13 +#define wxSTC_P_WORD2 14 +#define wxSTC_P_DECORATOR 15 // Lexical states for SCLEX_CPP #define wxSTC_C_DEFAULT 0 @@ -562,6 +580,7 @@ #define wxSTC_PL_ARRAY 13 #define wxSTC_PL_HASH 14 #define wxSTC_PL_SYMBOLTABLE 15 +#define wxSTC_PL_VARIABLE_INDEXER 16 #define wxSTC_PL_REGEX 17 #define wxSTC_PL_REGSUBST 18 #define wxSTC_PL_LONGQUOTE 19 @@ -576,6 +595,43 @@ #define wxSTC_PL_STRING_QX 28 #define wxSTC_PL_STRING_QR 29 #define wxSTC_PL_STRING_QW 30 +#define wxSTC_PL_POD_VERB 31 + +// Lexical states for SCLEX_RUBY +#define wxSTC_RB_DEFAULT 0 +#define wxSTC_RB_ERROR 1 +#define wxSTC_RB_COMMENTLINE 2 +#define wxSTC_RB_POD 3 +#define wxSTC_RB_NUMBER 4 +#define wxSTC_RB_WORD 5 +#define wxSTC_RB_STRING 6 +#define wxSTC_RB_CHARACTER 7 +#define wxSTC_RB_CLASSNAME 8 +#define wxSTC_RB_DEFNAME 9 +#define wxSTC_RB_OPERATOR 10 +#define wxSTC_RB_IDENTIFIER 11 +#define wxSTC_RB_REGEX 12 +#define wxSTC_RB_GLOBAL 13 +#define wxSTC_RB_SYMBOL 14 +#define wxSTC_RB_MODULE_NAME 15 +#define wxSTC_RB_INSTANCE_VAR 16 +#define wxSTC_RB_CLASS_VAR 17 +#define wxSTC_RB_BACKTICKS 18 +#define wxSTC_RB_DATASECTION 19 +#define wxSTC_RB_HERE_DELIM 20 +#define wxSTC_RB_HERE_Q 21 +#define wxSTC_RB_HERE_QQ 22 +#define wxSTC_RB_HERE_QX 23 +#define wxSTC_RB_STRING_Q 24 +#define wxSTC_RB_STRING_QQ 25 +#define wxSTC_RB_STRING_QX 26 +#define wxSTC_RB_STRING_QR 27 +#define wxSTC_RB_STRING_QW 28 +#define wxSTC_RB_WORD_DEMOTED 29 +#define wxSTC_RB_STDIN 30 +#define wxSTC_RB_STDOUT 31 +#define wxSTC_RB_STDERR 40 +#define wxSTC_RB_UPPER_BOUND 41 // Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC #define wxSTC_B_DEFAULT 0 @@ -593,6 +649,10 @@ #define wxSTC_B_KEYWORD4 12 #define wxSTC_B_CONSTANT 13 #define wxSTC_B_ASM 14 +#define wxSTC_B_LABEL 15 +#define wxSTC_B_ERROR 16 +#define wxSTC_B_HEXNUMBER 17 +#define wxSTC_B_BINNUMBER 18 // Lexical states for SCLEX_PROPERTIES #define wxSTC_PROPS_DEFAULT 0 @@ -742,10 +802,14 @@ #define wxSTC_LISP_COMMENT 1 #define wxSTC_LISP_NUMBER 2 #define wxSTC_LISP_KEYWORD 3 +#define wxSTC_LISP_KEYWORD_KW 4 +#define wxSTC_LISP_SYMBOL 5 #define wxSTC_LISP_STRING 6 #define wxSTC_LISP_STRINGEOL 8 #define wxSTC_LISP_IDENTIFIER 9 #define wxSTC_LISP_OPERATOR 10 +#define wxSTC_LISP_SPECIAL 11 +#define wxSTC_LISP_MULTI_COMMENT 12 // Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW #define wxSTC_EIFFEL_DEFAULT 0 @@ -867,6 +931,7 @@ #define wxSTC_CSS_DOUBLESTRING 13 #define wxSTC_CSS_SINGLESTRING 14 #define wxSTC_CSS_IDENTIFIER2 15 +#define wxSTC_CSS_ATTRIBUTE 16 // Lexical states for SCLEX_POV #define wxSTC_POV_DEFAULT 0 @@ -948,6 +1013,10 @@ #define wxSTC_NSIS_MACRODEF 12 #define wxSTC_NSIS_STRINGVAR 13 #define wxSTC_NSIS_NUMBER 14 +#define wxSTC_NSIS_SECTIONGROUP 15 +#define wxSTC_NSIS_PAGEEX 16 +#define wxSTC_NSIS_FUNCTIONDEF 17 +#define wxSTC_NSIS_COMMENTBOX 18 // Lexical states for SCLEX_MMIXAL #define wxSTC_MMIXAL_LEADWS 0 @@ -980,11 +1049,13 @@ #define wxSTC_CLW_PICTURE_STRING 7 #define wxSTC_CLW_KEYWORD 8 #define wxSTC_CLW_COMPILER_DIRECTIVE 9 -#define wxSTC_CLW_BUILTIN_PROCEDURES_FUNCTION 10 -#define wxSTC_CLW_STRUCTURE_DATA_TYPE 11 -#define wxSTC_CLW_ATTRIBUTE 12 -#define wxSTC_CLW_STANDARD_EQUATE 13 -#define wxSTC_CLW_ERROR 14 +#define wxSTC_CLW_RUNTIME_EXPRESSIONS 10 +#define wxSTC_CLW_BUILTIN_PROCEDURES_FUNCTION 11 +#define wxSTC_CLW_STRUCTURE_DATA_TYPE 12 +#define wxSTC_CLW_ATTRIBUTE 13 +#define wxSTC_CLW_STANDARD_EQUATE 14 +#define wxSTC_CLW_ERROR 15 +#define wxSTC_CLW_DEPRECATED 16 // Lexical states for SCLEX_LOT #define wxSTC_LOT_DEFAULT 0 @@ -1131,6 +1202,8 @@ #define wxSTC_AU3_SENT 10 #define wxSTC_AU3_PREPROCESSOR 11 #define wxSTC_AU3_SPECIAL 12 +#define wxSTC_AU3_EXPAND 13 +#define wxSTC_AU3_COMOBJ 14 // Lexical states for SCLEX_APDL #define wxSTC_APDL_DEFAULT 0 @@ -1193,6 +1266,182 @@ #define wxSTC_VHDL_STDTYPE 13 #define wxSTC_VHDL_USERWORD 14 +// Lexical states for SCLEX_CAML +#define wxSTC_CAML_DEFAULT 0 +#define wxSTC_CAML_IDENTIFIER 1 +#define wxSTC_CAML_TAGNAME 2 +#define wxSTC_CAML_KEYWORD 3 +#define wxSTC_CAML_KEYWORD2 4 +#define wxSTC_CAML_KEYWORD3 5 +#define wxSTC_CAML_LINENUM 6 +#define wxSTC_CAML_OPERATOR 7 +#define wxSTC_CAML_NUMBER 8 +#define wxSTC_CAML_CHAR 9 +#define wxSTC_CAML_STRING 11 +#define wxSTC_CAML_COMMENT 12 +#define wxSTC_CAML_COMMENT1 13 +#define wxSTC_CAML_COMMENT2 14 +#define wxSTC_CAML_COMMENT3 15 + +// Lexical states for SCLEX_HASKELL +#define wxSTC_HA_DEFAULT 0 +#define wxSTC_HA_IDENTIFIER 1 +#define wxSTC_HA_KEYWORD 2 +#define wxSTC_HA_NUMBER 3 +#define wxSTC_HA_STRING 4 +#define wxSTC_HA_CHARACTER 5 +#define wxSTC_HA_CLASS 6 +#define wxSTC_HA_MODULE 7 +#define wxSTC_HA_CAPITAL 8 +#define wxSTC_HA_DATA 9 +#define wxSTC_HA_IMPORT 10 +#define wxSTC_HA_OPERATOR 11 +#define wxSTC_HA_INSTANCE 12 +#define wxSTC_HA_COMMENTLINE 13 +#define wxSTC_HA_COMMENTBLOCK 14 +#define wxSTC_HA_COMMENTBLOCK2 15 +#define wxSTC_HA_COMMENTBLOCK3 16 + +// Lexical states of SCLEX_TADS3 +#define wxSTC_T3_DEFAULT 0 +#define wxSTC_T3_X_DEFAULT 1 +#define wxSTC_T3_PREPROCESSOR 2 +#define wxSTC_T3_BLOCK_COMMENT 3 +#define wxSTC_T3_LINE_COMMENT 4 +#define wxSTC_T3_OPERATOR 5 +#define wxSTC_T3_KEYWORD 6 +#define wxSTC_T3_NUMBER 7 +#define wxSTC_T3_IDENTIFIER 8 +#define wxSTC_T3_S_STRING 9 +#define wxSTC_T3_D_STRING 10 +#define wxSTC_T3_X_STRING 11 +#define wxSTC_T3_LIB_DIRECTIVE 12 +#define wxSTC_T3_MSG_PARAM 13 +#define wxSTC_T3_HTML_TAG 14 +#define wxSTC_T3_HTML_DEFAULT 15 +#define wxSTC_T3_HTML_STRING 16 +#define wxSTC_T3_USER1 17 +#define wxSTC_T3_USER2 18 +#define wxSTC_T3_USER3 19 + +// Lexical states for SCLEX_REBOL +#define wxSTC_REBOL_DEFAULT 0 +#define wxSTC_REBOL_COMMENTLINE 1 +#define wxSTC_REBOL_COMMENTBLOCK 2 +#define wxSTC_REBOL_PREFACE 3 +#define wxSTC_REBOL_OPERATOR 4 +#define wxSTC_REBOL_CHARACTER 5 +#define wxSTC_REBOL_QUOTEDSTRING 6 +#define wxSTC_REBOL_BRACEDSTRING 7 +#define wxSTC_REBOL_NUMBER 8 +#define wxSTC_REBOL_PAIR 9 +#define wxSTC_REBOL_TUPLE 10 +#define wxSTC_REBOL_BINARY 11 +#define wxSTC_REBOL_MONEY 12 +#define wxSTC_REBOL_ISSUE 13 +#define wxSTC_REBOL_TAG 14 +#define wxSTC_REBOL_FILE 15 +#define wxSTC_REBOL_EMAIL 16 +#define wxSTC_REBOL_URL 17 +#define wxSTC_REBOL_DATE 18 +#define wxSTC_REBOL_TIME 19 +#define wxSTC_REBOL_IDENTIFIER 20 +#define wxSTC_REBOL_WORD 21 +#define wxSTC_REBOL_WORD2 22 +#define wxSTC_REBOL_WORD3 23 +#define wxSTC_REBOL_WORD4 24 +#define wxSTC_REBOL_WORD5 25 +#define wxSTC_REBOL_WORD6 26 +#define wxSTC_REBOL_WORD7 27 +#define wxSTC_REBOL_WORD8 28 + +// Lexical states for SCLEX_SQL +#define wxSTC_SQL_DEFAULT 0 +#define wxSTC_SQL_COMMENT 1 +#define wxSTC_SQL_COMMENTLINE 2 +#define wxSTC_SQL_COMMENTDOC 3 +#define wxSTC_SQL_NUMBER 4 +#define wxSTC_SQL_WORD 5 +#define wxSTC_SQL_STRING 6 +#define wxSTC_SQL_CHARACTER 7 +#define wxSTC_SQL_SQLPLUS 8 +#define wxSTC_SQL_SQLPLUS_PROMPT 9 +#define wxSTC_SQL_OPERATOR 10 +#define wxSTC_SQL_IDENTIFIER 11 +#define wxSTC_SQL_SQLPLUS_COMMENT 13 +#define wxSTC_SQL_COMMENTLINEDOC 15 +#define wxSTC_SQL_WORD2 16 +#define wxSTC_SQL_COMMENTDOCKEYWORD 17 +#define wxSTC_SQL_COMMENTDOCKEYWORDERROR 18 +#define wxSTC_SQL_USER1 19 +#define wxSTC_SQL_USER2 20 +#define wxSTC_SQL_USER3 21 +#define wxSTC_SQL_USER4 22 +#define wxSTC_SQL_QUOTEDIDENTIFIER 23 + +// Lexical states for SCLEX_SMALLTALK +#define wxSTC_ST_DEFAULT 0 +#define wxSTC_ST_STRING 1 +#define wxSTC_ST_NUMBER 2 +#define wxSTC_ST_COMMENT 3 +#define wxSTC_ST_SYMBOL 4 +#define wxSTC_ST_BINARY 5 +#define wxSTC_ST_BOOL 6 +#define wxSTC_ST_SELF 7 +#define wxSTC_ST_SUPER 8 +#define wxSTC_ST_NIL 9 +#define wxSTC_ST_GLOBAL 10 +#define wxSTC_ST_RETURN 11 +#define wxSTC_ST_SPECIAL 12 +#define wxSTC_ST_KWSEND 13 +#define wxSTC_ST_ASSIGN 14 +#define wxSTC_ST_CHARACTER 15 +#define wxSTC_ST_SPEC_SEL 16 + +// Lexical states for SCLEX_FLAGSHIP (clipper) +#define wxSTC_FS_DEFAULT 0 +#define wxSTC_FS_COMMENT 1 +#define wxSTC_FS_COMMENTLINE 2 +#define wxSTC_FS_COMMENTDOC 3 +#define wxSTC_FS_COMMENTLINEDOC 4 +#define wxSTC_FS_COMMENTDOCKEYWORD 5 +#define wxSTC_FS_COMMENTDOCKEYWORDERROR 6 +#define wxSTC_FS_KEYWORD 7 +#define wxSTC_FS_KEYWORD2 8 +#define wxSTC_FS_KEYWORD3 9 +#define wxSTC_FS_KEYWORD4 10 +#define wxSTC_FS_NUMBER 11 +#define wxSTC_FS_STRING 12 +#define wxSTC_FS_PREPROCESSOR 13 +#define wxSTC_FS_OPERATOR 14 +#define wxSTC_FS_IDENTIFIER 15 +#define wxSTC_FS_DATE 16 +#define wxSTC_FS_STRINGEOL 17 +#define wxSTC_FS_CONSTANT 18 +#define wxSTC_FS_ASM 19 +#define wxSTC_FS_LABEL 20 +#define wxSTC_FS_ERROR 21 +#define wxSTC_FS_HEXNUMBER 22 +#define wxSTC_FS_BINNUMBER 23 + +// Lexical states for SCLEX_CSOUND +#define wxSTC_CSOUND_DEFAULT 0 +#define wxSTC_CSOUND_COMMENT 1 +#define wxSTC_CSOUND_NUMBER 2 +#define wxSTC_CSOUND_OPERATOR 3 +#define wxSTC_CSOUND_INSTR 4 +#define wxSTC_CSOUND_IDENTIFIER 5 +#define wxSTC_CSOUND_OPCODE 6 +#define wxSTC_CSOUND_HEADERSTMT 7 +#define wxSTC_CSOUND_USERKEYWORD 8 +#define wxSTC_CSOUND_COMMENTBLOCK 9 +#define wxSTC_CSOUND_PARAM 10 +#define wxSTC_CSOUND_ARATE_VAR 11 +#define wxSTC_CSOUND_KRATE_VAR 12 +#define wxSTC_CSOUND_IRATE_VAR 13 +#define wxSTC_CSOUND_GLOBAL_VAR 14 +#define wxSTC_CSOUND_STRINGEOL 15 + //----------------------------------------- // Commands that can be bound to keystrokes @@ -1679,6 +1928,9 @@ public: // Define a marker from a bitmap void MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp); + // Add a set of markers to a line. + void MarkerAddSet(int line, int set); + // Set a margin to be either numeric or symbolic. void SetMarginType(int margin, int marginType); @@ -1914,6 +2166,20 @@ public: // Default is '?' but can be changed if items contain '?'. void AutoCompSetTypeSeparator(int separatorCharacter); + // Set the maximum width, in characters, of auto-completion and user lists. + // Set to 0 to autosize to fit longest item, which is the default. + void AutoCompSetMaxWidth(int characterCount); + + // Get the maximum width, in characters, of auto-completion and user lists. + int AutoCompGetMaxWidth(); + + // Set the maximum height, in rows, of auto-completion and user lists. + // The default is 5 rows. + void AutoCompSetMaxHeight(int rowCount); + + // Set the maximum height, in rows, of auto-completion and user lists. + int AutoCompGetMaxHeight(); + // Set the number of spaces used for one level of indentation. void SetIndent(int indentSize); @@ -2176,6 +2442,9 @@ public: // Find the document line of a display line taking hidden lines into account. int DocLineFromVisible(int lineDisplay); + // The number of display lines needed to wrap a document line + int WrapCount(int line); + // Set the fold level of a line. // This encodes an integer level along with flags indicating whether the // line is a header and whether it is effectively white space. @@ -2290,7 +2559,7 @@ public: // Retrieve whether the maximum scroll position has the last // line at the bottom of the view. - int GetEndAtLastLine(); + bool GetEndAtLastLine(); // Retrieve the height of a particular line of text in pixels. int TextHeight(int line); @@ -2773,10 +3042,28 @@ public: // Enlarge the document to a particular size of text bytes. void Allocate(int bytes); - // Find the position of a column on a line taking into account tabs and + // Find the position of a column on a line taking into account tabs and // multi-byte characters. If beyond end of line, return line end position. int FindColumn(int line, int column); + // Can the caret preferred x position only be changed by explicit movement commands? + bool GetCaretSticky(); + + // Stop the caret preferred x position changing when the user types. + void SetCaretSticky(bool useCaretStickyBehaviour); + + // Switch between sticky and non-sticky: meant to be bound to a key. + void ToggleCaretSticky(); + + // Enable/Disable convert-on-paste for line endings + void SetPasteConvertEndings(bool convert); + + // Get convert-on-paste setting + bool GetPasteConvertEndings(); + + // Duplicate the selection. If selection empty duplicate the line containing the caret. + void SelectionDuplicate(); + // Start notifying the container of all key presses and commands. void StartRecord(); @@ -2801,6 +3088,20 @@ public: // Set the lexing language of the document based on string name. void SetLexerLanguage(const wxString& language); + // Retrieve a 'property' value previously set with SetProperty. + wxString GetProperty(const wxString& key); + + // Retrieve a 'property' value previously set with SetProperty, + // with '$()' variable replacement on returned buffer. + wxString GetPropertyExpanded(const wxString& key); + + // Retrieve a 'property' value previously set with SetProperty, + // interpreted as an int AFTER any '$()' variable replacement. + int GetPropertyInt(const wxString& key); + + // Retrieve the number of bits the current lexer needs for styling. + int GetStyleBitsNeeded(); + // END of generated section //---------------------------------------------------------------------- // Others... @@ -3131,6 +3432,7 @@ BEGIN_DECLARE_EVENT_TYPES() DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_CLICK, 1673) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, 1674) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, 1675) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_SELECTION, 1676) END_DECLARE_EVENT_TYPES() #else enum { @@ -3158,7 +3460,8 @@ END_DECLARE_EVENT_TYPES() wxEVT_STC_ZOOM, wxEVT_STC_HOTSPOT_CLICK, wxEVT_STC_HOTSPOT_DCLICK, - wxEVT_STC_CALLTIP_CLICK + wxEVT_STC_CALLTIP_CLICK, + wxEVT_STC_AUTOCOMP_SELECTION }; #endif @@ -3192,7 +3495,7 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); #define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), #define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), #define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), - +#define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), #endif //---------------------------------------------------------------------- diff --git a/contrib/src/stc/Makefile.in b/contrib/src/stc/Makefile.in index 9662358d41..ef6471fac4 100644 --- a/contrib/src/stc/Makefile.in +++ b/contrib/src/stc/Makefile.in @@ -82,19 +82,24 @@ STCDLL_OBJECTS = \ stcdll_LexAsn1.o \ stcdll_LexBaan.o \ stcdll_LexBash.o \ + stcdll_LexBasic.o \ stcdll_LexBullant.o \ stcdll_LexCLW.o \ stcdll_LexCPP.o \ stcdll_LexCSS.o \ + stcdll_LexCaml.o \ + stcdll_LexCsound.o \ stcdll_LexConf.o \ stcdll_LexCrontab.o \ stcdll_LexEScript.o \ stcdll_LexEiffel.o \ stcdll_LexErlang.o \ + stcdll_LexFlagship.o \ stcdll_LexForth.o \ stcdll_LexFortran.o \ stcdll_LexGui4Cli.o \ stcdll_LexHTML.o \ + stcdll_LexHaskell.o \ stcdll_LexKix.o \ stcdll_LexLisp.o \ stcdll_LexLout.o \ @@ -112,8 +117,11 @@ STCDLL_OBJECTS = \ stcdll_LexPascal.o \ stcdll_LexPerl.o \ stcdll_LexPython.o \ + stcdll_LexRebol.o \ stcdll_LexRuby.o \ stcdll_LexSQL.o \ + stcdll_LexSmalltalk.o \ + stcdll_LexTADS3.o \ stcdll_LexScriptol.o \ stcdll_LexSpecman.o \ stcdll_LexTeX.o \ @@ -159,19 +167,24 @@ STCLIB_OBJECTS = \ stclib_LexAsn1.o \ stclib_LexBaan.o \ stclib_LexBash.o \ + stclib_LexBasic.o \ stclib_LexBullant.o \ stclib_LexCLW.o \ stclib_LexCPP.o \ stclib_LexCSS.o \ + stclib_LexCaml.o \ + stclib_LexCsound.o \ stclib_LexConf.o \ stclib_LexCrontab.o \ stclib_LexEScript.o \ stclib_LexEiffel.o \ stclib_LexErlang.o \ + stclib_LexFlagship.o \ stclib_LexForth.o \ stclib_LexFortran.o \ stclib_LexGui4Cli.o \ stclib_LexHTML.o \ + stclib_LexHaskell.o \ stclib_LexKix.o \ stclib_LexLisp.o \ stclib_LexLout.o \ @@ -189,8 +202,11 @@ STCLIB_OBJECTS = \ stclib_LexPascal.o \ stclib_LexPerl.o \ stclib_LexPython.o \ + stclib_LexRebol.o \ stclib_LexRuby.o \ stclib_LexSQL.o \ + stclib_LexSmalltalk.o \ + stclib_LexTADS3.o \ stclib_LexScriptol.o \ stclib_LexSpecman.o \ stclib_LexTeX.o \ @@ -447,6 +463,9 @@ stcdll_LexBaan.o: $(srcdir)/scintilla/src/LexBaan.cxx stcdll_LexBash.o: $(srcdir)/scintilla/src/LexBash.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexBash.cxx +stcdll_LexBasic.o: $(srcdir)/scintilla/src/LexBasic.cxx + $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexBasic.cxx + stcdll_LexBullant.o: $(srcdir)/scintilla/src/LexBullant.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexBullant.cxx @@ -459,6 +478,12 @@ stcdll_LexCPP.o: $(srcdir)/scintilla/src/LexCPP.cxx stcdll_LexCSS.o: $(srcdir)/scintilla/src/LexCSS.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexCSS.cxx +stcdll_LexCaml.o: $(srcdir)/scintilla/src/LexCaml.cxx + $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexCaml.cxx + +stcdll_LexCsound.o: $(srcdir)/scintilla/src/LexCsound.cxx + $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexCsound.cxx + stcdll_LexConf.o: $(srcdir)/scintilla/src/LexConf.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexConf.cxx @@ -474,6 +499,9 @@ stcdll_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx stcdll_LexErlang.o: $(srcdir)/scintilla/src/LexErlang.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexErlang.cxx +stcdll_LexFlagship.o: $(srcdir)/scintilla/src/LexFlagship.cxx + $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexFlagship.cxx + stcdll_LexForth.o: $(srcdir)/scintilla/src/LexForth.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexForth.cxx @@ -486,6 +514,9 @@ stcdll_LexGui4Cli.o: $(srcdir)/scintilla/src/LexGui4Cli.cxx stcdll_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexHTML.cxx +stcdll_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx + $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx + stcdll_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx @@ -537,12 +568,21 @@ stcdll_LexPerl.o: $(srcdir)/scintilla/src/LexPerl.cxx stcdll_LexPython.o: $(srcdir)/scintilla/src/LexPython.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexPython.cxx +stcdll_LexRebol.o: $(srcdir)/scintilla/src/LexRebol.cxx + $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexRebol.cxx + stcdll_LexRuby.o: $(srcdir)/scintilla/src/LexRuby.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexRuby.cxx stcdll_LexSQL.o: $(srcdir)/scintilla/src/LexSQL.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexSQL.cxx +stcdll_LexSmalltalk.o: $(srcdir)/scintilla/src/LexSmalltalk.cxx + $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexSmalltalk.cxx + +stcdll_LexTADS3.o: $(srcdir)/scintilla/src/LexTADS3.cxx + $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexTADS3.cxx + stcdll_LexScriptol.o: $(srcdir)/scintilla/src/LexScriptol.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexScriptol.cxx @@ -660,6 +700,9 @@ stclib_LexBaan.o: $(srcdir)/scintilla/src/LexBaan.cxx stclib_LexBash.o: $(srcdir)/scintilla/src/LexBash.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexBash.cxx +stclib_LexBasic.o: $(srcdir)/scintilla/src/LexBasic.cxx + $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexBasic.cxx + stclib_LexBullant.o: $(srcdir)/scintilla/src/LexBullant.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexBullant.cxx @@ -672,6 +715,12 @@ stclib_LexCPP.o: $(srcdir)/scintilla/src/LexCPP.cxx stclib_LexCSS.o: $(srcdir)/scintilla/src/LexCSS.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexCSS.cxx +stclib_LexCaml.o: $(srcdir)/scintilla/src/LexCaml.cxx + $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexCaml.cxx + +stclib_LexCsound.o: $(srcdir)/scintilla/src/LexCsound.cxx + $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexCsound.cxx + stclib_LexConf.o: $(srcdir)/scintilla/src/LexConf.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexConf.cxx @@ -687,6 +736,9 @@ stclib_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx stclib_LexErlang.o: $(srcdir)/scintilla/src/LexErlang.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexErlang.cxx +stclib_LexFlagship.o: $(srcdir)/scintilla/src/LexFlagship.cxx + $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexFlagship.cxx + stclib_LexForth.o: $(srcdir)/scintilla/src/LexForth.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexForth.cxx @@ -699,6 +751,9 @@ stclib_LexGui4Cli.o: $(srcdir)/scintilla/src/LexGui4Cli.cxx stclib_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexHTML.cxx +stclib_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx + $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx + stclib_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx @@ -750,12 +805,21 @@ stclib_LexPerl.o: $(srcdir)/scintilla/src/LexPerl.cxx stclib_LexPython.o: $(srcdir)/scintilla/src/LexPython.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexPython.cxx +stclib_LexRebol.o: $(srcdir)/scintilla/src/LexRebol.cxx + $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexRebol.cxx + stclib_LexRuby.o: $(srcdir)/scintilla/src/LexRuby.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexRuby.cxx stclib_LexSQL.o: $(srcdir)/scintilla/src/LexSQL.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexSQL.cxx +stclib_LexSmalltalk.o: $(srcdir)/scintilla/src/LexSmalltalk.cxx + $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexSmalltalk.cxx + +stclib_LexTADS3.o: $(srcdir)/scintilla/src/LexTADS3.cxx + $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexTADS3.cxx + stclib_LexScriptol.o: $(srcdir)/scintilla/src/LexScriptol.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexScriptol.cxx diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index 81f172cd71..5d7948423b 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -12,6 +12,7 @@ #include "wx/mstream.h" #include "wx/image.h" #include "wx/imaglist.h" +#include "wx/tokenzr.h" #include "Platform.h" #include "PlatWX.h" @@ -686,7 +687,7 @@ private: CallBackAction doubleClickAction; void* doubleClickActionData; public: - wxSTCListBoxWin(wxWindow* parent, wxWindowID id) : + wxSTCListBoxWin(wxWindow* parent, wxWindowID id, Point location) : wxPopupWindow(parent, wxBORDER_NONE) { SetBackgroundColour(*wxBLACK); // for our simple border @@ -804,8 +805,8 @@ private: CallBackAction doubleClickAction; void* doubleClickActionData; public: - wxSTCListBoxWin(wxWindow* parent, wxWindowID id) : - wxWindow(parent, id, wxDefaultPosition, wxSize(0,0), wxSIMPLE_BORDER ) + wxSTCListBoxWin(wxWindow* parent, wxWindowID id, Point location) : + wxWindow(parent, id, wxPoint(location.x, location.y), wxSize(0,0), wxSIMPLE_BORDER ) { lv = new wxSTCListBox(this, id, wxDefaultPosition, wxDefaultSize, @@ -919,6 +920,7 @@ private: int desiredVisibleRows; int aveCharWidth; int maxStrWidth; + Point location; // Caret location at which the list is opened wxImageList* imgList; wxArrayInt* imgTypeMap; @@ -927,13 +929,15 @@ public: ~ListBoxImpl(); virtual void SetFont(Font &font); - virtual void Create(Window &parent, int ctrlID, int lineHeight_, bool unicodeMode_); + virtual void Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_); virtual void SetAverageCharWidth(int width); virtual void SetVisibleRows(int rows); + virtual int GetVisibleRows() const; virtual PRectangle GetDesiredRect(); virtual int CaretFromEdge(); virtual void Clear(); virtual void Append(char *s, int type = -1); + void Append(const wxString& text, int type); virtual int Length(); virtual void Select(int n); virtual int GetSelection(); @@ -942,7 +946,7 @@ public: virtual void RegisterImage(int type, const char *xpm_data); virtual void ClearRegisteredImages(); virtual void SetDoubleClickAction(CallBackAction, void *); - + virtual void SetList(const char* list, char separator, char typesep); }; @@ -970,11 +974,12 @@ void ListBoxImpl::SetFont(Font &font) { } -void ListBoxImpl::Create(Window &parent, int ctrlID, int lineHeight_, bool unicodeMode_) { +void ListBoxImpl::Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_) { + location = location_; lineHeight = lineHeight_; unicodeMode = unicodeMode_; maxStrWidth = 0; - id = new wxSTCListBoxWin(GETWIN(parent.GetID()), ctrlID); + id = new wxSTCListBoxWin(GETWIN(parent.GetID()), ctrlID, location); if (imgList != NULL) GETLB(id)->SetImageList(imgList, wxIMAGE_LIST_SMALL); } @@ -990,10 +995,14 @@ void ListBoxImpl::SetVisibleRows(int rows) { } +int ListBoxImpl::GetVisibleRows() const { + return desiredVisibleRows; +} + PRectangle ListBoxImpl::GetDesiredRect() { // wxListCtrl doesn't have a DoGetBestSize, so instead we kept track of // the max size in Append and calculate it here... - int maxw = maxStrWidth; + int maxw = maxStrWidth * aveCharWidth; int maxh ; // give it a default if there are no lines, and/or add a bit more @@ -1039,13 +1048,14 @@ void ListBoxImpl::Clear() { void ListBoxImpl::Append(char *s, int type) { - wxString text = stc2wx(s); + Append(stc2wx(s), type); +} + +void ListBoxImpl::Append(const wxString& text, int type) { long count = GETLB(id)->GetItemCount(); long itemID = GETLB(id)->InsertItem(count, wxEmptyString); GETLB(id)->SetItem(itemID, 1, text); - int itemWidth = 0; - GETLB(id)->GetTextExtent(text, &itemWidth, NULL); - maxStrWidth = wxMax(maxStrWidth, itemWidth); + maxStrWidth = wxMax(maxStrWidth, text.Length()); if (type != -1) { wxCHECK_RET(imgTypeMap, wxT("Unexpected NULL imgTypeMap")); long idx = imgTypeMap->Item(type); @@ -1053,6 +1063,23 @@ void ListBoxImpl::Append(char *s, int type) { } } +void ListBoxImpl::SetList(const char* list, char separator, char typesep) { + GETLB(id)->Freeze(); + Clear(); + wxStringTokenizer tkzr(stc2wx(list), (wxChar)separator); + while ( tkzr.HasMoreTokens() ) { + wxString token = tkzr.GetNextToken(); + long type = -1; + int pos = token.Find(typesep); + if (pos != -1) { + token.Mid(pos+1).ToLong(&type); + token.Truncate(pos); + } + Append(token, (int)type); + } + GETLB(id)->Thaw(); +} + int ListBoxImpl::Length() { return GETLB(id)->GetItemCount(); @@ -1133,7 +1160,6 @@ void ListBoxImpl::SetDoubleClickAction(CallBackAction action, void *data) { } - ListBox::ListBox() { } diff --git a/contrib/src/stc/gen_iface.py b/contrib/src/stc/gen_iface.py index 4e0afbb129..62d7a45518 100644 --- a/contrib/src/stc/gen_iface.py +++ b/contrib/src/stc/gen_iface.py @@ -293,7 +293,12 @@ methodOverrideMap = { 'AutoCGetTypeSeparator' : ('AutoCompGetTypeSeparator', 0, 0, 0), 'AutoCSetTypeSeparator' : ('AutoCompSetTypeSeparator', 0, 0, 0), 'AutoCGetCurrent' : ('AutoCompGetCurrent', 0, 0, 0), - + 'AutoCSetMaxWidth' : ('AutoCompSetMaxWidth', 0, 0, 0), + 'AutoCGetMaxWidth' : ('AutoCompGetMaxWidth', 0, 0, 0), + 'AutoCSetMaxHeight' : ('AutoCompSetMaxHeight', 0, 0, 0), + 'AutoCGetMaxHeight' : ('AutoCompGetMaxHeight', 0, 0, 0), + 'AutoCGetMaxHeight' : ('AutoCompGetMaxHeight', 0, 0, 0), + 'RegisterImage' : (0, '''void %s(int type, const wxBitmap& bmp);''', @@ -519,7 +524,45 @@ methodOverrideMap = { 'TargetAsUTF8' : ( None, 0, 0, 0), 'SetLengthForEncode' : ( None, 0, 0, 0), 'EncodedFromUTF8' : ( None, 0, 0, 0), - + + + 'GetProperty' : + (0, + 'wxString %s(const wxString& key);', + + '''wxString %s(const wxString& key) { + int len = SendMsg(SCI_GETPROPERTY, (long)(const char*)wx2stc(key), NULL); + if (!len) return wxEmptyString; + + wxMemoryBuffer mbuf(len+1); + char* buf = (char*)mbuf.GetWriteBuf(len+1); + SendMsg(%s, (long)(const char*)wx2stc(key), (long)buf); + mbuf.UngetWriteBuf(len); + mbuf.AppendByte(0); + return stc2wx(buf);''', + ("Retrieve a 'property' value previously set with SetProperty.",)), + + 'GetPropertyExpanded' : + (0, + 'wxString %s(const wxString& key);', + + '''wxString %s(const wxString& key) { + int len = SendMsg(SCI_GETPROPERTYEXPANDED, (long)(const char*)wx2stc(key), NULL); + if (!len) return wxEmptyString; + + wxMemoryBuffer mbuf(len+1); + char* buf = (char*)mbuf.GetWriteBuf(len+1); + SendMsg(%s, (long)(const char*)wx2stc(key), (long)buf); + mbuf.UngetWriteBuf(len); + mbuf.AppendByte(0); + return stc2wx(buf);''', + ("Retrieve a 'property' value previously set with SetProperty,", + "with '$()' variable replacement on returned buffer.")), + + 'GetPropertyInt' : (0, 0, 0, + ("Retrieve a 'property' value previously set with SetProperty,", + "interpreted as an int AFTER any '$()' variable replacement.")), + 'GetDocPointer' : (0, diff --git a/contrib/src/stc/scintilla/README.txt b/contrib/src/stc/scintilla/README.txt index fce427d5d1..3dfc869851 100644 --- a/contrib/src/stc/scintilla/README.txt +++ b/contrib/src/stc/scintilla/README.txt @@ -3,5 +3,5 @@ scintilla/include directories from the Scintilla/SCiTE source distribution. All other code needed to implement Scintilla on top of wxWindows is located in the directory above this one. -The current version of the Scintilla code is 1.62 +The current version of the Scintilla code is 1.67 diff --git a/contrib/src/stc/scintilla/include/KeyWords.h b/contrib/src/stc/scintilla/include/KeyWords.h index df4e870c58..059ac0da0f 100644 --- a/contrib/src/stc/scintilla/include/KeyWords.h +++ b/contrib/src/stc/scintilla/include/KeyWords.h @@ -20,21 +20,29 @@ protected: LexerFunction fnLexer; LexerFunction fnFolder; const char * const * wordListDescriptions; + int styleBits; static const LexerModule *base; static int nextLanguage; public: const char *languageName; - LexerModule(int language_, LexerFunction fnLexer_, - const char *languageName_=0, LexerFunction fnFolder_=0, - const char * const wordListDescriptions_[] = NULL); + LexerModule(int language_, + LexerFunction fnLexer_, + const char *languageName_=0, + LexerFunction fnFolder_=0, + const char * const wordListDescriptions_[] = NULL, + int styleBits_=5); + virtual ~LexerModule() { + } int GetLanguage() const { return language; } // -1 is returned if no WordList information is available int GetNumWordLists() const; const char *GetWordListDescription(int index) const; + int GetStyleBitsNeeded() const; + virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle, WordList *keywordlists[], Accessor &styler) const; virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle, diff --git a/contrib/src/stc/scintilla/include/Platform.h b/contrib/src/stc/scintilla/include/Platform.h index 1e3bd69d75..88a05272fd 100644 --- a/contrib/src/stc/scintilla/include/Platform.h +++ b/contrib/src/stc/scintilla/include/Platform.h @@ -393,9 +393,10 @@ public: static ListBox *Allocate(); virtual void SetFont(Font &font)=0; - virtual void Create(Window &parent, int ctrlID, int lineHeight_, bool unicodeMode_)=0; + virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_)=0; virtual void SetAverageCharWidth(int width)=0; virtual void SetVisibleRows(int rows)=0; + virtual int GetVisibleRows() const=0; virtual PRectangle GetDesiredRect()=0; virtual int CaretFromEdge()=0; virtual void Clear()=0; @@ -408,6 +409,7 @@ public: virtual void RegisterImage(int type, const char *xpm_data)=0; virtual void ClearRegisteredImages()=0; virtual void SetDoubleClickAction(CallBackAction, void *)=0; + virtual void SetList(const char* list, char separator, char typesep)=0; }; /** diff --git a/contrib/src/stc/scintilla/include/PropSet.h b/contrib/src/stc/scintilla/include/PropSet.h index 32aea8a0c7..e38de7dc40 100644 --- a/contrib/src/stc/scintilla/include/PropSet.h +++ b/contrib/src/stc/scintilla/include/PropSet.h @@ -29,6 +29,7 @@ protected: Property *props[hashRoots]; Property *enumnext; int enumhash; + static bool caseSensitiveFilenames; static unsigned int HashString(const char *s, size_t len) { unsigned int ret = 0; while (len--) { @@ -58,9 +59,12 @@ public: char *ToString(); // Caller must delete[] the return value bool GetFirst(char **key, char **val); bool GetNext(char **key, char **val); + static void SetCaseSensitiveFilenames(bool caseSensitiveFilenames_) { + caseSensitiveFilenames = caseSensitiveFilenames_; + } private: - // copy-value semantics not implemented + // copy-value semantics not implemented PropSet(const PropSet ©); void operator=(const PropSet &assign); }; @@ -76,9 +80,11 @@ public: int len; bool onlyLineEnds; ///< Delimited by any white space or only line ends bool sorted; + bool sortedNoCase; int starts[256]; WordList(bool onlyLineEnds_ = false) : - words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_), sorted(false) {} + words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_), + sorted(false), sortedNoCase(false) {} ~WordList() { Clear(); } operator bool() { return len ? true : false; } char *operator[](int ind) { return words[ind]; } @@ -87,6 +93,7 @@ public: char *Allocate(int size); void SetFromAllocated(); bool InList(const char *s); + bool InListAbbreviated(const char *s, const char marker); const char *GetNearestWord(const char *wordStart, int searchLen, bool ignoreCase = false, SString wordCharacters="", int wordIndex = -1); char *GetNearestWords(const char *wordStart, int searchLen, diff --git a/contrib/src/stc/scintilla/include/SString.h b/contrib/src/stc/scintilla/include/SString.h index 5c2a93d33b..38a206ccf2 100644 --- a/contrib/src/stc/scintilla/include/SString.h +++ b/contrib/src/stc/scintilla/include/SString.h @@ -197,7 +197,7 @@ public: bool operator!=(const char *sOther) const { return !operator==(sOther); } - bool contains(char ch) { + bool contains(char ch) const { return (s && *s) ? strchr(s, ch) != 0 : false; } void setsizegrowth(lenpos_t sizeGrowth_) { @@ -253,7 +253,7 @@ public: bool startswith(const char *prefix); bool endswith(const char *suffix); int search(const char *sFind, lenpos_t start=0) const; - bool contains(const char *sFind) { + bool contains(const char *sFind) const { return search(sFind) >= 0; } int substitute(char chFind, char chReplace); diff --git a/contrib/src/stc/scintilla/include/SciLexer.h b/contrib/src/stc/scintilla/include/SciLexer.h index ce50a7fab5..9c7fc8a7dd 100644 --- a/contrib/src/stc/scintilla/include/SciLexer.h +++ b/contrib/src/stc/scintilla/include/SciLexer.h @@ -43,8 +43,6 @@ #define SCLEX_NNCRONTAB 26 #define SCLEX_BULLANT 27 #define SCLEX_VBSCRIPT 28 -#define SCLEX_ASP 29 -#define SCLEX_PHP 30 #define SCLEX_BAAN 31 #define SCLEX_MATLAB 32 #define SCLEX_SCRIPTOL 33 @@ -79,6 +77,17 @@ #define SCLEX_BASH 62 #define SCLEX_ASN1 63 #define SCLEX_VHDL 64 +#define SCLEX_CAML 65 +#define SCLEX_BLITZBASIC 66 +#define SCLEX_PUREBASIC 67 +#define SCLEX_HASKELL 68 +#define SCLEX_PHPSCRIPT 69 +#define SCLEX_TADS3 70 +#define SCLEX_REBOL 71 +#define SCLEX_SMALLTALK 72 +#define SCLEX_FLAGSHIP 73 +#define SCLEX_CSOUND 74 +#define SCLEX_FREEBASIC 75 #define SCLEX_AUTOMATIC 1000 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 @@ -94,6 +103,8 @@ #define SCE_P_IDENTIFIER 11 #define SCE_P_COMMENTBLOCK 12 #define SCE_P_STRINGEOL 13 +#define SCE_P_WORD2 14 +#define SCE_P_DECORATOR 15 #define SCE_C_DEFAULT 0 #define SCE_C_COMMENT 1 #define SCE_C_COMMENTLINE 2 @@ -241,6 +252,7 @@ #define SCE_PL_ARRAY 13 #define SCE_PL_HASH 14 #define SCE_PL_SYMBOLTABLE 15 +#define SCE_PL_VARIABLE_INDEXER 16 #define SCE_PL_REGEX 17 #define SCE_PL_REGSUBST 18 #define SCE_PL_LONGQUOTE 19 @@ -255,6 +267,41 @@ #define SCE_PL_STRING_QX 28 #define SCE_PL_STRING_QR 29 #define SCE_PL_STRING_QW 30 +#define SCE_PL_POD_VERB 31 +#define SCE_RB_DEFAULT 0 +#define SCE_RB_ERROR 1 +#define SCE_RB_COMMENTLINE 2 +#define SCE_RB_POD 3 +#define SCE_RB_NUMBER 4 +#define SCE_RB_WORD 5 +#define SCE_RB_STRING 6 +#define SCE_RB_CHARACTER 7 +#define SCE_RB_CLASSNAME 8 +#define SCE_RB_DEFNAME 9 +#define SCE_RB_OPERATOR 10 +#define SCE_RB_IDENTIFIER 11 +#define SCE_RB_REGEX 12 +#define SCE_RB_GLOBAL 13 +#define SCE_RB_SYMBOL 14 +#define SCE_RB_MODULE_NAME 15 +#define SCE_RB_INSTANCE_VAR 16 +#define SCE_RB_CLASS_VAR 17 +#define SCE_RB_BACKTICKS 18 +#define SCE_RB_DATASECTION 19 +#define SCE_RB_HERE_DELIM 20 +#define SCE_RB_HERE_Q 21 +#define SCE_RB_HERE_QQ 22 +#define SCE_RB_HERE_QX 23 +#define SCE_RB_STRING_Q 24 +#define SCE_RB_STRING_QQ 25 +#define SCE_RB_STRING_QX 26 +#define SCE_RB_STRING_QR 27 +#define SCE_RB_STRING_QW 28 +#define SCE_RB_WORD_DEMOTED 29 +#define SCE_RB_STDIN 30 +#define SCE_RB_STDOUT 31 +#define SCE_RB_STDERR 40 +#define SCE_RB_UPPER_BOUND 41 #define SCE_B_DEFAULT 0 #define SCE_B_COMMENT 1 #define SCE_B_NUMBER 2 @@ -270,6 +317,10 @@ #define SCE_B_KEYWORD4 12 #define SCE_B_CONSTANT 13 #define SCE_B_ASM 14 +#define SCE_B_LABEL 15 +#define SCE_B_ERROR 16 +#define SCE_B_HEXNUMBER 17 +#define SCE_B_BINNUMBER 18 #define SCE_PROPS_DEFAULT 0 #define SCE_PROPS_COMMENT 1 #define SCE_PROPS_SECTION 2 @@ -395,10 +446,14 @@ #define SCE_LISP_COMMENT 1 #define SCE_LISP_NUMBER 2 #define SCE_LISP_KEYWORD 3 +#define SCE_LISP_KEYWORD_KW 4 +#define SCE_LISP_SYMBOL 5 #define SCE_LISP_STRING 6 #define SCE_LISP_STRINGEOL 8 #define SCE_LISP_IDENTIFIER 9 #define SCE_LISP_OPERATOR 10 +#define SCE_LISP_SPECIAL 11 +#define SCE_LISP_MULTI_COMMENT 12 #define SCE_EIFFEL_DEFAULT 0 #define SCE_EIFFEL_COMMENTLINE 1 #define SCE_EIFFEL_NUMBER 2 @@ -502,6 +557,7 @@ #define SCE_CSS_DOUBLESTRING 13 #define SCE_CSS_SINGLESTRING 14 #define SCE_CSS_IDENTIFIER2 15 +#define SCE_CSS_ATTRIBUTE 16 #define SCE_POV_DEFAULT 0 #define SCE_POV_COMMENT 1 #define SCE_POV_COMMENTLINE 2 @@ -573,6 +629,10 @@ #define SCE_NSIS_MACRODEF 12 #define SCE_NSIS_STRINGVAR 13 #define SCE_NSIS_NUMBER 14 +#define SCE_NSIS_SECTIONGROUP 15 +#define SCE_NSIS_PAGEEX 16 +#define SCE_NSIS_FUNCTIONDEF 17 +#define SCE_NSIS_COMMENTBOX 18 #define SCE_MMIXAL_LEADWS 0 #define SCE_MMIXAL_COMMENT 1 #define SCE_MMIXAL_LABEL 2 @@ -601,11 +661,13 @@ #define SCE_CLW_PICTURE_STRING 7 #define SCE_CLW_KEYWORD 8 #define SCE_CLW_COMPILER_DIRECTIVE 9 -#define SCE_CLW_BUILTIN_PROCEDURES_FUNCTION 10 -#define SCE_CLW_STRUCTURE_DATA_TYPE 11 -#define SCE_CLW_ATTRIBUTE 12 -#define SCE_CLW_STANDARD_EQUATE 13 -#define SCE_CLW_ERROR 14 +#define SCE_CLW_RUNTIME_EXPRESSIONS 10 +#define SCE_CLW_BUILTIN_PROCEDURES_FUNCTION 11 +#define SCE_CLW_STRUCTURE_DATA_TYPE 12 +#define SCE_CLW_ATTRIBUTE 13 +#define SCE_CLW_STANDARD_EQUATE 14 +#define SCE_CLW_ERROR 15 +#define SCE_CLW_DEPRECATED 16 #define SCE_LOT_DEFAULT 0 #define SCE_LOT_HEADER 1 #define SCE_LOT_BREAK 2 @@ -731,6 +793,8 @@ #define SCE_AU3_SENT 10 #define SCE_AU3_PREPROCESSOR 11 #define SCE_AU3_SPECIAL 12 +#define SCE_AU3_EXPAND 13 +#define SCE_AU3_COMOBJ 14 #define SCE_APDL_DEFAULT 0 #define SCE_APDL_COMMENT 1 #define SCE_APDL_COMMENTBLOCK 2 @@ -784,6 +848,168 @@ #define SCE_VHDL_STDPACKAGE 12 #define SCE_VHDL_STDTYPE 13 #define SCE_VHDL_USERWORD 14 +#define SCE_CAML_DEFAULT 0 +#define SCE_CAML_IDENTIFIER 1 +#define SCE_CAML_TAGNAME 2 +#define SCE_CAML_KEYWORD 3 +#define SCE_CAML_KEYWORD2 4 +#define SCE_CAML_KEYWORD3 5 +#define SCE_CAML_LINENUM 6 +#define SCE_CAML_OPERATOR 7 +#define SCE_CAML_NUMBER 8 +#define SCE_CAML_CHAR 9 +#define SCE_CAML_STRING 11 +#define SCE_CAML_COMMENT 12 +#define SCE_CAML_COMMENT1 13 +#define SCE_CAML_COMMENT2 14 +#define SCE_CAML_COMMENT3 15 +#define SCE_HA_DEFAULT 0 +#define SCE_HA_IDENTIFIER 1 +#define SCE_HA_KEYWORD 2 +#define SCE_HA_NUMBER 3 +#define SCE_HA_STRING 4 +#define SCE_HA_CHARACTER 5 +#define SCE_HA_CLASS 6 +#define SCE_HA_MODULE 7 +#define SCE_HA_CAPITAL 8 +#define SCE_HA_DATA 9 +#define SCE_HA_IMPORT 10 +#define SCE_HA_OPERATOR 11 +#define SCE_HA_INSTANCE 12 +#define SCE_HA_COMMENTLINE 13 +#define SCE_HA_COMMENTBLOCK 14 +#define SCE_HA_COMMENTBLOCK2 15 +#define SCE_HA_COMMENTBLOCK3 16 +#define SCE_T3_DEFAULT 0 +#define SCE_T3_X_DEFAULT 1 +#define SCE_T3_PREPROCESSOR 2 +#define SCE_T3_BLOCK_COMMENT 3 +#define SCE_T3_LINE_COMMENT 4 +#define SCE_T3_OPERATOR 5 +#define SCE_T3_KEYWORD 6 +#define SCE_T3_NUMBER 7 +#define SCE_T3_IDENTIFIER 8 +#define SCE_T3_S_STRING 9 +#define SCE_T3_D_STRING 10 +#define SCE_T3_X_STRING 11 +#define SCE_T3_LIB_DIRECTIVE 12 +#define SCE_T3_MSG_PARAM 13 +#define SCE_T3_HTML_TAG 14 +#define SCE_T3_HTML_DEFAULT 15 +#define SCE_T3_HTML_STRING 16 +#define SCE_T3_USER1 17 +#define SCE_T3_USER2 18 +#define SCE_T3_USER3 19 +#define SCE_REBOL_DEFAULT 0 +#define SCE_REBOL_COMMENTLINE 1 +#define SCE_REBOL_COMMENTBLOCK 2 +#define SCE_REBOL_PREFACE 3 +#define SCE_REBOL_OPERATOR 4 +#define SCE_REBOL_CHARACTER 5 +#define SCE_REBOL_QUOTEDSTRING 6 +#define SCE_REBOL_BRACEDSTRING 7 +#define SCE_REBOL_NUMBER 8 +#define SCE_REBOL_PAIR 9 +#define SCE_REBOL_TUPLE 10 +#define SCE_REBOL_BINARY 11 +#define SCE_REBOL_MONEY 12 +#define SCE_REBOL_ISSUE 13 +#define SCE_REBOL_TAG 14 +#define SCE_REBOL_FILE 15 +#define SCE_REBOL_EMAIL 16 +#define SCE_REBOL_URL 17 +#define SCE_REBOL_DATE 18 +#define SCE_REBOL_TIME 19 +#define SCE_REBOL_IDENTIFIER 20 +#define SCE_REBOL_WORD 21 +#define SCE_REBOL_WORD2 22 +#define SCE_REBOL_WORD3 23 +#define SCE_REBOL_WORD4 24 +#define SCE_REBOL_WORD5 25 +#define SCE_REBOL_WORD6 26 +#define SCE_REBOL_WORD7 27 +#define SCE_REBOL_WORD8 28 +#define SCE_SQL_DEFAULT 0 +#define SCE_SQL_COMMENT 1 +#define SCE_SQL_COMMENTLINE 2 +#define SCE_SQL_COMMENTDOC 3 +#define SCE_SQL_NUMBER 4 +#define SCE_SQL_WORD 5 +#define SCE_SQL_STRING 6 +#define SCE_SQL_CHARACTER 7 +#define SCE_SQL_SQLPLUS 8 +#define SCE_SQL_SQLPLUS_PROMPT 9 +#define SCE_SQL_OPERATOR 10 +#define SCE_SQL_IDENTIFIER 11 +#define SCE_SQL_SQLPLUS_COMMENT 13 +#define SCE_SQL_COMMENTLINEDOC 15 +#define SCE_SQL_WORD2 16 +#define SCE_SQL_COMMENTDOCKEYWORD 17 +#define SCE_SQL_COMMENTDOCKEYWORDERROR 18 +#define SCE_SQL_USER1 19 +#define SCE_SQL_USER2 20 +#define SCE_SQL_USER3 21 +#define SCE_SQL_USER4 22 +#define SCE_SQL_QUOTEDIDENTIFIER 23 +#define SCE_ST_DEFAULT 0 +#define SCE_ST_STRING 1 +#define SCE_ST_NUMBER 2 +#define SCE_ST_COMMENT 3 +#define SCE_ST_SYMBOL 4 +#define SCE_ST_BINARY 5 +#define SCE_ST_BOOL 6 +#define SCE_ST_SELF 7 +#define SCE_ST_SUPER 8 +#define SCE_ST_NIL 9 +#define SCE_ST_GLOBAL 10 +#define SCE_ST_RETURN 11 +#define SCE_ST_SPECIAL 12 +#define SCE_ST_KWSEND 13 +#define SCE_ST_ASSIGN 14 +#define SCE_ST_CHARACTER 15 +#define SCE_ST_SPEC_SEL 16 +#define SCE_FS_DEFAULT 0 +#define SCE_FS_COMMENT 1 +#define SCE_FS_COMMENTLINE 2 +#define SCE_FS_COMMENTDOC 3 +#define SCE_FS_COMMENTLINEDOC 4 +#define SCE_FS_COMMENTDOCKEYWORD 5 +#define SCE_FS_COMMENTDOCKEYWORDERROR 6 +#define SCE_FS_KEYWORD 7 +#define SCE_FS_KEYWORD2 8 +#define SCE_FS_KEYWORD3 9 +#define SCE_FS_KEYWORD4 10 +#define SCE_FS_NUMBER 11 +#define SCE_FS_STRING 12 +#define SCE_FS_PREPROCESSOR 13 +#define SCE_FS_OPERATOR 14 +#define SCE_FS_IDENTIFIER 15 +#define SCE_FS_DATE 16 +#define SCE_FS_STRINGEOL 17 +#define SCE_FS_CONSTANT 18 +#define SCE_FS_ASM 19 +#define SCE_FS_LABEL 20 +#define SCE_FS_ERROR 21 +#define SCE_FS_HEXNUMBER 22 +#define SCE_FS_BINNUMBER 23 +#define SCE_CSOUND_DEFAULT 0 +#define SCE_CSOUND_COMMENT 1 +#define SCE_CSOUND_NUMBER 2 +#define SCE_CSOUND_OPERATOR 3 +#define SCE_CSOUND_INSTR 4 +#define SCE_CSOUND_IDENTIFIER 5 +#define SCE_CSOUND_OPCODE 6 +#define SCE_CSOUND_HEADERSTMT 7 +#define SCE_CSOUND_USERKEYWORD 8 +#define SCE_CSOUND_COMMENTBLOCK 9 +#define SCE_CSOUND_PARAM 10 +#define SCE_CSOUND_ARATE_VAR 11 +#define SCE_CSOUND_KRATE_VAR 12 +#define SCE_CSOUND_IRATE_VAR 13 +#define SCE_CSOUND_GLOBAL_VAR 14 +#define SCE_CSOUND_STRINGEOL 15 +#define SCLEX_ASP 29 +#define SCLEX_PHP 30 //--Autogenerated -- end of section automatically generated from Scintilla.iface #endif diff --git a/contrib/src/stc/scintilla/include/Scintilla.h b/contrib/src/stc/scintilla/include/Scintilla.h index fb6c674a7a..b4ed329f72 100644 --- a/contrib/src/stc/scintilla/include/Scintilla.h +++ b/contrib/src/stc/scintilla/include/Scintilla.h @@ -11,23 +11,23 @@ #ifndef SCINTILLA_H #define SCINTILLA_H -#ifdef PLAT_WIN +#if LCCWIN +typedef BOOL bool; +#endif + #if PLAT_WIN // Return false on failure: bool Scintilla_RegisterClasses(void *hInstance); bool Scintilla_ReleaseResources(); #endif -#endif int Scintilla_LinkLexers(); // Here should be placed typedefs for uptr_t, an unsigned integer type large enough to // hold a pointer and sptr_t, a signed integer large enough to hold a pointer. // May need to be changed for 64 bit platforms. -#ifdef _MSC_VER #if _MSC_VER >= 1300 #include #endif -#endif #ifdef MAXULONG_PTR typedef ULONG_PTR uptr_t; typedef LONG_PTR sptr_t; @@ -117,6 +117,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MARK_DOTDOTDOT 23 #define SC_MARK_ARROWS 24 #define SC_MARK_PIXMAP 25 +#define SC_MARK_FULLRECT 26 #define SC_MARK_CHARACTER 10000 #define SC_MARKNUM_FOLDEREND 25 #define SC_MARKNUM_FOLDEROPENMID 26 @@ -136,6 +137,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_MARKERNEXT 2047 #define SCI_MARKERPREVIOUS 2048 #define SCI_MARKERDEFINEPIXMAP 2049 +#define SCI_MARKERADDSET 2466 #define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_NUMBER 1 #define SCI_SETMARGINTYPEN 2240 @@ -165,6 +167,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_CHARSET_MAC 77 #define SC_CHARSET_OEM 255 #define SC_CHARSET_RUSSIAN 204 +#define SC_CHARSET_CYRILLIC 1251 #define SC_CHARSET_SHIFTJIS 128 #define SC_CHARSET_SYMBOL 2 #define SC_CHARSET_TURKISH 162 @@ -173,6 +176,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_CHARSET_ARABIC 178 #define SC_CHARSET_VIETNAMESE 163 #define SC_CHARSET_THAI 222 +#define SC_CHARSET_8859_15 1000 #define SCI_STYLECLEARALL 2050 #define SCI_STYLESETFORE 2051 #define SCI_STYLESETBACK 2052 @@ -255,6 +259,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CLEARREGISTEREDIMAGES 2408 #define SCI_AUTOCGETTYPESEPARATOR 2285 #define SCI_AUTOCSETTYPESEPARATOR 2286 +#define SCI_AUTOCSETMAXWIDTH 2208 +#define SCI_AUTOCGETMAXWIDTH 2209 +#define SCI_AUTOCSETMAXHEIGHT 2210 +#define SCI_AUTOCGETMAXHEIGHT 2211 #define SCI_SETINDENT 2122 #define SCI_GETINDENT 2123 #define SCI_SETUSETABS 2124 @@ -352,6 +360,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CALLTIPSETFOREHLT 2207 #define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_DOCLINEFROMVISIBLE 2221 +#define SCI_WRAPCOUNT 2235 #define SC_FOLDLEVELBASE 0x400 #define SC_FOLDLEVELWHITEFLAG 0x1000 #define SC_FOLDLEVELHEADERFLAG 0x2000 @@ -390,6 +399,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_WORDENDPOSITION 2267 #define SC_WRAP_NONE 0 #define SC_WRAP_WORD 1 +#define SC_WRAP_CHAR 2 #define SCI_SETWRAPMODE 2268 #define SCI_GETWRAPMODE 2269 #define SC_WRAPVISUALFLAG_NONE 0x0000 @@ -591,6 +601,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETLENGTHFORENCODE 2448 #define SCI_ENCODEDFROMUTF8 2449 #define SCI_FINDCOLUMN 2456 +#define SCI_GETCARETSTICKY 2457 +#define SCI_SETCARETSTICKY 2458 +#define SCI_TOGGLECARETSTICKY 2459 +#define SCI_SETPASTECONVERTENDINGS 2467 +#define SCI_GETPASTECONVERTENDINGS 2468 +#define SCI_SELECTIONDUPLICATE 2469 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 @@ -601,6 +617,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETKEYWORDS 4005 #define SCI_SETLEXERLANGUAGE 4006 #define SCI_LOADLEXERLIBRARY 4007 +#define SCI_GETPROPERTY 4008 +#define SCI_GETPROPERTYEXPANDED 4009 +#define SCI_GETPROPERTYINT 4010 +#define SCI_GETSTYLEBITSNEEDED 4011 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 #define SC_MOD_CHANGESTYLE 0x4 @@ -608,11 +628,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_PERFORMED_USER 0x10 #define SC_PERFORMED_UNDO 0x20 #define SC_PERFORMED_REDO 0x40 +#define SC_MULTISTEPUNDOREDO 0x80 #define SC_LASTSTEPINUNDOREDO 0x100 #define SC_MOD_CHANGEMARKER 0x200 #define SC_MOD_BEFOREINSERT 0x400 #define SC_MOD_BEFOREDELETE 0x800 -#define SC_MODEVENTMASKALL 0xF77 +#define SC_MULTILINEUNDOREDO 0x1000 +#define SC_MODEVENTMASKALL 0x1FFF #define SCEN_CHANGE 768 #define SCEN_SETFOCUS 512 #define SCEN_KILLFOCUS 256 @@ -633,6 +655,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCK_ADD 310 #define SCK_SUBTRACT 311 #define SCK_DIVIDE 312 +#define SCMOD_NORM 0 #define SCMOD_SHIFT 1 #define SCMOD_CTRL 2 #define SCMOD_ALT 4 @@ -657,6 +680,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCN_HOTSPOTCLICK 2019 #define SCN_HOTSPOTDOUBLECLICK 2020 #define SCN_CALLTIPCLICK 2021 +#define SCN_AUTOCSELECTION 2022 //--Autogenerated -- end of section automatically generated from Scintilla.iface // These structures are defined to be exactly the same shape as the Win32 @@ -695,11 +719,11 @@ struct RangeToFormat { #endif struct NotifyHeader { - // hwndFrom is really an environment specifc window handle or pointer + // Compatible with Windows NMHDR. + // hwndFrom is really an environment specific window handle or pointer // but most clients of Scintilla.h do not have this type visible. - //WindowID hwndFrom; void *hwndFrom; - unsigned int idFrom; + uptr_t idFrom; unsigned int code; }; @@ -709,7 +733,7 @@ struct SCNotification { int ch; // SCN_CHARADDED, SCN_KEY int modifiers; // SCN_KEY int modificationType; // SCN_MODIFIED - const char *text; // SCN_MODIFIED + const char *text; // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION int length; // SCN_MODIFIED int linesAdded; // SCN_MODIFIED int message; // SCN_MACRORECORD diff --git a/contrib/src/stc/scintilla/include/Scintilla.iface b/contrib/src/stc/scintilla/include/Scintilla.iface index 5be763f258..a35f352e92 100644 --- a/contrib/src/stc/scintilla/include/Scintilla.iface +++ b/contrib/src/stc/scintilla/include/Scintilla.iface @@ -267,6 +267,7 @@ val SC_MARK_BACKGROUND=22 val SC_MARK_DOTDOTDOT=23 val SC_MARK_ARROWS=24 val SC_MARK_PIXMAP=25 +val SC_MARK_FULLRECT=26 val SC_MARK_CHARACTER=10000 @@ -312,6 +313,9 @@ fun int MarkerPrevious=2048(int lineStart, int markerMask) # Define a marker from a pixmap. fun void MarkerDefinePixmap=2049(int markerNumber, string pixmap) +# Add a set of markers to a line. +fun void MarkerAddSet=2466(int line, int set) + enu MarginType=SC_MARGIN_ val SC_MARGIN_SYMBOL=0 val SC_MARGIN_NUMBER=1 @@ -366,6 +370,7 @@ val SC_CHARSET_HANGUL=129 val SC_CHARSET_MAC=77 val SC_CHARSET_OEM=255 val SC_CHARSET_RUSSIAN=204 +val SC_CHARSET_CYRILLIC=1251 val SC_CHARSET_SHIFTJIS=128 val SC_CHARSET_SYMBOL=2 val SC_CHARSET_TURKISH=162 @@ -374,6 +379,7 @@ val SC_CHARSET_HEBREW=177 val SC_CHARSET_ARABIC=178 val SC_CHARSET_VIETNAMESE=163 val SC_CHARSET_THAI=222 +val SC_CHARSET_8859_15=1000 # Clear all the styles and make equivalent to the global default style. set void StyleClearAll=2050(,) @@ -607,6 +613,20 @@ get int AutoCGetTypeSeparator=2285(,) # Default is '?' but can be changed if items contain '?'. set void AutoCSetTypeSeparator=2286(int separatorCharacter,) +# Set the maximum width, in characters, of auto-completion and user lists. +# Set to 0 to autosize to fit longest item, which is the default. +set void AutoCSetMaxWidth=2208(int characterCount,) + +# Get the maximum width, in characters, of auto-completion and user lists. +get int AutoCGetMaxWidth=2209(,) + +# Set the maximum height, in rows, of auto-completion and user lists. +# The default is 5 rows. +set void AutoCSetMaxHeight=2210(int rowCount,) + +# Set the maximum height, in rows, of auto-completion and user lists. +get int AutoCGetMaxHeight=2211(,) + # Set the number of spaces used for one level of indentation. set void SetIndent=2122(int indentSize,) @@ -905,6 +925,9 @@ fun int VisibleFromDocLine=2220(int line,) # Find the document line of a display line taking hidden lines into account. fun int DocLineFromVisible=2221(int lineDisplay,) +# The number of display lines needed to wrap a document line +fun int WrapCount=2235(int line,) + enu FoldLevel=SC_FOLDLEVEL val SC_FOLDLEVELBASE=0x400 val SC_FOLDLEVELWHITEFLAG=0x1000 @@ -994,6 +1017,7 @@ fun int WordEndPosition=2267(position pos, bool onlyWordCharacters) enu Wrap=SC_WRAP_ val SC_WRAP_NONE=0 val SC_WRAP_WORD=1 +val SC_WRAP_CHAR=2 # Sets whether text is word wrapped. set void SetWrapMode=2268(int mode,) @@ -1059,7 +1083,7 @@ set void SetEndAtLastLine=2277(bool endAtLastLine,) # Retrieve whether the maximum scroll position has the last # line at the bottom of the view. -get int GetEndAtLastLine=2278(,) +get bool GetEndAtLastLine=2278(,) # Retrieve the height of a particular line of text in pixels. fun int TextHeight=2279(int line,) @@ -1588,7 +1612,7 @@ fun void Allocate=2446(int bytes,) fun int TargetAsUTF8=2447(, stringresult s) # Set the length of the utf8 argument for calling EncodedFromUTF8. -# Set to 0 and the string will be measured to the first nul. +# Set to -1 and the string will be measured to the first nul. fun void SetLengthForEncode=2448(int bytes,) # Translates a UTF8 string into the document encoding. @@ -1596,10 +1620,28 @@ fun void SetLengthForEncode=2448(int bytes,) # On error return 0. fun int EncodedFromUTF8=2449(string utf8, stringresult encoded) -# Find the position of a column on a line taking into account tabs and +# Find the position of a column on a line taking into account tabs and # multi-byte characters. If beyond end of line, return line end position. fun int FindColumn=2456(int line, int column) +# Can the caret preferred x position only be changed by explicit movement commands? +get bool GetCaretSticky=2457(,) + +# Stop the caret preferred x position changing when the user types. +set void SetCaretSticky=2458(bool useCaretStickyBehaviour,) + +# Switch between sticky and non-sticky: meant to be bound to a key. +fun void ToggleCaretSticky=2459(,) + +# Enable/Disable convert-on-paste for line endings +set void SetPasteConvertEndings=2467(bool convert,) + +# Get convert-on-paste setting +get bool GetPasteConvertEndings=2468(,) + +# Duplicate the selection. If selection empty duplicate the line containing the caret. +fun void SelectionDuplicate=2469(,) + # Start notifying the container of all key presses and commands. fun void StartRecord=3001(,) @@ -1630,6 +1672,20 @@ set void SetLexerLanguage=4006(, string language) # Load a lexer library (dll / so). fun void LoadLexerLibrary=4007(, string path) +# Retrieve a "property" value previously set with SetProperty. +fun int GetProperty=4008(string key, stringresult buf) + +# Retrieve a "property" value previously set with SetProperty, +# with "$()" variable replacement on returned buffer. +fun int GetPropertyExpanded=4009(string key, stringresult buf) + +# Retrieve a "property" value previously set with SetProperty, +# interpreted as an int AFTER any "$()" variable replacement. +get int GetPropertyInt=4010(string key,) + +# Retrieve the number of bits the current lexer needs for styling. +get int GetStyleBitsNeeded=4011(,) + # Notifications # Type of modification and the action which caused the modification. # These are defined as a bit mask to make it easy to specify which notifications are wanted. @@ -1642,11 +1698,13 @@ val SC_MOD_CHANGEFOLD=0x8 val SC_PERFORMED_USER=0x10 val SC_PERFORMED_UNDO=0x20 val SC_PERFORMED_REDO=0x40 +val SC_MULTISTEPUNDOREDO=0x80 val SC_LASTSTEPINUNDOREDO=0x100 val SC_MOD_CHANGEMARKER=0x200 val SC_MOD_BEFOREINSERT=0x400 val SC_MOD_BEFOREDELETE=0x800 -val SC_MODEVENTMASKALL=0xF77 +val SC_MULTILINEUNDOREDO=0x1000 +val SC_MODEVENTMASKALL=0x1FFF # For compatibility, these go through the COMMAND notification rather than NOTIFY # and should have had exactly the same values as the EN_* constants. @@ -1680,6 +1738,7 @@ val SCK_SUBTRACT=311 val SCK_DIVIDE=312 enu KeyMod=SCMOD_ +val SCMOD_NORM=0 val SCMOD_SHIFT=1 val SCMOD_CTRL=2 val SCMOD_ALT=4 @@ -1716,8 +1775,6 @@ val SCLEX_TCL=25 val SCLEX_NNCRONTAB=26 val SCLEX_BULLANT=27 val SCLEX_VBSCRIPT=28 -val SCLEX_ASP=29 -val SCLEX_PHP=30 val SCLEX_BAAN=31 val SCLEX_MATLAB=32 val SCLEX_SCRIPTOL=33 @@ -1752,13 +1809,23 @@ val SCLEX_APDL=61 val SCLEX_BASH=62 val SCLEX_ASN1=63 val SCLEX_VHDL=64 +val SCLEX_CAML=65 +val SCLEX_BLITZBASIC=66 +val SCLEX_PUREBASIC=67 +val SCLEX_HASKELL=68 +val SCLEX_PHPSCRIPT=69 +val SCLEX_TADS3=70 +val SCLEX_REBOL=71 +val SCLEX_SMALLTALK=72 +val SCLEX_FLAGSHIP=73 +val SCLEX_CSOUND=74 +val SCLEX_FREEBASIC=75 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # value assigned in sequence from SCLEX_AUTOMATIC+1. val SCLEX_AUTOMATIC=1000 # Lexical states for SCLEX_PYTHON lex Python=SCLEX_PYTHON SCE_P_ -lex Ruby=SCLEX_RUBY SCE_P_ val SCE_P_DEFAULT=0 val SCE_P_COMMENTLINE=1 val SCE_P_NUMBER=2 @@ -1773,9 +1840,10 @@ val SCE_P_OPERATOR=10 val SCE_P_IDENTIFIER=11 val SCE_P_COMMENTBLOCK=12 val SCE_P_STRINGEOL=13 +val SCE_P_WORD2=14 +val SCE_P_DECORATOR=15 # Lexical states for SCLEX_CPP lex Cpp=SCLEX_CPP SCE_C_ -lex SQL=SCLEX_SQL SCE_C_ lex Pascal=SCLEX_PASCAL SCE_C_ lex TCL=SCLEX_TCL SCE_C_ lex BullAnt=SCLEX_BULLANT SCE_C_ @@ -1945,6 +2013,7 @@ val SCE_PL_SCALAR=12 val SCE_PL_ARRAY=13 val SCE_PL_HASH=14 val SCE_PL_SYMBOLTABLE=15 +val SCE_PL_VARIABLE_INDEXER=16 val SCE_PL_REGEX=17 val SCE_PL_REGSUBST=18 val SCE_PL_LONGQUOTE=19 @@ -1959,6 +2028,43 @@ val SCE_PL_STRING_QQ=27 val SCE_PL_STRING_QX=28 val SCE_PL_STRING_QR=29 val SCE_PL_STRING_QW=30 +val SCE_PL_POD_VERB=31 +# Lexical states for SCLEX_RUBY +lex Ruby=SCLEX_RUBY SCE_RB_ +val SCE_RB_DEFAULT=0 +val SCE_RB_ERROR=1 +val SCE_RB_COMMENTLINE=2 +val SCE_RB_POD=3 +val SCE_RB_NUMBER=4 +val SCE_RB_WORD=5 +val SCE_RB_STRING=6 +val SCE_RB_CHARACTER=7 +val SCE_RB_CLASSNAME=8 +val SCE_RB_DEFNAME=9 +val SCE_RB_OPERATOR=10 +val SCE_RB_IDENTIFIER=11 +val SCE_RB_REGEX=12 +val SCE_RB_GLOBAL=13 +val SCE_RB_SYMBOL=14 +val SCE_RB_MODULE_NAME=15 +val SCE_RB_INSTANCE_VAR=16 +val SCE_RB_CLASS_VAR=17 +val SCE_RB_BACKTICKS=18 +val SCE_RB_DATASECTION=19 +val SCE_RB_HERE_DELIM=20 +val SCE_RB_HERE_Q=21 +val SCE_RB_HERE_QQ=22 +val SCE_RB_HERE_QX=23 +val SCE_RB_STRING_Q=24 +val SCE_RB_STRING_QQ=25 +val SCE_RB_STRING_QX=26 +val SCE_RB_STRING_QR=27 +val SCE_RB_STRING_QW=28 +val SCE_RB_WORD_DEMOTED=29 +val SCE_RB_STDIN=30 +val SCE_RB_STDOUT=31 +val SCE_RB_STDERR=40 +val SCE_RB_UPPER_BOUND=41 # Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC lex VB=SCLEX_VB SCE_B_ lex VBScript=SCLEX_VBSCRIPT SCE_B_ @@ -1978,6 +2084,10 @@ val SCE_B_KEYWORD3=11 val SCE_B_KEYWORD4=12 val SCE_B_CONSTANT=13 val SCE_B_ASM=14 +val SCE_B_LABEL=15 +val SCE_B_ERROR=16 +val SCE_B_HEXNUMBER=17 +val SCE_B_BINNUMBER=18 # Lexical states for SCLEX_PROPERTIES lex Properties=SCLEX_PROPERTIES SCE_PROPS_ val SCE_PROPS_DEFAULT=0 @@ -2127,10 +2237,14 @@ val SCE_LISP_DEFAULT=0 val SCE_LISP_COMMENT=1 val SCE_LISP_NUMBER=2 val SCE_LISP_KEYWORD=3 +val SCE_LISP_KEYWORD_KW=4 +val SCE_LISP_SYMBOL=5 val SCE_LISP_STRING=6 val SCE_LISP_STRINGEOL=8 val SCE_LISP_IDENTIFIER=9 val SCE_LISP_OPERATOR=10 +val SCE_LISP_SPECIAL=11 +val SCE_LISP_MULTI_COMMENT=12 # Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW lex Eiffel=SCLEX_EIFFEL SCE_EIFFEL_ lex EiffelKW=SCLEX_EIFFELKW SCE_EIFFEL_ @@ -2253,6 +2367,7 @@ val SCE_CSS_DIRECTIVE=12 val SCE_CSS_DOUBLESTRING=13 val SCE_CSS_SINGLESTRING=14 val SCE_CSS_IDENTIFIER2=15 +val SCE_CSS_ATTRIBUTE=16 # Lexical states for SCLEX_POV lex POV=SCLEX_POV SCE_POV_ val SCE_POV_DEFAULT=0 @@ -2334,6 +2449,10 @@ val SCE_NSIS_IFDEFINEDEF=11 val SCE_NSIS_MACRODEF=12 val SCE_NSIS_STRINGVAR=13 val SCE_NSIS_NUMBER=14 +val SCE_NSIS_SECTIONGROUP=15 +val SCE_NSIS_PAGEEX=16 +val SCE_NSIS_FUNCTIONDEF=17 +val SCE_NSIS_COMMENTBOX=18 # Lexical states for SCLEX_MMIXAL lex MMIXAL=SCLEX_MMIXAL SCE_MMIXAL_ val SCE_MMIXAL_LEADWS=0 @@ -2366,11 +2485,13 @@ val SCE_CLW_REAL_CONSTANT=6 val SCE_CLW_PICTURE_STRING=7 val SCE_CLW_KEYWORD=8 val SCE_CLW_COMPILER_DIRECTIVE=9 -val SCE_CLW_BUILTIN_PROCEDURES_FUNCTION=10 -val SCE_CLW_STRUCTURE_DATA_TYPE=11 -val SCE_CLW_ATTRIBUTE=12 -val SCE_CLW_STANDARD_EQUATE=13 -val SCE_CLW_ERROR=14 +val SCE_CLW_RUNTIME_EXPRESSIONS=10 +val SCE_CLW_BUILTIN_PROCEDURES_FUNCTION=11 +val SCE_CLW_STRUCTURE_DATA_TYPE=12 +val SCE_CLW_ATTRIBUTE=13 +val SCE_CLW_STANDARD_EQUATE=14 +val SCE_CLW_ERROR=15 +val SCE_CLW_DEPRECATED=16 # Lexical states for SCLEX_LOT lex LOT=SCLEX_LOT SCE_LOT_ val SCE_LOT_DEFAULT=0 @@ -2518,6 +2639,8 @@ val SCE_AU3_VARIABLE=9 val SCE_AU3_SENT=10 val SCE_AU3_PREPROCESSOR=11 val SCE_AU3_SPECIAL=12 +val SCE_AU3_EXPAND=13 +val SCE_AU3_COMOBJ=14 # Lexical states for SCLEX_APDL lex APDL=SCLEX_APDL SCE_APDL_ val SCE_APDL_DEFAULT=0 @@ -2579,6 +2702,182 @@ val SCE_VHDL_STDFUNCTION=11 val SCE_VHDL_STDPACKAGE=12 val SCE_VHDL_STDTYPE=13 val SCE_VHDL_USERWORD=14 +# Lexical states for SCLEX_CAML +lex Caml=SCLEX_CAML SCE_CAML_ +val SCE_CAML_DEFAULT=0 +val SCE_CAML_IDENTIFIER=1 +val SCE_CAML_TAGNAME=2 +val SCE_CAML_KEYWORD=3 +val SCE_CAML_KEYWORD2=4 +val SCE_CAML_KEYWORD3=5 +val SCE_CAML_LINENUM=6 +val SCE_CAML_OPERATOR=7 +val SCE_CAML_NUMBER=8 +val SCE_CAML_CHAR=9 +val SCE_CAML_STRING=11 +val SCE_CAML_COMMENT=12 +val SCE_CAML_COMMENT1=13 +val SCE_CAML_COMMENT2=14 +val SCE_CAML_COMMENT3=15 +# Lexical states for SCLEX_HASKELL +lex Haskell=SCLEX_HASKELL SCE_HA_ +val SCE_HA_DEFAULT=0 +val SCE_HA_IDENTIFIER=1 +val SCE_HA_KEYWORD=2 +val SCE_HA_NUMBER=3 +val SCE_HA_STRING=4 +val SCE_HA_CHARACTER=5 +val SCE_HA_CLASS=6 +val SCE_HA_MODULE=7 +val SCE_HA_CAPITAL=8 +val SCE_HA_DATA=9 +val SCE_HA_IMPORT=10 +val SCE_HA_OPERATOR=11 +val SCE_HA_INSTANCE=12 +val SCE_HA_COMMENTLINE=13 +val SCE_HA_COMMENTBLOCK=14 +val SCE_HA_COMMENTBLOCK2=15 +val SCE_HA_COMMENTBLOCK3=16 +# Lexical states of SCLEX_TADS3 +lex TADS3=SCLEX_TADS3 SCE_T3_ +val SCE_T3_DEFAULT=0 +val SCE_T3_X_DEFAULT=1 +val SCE_T3_PREPROCESSOR=2 +val SCE_T3_BLOCK_COMMENT=3 +val SCE_T3_LINE_COMMENT=4 +val SCE_T3_OPERATOR=5 +val SCE_T3_KEYWORD=6 +val SCE_T3_NUMBER=7 +val SCE_T3_IDENTIFIER=8 +val SCE_T3_S_STRING=9 +val SCE_T3_D_STRING=10 +val SCE_T3_X_STRING=11 +val SCE_T3_LIB_DIRECTIVE=12 +val SCE_T3_MSG_PARAM=13 +val SCE_T3_HTML_TAG=14 +val SCE_T3_HTML_DEFAULT=15 +val SCE_T3_HTML_STRING=16 +val SCE_T3_USER1=17 +val SCE_T3_USER2=18 +val SCE_T3_USER3=19 +# Lexical states for SCLEX_REBOL +lex Rebol=SCLEX_REBOL SCE_REBOL_ +val SCE_REBOL_DEFAULT=0 +val SCE_REBOL_COMMENTLINE=1 +val SCE_REBOL_COMMENTBLOCK=2 +val SCE_REBOL_PREFACE=3 +val SCE_REBOL_OPERATOR=4 +val SCE_REBOL_CHARACTER=5 +val SCE_REBOL_QUOTEDSTRING=6 +val SCE_REBOL_BRACEDSTRING=7 +val SCE_REBOL_NUMBER=8 +val SCE_REBOL_PAIR=9 +val SCE_REBOL_TUPLE=10 +val SCE_REBOL_BINARY=11 +val SCE_REBOL_MONEY=12 +val SCE_REBOL_ISSUE=13 +val SCE_REBOL_TAG=14 +val SCE_REBOL_FILE=15 +val SCE_REBOL_EMAIL=16 +val SCE_REBOL_URL=17 +val SCE_REBOL_DATE=18 +val SCE_REBOL_TIME=19 +val SCE_REBOL_IDENTIFIER=20 +val SCE_REBOL_WORD=21 +val SCE_REBOL_WORD2=22 +val SCE_REBOL_WORD3=23 +val SCE_REBOL_WORD4=24 +val SCE_REBOL_WORD5=25 +val SCE_REBOL_WORD6=26 +val SCE_REBOL_WORD7=27 +val SCE_REBOL_WORD8=28 +# Lexical states for SCLEX_SQL +lex SQL=SCLEX_SQL SCE_SQL_ +val SCE_SQL_DEFAULT=0 +val SCE_SQL_COMMENT=1 +val SCE_SQL_COMMENTLINE=2 +val SCE_SQL_COMMENTDOC=3 +val SCE_SQL_NUMBER=4 +val SCE_SQL_WORD=5 +val SCE_SQL_STRING=6 +val SCE_SQL_CHARACTER=7 +val SCE_SQL_SQLPLUS=8 +val SCE_SQL_SQLPLUS_PROMPT=9 +val SCE_SQL_OPERATOR=10 +val SCE_SQL_IDENTIFIER=11 +val SCE_SQL_SQLPLUS_COMMENT=13 +val SCE_SQL_COMMENTLINEDOC=15 +val SCE_SQL_WORD2=16 +val SCE_SQL_COMMENTDOCKEYWORD=17 +val SCE_SQL_COMMENTDOCKEYWORDERROR=18 +val SCE_SQL_USER1=19 +val SCE_SQL_USER2=20 +val SCE_SQL_USER3=21 +val SCE_SQL_USER4=22 +val SCE_SQL_QUOTEDIDENTIFIER=23 +# Lexical states for SCLEX_SMALLTALK +lex Smalltalk=SCLEX_SMALLTALK SCE_ST_ +val SCE_ST_DEFAULT=0 +val SCE_ST_STRING=1 +val SCE_ST_NUMBER=2 +val SCE_ST_COMMENT=3 +val SCE_ST_SYMBOL=4 +val SCE_ST_BINARY=5 +val SCE_ST_BOOL=6 +val SCE_ST_SELF=7 +val SCE_ST_SUPER=8 +val SCE_ST_NIL=9 +val SCE_ST_GLOBAL=10 +val SCE_ST_RETURN=11 +val SCE_ST_SPECIAL=12 +val SCE_ST_KWSEND=13 +val SCE_ST_ASSIGN=14 +val SCE_ST_CHARACTER=15 +val SCE_ST_SPEC_SEL=16 +# Lexical states for SCLEX_FLAGSHIP (clipper) +lex FlagShip=SCLEX_FLAGSHIP SCE_B_ +val SCE_FS_DEFAULT=0 +val SCE_FS_COMMENT=1 +val SCE_FS_COMMENTLINE=2 +val SCE_FS_COMMENTDOC=3 +val SCE_FS_COMMENTLINEDOC=4 +val SCE_FS_COMMENTDOCKEYWORD=5 +val SCE_FS_COMMENTDOCKEYWORDERROR=6 +val SCE_FS_KEYWORD=7 +val SCE_FS_KEYWORD2=8 +val SCE_FS_KEYWORD3=9 +val SCE_FS_KEYWORD4=10 +val SCE_FS_NUMBER=11 +val SCE_FS_STRING=12 +val SCE_FS_PREPROCESSOR=13 +val SCE_FS_OPERATOR=14 +val SCE_FS_IDENTIFIER=15 +val SCE_FS_DATE=16 +val SCE_FS_STRINGEOL=17 +val SCE_FS_CONSTANT=18 +val SCE_FS_ASM=19 +val SCE_FS_LABEL=20 +val SCE_FS_ERROR=21 +val SCE_FS_HEXNUMBER=22 +val SCE_FS_BINNUMBER=23 +# Lexical states for SCLEX_CSOUND +lex Csound=SCLEX_CSOUND SCE_CSOUND_ +val SCE_CSOUND_DEFAULT=0 +val SCE_CSOUND_COMMENT=1 +val SCE_CSOUND_NUMBER=2 +val SCE_CSOUND_OPERATOR=3 +val SCE_CSOUND_INSTR=4 +val SCE_CSOUND_IDENTIFIER=5 +val SCE_CSOUND_OPCODE=6 +val SCE_CSOUND_HEADERSTMT=7 +val SCE_CSOUND_USERKEYWORD=8 +val SCE_CSOUND_COMMENTBLOCK=9 +val SCE_CSOUND_PARAM=10 +val SCE_CSOUND_ARATE_VAR=11 +val SCE_CSOUND_KRATE_VAR=12 +val SCE_CSOUND_IRATE_VAR=13 +val SCE_CSOUND_GLOBAL_VAR=14 +val SCE_CSOUND_STRINGEOL=15 # Events @@ -2604,6 +2903,7 @@ evt void Zoom=2018(void) evt void HotSpotClick=2019(int modifiers, int position) evt void HotSpotDoubleClick=2020(int modifiers, int position) evt void CallTipClick=2021(int position) +evt void AutoCSelection=2022(string text) cat Deprecated @@ -2617,3 +2917,6 @@ val CARET_XJUMPS=0x10 val SCN_CHECKBRACE=2007 evt void PosChanged=2012(int position) +# SCLEX_HTML should be used in preference to these. +val SCLEX_ASP=29 +val SCLEX_PHP=30 diff --git a/contrib/src/stc/scintilla/include/ScintillaWidget.h b/contrib/src/stc/scintilla/include/ScintillaWidget.h index 765fd8594d..7f47de7e13 100644 --- a/contrib/src/stc/scintilla/include/ScintillaWidget.h +++ b/contrib/src/stc/scintilla/include/ScintillaWidget.h @@ -34,9 +34,9 @@ struct _ScintillaClass { void (* notify) (ScintillaObject *ttt); }; -guint scintilla_get_type (void); +GtkType scintilla_get_type (void); GtkWidget* scintilla_new (void); -void scintilla_set_id (ScintillaObject *sci,int id); +void scintilla_set_id (ScintillaObject *sci, uptr_t id); sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam); void scintilla_release_resources(void); diff --git a/contrib/src/stc/scintilla/src/AutoComplete.cxx b/contrib/src/stc/scintilla/src/AutoComplete.cxx index adbd24d038..753adca779 100644 --- a/contrib/src/stc/scintilla/src/AutoComplete.cxx +++ b/contrib/src/stc/scintilla/src/AutoComplete.cxx @@ -43,12 +43,13 @@ bool AutoComplete::Active() { return active; } -void AutoComplete::Start(Window &parent, int ctrlID, int position, - int startLen_, int lineHeight, bool unicodeMode) { +void AutoComplete::Start(Window &parent, int ctrlID, + int position, Point location, int startLen_, + int lineHeight, bool unicodeMode) { if (active) { Cancel(); } - lb->Create(parent, ctrlID, lineHeight, unicodeMode); + lb->Create(parent, ctrlID, location, lineHeight, unicodeMode); lb->Clear(); active = true; startLen = startLen_; @@ -90,41 +91,18 @@ char AutoComplete::GetTypesep() { } void AutoComplete::SetList(const char *list) { - lb->Clear(); - char *words = new char[strlen(list) + 1]; - if (words) { - strcpy(words, list); - char *startword = words; - char *numword = NULL; - int i = 0; - for (; words && words[i]; i++) { - if (words[i] == separator) { - words[i] = '\0'; - if (numword) - *numword = '\0'; - lb->Append(startword, numword?atoi(numword + 1):-1); - startword = words + i + 1; - numword = NULL; - } else if (words[i] == typesep) { - numword = words + i; - } - } - if (startword) { - if (numword) - *numword = '\0'; - lb->Append(startword, numword?atoi(numword + 1):-1); - } - delete []words; - } + lb->SetList(list, separator, typesep); } -void AutoComplete::Show() { - lb->Show(); - lb->Select(0); +void AutoComplete::Show(bool show) { + lb->Show(show); + if (show) + lb->Select(0); } void AutoComplete::Cancel() { if (lb->Created()) { + lb->Clear(); lb->Destroy(); active = false; } @@ -170,6 +148,18 @@ void AutoComplete::Select(const char *word) { --pivot; } location = pivot; + if (ignoreCase) { + // Check for exact-case match + for (; pivot <= end; pivot++) { + lb->GetValue(pivot, item, maxItemLen); + if (!strncmp(word, item, lenWord)) { + location = pivot; + break; + } + if (CompareNCaseInsensitive(word, item, lenWord)) + break; + } + } } else if (cond < 0) { end = pivot - 1; } else if (cond > 0) { diff --git a/contrib/src/stc/scintilla/src/AutoComplete.h b/contrib/src/stc/scintilla/src/AutoComplete.h index eedab5625e..10577ca380 100644 --- a/contrib/src/stc/scintilla/src/AutoComplete.h +++ b/contrib/src/stc/scintilla/src/AutoComplete.h @@ -15,7 +15,7 @@ class AutoComplete { char stopChars[256]; char fillUpChars[256]; char separator; - char typesep; // Type separator + char typesep; // Type seperator public: bool ignoreCase; @@ -35,7 +35,7 @@ public: bool Active(); /// Display the auto completion list positioned to be near a character position - void Start(Window &parent, int ctrlID, int position, + void Start(Window &parent, int ctrlID, int position, Point location, int startLen_, int lineHeight, bool unicodeMode); /// The stop chars are characters which, when typed, cause the auto completion list to disappear @@ -50,14 +50,14 @@ public: void SetSeparator(char separator_); char GetSeparator(); - /// The typesep character is used for separating the word from the type + /// The typesep character is used for seperating the word from the type void SetTypesep(char separator_); char GetTypesep(); /// The list string contains a sequence of words separated by the separator character void SetList(const char *list); - void Show(); + void Show(bool show); void Cancel(); /// Move the current list element by delta, scrolling appropriately diff --git a/contrib/src/stc/scintilla/src/CallTip.cxx b/contrib/src/stc/scintilla/src/CallTip.cxx index 003284c12d..80fd55d7b8 100644 --- a/contrib/src/stc/scintilla/src/CallTip.cxx +++ b/contrib/src/stc/scintilla/src/CallTip.cxx @@ -18,8 +18,8 @@ CallTip::CallTip() { inCallTipMode = false; posStartCallTip = 0; val = 0; - xUp = -100; - xDown = -100; + rectUp = PRectangle(0,0,0,0); + rectDown = PRectangle(0,0,0,0); lineHeight = 1; startHighlight = 0; endHighlight = 0; @@ -75,12 +75,12 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s, if (IsArrowCharacter(s[startSeg])) { xEnd = x + widthArrow; offsetMain = xEnd; + rcClient.left = x; + rcClient.right = xEnd; if (draw) { const int halfWidth = widthArrow / 2 - 3; const int centreX = x + widthArrow / 2 - 1; const int centreY = (rcClient.top + rcClient.bottom) / 2; - rcClient.left = x; - rcClient.right = xEnd; surface->FillRectangle(rcClient, colourBG.allocated); PRectangle rcClientInner(rcClient.left+1, rcClient.top+1, rcClient.right-2, rcClient.bottom-1); surface->FillRectangle(rcClientInner, colourUnSel.allocated); @@ -104,12 +104,11 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s, surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), colourBG.allocated, colourBG.allocated); } - } else { - if (s[startSeg] == '\001') { - xUp = x+1; - } else { - xDown = x+1; - } + } + if (s[startSeg] == '\001') { + rectUp = rcClient; + } else if (s[startSeg] == '\002') { + rectDown = rcClient; } } else { xEnd = x + surface->WidthText(font, s+startSeg, endSeg - startSeg); @@ -203,13 +202,10 @@ void CallTip::PaintCT(Surface *surfaceWindow) { void CallTip::MouseClick(Point pt) { clickPlace = 0; - if (pt.y < lineHeight) { - if ((pt.x > xUp) && (pt.x < xUp + widthArrow - 2)) { - clickPlace = 1; - } else if ((pt.x > xDown) && (pt.x < xDown + widthArrow - 2)) { - clickPlace = 2; - } - } + if (rectUp.Contains(pt)) + clickPlace = 1; + if (rectDown.Contains(pt)) + clickPlace = 2; } PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn, @@ -240,8 +236,8 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn, int numLines = 1; const char *newline; const char *look = val; - xUp = -100; - xDown = -100; + rectUp = PRectangle(0,0,0,0); + rectDown = PRectangle(0,0,0,0); offsetMain = 5; int width = PaintContents(surfaceMeasure, false) + 5; while ((newline = strchr(look, '\n')) != NULL) { diff --git a/contrib/src/stc/scintilla/src/CallTip.h b/contrib/src/stc/scintilla/src/CallTip.h index feff7ea0b1..53eec832a2 100644 --- a/contrib/src/stc/scintilla/src/CallTip.h +++ b/contrib/src/stc/scintilla/src/CallTip.h @@ -15,8 +15,8 @@ class CallTip { int endHighlight; char *val; Font font; - int xUp; - int xDown; + PRectangle rectUp; + PRectangle rectDown; int lineHeight; int offsetMain; // Private so CallTip objects can not be copied diff --git a/contrib/src/stc/scintilla/src/CellBuffer.cxx b/contrib/src/stc/scintilla/src/CellBuffer.cxx index 8183e4d8d3..1109a17fbe 100644 --- a/contrib/src/stc/scintilla/src/CellBuffer.cxx +++ b/contrib/src/stc/scintilla/src/CellBuffer.cxx @@ -254,13 +254,14 @@ void LineVector::Remove(int pos) { linesData[i] = linesData[i + 1]; } if (levels) { - // Level information merges back onto previous line - int posAbove = pos - 1; - if (posAbove < 0) - posAbove = 0; - for (int j = posAbove; j < lines; j++) { + // Move up following lines but merge header flag from this line + // to line before to avoid a temporary disappearence causing expansion. + int firstHeader = levels[pos] & SC_FOLDLEVELHEADERFLAG; + for (int j = pos; j < lines; j++) { levels[j] = levels[j + 1]; } + if (pos > 0) + levels[pos-1] |= firstHeader; } lines--; } @@ -464,7 +465,7 @@ void UndoHistory::AppendAction(actionType at, int position, char *data, int leng } else if (currentAction == savePoint) { currentAction++; } else if ((at == insertAction) && - (position != (actPrevious.position + actPrevious.lenData*2))) { + (position != (actPrevious.position + actPrevious.lenData))) { // Insertions must be immediately after to coalesce currentAction++; } else if (!actions[currentAction].mayCoalesce) { @@ -472,7 +473,7 @@ void UndoHistory::AppendAction(actionType at, int position, char *data, int leng currentAction++; } else if (at == removeAction) { if ((lengthData == 1) || (lengthData == 2)){ - if ((position + lengthData * 2) == actPrevious.position) { + if ((position + lengthData) == actPrevious.position) { ; // Backspace -> OK } else if (position == actPrevious.position) { ; // Delete -> OK @@ -724,7 +725,7 @@ const char *CellBuffer::InsertString(int position, char *s, int insertLength) { for (int i = 0; i < insertLength / 2; i++) { data[i] = s[i * 2]; } - uh.AppendAction(insertAction, position, data, insertLength / 2); + uh.AppendAction(insertAction, position / 2, data, insertLength / 2); } BasicInsertString(position, s, insertLength); @@ -732,13 +733,6 @@ const char *CellBuffer::InsertString(int position, char *s, int insertLength) { return data; } -void CellBuffer::InsertCharStyle(int position, char ch, char style) { - char s[2]; - s[0] = ch; - s[1] = style; - InsertString(position*2, s, 2); -} - bool CellBuffer::SetStyleAt(int position, char style, char mask) { style &= mask; char curVal = ByteAt(position * 2 + 1); @@ -768,6 +762,7 @@ bool CellBuffer::SetStyleFor(int position, int lengthStyle, char style, char mas const char *CellBuffer::DeleteChars(int position, int deleteLength) { // InsertString and DeleteChars are the bottleneck though which all changes occur + PLATFORM_ASSERT(deleteLength > 0); char *data = 0; if (!readOnly) { if (collectingUndo) { @@ -776,7 +771,7 @@ const char *CellBuffer::DeleteChars(int position, int deleteLength) { for (int i = 0; i < deleteLength / 2; i++) { data[i] = ByteAt(position + i * 2); } - uh.AppendAction(removeAction, position, data, deleteLength / 2); + uh.AppendAction(removeAction, position / 2, data, deleteLength / 2); } BasicDeleteChars(position, deleteLength); @@ -874,6 +869,7 @@ void CellBuffer::BasicInsertString(int position, char *s, int insertLength) { //Platform::DebugPrintf("Inserting at %d for %d\n", position, insertLength); if (insertLength == 0) return ; + PLATFORM_ASSERT(insertLength > 0); RoomFor(insertLength); GapTo(position); @@ -1028,7 +1024,7 @@ void CellBuffer::DeleteUndoHistory() { } bool CellBuffer::CanUndo() { - return (!readOnly) && (uh.CanUndo()); + return uh.CanUndo(); } int CellBuffer::StartUndo() { @@ -1042,21 +1038,21 @@ const Action &CellBuffer::GetUndoStep() const { void CellBuffer::PerformUndoStep() { const Action &actionStep = uh.GetUndoStep(); if (actionStep.at == insertAction) { - BasicDeleteChars(actionStep.position, actionStep.lenData*2); + BasicDeleteChars(actionStep.position*2, actionStep.lenData*2); } else if (actionStep.at == removeAction) { char *styledData = new char[actionStep.lenData * 2]; for (int i = 0; i < actionStep.lenData; i++) { styledData[i*2] = actionStep.data[i]; styledData[i*2 + 1] = 0; } - BasicInsertString(actionStep.position, styledData, actionStep.lenData*2); + BasicInsertString(actionStep.position*2, styledData, actionStep.lenData*2); delete []styledData; } uh.CompletedUndoStep(); } bool CellBuffer::CanRedo() { - return (!readOnly) && (uh.CanRedo()); + return uh.CanRedo(); } int CellBuffer::StartRedo() { @@ -1075,10 +1071,10 @@ void CellBuffer::PerformRedoStep() { styledData[i*2] = actionStep.data[i]; styledData[i*2 + 1] = 0; } - BasicInsertString(actionStep.position, styledData, actionStep.lenData*2); + BasicInsertString(actionStep.position*2, styledData, actionStep.lenData*2); delete []styledData; } else if (actionStep.at == removeAction) { - BasicDeleteChars(actionStep.position, actionStep.lenData*2); + BasicDeleteChars(actionStep.position*2, actionStep.lenData*2); } uh.CompletedRedoStep(); } diff --git a/contrib/src/stc/scintilla/src/CellBuffer.h b/contrib/src/stc/scintilla/src/CellBuffer.h index b16eef5e51..bb81fd5722 100644 --- a/contrib/src/stc/scintilla/src/CellBuffer.h +++ b/contrib/src/stc/scintilla/src/CellBuffer.h @@ -191,7 +191,6 @@ public: int LineStart(int line); int LineFromPosition(int pos) { return lv.LineFromPosition(pos); } const char *InsertString(int position, char *s, int insertLength); - void InsertCharStyle(int position, char ch, char style); /// Setting styles for positions outside the range of the buffer is safe and has no effect. /// @return true if the style of a character is changed. diff --git a/contrib/src/stc/scintilla/src/Document.cxx b/contrib/src/stc/scintilla/src/Document.cxx index 76fa456ccb..a88468cb1a 100644 --- a/contrib/src/stc/scintilla/src/Document.cxx +++ b/contrib/src/stc/scintilla/src/Document.cxx @@ -103,26 +103,40 @@ void Document::SetSavePoint() { int Document::AddMark(int line, int markerNum) { int prev = cb.AddMark(line, markerNum); - DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0); + DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); + mh.line = line; NotifyModified(mh); return prev; } +void Document::AddMarkSet(int line, int valueSet) { + unsigned int m = valueSet; + for (int i = 0; m; i++, m >>= 1) + if (m & 1) + cb.AddMark(line, i); + DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); + mh.line = line; + NotifyModified(mh); +} + void Document::DeleteMark(int line, int markerNum) { cb.DeleteMark(line, markerNum); - DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0); + DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); + mh.line = line; NotifyModified(mh); } void Document::DeleteMarkFromHandle(int markerHandle) { cb.DeleteMarkFromHandle(markerHandle); DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0); + mh.line = -1; NotifyModified(mh); } void Document::DeleteAllMarks(int markerNum) { cb.DeleteAllMarks(markerNum); DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0); + mh.line = -1; NotifyModified(mh); } @@ -266,7 +280,7 @@ int Document::LenChar(int pos) { return 1; } } -#include + // Normalise a position so that it is not halfway through a two byte character. // This can occur in two situations - // When lines are terminated with \r\n pairs which should be treated as one character. @@ -280,7 +294,7 @@ int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) { if (pos >= Length()) return Length(); - // assert pos > 0 && pos < Length() + // PLATFORM_ASSERT(pos > 0 && pos < Length()); if (checkLineEnd && IsCrLf(pos - 1)) { if (moveDir > 0) return pos + 1; @@ -336,6 +350,14 @@ void Document::ModifiedAt(int pos) { endStyled = pos; } +void Document::CheckReadOnly() { + if (cb.IsReadOnly() && enteredReadOnlyCount == 0) { + enteredReadOnlyCount++; + NotifyModifyAttempt(); + enteredReadOnlyCount--; + } +} + // Document only modified by gateways DeleteChars, InsertStyledString, Undo, Redo, and SetStyleAt. // SetStyleAt does not change the persistent state of a document @@ -345,11 +367,7 @@ bool Document::DeleteChars(int pos, int len) { return false; if ((pos + len) > Length()) return false; - if (cb.IsReadOnly() && enteredReadOnlyCount == 0) { - enteredReadOnlyCount++; - NotifyModifyAttempt(); - enteredReadOnlyCount--; - } + CheckReadOnly(); if (enteredCount != 0) { return false; } else { @@ -384,11 +402,7 @@ bool Document::DeleteChars(int pos, int len) { * Insert a styled string (char/style pairs) with a length. */ bool Document::InsertStyledString(int position, char *s, int insertLength) { - if (cb.IsReadOnly() && enteredReadOnlyCount == 0) { - enteredReadOnlyCount++; - NotifyModifyAttempt(); - enteredReadOnlyCount--; - } + CheckReadOnly(); if (enteredCount != 0) { return false; } else { @@ -417,86 +431,110 @@ bool Document::InsertStyledString(int position, char *s, int insertLength) { } int Document::Undo() { - int newPos = 0; + int newPos = -1; + CheckReadOnly(); if (enteredCount == 0) { enteredCount++; - bool startSavePoint = cb.IsSavePoint(); - int steps = cb.StartUndo(); - //Platform::DebugPrintf("Steps=%d\n", steps); - for (int step = 0; step < steps; step++) { - int prevLinesTotal = LinesTotal(); - const Action &action = cb.GetUndoStep(); - if (action.at == removeAction) { - NotifyModified(DocModification( - SC_MOD_BEFOREINSERT | SC_PERFORMED_UNDO, action)); - } else { - NotifyModified(DocModification( - SC_MOD_BEFOREDELETE | SC_PERFORMED_UNDO, action)); - } - cb.PerformUndoStep(); - int cellPosition = action.position / 2; - ModifiedAt(cellPosition); - newPos = cellPosition; - - int modFlags = SC_PERFORMED_UNDO; - // With undo, an insertion action becomes a deletion notification - if (action.at == removeAction) { - newPos += action.lenData; - modFlags |= SC_MOD_INSERTTEXT; - } else { - modFlags |= SC_MOD_DELETETEXT; + if (!cb.IsReadOnly()) { + bool startSavePoint = cb.IsSavePoint(); + bool multiLine = false; + int steps = cb.StartUndo(); + //Platform::DebugPrintf("Steps=%d\n", steps); + for (int step = 0; step < steps; step++) { + const int prevLinesTotal = LinesTotal(); + const Action &action = cb.GetUndoStep(); + if (action.at == removeAction) { + NotifyModified(DocModification( + SC_MOD_BEFOREINSERT | SC_PERFORMED_UNDO, action)); + } else { + NotifyModified(DocModification( + SC_MOD_BEFOREDELETE | SC_PERFORMED_UNDO, action)); + } + cb.PerformUndoStep(); + int cellPosition = action.position; + ModifiedAt(cellPosition); + newPos = cellPosition; + + int modFlags = SC_PERFORMED_UNDO; + // With undo, an insertion action becomes a deletion notification + if (action.at == removeAction) { + newPos += action.lenData; + modFlags |= SC_MOD_INSERTTEXT; + } else { + modFlags |= SC_MOD_DELETETEXT; + } + if (steps > 1) + modFlags |= SC_MULTISTEPUNDOREDO; + const int linesAdded = LinesTotal() - prevLinesTotal; + if (linesAdded != 0) + multiLine = true; + if (step == steps - 1) { + modFlags |= SC_LASTSTEPINUNDOREDO; + if (multiLine) + modFlags |= SC_MULTILINEUNDOREDO; + } + NotifyModified(DocModification(modFlags, cellPosition, action.lenData, + linesAdded, action.data)); } - if (step == steps - 1) - modFlags |= SC_LASTSTEPINUNDOREDO; - NotifyModified(DocModification(modFlags, cellPosition, action.lenData, - LinesTotal() - prevLinesTotal, action.data)); - } - bool endSavePoint = cb.IsSavePoint(); - if (startSavePoint != endSavePoint) - NotifySavePoint(endSavePoint); + bool endSavePoint = cb.IsSavePoint(); + if (startSavePoint != endSavePoint) + NotifySavePoint(endSavePoint); + } enteredCount--; } return newPos; } int Document::Redo() { - int newPos = 0; + int newPos = -1; + CheckReadOnly(); if (enteredCount == 0) { enteredCount++; - bool startSavePoint = cb.IsSavePoint(); - int steps = cb.StartRedo(); - for (int step = 0; step < steps; step++) { - int prevLinesTotal = LinesTotal(); - const Action &action = cb.GetRedoStep(); - if (action.at == insertAction) { - NotifyModified(DocModification( - SC_MOD_BEFOREINSERT | SC_PERFORMED_REDO, action)); - } else { - NotifyModified(DocModification( - SC_MOD_BEFOREDELETE | SC_PERFORMED_REDO, action)); - } - cb.PerformRedoStep(); - ModifiedAt(action.position / 2); - newPos = action.position / 2; - - int modFlags = SC_PERFORMED_REDO; - if (action.at == insertAction) { - newPos += action.lenData; - modFlags |= SC_MOD_INSERTTEXT; - } else { - modFlags |= SC_MOD_DELETETEXT; + if (!cb.IsReadOnly()) { + bool startSavePoint = cb.IsSavePoint(); + bool multiLine = false; + int steps = cb.StartRedo(); + for (int step = 0; step < steps; step++) { + const int prevLinesTotal = LinesTotal(); + const Action &action = cb.GetRedoStep(); + if (action.at == insertAction) { + NotifyModified(DocModification( + SC_MOD_BEFOREINSERT | SC_PERFORMED_REDO, action)); + } else { + NotifyModified(DocModification( + SC_MOD_BEFOREDELETE | SC_PERFORMED_REDO, action)); + } + cb.PerformRedoStep(); + ModifiedAt(action.position); + newPos = action.position; + + int modFlags = SC_PERFORMED_REDO; + if (action.at == insertAction) { + newPos += action.lenData; + modFlags |= SC_MOD_INSERTTEXT; + } else { + modFlags |= SC_MOD_DELETETEXT; + } + if (steps > 1) + modFlags |= SC_MULTISTEPUNDOREDO; + const int linesAdded = LinesTotal() - prevLinesTotal; + if (linesAdded != 0) + multiLine = true; + if (step == steps - 1) { + modFlags |= SC_LASTSTEPINUNDOREDO; + if (multiLine) + modFlags |= SC_MULTILINEUNDOREDO; + } + NotifyModified( + DocModification(modFlags, action.position, action.lenData, + linesAdded, action.data)); } - if (step == steps - 1) - modFlags |= SC_LASTSTEPINUNDOREDO; - NotifyModified( - DocModification(modFlags, action.position / 2, action.lenData, - LinesTotal() - prevLinesTotal, action.data)); - } - bool endSavePoint = cb.IsSavePoint(); - if (startSavePoint != endSavePoint) - NotifySavePoint(endSavePoint); + bool endSavePoint = cb.IsSavePoint(); + if (startSavePoint != endSavePoint) + NotifySavePoint(endSavePoint); + } enteredCount--; } return newPos; @@ -524,15 +562,17 @@ bool Document::InsertString(int position, const char *s) { */ bool Document::InsertString(int position, const char *s, size_t insertLength) { bool changed = false; - char *sWithStyle = new char[insertLength * 2]; - if (sWithStyle) { - for (size_t i = 0; i < insertLength; i++) { - sWithStyle[i*2] = s[i]; - sWithStyle[i*2 + 1] = 0; + if (insertLength > 0) { + char *sWithStyle = new char[insertLength * 2]; + if (sWithStyle) { + for (size_t i = 0; i < insertLength; i++) { + sWithStyle[i*2] = s[i]; + sWithStyle[i*2 + 1] = 0; + } + changed = InsertStyledString(position*2, sWithStyle, + static_cast(insertLength*2)); + delete []sWithStyle; } - changed = InsertStyledString(position*2, sWithStyle, - static_cast(insertLength*2)); - delete []sWithStyle; } return changed; } @@ -611,8 +651,10 @@ void Document::SetLineIndentation(int line, int indent) { CreateIndentation(linebuf, sizeof(linebuf), indent, tabInChars, !useTabs); int thisLineStart = LineStart(line); int indentPos = GetLineIndentPosition(line); + BeginUndoAction(); DeleteChars(thisLineStart, indentPos - thisLineStart); InsertString(thisLineStart, linebuf); + EndUndoAction(); } } @@ -675,10 +717,13 @@ void Document::Indent(bool forwards, int lineBottom, int lineTop) { // Dedent - suck white space off the front of the line to dedent by equivalent of a tab for (int line = lineBottom; line >= lineTop; line--) { int indentOfLine = GetLineIndentation(line); - if (forwards) - SetLineIndentation(line, indentOfLine + IndentSize()); - else + if (forwards) { + if (LineStart(line) < LineEnd(line)) { + SetLineIndentation(line, indentOfLine + IndentSize()); + } + } else { SetLineIndentation(line, indentOfLine - IndentSize()); + } } } @@ -718,7 +763,7 @@ void Document::ConvertLineEnds(int eolModeSet) { for (int pos = 0; pos < Length(); pos++) { if (cb.CharAt(pos) == '\r') { - if (cb.CharAt(pos + 1) == '\n') { + if (cb.CharAt(pos + 1) == '\n') { // CRLF if (eolModeSet == SC_EOL_CR) { DeleteChars(pos + 1, 1); // Delete the LF @@ -727,7 +772,7 @@ void Document::ConvertLineEnds(int eolModeSet) { } else { pos++; } - } else { + } else { // CR if (eolModeSet == SC_EOL_CRLF) { InsertString(pos + 1, "\n", 1); // Insert LF @@ -752,33 +797,45 @@ void Document::ConvertLineEnds(int eolModeSet) { EndUndoAction(); } -int Document::ParaDown(int pos) { - int line = LineFromPosition(pos); - while (line < LinesTotal() && LineStart(line) != LineEnd(line)) { // skip non-empty lines - line++; - } - while (line < LinesTotal() && LineStart(line) == LineEnd(line)) { // skip empty lines - line++; +bool Document::IsWhiteLine(int line) { + int currentChar = LineStart(line); + int endLine = LineEnd(line); + while (currentChar < endLine) { + if (cb.CharAt(currentChar) != ' ' && cb.CharAt(currentChar) != '\t') { + return false; + } + ++currentChar; } - if (line < LinesTotal()) - return LineStart(line); - else // end of a document - return LineEnd(line-1); + return true; } int Document::ParaUp(int pos) { int line = LineFromPosition(pos); line--; - while (line >= 0 && LineStart(line) == LineEnd(line)) { // skip empty lines + while (line >= 0 && IsWhiteLine(line)) { // skip empty lines line--; } - while (line >= 0 && LineStart(line) != LineEnd(line)) { // skip non-empty lines + while (line >= 0 && !IsWhiteLine(line)) { // skip non-empty lines line--; } line++; return LineStart(line); } +int Document::ParaDown(int pos) { + int line = LineFromPosition(pos); + while (line < LinesTotal() && !IsWhiteLine(line)) { // skip non-empty lines + line++; + } + while (line < LinesTotal() && IsWhiteLine(line)) { // skip empty lines + line++; + } + if (line < LinesTotal()) + return LineStart(line); + else // end of a document + return LineEnd(line-1); +} + Document::charClassification Document::WordCharClass(unsigned char ch) { if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80)) return ccWord; @@ -926,6 +983,9 @@ public: pdoc(pdoc_), end(end_) { } + virtual ~DocumentIndexer() { + } + virtual char CharAt(int index) { if (index < 0 || index >= end) return 0; @@ -1001,7 +1061,7 @@ long Document::FindText(int minPos, int maxPos, const char *s, if (line == lineRangeStart) { if ((startPos != endOfLine) && (searchEnd == '$')) continue; // Can't match end of line if start position before end of line - endOfLine = startPos+1; + endOfLine = startPos; } } @@ -1013,10 +1073,10 @@ long Document::FindText(int minPos, int maxPos, const char *s, if (increment == -1) { // Check for the last match on this line. int repetitions = 1000; // Break out of infinite loop - while (success && (pre->eopat[0] <= (endOfLine+1)) && (repetitions--)) { - success = pre->Execute(di, pos+1, endOfLine+1); + while (success && (pre->eopat[0] <= endOfLine) && (repetitions--)) { + success = pre->Execute(di, pos+1, endOfLine); if (success) { - if (pre->eopat[0] <= (minPos+1)) { + if (pre->eopat[0] <= minPos) { pos = pre->bopat[0]; lenRet = pre->eopat[0] - pre->bopat[0]; } else { @@ -1052,12 +1112,13 @@ long Document::FindText(int minPos, int maxPos, const char *s, char firstChar = s[0]; if (!caseSensitive) firstChar = static_cast(MakeUpperCase(firstChar)); - int pos = startPos; + int pos = forward ? startPos : (startPos - 1); while (forward ? (pos < endSearch) : (pos >= endSearch)) { char ch = CharAt(pos); if (caseSensitive) { if (ch == firstChar) { bool found = true; + if (pos + lengthFind > Platform::Maximum(startPos, endPos)) found = false; for (int posMatch = 1; posMatch < lengthFind && found; posMatch++) { ch = CharAt(pos + posMatch); if (ch != s[posMatch]) @@ -1073,6 +1134,7 @@ long Document::FindText(int minPos, int maxPos, const char *s, } else { if (MakeUpperCase(ch) == firstChar) { bool found = true; + if (pos + lengthFind > Platform::Maximum(startPos, endPos)) found = false; for (int posMatch = 1; posMatch < lengthFind && found; posMatch++) { ch = CharAt(pos + posMatch); if (MakeUpperCase(ch) != MakeUpperCase(s[posMatch])) @@ -1185,11 +1247,9 @@ int Document::LinesTotal() { } void Document::ChangeCase(Range r, bool makeUpperCase) { - for (int pos = r.start; pos < r.end; pos++) { + for (int pos = r.start; pos < r.end;) { int len = LenChar(pos); - if (dbcsCodePage && (len > 1)) { - pos += len; - } else { + if (len == 1) { char ch = CharAt(pos); if (makeUpperCase) { if (IsLowerCase(ch)) { @@ -1201,6 +1261,7 @@ void Document::ChangeCase(Range r, bool makeUpperCase) { } } } + pos += len; } } @@ -1265,19 +1326,22 @@ bool Document::SetStyles(int length, char *styles) { return false; } else { enteredCount++; - int prevEndStyled = endStyled; bool didChange = false; - int lastChange = 0; + int startMod = 0; + int endMod = 0; for (int iPos = 0; iPos < length; iPos++, endStyled++) { PLATFORM_ASSERT(endStyled < Length()); if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) { + if (!didChange) { + startMod = endStyled; + } didChange = true; - lastChange = iPos; + endMod = endStyled; } } if (didChange) { DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER, - prevEndStyled, lastChange); + startMod, endMod - startMod + 1); NotifyModified(mh); } enteredCount--; @@ -1475,3 +1539,55 @@ int Document::ExtendStyleRange(int pos, int delta, bool singleLine) { } return pos; } + +static char BraceOpposite(char ch) { + switch (ch) { + case '(': + return ')'; + case ')': + return '('; + case '[': + return ']'; + case ']': + return '['; + case '{': + return '}'; + case '}': + return '{'; + case '<': + return '>'; + case '>': + return '<'; + default: + return '\0'; + } +} + +// TODO: should be able to extend styled region to find matching brace +int Document::BraceMatch(int position, int /*maxReStyle*/) { + char chBrace = CharAt(position); + char chSeek = BraceOpposite(chBrace); + if (chSeek == '\0') + return - 1; + char styBrace = static_cast(StyleAt(position) & stylingBitsMask); + int direction = -1; + if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<') + direction = 1; + int depth = 1; + position = position + direction; + while ((position >= 0) && (position < Length())) { + position = MovePositionOutsideChar(position, direction); + char chAtPos = CharAt(position); + char styAtPos = static_cast(StyleAt(position) & stylingBitsMask); + if ((position > GetEndStyled()) || (styAtPos == styBrace)) { + if (chAtPos == chBrace) + depth++; + if (chAtPos == chSeek) + depth--; + if (depth == 0) + return position; + } + position = position + direction; + } + return - 1; +} diff --git a/contrib/src/stc/scintilla/src/Document.h b/contrib/src/stc/scintilla/src/Document.h index ce27ffc476..6ff858b923 100644 --- a/contrib/src/stc/scintilla/src/Document.h +++ b/contrib/src/stc/scintilla/src/Document.h @@ -134,6 +134,7 @@ public: int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true); // Gateways to modifying document + void ModifiedAt(int pos); bool DeleteChars(int pos, int len); bool InsertStyledString(int position, char *s, int insertLength); int Undo(); @@ -175,6 +176,7 @@ public: char StyleAt(int position) { return cb.StyleAt(position); } int GetMark(int line) { return cb.GetMark(line); } int AddMark(int line, int markerNum); + void AddMarkSet(int line, int valueSet); void DeleteMark(int line, int markerNum); void DeleteMarkFromHandle(int markerHandle); void DeleteAllMarks(int markerNum); @@ -228,16 +230,19 @@ public: int WordPartLeft(int pos); int WordPartRight(int pos); int ExtendStyleRange(int pos, int delta, bool singleLine = false); + bool IsWhiteLine(int line); int ParaUp(int pos); int ParaDown(int pos); int IndentSize() { return actualIndentInChars; } + int BraceMatch(int position, int maxReStyle); private: + void CheckReadOnly(); + charClassification WordCharClass(unsigned char ch); bool IsWordStartAt(int pos); bool IsWordEndAt(int pos); bool IsWordAt(int start, int end); - void ModifiedAt(int pos); void NotifyModifyAttempt(); void NotifySavePoint(bool atSavePoint); @@ -261,19 +266,19 @@ public: int foldLevelPrev; DocModification(int modificationType_, int position_=0, int length_=0, - int linesAdded_=0, const char *text_=0) : + int linesAdded_=0, const char *text_=0, int line_=0) : modificationType(modificationType_), position(position_), length(length_), linesAdded(linesAdded_), text(text_), - line(0), + line(line_), foldLevelNow(0), foldLevelPrev(0) {} - DocModification(int modificationType_, const Action &act, int linesAdded_=0) : + DocModification(int modificationType_, const Action &act, int linesAdded_=0) : modificationType(modificationType_), - position(act.position / 2), + position(act.position), length(act.lenData), linesAdded(linesAdded_), text(act.data), diff --git a/contrib/src/stc/scintilla/src/DocumentAccessor.cxx b/contrib/src/stc/scintilla/src/DocumentAccessor.cxx index 738eca7a07..f479ce0259 100644 --- a/contrib/src/stc/scintilla/src/DocumentAccessor.cxx +++ b/contrib/src/stc/scintilla/src/DocumentAccessor.cxx @@ -58,7 +58,8 @@ bool DocumentAccessor::Match(int pos, const char *s) { } char DocumentAccessor::StyleAt(int position) { - return pdoc->StyleAt(position); + // Mask off all bits which aren't in the 'mask'. + return static_cast(pdoc->StyleAt(position) & mask); } int DocumentAccessor::GetLine(int position) { @@ -88,6 +89,8 @@ int DocumentAccessor::SetLineState(int line, int state) { } void DocumentAccessor::StartAt(unsigned int start, char chMask) { + // Store the mask specified for use with StyleAt. + mask = chMask; pdoc->StartStyling(start, chMask); startPosStyling = start; } diff --git a/contrib/src/stc/scintilla/src/DocumentAccessor.h b/contrib/src/stc/scintilla/src/DocumentAccessor.h index dc591d13ec..7406520452 100644 --- a/contrib/src/stc/scintilla/src/DocumentAccessor.h +++ b/contrib/src/stc/scintilla/src/DocumentAccessor.h @@ -27,6 +27,7 @@ protected: char chWhile; unsigned int startSeg; int startPosStyling; + int mask; bool InternalIsLeadByte(char ch); void Fill(int position); @@ -35,7 +36,8 @@ public: DocumentAccessor(Document *pdoc_, PropSet &props_, WindowID id_=0) : Accessor(), pdoc(pdoc_), props(props_), id(id_), lenDoc(-1), validLen(0), chFlags(0), chWhile(0), - startSeg(0), startPosStyling(0) { + startSeg(0), startPosStyling(0), + mask(127) { // Initialize the mask to be big enough for any lexer. } ~DocumentAccessor(); bool Match(int pos, const char *s); diff --git a/contrib/src/stc/scintilla/src/Editor.cxx b/contrib/src/stc/scintilla/src/Editor.cxx index d32022ff11..0aa2a651c6 100644 --- a/contrib/src/stc/scintilla/src/Editor.cxx +++ b/contrib/src/stc/scintilla/src/Editor.cxx @@ -29,6 +29,37 @@ #include "Document.h" #include "Editor.h" +/* + return whether this modification represents an operation that + may reasonably be deferred (not done now OR [possibly] at all) +*/ +static bool CanDeferToLastStep(const DocModification& mh) { + if (mh.modificationType & (SC_MOD_BEFOREINSERT|SC_MOD_BEFOREDELETE)) + return true; // CAN skip + if (!(mh.modificationType & (SC_PERFORMED_UNDO|SC_PERFORMED_REDO))) + return false; // MUST do + if (mh.modificationType & SC_MULTISTEPUNDOREDO) + return true; // CAN skip + return false; // PRESUMABLY must do +} + +static bool CanEliminate(const DocModification& mh) { + return + (mh.modificationType & (SC_MOD_BEFOREINSERT|SC_MOD_BEFOREDELETE)) != 0; +} + +/* + return whether this modification represents the FINAL step + in a [possibly lengthy] multi-step Undo/Redo sequence +*/ +static bool IsLastStep(const DocModification& mh) { + return + (mh.modificationType & (SC_PERFORMED_UNDO|SC_PERFORMED_REDO)) != 0 + && (mh.modificationType & SC_MULTISTEPUNDOREDO) != 0 + && (mh.modificationType & SC_LASTSTEPINUNDOREDO) != 0 + && (mh.modificationType & SC_MULTILINEUNDOREDO) != 0; +} + Caret::Caret() : active(false), on(false), period(500) {} @@ -54,6 +85,7 @@ LineLayout::LineLayout(int maxLineLength_) : edgeColumn(0), chars(0), styles(0), + styleBitsSet(0), indicators(0), positions(0), hsStart(0), @@ -157,7 +189,7 @@ void LineLayout::RestoreBracesHighlight(Range rangeLine, Position braces[]) { LineLayoutCache::LineLayoutCache() : level(0), length(0), size(0), cache(0), - allInvalidated(false), styleClock(-1) { + allInvalidated(false), styleClock(-1), useCount(0) { Allocate(0); } @@ -166,6 +198,7 @@ LineLayoutCache::~LineLayoutCache() { } void LineLayoutCache::Allocate(int length_) { + PLATFORM_ASSERT(cache == NULL); allInvalidated = false; length = length_; size = length; @@ -180,6 +213,7 @@ void LineLayoutCache::Allocate(int length_) { } void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) { + PLATFORM_ASSERT(useCount == 0); int lengthForLevel = 0; if (level == llcCaret) { lengthForLevel = 1; @@ -190,23 +224,28 @@ void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) { } if (lengthForLevel > size) { Deallocate(); - } else if (lengthForLevel < length) { - for (int i = lengthForLevel; i < length; i++) { - delete cache[i]; - cache[i] = 0; - } - } - if (!cache) { Allocate(lengthForLevel); + } else { + if (lengthForLevel < length) { + for (int i = lengthForLevel; i < length; i++) { + delete cache[i]; + cache[i] = 0; + } + } + length = lengthForLevel; } + PLATFORM_ASSERT(length == lengthForLevel); + PLATFORM_ASSERT(cache != NULL || length == 0); } void LineLayoutCache::Deallocate() { + PLATFORM_ASSERT(useCount == 0); for (int i = 0; i < length; i++) delete cache[i]; delete []cache; cache = 0; length = 0; + size = 0; } void LineLayoutCache::Invalidate(LineLayout::validLevel validity_) { @@ -244,14 +283,15 @@ LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChar pos = 0; } else if (level == llcPage) { if (lineNumber == lineCaret) { - pos = length; + pos = 0; } else { - pos = lineNumber % length; + pos = 1 + (lineNumber % (length - 1)); } } else if (level == llcDocument) { pos = lineNumber; } if (pos >= 0) { + PLATFORM_ASSERT(useCount == 0); if (cache && (pos < length)) { if (cache[pos]) { if ((cache[pos]->lineNumber != lineNumber) || @@ -267,6 +307,7 @@ LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChar cache[pos]->lineNumber = lineNumber; cache[pos]->inCache = true; ret = cache[pos]; + useCount++; } } } @@ -284,7 +325,9 @@ void LineLayoutCache::Dispose(LineLayout *ll) { if (ll) { if (!ll->inCache) { delete ll; - } + } else { + useCount--; + } } } @@ -344,6 +387,7 @@ Editor::Editor() { scrollWidth = 2000; verticalScrollBarVisible = true; endAtLastLine = true; + caretSticky = false; pixmapLine = Surface::Allocate(); pixmapSelMargin = Surface::Allocate(); @@ -361,7 +405,7 @@ Editor::Editor() { topLine = 0; posTopLine = 0; - lengthForEncode = 0; + lengthForEncode = -1; needUpdateUI = true; braces[0] = invalidPosition; @@ -392,6 +436,8 @@ Editor::Editor() { wrapVisualStartIndent = 0; actualWrapVisualStartIndent = 0; + convertPastes = true; + hsStart = -1; hsEnd = -1; @@ -420,6 +466,7 @@ void Editor::DropGraphics() { pixmapSelMargin->Release(); pixmapSelPattern->Release(); pixmapIndentGuide->Release(); + pixmapIndentGuideHighlight->Release(); } void Editor::InvalidateStyleData() { @@ -842,13 +889,19 @@ void Editor::Redraw() { //wMain.InvalidateAll(); } -void Editor::RedrawSelMargin() { +void Editor::RedrawSelMargin(int line) { if (!AbandonPaint()) { if (vs.maskInLine) { Redraw(); } else { PRectangle rcSelMargin = GetClientRectangle(); rcSelMargin.right = vs.fixedColumnWidth; + if (line != -1) { + int position = pdoc->LineStart(line); + PRectangle rcLine = RectangleFromRange(position, position); + rcSelMargin.top = rcLine.top; + rcSelMargin.bottom = rcLine.bottom; + } wMain.InvalidateRectangle(rcSelMargin); } } @@ -899,6 +952,13 @@ int Editor::SelectionEnd() { return Platform::Maximum(currentPos, anchor); } +void Editor::SetRectangularRange() { + if (selType == selRectangle) { + xStartSelect = XFromPosition(anchor); + xEndSelect = XFromPosition(currentPos); + } +} + void Editor::InvalidateSelection(int currentPos_, int anchor_) { int firstAffected = anchor; if (firstAffected > currentPos) @@ -926,10 +986,7 @@ void Editor::SetSelection(int currentPos_, int anchor_) { currentPos = currentPos_; anchor = anchor_; } - if (selType == selRectangle) { - xStartSelect = XFromPosition(anchor); - xEndSelect = XFromPosition(currentPos); - } + SetRectangularRange(); ClaimSelection(); } @@ -939,10 +996,7 @@ void Editor::SetSelection(int currentPos_) { InvalidateSelection(currentPos_, currentPos_); currentPos = currentPos_; } - if (selType == selRectangle) { - xStartSelect = XFromPosition(anchor); - xEndSelect = XFromPosition(currentPos); - } + SetRectangularRange(); ClaimSelection(); } @@ -1065,11 +1119,15 @@ void Editor::ScrollTo(int line, bool moveThumb) { SetTopLine(topLineNew); ShowCaretAtCurrentPosition(); // Perform redraw rather than scroll if many lines would be redrawn anyway. +#ifndef UNDER_CE if (abs(linesToMove) <= 10) { ScrollText(linesToMove); } else { Redraw(); } +#else + Redraw(); +#endif if (moveThumb) { SetVerticalScrollPos(); } @@ -1872,39 +1930,41 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou posLineEnd = posLineStart + ll->maxLineLength; } if (ll->validity == LineLayout::llCheckTextAndStyle) { - int lineLength = 0; - for (int cid = posLineStart; cid < posLineEnd; cid++) { - char chDoc = pdoc->CharAt(cid); - if (vstyle.viewEOL || (!IsEOLChar(chDoc))) { - lineLength++; + int lineLength = posLineEnd - posLineStart; + if (!vstyle.viewEOL) { + int cid = posLineEnd - 1; + while ((cid > posLineStart) && IsEOLChar(pdoc->CharAt(cid))) { + cid--; + lineLength--; } } if (lineLength == ll->numCharsInLine) { - int numCharsInLine = 0; // See if chars, styles, indicators, are all the same bool allSame = true; const int styleMask = pdoc->stylingBitsMask; // Check base line layout - for (int charInDoc = posLineStart; allSame && (charInDoc < posLineEnd); charInDoc++) { + char styleByte = 0; + int numCharsInLine = 0; + while (numCharsInLine < lineLength) { + int charInDoc = numCharsInLine + posLineStart; char chDoc = pdoc->CharAt(charInDoc); - if (vstyle.viewEOL || (!IsEOLChar(chDoc))) { - char styleByte = pdoc->StyleAt(charInDoc); + styleByte = pdoc->StyleAt(charInDoc); + allSame = allSame && + (ll->styles[numCharsInLine] == static_cast(styleByte & styleMask)); + allSame = allSame && + (ll->indicators[numCharsInLine] == static_cast(styleByte & ~styleMask)); + if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseMixed) allSame = allSame && - (ll->styles[numCharsInLine] == static_cast(styleByte & styleMask)); + (ll->chars[numCharsInLine] == chDoc); + else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseLower) allSame = allSame && - (ll->indicators[numCharsInLine] == static_cast(styleByte & ~styleMask)); - if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseUpper) - allSame = allSame && - (ll->chars[numCharsInLine] == static_cast(toupper(chDoc))); - else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseLower) - allSame = allSame && - (ll->chars[numCharsInLine] == static_cast(tolower(chDoc))); - else - allSame = allSame && - (ll->chars[numCharsInLine] == chDoc); - numCharsInLine++; - } + (ll->chars[numCharsInLine] == static_cast(tolower(chDoc))); + else // Style::caseUpper + allSame = allSame && + (ll->chars[numCharsInLine] == static_cast(toupper(chDoc))); + numCharsInLine++; } + allSame = allSame && (ll->styles[numCharsInLine] == styleByte); // For eolFilled if (allSame) { ll->validity = LineLayout::llPositions; } else { @@ -1929,10 +1989,12 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou char styleByte = 0; int styleMask = pdoc->stylingBitsMask; + ll->styleBitsSet = 0; // Fill base line layout for (int charInDoc = posLineStart; charInDoc < posLineEnd; charInDoc++) { char chDoc = pdoc->CharAt(charInDoc); styleByte = pdoc->StyleAt(charInDoc); + ll->styleBitsSet |= styleByte; if (vstyle.viewEOL || (!IsEOLChar(chDoc))) { ll->chars[numCharsInLine] = chDoc; ll->styles[numCharsInLine] = static_cast(styleByte & styleMask); @@ -1959,6 +2021,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou bool lastSegItalics = false; Font &ctrlCharsFont = vstyle.styles[STYLE_CONTROLCHAR].font; + int ctrlCharWidth[32] = {0}; bool isControlNext = IsControlCharacter(ll->chars[0]); for (int charInLine = 0; charInLine < numCharsInLine; charInLine++) { bool isControl = isControlNext; @@ -1972,9 +2035,13 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou ll->positions[charInLine + 1] = ((((startsegx + 2) / tabWidth) + 1) * tabWidth) - startsegx; } else if (controlCharSymbol < 32) { - const char *ctrlChar = ControlCharacterString(ll->chars[charInLine]); - // +3 For a blank on front and rounded edge each side: - ll->positions[charInLine + 1] = surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + 3; + if (ctrlCharWidth[ll->chars[charInLine]] == 0) { + const char *ctrlChar = ControlCharacterString(ll->chars[charInLine]); + // +3 For a blank on front and rounded edge each side: + ctrlCharWidth[ll->chars[charInLine]] = + surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + 3; + } + ll->positions[charInLine + 1] = ctrlCharWidth[ll->chars[charInLine]]; } else { char cc[2] = { static_cast(controlCharSymbol), '\0' }; surface->MeasureWidths(ctrlCharsFont, cc, 1, @@ -2059,7 +2126,12 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou continue; } if (p > 0) { - if (ll->styles[p] != ll->styles[p - 1]) { + if (wrapState == eWrapChar){ + lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1) + - posLineStart; + p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart; + continue; + } else if (ll->styles[p] != ll->styles[p - 1]) { lastGoodBreak = p; } else if (IsSpaceOrTab(ll->chars[p - 1]) && !IsSpaceOrTab(ll->chars[p])) { lastGoodBreak = p; @@ -2358,6 +2430,8 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis } } } + } else if (rcSegment.left > rcLine.right) { + break; } startseg = i + 1; } @@ -2520,41 +2594,46 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis rcUL.bottom = rcUL.top + 1; surface->FillRectangle(rcUL, textFore); } + } else if (rcSegment.left > rcLine.right) { + break; } startseg = i + 1; } } // Draw indicators - int indStart[INDIC_MAX + 1] = {0}; - for (int indica = 0; indica <= INDIC_MAX; indica++) - indStart[indica] = 0; - - for (int indicPos = lineStart; indicPos <= lineEnd; indicPos++) { - if ((indicPos == lineStart) || (indicPos == lineEnd) || - (ll->indicators[indicPos] != ll->indicators[indicPos + 1])) { - int mask = 1 << pdoc->stylingBits; - for (int indicnum = 0; mask < 0x100; indicnum++) { - if ((indicPos == lineStart) || (indicPos == lineEnd)) { - indStart[indicnum] = ll->positions[indicPos]; - } else if ((ll->indicators[indicPos + 1] & mask) && !(ll->indicators[indicPos] & mask)) { - indStart[indicnum] = ll->positions[indicPos + 1]; - } - if ((ll->indicators[indicPos] & mask) && - ((indicPos == lineEnd) || !(ll->indicators[indicPos + 1] & mask))) { - int endIndicator = indicPos; - if (endIndicator >= lineEnd) - endIndicator = lineEnd-1; + // foreach indicator... + for (int indicnum = 0, mask = 1 << pdoc->stylingBits; mask < 0x100; indicnum++) { + if (!(mask & ll->styleBitsSet)) { + mask <<= 1; + continue; + } + int startPos = -1; + // foreach style pos in line... + for (int indicPos = lineStart; indicPos <= lineEnd; indicPos++) { + // look for starts... + if (startPos < 0) { + // NOT in indicator run, looking for START + if (indicPos < lineEnd && (ll->indicators[indicPos] & mask)) + startPos = indicPos; + } + // ... or ends + if (startPos >= 0) { + // IN indicator run, looking for END + if (indicPos >= lineEnd || !(ll->indicators[indicPos] & mask)) { + // AT end of indicator run, DRAW it! PRectangle rcIndic( - indStart[indicnum] + xStart - subLineStart, + ll->positions[startPos] + xStart - subLineStart, rcLine.top + vsDraw.maxAscent, - ll->positions[endIndicator + 1] + xStart - subLineStart, + ll->positions[indicPos] + xStart - subLineStart, rcLine.top + vsDraw.maxAscent + 3); vsDraw.indicators[indicnum].Draw(surface, rcIndic, rcLine); + // RESET control var + startPos = -1; } - mask = mask << 1; } } + mask <<= 1; } // End of the drawing of the current line if (!twoPhaseDraw) { @@ -2629,7 +2708,7 @@ void Editor::RefreshPixMaps(Surface *surfaceWindow) { if (bufferedDraw) { if (!pixmapLine->Initialised()) { PRectangle rcClient = GetClientRectangle(); - pixmapLine->InitPixMap(rcClient.Width(), rcClient.Height(), + pixmapLine->InitPixMap(rcClient.Width(), vs.lineHeight, surfaceWindow, wMain.GetID()); pixmapSelMargin->InitPixMap(vs.fixedColumnWidth, rcClient.Height(), surfaceWindow, wMain.GetID()); @@ -2760,6 +2839,8 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { //ElapsedTime et; if (lineDoc != lineDocPrevious) { ll.Set(0); + // For rectangular selection this accesses the layout cache so should be after layout returned. + lineIterator.SetAt(lineDoc); ll.Set(RetrieveLineLayout(lineDoc)); LayoutLine(lineDoc, surface, vs, ll, wrapWidth); lineDocPrevious = lineDoc; @@ -2771,7 +2852,6 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { ll->selStart = SelectionStart(); ll->selEnd = SelectionEnd(); } else { - lineIterator.SetAt(lineDoc); ll->selStart = lineIterator.startPos; ll->selEnd = lineIterator.endPos; } @@ -2920,6 +3000,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { visibleLine++; //gdk_flush(); } + ll.Set(0); //if (durPaint < 0.00000001) // durPaint = 0.00000001; @@ -3160,6 +3241,9 @@ void Editor::SetScrollBars() { int nMax = MaxScrollPos(); int nPage = LinesOnScreen(); bool modified = ModifyScrollBars(nMax + nPage - 1, nPage); + if (modified) { + DwellEnd(true); + } // TODO: ensure always showing as many lines as possible // May not be, if, for example, window made larger @@ -3199,9 +3283,12 @@ void Editor::AddChar(char ch) { void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) { bool wasSelection = currentPos != anchor; ClearSelection(); + bool charReplaceAction = false; if (inOverstrike && !wasSelection && !RangeContainsProtected(currentPos, currentPos + 1)) { if (currentPos < (pdoc->Length())) { if (!IsEOLChar(pdoc->CharAt(currentPos))) { + charReplaceAction = true; + pdoc->BeginUndoAction(); pdoc->DelChar(currentPos); } } @@ -3209,10 +3296,15 @@ void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) { if (pdoc->InsertString(currentPos, s, len)) { SetEmptySelection(currentPos + len); } + if (charReplaceAction) { + pdoc->EndUndoAction(); + } EnsureCaretVisible(); // Avoid blinking during rapid typing: ShowCaretAtCurrentPosition(); - SetLastXChosen(); + if (!caretSticky) { + SetLastXChosen(); + } if (treatAsDBCS) { NotifyChar((static_cast(s[0]) << 8) | @@ -3292,7 +3384,7 @@ void Editor::ClearAll() { currentPos = 0; SetTopLine(0); SetVerticalScrollPos(); - InvalidateStyleRedraw(); // RPD: patch #1106564 + InvalidateStyleRedraw(); } void Editor::ClearDocumentStyle() { @@ -3371,7 +3463,8 @@ void Editor::Undo() { if (pdoc->CanUndo()) { InvalidateCaret(); int newPos = pdoc->Undo(); - SetEmptySelection(newPos); + if (newPos >= 0) + SetEmptySelection(newPos); EnsureCaretVisible(); } } @@ -3379,7 +3472,8 @@ void Editor::Undo() { void Editor::Redo() { if (pdoc->CanRedo()) { int newPos = pdoc->Redo(); - SetEmptySelection(newPos); + if (newPos >= 0) + SetEmptySelection(newPos); EnsureCaretVisible(); } } @@ -3425,7 +3519,7 @@ void Editor::DelCharBack(bool allowLineStartDeletion) { void Editor::NotifyFocus(bool) {} void Editor::NotifyStyleToNeeded(int endStyleNeeded) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_STYLENEEDED; scn.position = endStyleNeeded; NotifyParent(scn); @@ -3436,7 +3530,7 @@ void Editor::NotifyStyleNeeded(Document*, void *, int endStyleNeeded) { } void Editor::NotifyChar(int ch) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_CHARADDED; scn.ch = ch; NotifyParent(scn); @@ -3449,7 +3543,7 @@ void Editor::NotifyChar(int ch) { } void Editor::NotifySavePoint(bool isSavePoint) { - SCNotification scn; + SCNotification scn = {0}; if (isSavePoint) { scn.nmhdr.code = SCN_SAVEPOINTREACHED; } else { @@ -3459,19 +3553,19 @@ void Editor::NotifySavePoint(bool isSavePoint) { } void Editor::NotifyModifyAttempt() { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_MODIFYATTEMPTRO; NotifyParent(scn); } void Editor::NotifyDoubleClick(Point, bool) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_DOUBLECLICK; NotifyParent(scn); } void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK; scn.position = position; scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | @@ -3480,7 +3574,7 @@ void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, boo } void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_HOTSPOTCLICK; scn.position = position; scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | @@ -3489,13 +3583,13 @@ void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) } void Editor::NotifyUpdateUI() { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_UPDATEUI; NotifyParent(scn); } void Editor::NotifyPainted() { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_PAINTED; NotifyParent(scn); } @@ -3509,7 +3603,7 @@ bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) { x += vs.ms[margin].width; } if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_MARGINCLICK; scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | (alt ? SCI_ALT : 0); @@ -3523,7 +3617,7 @@ bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) { } void Editor::NotifyNeedShown(int pos, int len) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_NEEDSHOWN; scn.position = pos; scn.length = len; @@ -3531,7 +3625,7 @@ void Editor::NotifyNeedShown(int pos, int len) { } void Editor::NotifyDwelling(Point pt, bool state) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = state ? SCN_DWELLSTART : SCN_DWELLEND; scn.position = PositionFromLocationClose(pt); scn.x = pt.x; @@ -3540,7 +3634,7 @@ void Editor::NotifyDwelling(Point pt, bool state) { } void Editor::NotifyZoom() { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_ZOOM; NotifyParent(scn); } @@ -3552,7 +3646,7 @@ void Editor::NotifyModifyAttempt(Document*, void *) { } void Editor::NotifyMove(int position) { - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_POSCHANGED; scn.position = position; NotifyParent(scn); @@ -3564,8 +3658,7 @@ void Editor::NotifySavePoint(Document*, void *, bool atSavePoint) { } void Editor::CheckModificationForWrap(DocModification mh) { - if ((mh.modificationType & SC_MOD_INSERTTEXT) || - (mh.modificationType & SC_MOD_DELETETEXT)) { + if (mh.modificationType & (SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT)) { llc.Invalidate(LineLayout::llCheckTextAndStyle); if (wrapState != eWrapNone) { int lineDoc = pdoc->LineFromPosition(mh.position); @@ -3641,7 +3734,7 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { // Some lines are hidden so may need shown. // TODO: check if the modified area is hidden. if (mh.modificationType & SC_MOD_BEFOREINSERT) { - NotifyNeedShown(mh.position, mh.length); + NotifyNeedShown(mh.position, 0); } else if (mh.modificationType & SC_MOD_BEFOREDELETE) { NotifyNeedShown(mh.position, mh.length); } @@ -3659,7 +3752,7 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { CheckModificationForWrap(mh); if (mh.linesAdded != 0) { // Avoid scrolling of display if change before current display - if (mh.position < posTopLine) { + if (mh.position < posTopLine && !CanDeferToLastStep(mh)) { int newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos()); if (newTop != topLine) { SetTopLine(newTop); @@ -3670,28 +3763,39 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { //Platform::DebugPrintf("** %x Doc Changed\n", this); // TODO: could invalidate from mh.startModification to end of screen //InvalidateRange(mh.position, mh.position + mh.length); - if (paintState == notPainting) { + if (paintState == notPainting && !CanDeferToLastStep(mh)) { Redraw(); } } else { //Platform::DebugPrintf("** %x Line Changed %d .. %d\n", this, // mh.position, mh.position + mh.length); - if (paintState == notPainting) { + if (paintState == notPainting && mh.length && !CanEliminate(mh)) { InvalidateRange(mh.position, mh.position + mh.length); } } } - if (mh.linesAdded != 0) { + if (mh.linesAdded != 0 && !CanDeferToLastStep(mh)) { SetScrollBars(); } if (mh.modificationType & SC_MOD_CHANGEMARKER) { - if (paintState == notPainting) { - RedrawSelMargin(); + if ((paintState == notPainting) || !PaintContainsMargin()) { + if (mh.modificationType & SC_MOD_CHANGEFOLD) { + // Fold changes can affect the drawing of following lines so redraw whole margin + RedrawSelMargin(); + } else { + RedrawSelMargin(mh.line); + } } } + // NOW pay the piper WRT "deferred" visual updates + if (IsLastStep(mh)) { + SetScrollBars(); + Redraw(); + } + // If client wants to see this modification if (mh.modificationType & modEventMask) { if ((mh.modificationType & SC_MOD_CHANGESTYLE) == 0) { @@ -3699,7 +3803,7 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { NotifyChange(); // Send EN_CHANGE } - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_MODIFIED; scn.position = mh.position; scn.modificationType = mh.modificationType; @@ -3717,7 +3821,7 @@ void Editor::NotifyDeleted(Document *, void *) { /* Do nothing */ } -void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long lParam) { +void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { // Enumerates all macroable messages switch (iMessage) { @@ -3818,6 +3922,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long case SCI_LINEENDRECTEXTEND: case SCI_PAGEUPRECTEXTEND: case SCI_PAGEDOWNRECTEXTEND: + case SCI_SELECTIONDUPLICATE: break; // Filter out all others like display changes. Also, newlines are redundant @@ -3829,7 +3934,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long } // Send notification - SCNotification scn; + SCNotification scn = {0}; scn.nmhdr.code = SCN_MACRORECORD; scn.message = iMessage; scn.wParam = wParam; @@ -3931,15 +4036,26 @@ void Editor::LineTranspose() { } } -void Editor::LineDuplicate() { - int line = pdoc->LineFromPosition(currentPos); - int start = pdoc->LineStart(line); - int end = pdoc->LineEnd(line); - char *thisLine = CopyRange(start, end); - const char *eol = StringFromEOLMode(pdoc->eolMode); - pdoc->InsertString(end, eol); - pdoc->InsertString(end + istrlen(eol), thisLine, end - start); - delete []thisLine; +void Editor::Duplicate(bool forLine) { + int start = SelectionStart(); + int end = SelectionEnd(); + if (start == end) { + forLine = true; + } + if (forLine) { + int line = pdoc->LineFromPosition(currentPos); + start = pdoc->LineStart(line); + end = pdoc->LineEnd(line); + } + char *text = CopyRange(start, end); + if (forLine) { + const char *eol = StringFromEOLMode(pdoc->eolMode); + pdoc->InsertString(end, eol); + pdoc->InsertString(end + istrlen(eol), text, end - start); + } else { + pdoc->InsertString(end, text, end - start); + } + delete []text; } void Editor::CancelModes() { @@ -3963,6 +4079,8 @@ void Editor::NewLine() { } SetLastXChosen(); EnsureCaretVisible(); + // Avoid blinking during rapid typing: + ShowCaretAtCurrentPosition(); } void Editor::CursorUpOrDown(int direction, selTypes sel) { @@ -3983,6 +4101,22 @@ void Editor::CursorUpOrDown(int direction, selTypes sel) { MovePositionTo(posNew, sel); } +void Editor::ParaUpOrDown(int direction, selTypes sel) { + int lineDoc, savedPos = currentPos; + do { + MovePositionTo(direction > 0 ? pdoc->ParaDown(currentPos) : pdoc->ParaUp(currentPos), sel); + lineDoc = pdoc->LineFromPosition(currentPos); + if (direction > 0) { + if (currentPos >= pdoc->Length() && !cs.GetVisible(lineDoc)) { + if (sel == noSel) { + MovePositionTo(pdoc->LineEndPosition(savedPos)); + } + break; + } + } + } while (!cs.GetVisible(lineDoc)); +} + int Editor::StartEndDisplayLine(int pos, bool start) { RefreshStyleData(); int line = pdoc->LineFromPosition(pos); @@ -4027,10 +4161,10 @@ int Editor::KeyCommand(unsigned int iMessage) { CursorUpOrDown(1, selRectangle); break; case SCI_PARADOWN: - MovePositionTo(pdoc->ParaDown(currentPos)); + ParaUpOrDown(1); break; case SCI_PARADOWNEXTEND: - MovePositionTo(pdoc->ParaDown(currentPos), selStream); + ParaUpOrDown(1, selStream); break; case SCI_LINESCROLLDOWN: ScrollTo(topLine + 1); @@ -4046,10 +4180,10 @@ int Editor::KeyCommand(unsigned int iMessage) { CursorUpOrDown(-1, selRectangle); break; case SCI_PARAUP: - MovePositionTo(pdoc->ParaUp(currentPos)); + ParaUpOrDown(-1); break; case SCI_PARAUPEXTEND: - MovePositionTo(pdoc->ParaUp(currentPos), selStream); + ParaUpOrDown(-1, selStream); break; case SCI_LINESCROLLUP: ScrollTo(topLine - 1); @@ -4239,22 +4373,30 @@ int Editor::KeyCommand(unsigned int iMessage) { break; case SCI_DELETEBACK: DelCharBack(true); - SetLastXChosen(); + if (!caretSticky) { + SetLastXChosen(); + } EnsureCaretVisible(); break; case SCI_DELETEBACKNOTLINE: DelCharBack(false); - SetLastXChosen(); + if (!caretSticky) { + SetLastXChosen(); + } EnsureCaretVisible(); break; case SCI_TAB: Indent(true); - SetLastXChosen(); + if (!caretSticky) { + SetLastXChosen(); + } EnsureCaretVisible(); break; case SCI_BACKTAB: Indent(false); - SetLastXChosen(); + if (!caretSticky) { + SetLastXChosen(); + } EnsureCaretVisible(); break; case SCI_NEWLINE: @@ -4361,7 +4503,10 @@ int Editor::KeyCommand(unsigned int iMessage) { LineTranspose(); break; case SCI_LINEDUPLICATE: - LineDuplicate(); + Duplicate(true); + break; + case SCI_SELECTIONDUPLICATE: + Duplicate(false); break; case SCI_LOWERCASE: ChangeCaseOfSelection(false); @@ -4978,7 +5123,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b NotifyHotSpotClicked(newPos, shift, ctrl, alt); } if (!shift) { - inDragDrop = PointInSelection(pt); + inDragDrop = PointInSelection(pt) && !SelectionEmpty(); } if (inDragDrop) { SetMouseCapture(false); @@ -4992,9 +5137,9 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b SetEmptySelection(newPos); } selType = alt ? selRectangle : selStream; - xStartSelect = xEndSelect = pt.x - vs.fixedColumnWidth + xOffset; selectionType = selChar; originalAnchorPos = currentPos; + SetRectangularRange(); } } } @@ -5131,7 +5276,7 @@ void Editor::ButtonMove(Point pt) { } } // Display regular (drag) cursor over selection - if (PointInSelection(pt)) { + if (PointInSelection(pt) && !SelectionEmpty()) { DisplayCursor(Window::cursorArrow); } else if (PointIsHotspot(pt)) { DisplayCursor(Window::cursorHand); @@ -5144,7 +5289,7 @@ void Editor::ButtonMove(Point pt) { } void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) { - //Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture()); + //Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture()); if (HaveMouseCapture()) { if (PointInSelMargin(pt)) { DisplayCursor(Window::cursorReverseArrow); @@ -5188,9 +5333,7 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) { SetSelection(newPos); } } - // Now we rely on the current pos to compute rectangular selection - xStartSelect = XFromPosition(anchor); - xEndSelect = XFromPosition(currentPos); + SetRectangularRange(); lastClickTime = curTime; lastClick = pt; lastXChosen = pt.x; @@ -5214,7 +5357,9 @@ void Editor::Tick() { if (timer.ticksToWait <= 0) { caret.on = !caret.on; timer.ticksToWait = caret.period; - InvalidateCaret(); + if (caret.active) { + InvalidateCaret(); + } } } if ((dwellDelay < SC_TIME_FOREVER) && @@ -5263,16 +5408,14 @@ void Editor::SetFocusState(bool focusState) { } } -static bool IsIn(int a, int minimum, int maximum) { - return (a >= minimum) && (a <= maximum); +bool Editor::PaintContains(PRectangle rc) { + return rcPaint.Contains(rc); } -static bool IsOverlap(int mina, int maxa, int minb, int maxb) { - return - IsIn(mina, minb, maxb) || - IsIn(maxa, minb, maxb) || - IsIn(minb, mina, maxa) || - IsIn(maxb, mina, maxa); +bool Editor::PaintContainsMargin() { + PRectangle rcSelMargin = GetClientRectangle(); + rcSelMargin.right = vs.fixedColumnWidth; + return PaintContains(rcSelMargin); } void Editor::CheckForChangeOutsidePaint(Range r) { @@ -5281,99 +5424,21 @@ void Editor::CheckForChangeOutsidePaint(Range r) { if (!r.Valid()) return; + PRectangle rcRange = RectangleFromRange(r.start, r.end); PRectangle rcText = GetTextRectangle(); - // Determine number of lines displayed including a possible partially displayed last line - int linesDisplayed = (rcText.bottom - rcText.top - 1) / vs.lineHeight + 1; - int bottomLine = topLine + linesDisplayed - 1; - - int lineRangeStart = cs.DisplayFromDoc(pdoc->LineFromPosition(r.start)); - int lineRangeEnd = cs.DisplayFromDoc(pdoc->LineFromPosition(r.end)); - if (!IsOverlap(topLine, bottomLine, lineRangeStart, lineRangeEnd)) { - //Platform::DebugPrintf("No overlap (%d-%d) with window(%d-%d)\n", - // lineRangeStart, lineRangeEnd, topLine, bottomLine); - return; + if (rcRange.top < rcText.top) { + rcRange.top = rcText.top; } - - // Assert rcPaint contained within or equal to rcText - if (rcPaint.top > rcText.top) { - // does range intersect rcText.top .. rcPaint.top - int paintTopLine = ((rcPaint.top - rcText.top - 1) / vs.lineHeight) + topLine; - // paintTopLine is the top line of the paint rectangle or the line just above if that line is completely inside the paint rectangle - if (IsOverlap(topLine, paintTopLine, lineRangeStart, lineRangeEnd)) { - //Platform::DebugPrintf("Change (%d-%d) in top npv(%d-%d)\n", - // lineRangeStart, lineRangeEnd, topLine, paintTopLine); - AbandonPaint(); - return; - } + if (rcRange.bottom > rcText.bottom) { + rcRange.bottom = rcText.bottom; } - if (rcPaint.bottom < rcText.bottom) { - // does range intersect rcPaint.bottom .. rcText.bottom - int paintBottomLine = ((rcPaint.bottom - rcText.top - 1) / vs.lineHeight + 1) + topLine; - // paintTopLine is the bottom line of the paint rectangle or the line just below if that line is completely inside the paint rectangle - if (IsOverlap(paintBottomLine, bottomLine, lineRangeStart, lineRangeEnd)) { - //Platform::DebugPrintf("Change (%d-%d) in bottom npv(%d-%d)\n", - // lineRangeStart, lineRangeEnd, paintBottomLine, bottomLine); - AbandonPaint(); - return; - } + + if (!PaintContains(rcRange)) { + AbandonPaint(); } } } -char BraceOpposite(char ch) { - switch (ch) { - case '(': - return ')'; - case ')': - return '('; - case '[': - return ']'; - case ']': - return '['; - case '{': - return '}'; - case '}': - return '{'; - case '<': - return '>'; - case '>': - return '<'; - default: - return '\0'; - } -} - -// TODO: should be able to extend styled region to find matching brace -// TODO: may need to make DBCS safe -// so should be moved into Document -int Editor::BraceMatch(int position, int /*maxReStyle*/) { - char chBrace = pdoc->CharAt(position); - char chSeek = BraceOpposite(chBrace); - if (chSeek == '\0') - return - 1; - char styBrace = static_cast( - pdoc->StyleAt(position) & pdoc->stylingBitsMask); - int direction = -1; - if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<') - direction = 1; - int depth = 1; - position = position + direction; - while ((position >= 0) && (position < pdoc->Length())) { - char chAtPos = pdoc->CharAt(position); - char styAtPos = static_cast(pdoc->StyleAt(position) & pdoc->stylingBitsMask); - if ((position > pdoc->GetEndStyled()) || (styAtPos == styBrace)) { - if (chAtPos == chBrace) - depth++; - if (chAtPos == chSeek) - depth--; - if (depth == 0) - return position; - } - position = position + direction; - } - return - 1; -} - void Editor::SetBraceHighlight(Position pos0, Position pos1, int matchStyle) { if ((pos0 != braces[0]) || (pos1 != braces[1]) || (matchStyle != bracesMatchStyle)) { if ((braces[0] != pos0) || (matchStyle != bracesMatchStyle)) { @@ -5421,8 +5486,8 @@ void Editor::SetDocPointer(Document *document) { NeedWrapping(); pdoc->AddWatcher(this, 0); - Redraw(); SetScrollBars(); + Redraw(); } /** @@ -5558,6 +5623,18 @@ int Editor::CodePage() const { return 0; } +int Editor::WrapCount(int line) { + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(line)); + + if (surface && ll) { + LayoutLine(line, surface, vs, ll, wrapWidth); + return ll->lines; + } else { + return 1; + } +} + static bool ValidMargin(unsigned long wParam) { return wParam < ViewStyle::margins; } @@ -5621,7 +5698,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_PASTE: Paste(); - SetLastXChosen(); + if (!caretSticky) { + SetLastXChosen(); + } EnsureCaretVisible(); break; @@ -5637,7 +5716,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { break; case SCI_CANUNDO: - return pdoc->CanUndo() ? 1 : 0; + return (pdoc->CanUndo() && !pdoc->IsReadOnly()) ? 1 : 0; case SCI_EMPTYUNDOBUFFER: pdoc->DeleteUndoHistory(); @@ -6066,7 +6145,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { } case SCI_CANREDO: - return pdoc->CanRedo() ? 1 : 0; + return (pdoc->CanRedo() && !pdoc->IsReadOnly()) ? 1 : 0; case SCI_MARKERLINEFROMHANDLE: return pdoc->LineFromHandle(wParam); @@ -6106,6 +6185,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { if (lParam == 0) { return 1 + lineEnd - lineStart; } + PLATFORM_ASSERT(wParam > 0); char *ptr = CharPtrFromSPtr(lParam); unsigned int iPlace = 0; for (unsigned int iChar = lineStart; iChar < lineEnd && iPlace < wParam - 1; iChar++) { @@ -6225,7 +6305,17 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return pdoc->ExtendWordSelect(wParam, 1, lParam != 0); case SCI_SETWRAPMODE: - wrapState = (wParam == SC_WRAP_WORD) ? eWrapWord : eWrapNone; + switch(wParam){ + case SC_WRAP_WORD: + wrapState = eWrapWord; + break; + case SC_WRAP_CHAR: + wrapState = eWrapChar; + break; + default: + wrapState = eWrapNone; + break; + } xOffset = 0; InvalidateStyleRedraw(); ReconfigureScrollBars(); @@ -6311,6 +6401,20 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_GETENDATLASTLINE: return endAtLastLine; + case SCI_SETCARETSTICKY: + PLATFORM_ASSERT((wParam == 0) || (wParam == 1)); + if (caretSticky != (wParam != 0)) { + caretSticky = wParam != 0; + } + break; + + case SCI_GETCARETSTICKY: + return caretSticky; + + case SCI_TOGGLECARETSTICKY: + caretSticky = !caretSticky; + break; + case SCI_GETCOLUMN: return pdoc->GetColumn(wParam); @@ -6399,6 +6503,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { int markerID = pdoc->AddMark(wParam, lParam); return markerID; } + case SCI_MARKERADDSET: + if (lParam != 0) + pdoc->AddMarkSet(wParam, lParam); + break; case SCI_MARKERDELETE: pdoc->DeleteMark(wParam, lParam); @@ -6618,6 +6726,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_DOCLINEFROMVISIBLE: return cs.DocFromDisplay(wParam); + case SCI_WRAPCOUNT: + return WrapCount(wParam); + case SCI_SETFOLDLEVEL: { int prev = pdoc->SetLevel(wParam, lParam); if (prev != lParam) @@ -6873,6 +6984,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_LINEENDRECTEXTEND: case SCI_PAGEUPRECTEXTEND: case SCI_PAGEDOWNRECTEXTEND: + case SCI_SELECTIONDUPLICATE: return KeyCommand(iMessage); case SCI_BRACEHIGHLIGHT: @@ -6886,7 +6998,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_BRACEMATCH: // wParam is position of char to find brace for, // lParam is maximum amount of text to restyle to find it - return BraceMatch(wParam, lParam); + return pdoc->BraceMatch(wParam, lParam); case SCI_GETVIEWEOL: return vs.viewEOL; @@ -7103,6 +7215,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { InvalidateStyleRedraw(); break; + case SCI_SETPASTECONVERTENDINGS: + convertPastes = wParam != 0; + break; + + case SCI_GETPASTECONVERTENDINGS: + return convertPastes ? 1 : 0; + default: return DefWndProc(iMessage, wParam, lParam); } diff --git a/contrib/src/stc/scintilla/src/Editor.h b/contrib/src/stc/scintilla/src/Editor.h index e14cb5ed95..9243d3a2f4 100644 --- a/contrib/src/stc/scintilla/src/Editor.h +++ b/contrib/src/stc/scintilla/src/Editor.h @@ -64,6 +64,7 @@ public: int edgeColumn; char *chars; unsigned char *styles; + int styleBitsSet; char *indicators; int *positions; char bracePreviousStyles[2]; @@ -105,6 +106,7 @@ class LineLayoutCache { LineLayout **cache; bool allInvalidated; int styleClock; + int useCount; void Allocate(int length_); void AllocateForLevel(int linesOnScreen, int linesInDoc); public: @@ -218,6 +220,7 @@ protected: // ScintillaBase subclass needs access to much of Editor int scrollWidth; bool verticalScrollBarVisible; bool endAtLastLine; + bool caretSticky; Surface *pixmapLine; Surface *pixmapSelMargin; @@ -301,7 +304,7 @@ protected: // ScintillaBase subclass needs access to much of Editor int hsEnd; // Wrapping support - enum { eWrapNone, eWrapWord } wrapState; + enum { eWrapNone, eWrapWord, eWrapChar } wrapState; bool backgroundWrapEnabled; int wrapWidth; int docLineLastWrapped; @@ -311,6 +314,8 @@ protected: // ScintillaBase subclass needs access to much of Editor int wrapVisualStartIndent; int actualWrapVisualStartIndent; + bool convertPastes; + Document *pdoc; Editor(); @@ -341,7 +346,7 @@ protected: // ScintillaBase subclass needs access to much of Editor bool AbandonPaint(); void RedrawRect(PRectangle rc); void Redraw(); - void RedrawSelMargin(); + void RedrawSelMargin(int line=-1); PRectangle RectangleFromRange(int start, int end); void InvalidateRange(int start, int end); @@ -349,6 +354,7 @@ protected: // ScintillaBase subclass needs access to much of Editor bool SelectionEmpty(); int SelectionStart(); int SelectionEnd(); + void SetRectangularRange(); void InvalidateSelection(int currentPos_, int anchor_); void SetSelection(int currentPos_, int anchor_); void SetSelection(int currentPos_); @@ -450,10 +456,11 @@ protected: // ScintillaBase subclass needs access to much of Editor void PageMove(int direction, selTypes sel=noSel, bool stuttered = false); void ChangeCaseOfSelection(bool makeUpperCase); void LineTranspose(); - void LineDuplicate(); + void Duplicate(bool forLine); virtual void CancelModes(); void NewLine(); void CursorUpOrDown(int direction, selTypes sel=noSel); + void ParaUpOrDown(int direction, selTypes sel=noSel); int StartEndDisplayLine(int pos, bool start); virtual int KeyCommand(unsigned int iMessage); virtual int KeyDefault(int /* key */, int /*modifiers*/); @@ -499,8 +506,9 @@ protected: // ScintillaBase subclass needs access to much of Editor virtual bool HaveMouseCapture() = 0; void SetFocusState(bool focusState); + virtual bool PaintContains(PRectangle rc); + bool PaintContainsMargin(); void CheckForChangeOutsidePaint(Range r); - int BraceMatch(int position, int maxReStyle); void SetBraceHighlight(Position pos0, Position pos1, int matchStyle); void SetDocPointer(Document *document); @@ -516,6 +524,7 @@ protected: // ScintillaBase subclass needs access to much of Editor void GetHotSpotRange(int& hsStart, int& hsEnd); int CodePage() const; + int WrapCount(int line); virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; diff --git a/contrib/src/stc/scintilla/src/KeyMap.cxx b/contrib/src/stc/scintilla/src/KeyMap.cxx index 950916bd08..bfa6e2d789 100644 --- a/contrib/src/stc/scintilla/src/KeyMap.cxx +++ b/contrib/src/stc/scintilla/src/KeyMap.cxx @@ -140,7 +140,7 @@ const KeyToCommand KeyMap::MapDefault[] = { {'L', SCI_CSHIFT, SCI_LINEDELETE}, {'T', SCI_CSHIFT, SCI_LINECOPY}, {'T', SCI_CTRL, SCI_LINETRANSPOSE}, - {'D', SCI_CTRL, SCI_LINEDUPLICATE}, + {'D', SCI_CTRL, SCI_SELECTIONDUPLICATE}, {'U', SCI_CTRL, SCI_LOWERCASE}, {'U', SCI_CSHIFT, SCI_UPPERCASE}, {0,0,0}, diff --git a/contrib/src/stc/scintilla/src/KeyWords.cxx b/contrib/src/stc/scintilla/src/KeyWords.cxx index 67e52ec11a..1ffc4fb5f8 100644 --- a/contrib/src/stc/scintilla/src/KeyWords.cxx +++ b/contrib/src/stc/scintilla/src/KeyWords.cxx @@ -22,13 +22,17 @@ const LexerModule *LexerModule::base = 0; int LexerModule::nextLanguage = SCLEX_AUTOMATIC+1; -LexerModule::LexerModule(int language_, LexerFunction fnLexer_, - const char *languageName_, LexerFunction fnFolder_, - const char * const wordListDescriptions_[]) : +LexerModule::LexerModule(int language_, + LexerFunction fnLexer_, + const char *languageName_, + LexerFunction fnFolder_, + const char * const wordListDescriptions_[], + int styleBits_) : language(language_), fnLexer(fnLexer_), fnFolder(fnFolder_), wordListDescriptions(wordListDescriptions_), + styleBits(styleBits_), languageName(languageName_) { next = base; base = this; @@ -52,7 +56,7 @@ int LexerModule::GetNumWordLists() const { } } -const char * LexerModule::GetWordListDescription(int index) const { +const char *LexerModule::GetWordListDescription(int index) const { static const char *emptyStr = ""; PLATFORM_ASSERT(index < GetNumWordLists()); @@ -63,6 +67,10 @@ const char * LexerModule::GetWordListDescription(int index) const { } } +int LexerModule::GetStyleBitsNeeded() const { + return styleBits; +} + const LexerModule *LexerModule::Find(int language) { const LexerModule *lm = base; while (lm) { @@ -130,67 +138,78 @@ int Scintilla_LinkLexers() { //++Autogenerated -- run src/LexGen.py to regenerate //**\(\tLINK_LEXER(\*);\n\) LINK_LEXER(lmAda); + LINK_LEXER(lmAns1); LINK_LEXER(lmAPDL); LINK_LEXER(lmAsm); - LINK_LEXER(lmAsn1); + LINK_LEXER(lmASP); LINK_LEXER(lmAU3); LINK_LEXER(lmAVE); LINK_LEXER(lmBaan); LINK_LEXER(lmBash); + LINK_LEXER(lmBatch); + LINK_LEXER(lmBlitzBasic); LINK_LEXER(lmBullant); + LINK_LEXER(lmCaml); LINK_LEXER(lmClw); LINK_LEXER(lmClwNoCase); LINK_LEXER(lmConf); LINK_LEXER(lmCPP); LINK_LEXER(lmCPPNoCase); - LINK_LEXER(lmTCL); - LINK_LEXER(lmNncrontab); + LINK_LEXER(lmCsound); LINK_LEXER(lmCss); + LINK_LEXER(lmDiff); LINK_LEXER(lmEiffel); LINK_LEXER(lmEiffelkw); LINK_LEXER(lmErlang); + LINK_LEXER(lmErrorList); LINK_LEXER(lmESCRIPT); + LINK_LEXER(lmF77); + LINK_LEXER(lmFlagShip); LINK_LEXER(lmForth); LINK_LEXER(lmFortran); - LINK_LEXER(lmF77); + LINK_LEXER(lmFreeBasic); LINK_LEXER(lmGui4Cli); + LINK_LEXER(lmHaskell); LINK_LEXER(lmHTML); - LINK_LEXER(lmXML); - LINK_LEXER(lmASP); - LINK_LEXER(lmPHP); LINK_LEXER(lmKix); + LINK_LEXER(lmLatex); LINK_LEXER(lmLISP); + LINK_LEXER(lmLot); LINK_LEXER(lmLout); LINK_LEXER(lmLua); + LINK_LEXER(lmMake); LINK_LEXER(lmMatlab); - LINK_LEXER(lmOctave); LINK_LEXER(lmMETAPOST); LINK_LEXER(lmMMIXAL); - LINK_LEXER(lmLot); LINK_LEXER(lmMSSQL); + LINK_LEXER(lmNncrontab); LINK_LEXER(lmNsis); - LINK_LEXER(lmBatch); - LINK_LEXER(lmDiff); - LINK_LEXER(lmProps); - LINK_LEXER(lmMake); - LINK_LEXER(lmErrorList); - LINK_LEXER(lmLatex); LINK_LEXER(lmNull); + LINK_LEXER(lmOctave); LINK_LEXER(lmPascal); LINK_LEXER(lmPB); LINK_LEXER(lmPerl); + LINK_LEXER(lmPHP); + LINK_LEXER(lmPHPSCRIPT); LINK_LEXER(lmPOV); + LINK_LEXER(lmProps); LINK_LEXER(lmPS); + LINK_LEXER(lmPureBasic); LINK_LEXER(lmPython); + LINK_LEXER(lmREBOL); LINK_LEXER(lmRuby); LINK_LEXER(lmScriptol); + LINK_LEXER(lmSmalltalk); LINK_LEXER(lmSpecman); LINK_LEXER(lmSQL); + LINK_LEXER(lmTADS3); + LINK_LEXER(lmTCL); LINK_LEXER(lmTeX); LINK_LEXER(lmVB); LINK_LEXER(lmVBScript); LINK_LEXER(lmVerilog); LINK_LEXER(lmVHDL); + LINK_LEXER(lmXML); LINK_LEXER(lmYAML); //--Autogenerated -- end of automatically generated section diff --git a/contrib/src/stc/scintilla/src/LexAU3.cxx b/contrib/src/stc/scintilla/src/LexAU3.cxx index 31e4ee52d2..ee547f497f 100644 --- a/contrib/src/stc/scintilla/src/LexAU3.cxx +++ b/contrib/src/stc/scintilla/src/LexAU3.cxx @@ -25,7 +25,21 @@ // Added fold.compact support set with fold.compact=1 // Changed folding inside of #cs-#ce. Default is no keyword folding inside comment blocks when fold.comment=1 // it will now only happen when fold.comment=2. -// +// Sep 5, 2004 - Added logic to handle colourizing words on the last line. +// Typed Characters now show as "default" till they match any table. +// Oct 10, 2004 - Added logic to show Comments in "Special" directives. +// Nov 1, 2004 - Added better testing for Numbers supporting x and e notation. +// Nov 28, 2004 - Added logic to handle continuation lines for syntax highlighting. +// Jan 10, 2005 - Added Abbreviations Keyword used for expansion +// Mar 24, 2005 - Updated Abbreviations Keywords to fix when followed by Operator. +// Apr 18, 2005 - Updated #CE/#Comment-End logic to take a linecomment ";" into account +// - Added folding support for With...EndWith +// - Added support for a DOT in variable names +// - Fixed Underscore in CommentBlock +// May 23, 2005 - Fixed the SentKey lexing in case of a missing } +// Aug 11, 2005 - Fixed possible bug with s_save length > 100. +// Aug 23, 2005 - Added Switch/endswitch support to the folding logic. +// // Copyright for Scintilla: 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. // Scintilla source code edit control @@ -56,7 +70,7 @@ static inline bool IsAWordChar(const int ch) static inline bool IsAWordStart(const int ch) { - return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$'); + return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$' || ch == '.'); } static inline bool IsAOperator(char ch) { @@ -88,7 +102,11 @@ static int GetSendKey(const char *szLine, char *szKey) // split the portion of the sendkey in the part before and after the spaces while ( ( (cTemp = szLine[nPos]) != '\0')) { - if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space + // skip leading Ctrl/Shift/ALt state + if ((cTemp == '#' || cTemp == '!' || cTemp == '^') && (szLine[nPos+1] == '{') ) + { + } + else if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space { nFlag = 1; // Add } to the end of the first bit for table lookup later. @@ -132,6 +150,34 @@ static int GetSendKey(const char *szLine, char *szKey) } // GetSendKey() +// +// Routine to check the last "none comment" character on a line to see if its a continuation +// +static bool IsContinuationLine(unsigned int szLine, Accessor &styler) +{ + int nsPos = styler.LineStart(szLine); + int nePos = styler.LineStart(szLine+1) - 2; + //int stylech = styler.StyleAt(nsPos); + while (nsPos < nePos) + { + //stylech = styler.StyleAt(nePos); + int stylech = styler.StyleAt(nsPos); + if (!(stylech == SCE_AU3_COMMENT)) { + char ch = styler.SafeGetCharAt(nePos); + if (!isspacechar(ch)) { + if (ch == '_') + return true; + else + return false; + } + } + nePos--; // skip to next char + } // End While + return false; +} // IsContinuationLine() + +// +// syntax highlighting logic static void ColouriseAU3Doc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], @@ -143,25 +189,78 @@ static void ColouriseAU3Doc(unsigned int startPos, WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; + WordList &keywords7 = *keywordlists[6]; + // find the first previous line without continuation character at the end + int lineCurrent = styler.GetLine(startPos); + int s_startPos = startPos; + // When not inside a Block comment: find First line without _ + if (!(initStyle==SCE_AU3_COMMENTBLOCK)) { + while ((lineCurrent > 0 && IsContinuationLine(lineCurrent,styler)) || + (lineCurrent > 1 && IsContinuationLine(lineCurrent-1,styler))) { + lineCurrent--; + startPos = styler.LineStart(lineCurrent); // get start position + initStyle = 0; // reset the start style to 0 + } + } + // Set the new length to include it from the start and set the start position + length = length + s_startPos - startPos; // correct the total length to process styler.StartAt(startPos); - + StyleContext sc(startPos, length, initStyle, styler); char si; // string indicator "=1 '=2 - si=0; + char ni; // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 Enot=3 + char ci; // comment indicator 0=not linecomment(;) + char s_save[100]; + si=0; + ni=0; + ci=0; //$$$ for (; sc.More(); sc.Forward()) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); + // ********************************************** + // save the total current word for eof processing + if (IsAWordChar(sc.ch) || sc.ch == '}') + { + strcpy(s_save,s); + int tp = strlen(s_save); + if (tp < 99) { + s_save[tp] = static_cast(tolower(sc.ch)); + s_save[tp+1] = '\0'; + } + } + // ********************************************** + // switch (sc.state) { case SCE_AU3_COMMENTBLOCK: { - if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) - { + //Reset at line end + if (sc.atLineEnd) { + ci=0; + sc.SetState(SCE_AU3_COMMENTBLOCK); + } + //skip rest of line when a ; is encountered + if (sc.chPrev == ';') { + ci=2; + sc.SetState(SCE_AU3_COMMENTBLOCK); + } + // skip rest of the line + if (ci==2) + break; + // check when first character is detected on the line + if (ci==0) { + if (IsAWordStart(static_cast(sc.ch)) || IsAOperator(static_cast(sc.ch))) { + ci=1; + sc.SetState(SCE_AU3_COMMENTBLOCK); + } + break; + } + if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) { if ((strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0)) - {sc.SetState(SCE_AU3_COMMENT);} // set to comment line for the rest of the line + sc.SetState(SCE_AU3_COMMENT); // set to comment line for the rest of the line else - {sc.SetState(SCE_AU3_COMMENTBLOCK);} + ci=2; // line doesn't begin with #CE so skip the rest of the line } break; } @@ -172,12 +271,19 @@ static void ColouriseAU3Doc(unsigned int startPos, } case SCE_AU3_OPERATOR: { - sc.SetState(SCE_AU3_DEFAULT); + // check if its a COMobject + if (sc.chPrev == '.' && IsAWordChar(sc.ch)) { + sc.SetState(SCE_AU3_COMOBJ); + } + else { + sc.SetState(SCE_AU3_DEFAULT); + } break; } case SCE_AU3_SPECIAL: { - if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} + if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);} + if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} break; } case SCE_AU3_KEYWORD: @@ -215,6 +321,10 @@ static void ColouriseAU3Doc(unsigned int startPos, sc.ChangeState(SCE_AU3_SPECIAL); sc.SetState(SCE_AU3_SPECIAL); } + else if ((keywords7.InList(s)) && (!IsAOperator(static_cast(sc.ch)))) { + sc.ChangeState(SCE_AU3_EXPAND); + sc.SetState(SCE_AU3_DEFAULT); + } else if (strcmp(s, "_") == 0) { sc.ChangeState(SCE_AU3_OPERATOR); sc.SetState(SCE_AU3_DEFAULT); @@ -225,18 +335,74 @@ static void ColouriseAU3Doc(unsigned int startPos, } } } - if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} + if (sc.atLineEnd) { + sc.SetState(SCE_AU3_DEFAULT);} break; } - case SCE_AU3_NUMBER: + case SCE_AU3_NUMBER: { - if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_AU3_DEFAULT);} - break; + // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 E-not=3 + // + // test for Hex notation + if (strcmp(s, "0") == 0 && (sc.ch == 'x' || sc.ch == 'X') && ni == 0) + { + ni = 2; + break; + } + // test for E notation + if (IsADigit(sc.chPrev) && (sc.ch == 'e' || sc.ch == 'E') && ni <= 1) + { + ni = 3; + break; + } + // Allow Hex characters inside hex numeric strings + if ((ni == 2) && + (sc.ch == 'a' || sc.ch == 'b' || sc.ch == 'c' || sc.ch == 'd' || sc.ch == 'e' || sc.ch == 'f' || + sc.ch == 'A' || sc.ch == 'B' || sc.ch == 'C' || sc.ch == 'D' || sc.ch == 'E' || sc.ch == 'F' )) + { + break; + } + // test for 1 dec point only + if (sc.ch == '.') + { + if (ni==0) + { + ni=1; + } + else + { + ni=9; + } + break; + } + // end of numeric string ? + if (!(IsADigit(sc.ch))) + { + if (ni==9) + { + sc.ChangeState(SCE_AU3_DEFAULT); + } + sc.SetState(SCE_AU3_DEFAULT); + } + break; + } + case SCE_AU3_VARIABLE: + { + // Check if its a COMObject + if (sc.ch == '.' && !IsADigit(sc.chNext)) { + sc.SetState(SCE_AU3_OPERATOR); + } + else if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_AU3_DEFAULT); + } + break; } - case SCE_AU3_VARIABLE: - { - if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_AU3_DEFAULT);} - break; + case SCE_AU3_COMOBJ: + { + if (!(IsAWordChar(sc.ch))) { + sc.SetState(SCE_AU3_DEFAULT); + } + break; } case SCE_AU3_STRING: { @@ -246,7 +412,15 @@ static void ColouriseAU3Doc(unsigned int startPos, { sc.ForwardSetState(SCE_AU3_DEFAULT); } - if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} + if (sc.atLineEnd) + { + // at line end and not found a continuation char then reset to default + int lineCurrent = styler.GetLine(sc.currentPos); + if (!IsContinuationLine(lineCurrent,styler)) + { + sc.SetState(SCE_AU3_DEFAULT); + } + } // find Sendkeys in a STRING if (sc.ch == '{') {sc.SetState(SCE_AU3_SENT);} if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} @@ -288,10 +462,11 @@ static void ColouriseAU3Doc(unsigned int startPos, // check if next portion is again a sendkey if (sc.atLineEnd) { + sc.ChangeState(SCE_AU3_STRING); sc.SetState(SCE_AU3_DEFAULT); si = 0; // reset string indicator } - if (sc.ch == '{' && sc.chPrev != '{') {sc.SetState(SCE_AU3_SENT);} + //if (sc.ch == '{' && sc.chPrev != '{') {sc.SetState(SCE_AU3_SENT);} if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} if (sc.ch == '!' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} if (sc.ch == '^' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} @@ -314,6 +489,7 @@ static void ColouriseAU3Doc(unsigned int startPos, if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);} else if (sc.ch == '#') {sc.SetState(SCE_AU3_KEYWORD);} else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);} + else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);} else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);} else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);} // string after #include else if (sc.ch == '\"') { @@ -322,13 +498,94 @@ static void ColouriseAU3Doc(unsigned int startPos, else if (sc.ch == '\'') { sc.SetState(SCE_AU3_STRING); si = 2; } - else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {sc.SetState(SCE_AU3_NUMBER);} + else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) + { + sc.SetState(SCE_AU3_NUMBER); + ni = 0; + } else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_AU3_KEYWORD);} else if (IsAOperator(static_cast(sc.ch))) {sc.SetState(SCE_AU3_OPERATOR);} else if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} } } //for (; sc.More(); sc.Forward()) - sc.Complete(); + + //************************************* + // Colourize the last word correctly + //************************************* + if (sc.state == SCE_AU3_KEYWORD) + { + if (strcmp(s_save, "#cs")== 0 || strcmp(s_save, "#comments-start")== 0 ) + { + sc.ChangeState(SCE_AU3_COMMENTBLOCK); + sc.SetState(SCE_AU3_COMMENTBLOCK); + } + else if (keywords.InList(s_save)) { + sc.ChangeState(SCE_AU3_KEYWORD); + sc.SetState(SCE_AU3_KEYWORD); + } + else if (keywords2.InList(s_save)) { + sc.ChangeState(SCE_AU3_FUNCTION); + sc.SetState(SCE_AU3_FUNCTION); + } + else if (keywords3.InList(s_save)) { + sc.ChangeState(SCE_AU3_MACRO); + sc.SetState(SCE_AU3_MACRO); + } + else if (keywords5.InList(s_save)) { + sc.ChangeState(SCE_AU3_PREPROCESSOR); + sc.SetState(SCE_AU3_PREPROCESSOR); + } + else if (keywords6.InList(s_save)) { + sc.ChangeState(SCE_AU3_SPECIAL); + sc.SetState(SCE_AU3_SPECIAL); + } + else if (keywords7.InList(s_save) && sc.atLineEnd) { + sc.ChangeState(SCE_AU3_EXPAND); + sc.SetState(SCE_AU3_EXPAND); + } + else { + sc.ChangeState(SCE_AU3_DEFAULT); + sc.SetState(SCE_AU3_DEFAULT); + } + } + if (sc.state == SCE_AU3_SENT) + { + // Send key string ended + if (sc.chPrev == '}' && sc.ch != '}') + { + // set color to SENDKEY when valid sendkey .. else set back to regular string + char sk[100]; + // split {111 222} and return {111} and check if 222 is valid. + // if return code = 1 then invalid 222 so must be string + if (GetSendKey(s_save,sk)) + { + sc.ChangeState(SCE_AU3_STRING); + } + // if single char between {?} then its ok as sendkey for a single character + else if (strlen(sk) == 3) + { + sc.ChangeState(SCE_AU3_SENT); + } + // if sendkey {111} is in table then ok as sendkey + else if (keywords4.InList(sk)) + { + sc.ChangeState(SCE_AU3_SENT); + } + else + { + sc.ChangeState(SCE_AU3_STRING); + } + sc.SetState(SCE_AU3_STRING); + } + // check if next portion is again a sendkey + if (sc.atLineEnd) + { + sc.ChangeState(SCE_AU3_STRING); + sc.SetState(SCE_AU3_DEFAULT); + } + } + //************************************* + sc.Complete(); } // @@ -352,32 +609,6 @@ static int GetStyleFirstWord(unsigned int szLine, Accessor &styler) } // GetStyleFirstWord() -// -// Routine to check the last "none comment" character on a line to see if its a continuation -// -static bool IsContinuationLine(unsigned int szLine, Accessor &styler) -{ - int nsPos = styler.LineStart(szLine); - int nePos = styler.LineStart(szLine+1) - 2; - //int stylech = styler.StyleAt(nsPos); - while (nsPos < nePos) - { - //stylech = styler.StyleAt(nePos); - int stylech = styler.StyleAt(nsPos); - if (!(stylech == SCE_AU3_COMMENT)) { - char ch = styler.SafeGetCharAt(nePos); - if (!isspacechar(ch)) { - if (ch == '_') - return true; - else - return false; - } - } - nePos--; // skip to next char - } // End While - return false; -} // IsContinuationLine() - // static void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) @@ -496,18 +727,18 @@ static void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Acc // create new fold for these words if (strcmp(szKeyword,"do") == 0 || strcmp(szKeyword,"for") == 0 || strcmp(szKeyword,"func") == 0 || strcmp(szKeyword,"while") == 0|| - strcmp(szKeyword,"#region") == 0 ) { + strcmp(szKeyword,"with") == 0 || strcmp(szKeyword,"#region") == 0 ) { levelNext++; } - // create double Fold for select because Case will subtract one of the current level - if (strcmp(szKeyword,"select") == 0) { + // create double Fold for select&switch because Case will subtract one of the current level + if (strcmp(szKeyword,"select") == 0 || strcmp(szKeyword,"switch") == 0) { levelNext++; levelNext++; } // end the fold for these words before the current line if (strcmp(szKeyword,"endfunc") == 0 || strcmp(szKeyword,"endif") == 0 || strcmp(szKeyword,"next") == 0 || strcmp(szKeyword,"until") == 0 || - strcmp(szKeyword,"wend") == 0){ + strcmp(szKeyword,"endwith") == 0 ||strcmp(szKeyword,"wend") == 0){ levelNext--; levelCurrent--; } @@ -517,7 +748,7 @@ static void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Acc levelCurrent--; } // end the double fold for this word before the current line - if (strcmp(szKeyword,"endselect") == 0 ) { + if (strcmp(szKeyword,"endselect") == 0 || strcmp(szKeyword,"endswitch") == 0 ) { levelNext--; levelNext--; levelCurrent--; @@ -609,6 +840,7 @@ static const char * const AU3WordLists[] = { "#autoit Sent keys", "#autoit Pre-processors", "#autoit Special", + "#autoit Expand", 0 }; LexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists); diff --git a/contrib/src/stc/scintilla/src/LexAVE.cxx b/contrib/src/stc/scintilla/src/LexAVE.cxx index 900aea317c..e30ee7dc9e 100644 --- a/contrib/src/stc/scintilla/src/LexAVE.cxx +++ b/contrib/src/stc/scintilla/src/LexAVE.cxx @@ -12,7 +12,6 @@ #include #include #include -#include #include "Platform.h" @@ -183,7 +182,9 @@ static void FoldAveDoc(unsigned int startPos, int length, int /* initStyle */, W if ((strcmp(s, "then") == 0) || (strcmp(s, "for") == 0) || (strcmp(s, "while") == 0)) { levelCurrent++; } - if ((strcmp(s, "end") == 0)) { + if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0)) { + // Normally "elseif" and "then" will be on the same line and will cancel + // each other out. // As implemented, this does not support fold.at.else. levelCurrent--; } } diff --git a/contrib/src/stc/scintilla/src/LexAsn1.cxx b/contrib/src/stc/scintilla/src/LexAsn1.cxx index be6c3f2aea..1600e6329d 100644 --- a/contrib/src/stc/scintilla/src/LexAsn1.cxx +++ b/contrib/src/stc/scintilla/src/LexAsn1.cxx @@ -178,4 +178,4 @@ static const char * const asn1WordLists[] = { 0, }; -LexerModule lmAsn1(SCLEX_ASN1, ColouriseAsn1Doc, "asn1", FoldAsn1Doc, asn1WordLists); +LexerModule lmAns1(SCLEX_ASN1, ColouriseAsn1Doc, "asn1", FoldAsn1Doc, asn1WordLists); diff --git a/contrib/src/stc/scintilla/src/LexBash.cxx b/contrib/src/stc/scintilla/src/LexBash.cxx index abd02c46b3..903d793bb0 100644 --- a/contrib/src/stc/scintilla/src/LexBash.cxx +++ b/contrib/src/stc/scintilla/src/LexBash.cxx @@ -2,7 +2,7 @@ /** @file LexBash.cxx ** Lexer for Bash. **/ -// Copyright 2004 by Neil Hodgson +// Copyright 2004-2005 by Neil Hodgson // Adapted from LexPerl by Kein-Hong Man 2004 // The License.txt file describes the conditions under which this software may be distributed. @@ -144,6 +144,9 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, char *Delimiter; // the Delimiter, 256: sizeof PL_tokenbuf HereDocCls() { State = 0; + Quote = 0; + Quoted = false; + Indent = 0; DelimiterLength = 0; Delimiter = new char[HERE_DELIM_MAX]; Delimiter[0] = '\0'; @@ -442,7 +445,7 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, HereDoc.Quoted = false; HereDoc.DelimiterLength = 0; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; - if (chNext == '\'') { // a quoted here-doc delimiter (' only) + if (chNext == '\'' || chNext == '\"') { // a quoted here-doc delimiter (' or ") i++; ch = chNext; chNext = chNext2; @@ -451,8 +454,9 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, HereDoc.Indent = true; HereDoc.State = 0; } else if (isalpha(chNext) || chNext == '_' || chNext == '\\' - || chNext == '-' || chNext == '+') { + || chNext == '-' || chNext == '+' || chNext == '!') { // an unquoted here-doc delimiter, no special handling + // TODO check what exactly bash considers part of the delim } else if (chNext == '<') { // HERE string <<< i++; ch = chNext; @@ -486,7 +490,7 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; } } else { // an unquoted here-doc delimiter - if (isalnum(ch) || ch == '_' || ch == '-' || ch == '+') { + if (isalnum(ch) || ch == '_' || ch == '-' || ch == '+' || ch == '!') { HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; } else if (ch == '\\') { @@ -582,6 +586,19 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, styler.ColourTo(lengthDoc - 1, state); } +static bool IsCommentLine(int line, Accessor &styler) { + int pos = styler.LineStart(line); + int eol_pos = styler.LineStart(line + 1) - 1; + for (int i = pos; i < eol_pos; i++) { + char ch = styler[i]; + if (ch == '#') + return true; + else if (ch != ' ' && ch != '\t') + return false; + } + return false; +} + static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; @@ -599,16 +616,16 @@ static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[], int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); - if (foldComment && (style == SCE_SH_COMMENTLINE)) { - if ((ch == '/') && (chNext == '/')) { - char chNext2 = styler.SafeGetCharAt(i + 2); - if (chNext2 == '{') { - levelCurrent++; - } else if (chNext2 == '}') { - levelCurrent--; - } - } - } + // Comment folding + if (foldComment && atEOL && IsCommentLine(lineCurrent, styler)) + { + if (!IsCommentLine(lineCurrent - 1, styler) + && IsCommentLine(lineCurrent + 1, styler)) + levelCurrent++; + else if (IsCommentLine(lineCurrent - 1, styler) + && !IsCommentLine(lineCurrent+1, styler)) + levelCurrent--; + } if (style == SCE_C_OPERATOR) { if (ch == '{') { levelCurrent++; diff --git a/contrib/src/stc/scintilla/src/LexBasic.cxx b/contrib/src/stc/scintilla/src/LexBasic.cxx new file mode 100644 index 0000000000..4a1843aa0d --- /dev/null +++ b/contrib/src/stc/scintilla/src/LexBasic.cxx @@ -0,0 +1,364 @@ +// Scintilla source code edit control +/** @file LexBasic.cxx + ** Lexer for BlitzBasic and PureBasic. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +// This tries to be a unified Lexer/Folder for all the BlitzBasic/BlitzMax/PurBasic basics +// and derivatives. Once they diverge enough, might want to split it into multiple +// lexers for more code clearity. +// +// Mail me (elias users sf net) for any bugs. + +// Folding only works for simple things like functions or types. + +// You may want to have a look at my ctags lexer as well, if you additionally to coloring +// and folding need to extract things like label tags in your editor. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +/* Bits: + * 1 - whitespace + * 2 - operator + * 4 - identifier + * 8 - decimal digit + * 16 - hex digit + * 32 - bin digit + */ +static int character_classification[128] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 2, + 60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2, + 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, + 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0 +}; + +static bool IsSpace(int c) { + return c < 128 && (character_classification[c] & 1); +} + +static bool IsOperator(int c) { + return c < 128 && (character_classification[c] & 2); +} + +static bool IsIdentifier(int c) { + return c < 128 && (character_classification[c] & 4); +} + +static bool IsDigit(int c) { + return c < 128 && (character_classification[c] & 8); +} + +static bool IsHexDigit(int c) { + return c < 128 && (character_classification[c] & 16); +} + +static bool IsBinDigit(int c) { + return c < 128 && (character_classification[c] & 32); +} + +static int LowerCase(int c) +{ + if (c >= 'A' && c <= 'Z') + return 'a' + c - 'A'; + return c; +} + +static void ColouriseBasicDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler, char comment_char) { + bool wasfirst = true, isfirst = true; // true if first token in a line + styler.StartAt(startPos); + + StyleContext sc(startPos, length, initStyle, styler); + + // Can't use sc.More() here else we miss the last character + for (; ; sc.Forward()) { + if (sc.state == SCE_B_IDENTIFIER) { + if (!IsIdentifier(sc.ch)) { + // Labels + if (wasfirst && sc.Match(':')) { + sc.ChangeState(SCE_B_LABEL); + sc.ForwardSetState(SCE_B_DEFAULT); + } else { + char s[100]; + int kstates[4] = { + SCE_B_KEYWORD, + SCE_B_KEYWORD2, + SCE_B_KEYWORD3, + SCE_B_KEYWORD4, + }; + sc.GetCurrentLowered(s, sizeof(s)); + for (int i = 0; i < 4; i++) { + if (keywordlists[i]->InList(s)) { + sc.ChangeState(kstates[i]); + } + } + // Types, must set them as operator else they will be + // matched as number/constant + if (sc.Match('.') || sc.Match('$') || sc.Match('%') || + sc.Match('#')) { + sc.SetState(SCE_B_OPERATOR); + } else { + sc.SetState(SCE_B_DEFAULT); + } + } + } + } else if (sc.state == SCE_B_OPERATOR) { + if (!IsOperator(sc.ch) || sc.Match('#')) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_LABEL) { + if (!IsIdentifier(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_CONSTANT) { + if (!IsIdentifier(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_NUMBER) { + if (!IsDigit(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_HEXNUMBER) { + if (!IsHexDigit(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_BINNUMBER) { + if (!IsBinDigit(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_STRING) { + if (sc.ch == '"') { + sc.ForwardSetState(SCE_B_DEFAULT); + } + if (sc.atLineEnd) { + sc.ChangeState(SCE_B_ERROR); + sc.SetState(SCE_B_DEFAULT); + } + } else if (sc.state == SCE_B_COMMENT) { + if (sc.atLineEnd) { + sc.SetState(SCE_B_DEFAULT); + } + } + + if (sc.atLineStart) + isfirst = true; + + if (sc.state == SCE_B_DEFAULT || sc.state == SCE_B_ERROR) { + if (isfirst && sc.Match('.')) { + sc.SetState(SCE_B_LABEL); + } else if (isfirst && sc.Match('#')) { + wasfirst = isfirst; + sc.SetState(SCE_B_IDENTIFIER); + } else if (sc.Match(comment_char)) { + sc.SetState(SCE_B_COMMENT); + } else if (sc.Match('"')) { + sc.SetState(SCE_B_STRING); + } else if (IsDigit(sc.ch)) { + sc.SetState(SCE_B_NUMBER); + } else if (sc.Match('$')) { + sc.SetState(SCE_B_HEXNUMBER); + } else if (sc.Match('%')) { + sc.SetState(SCE_B_BINNUMBER); + } else if (sc.Match('#')) { + sc.SetState(SCE_B_CONSTANT); + } else if (IsOperator(sc.ch)) { + sc.SetState(SCE_B_OPERATOR); + } else if (IsIdentifier(sc.ch)) { + wasfirst = isfirst; + sc.SetState(SCE_B_IDENTIFIER); + } else if (!IsSpace(sc.ch)) { + sc.SetState(SCE_B_ERROR); + } + } + + if (!IsSpace(sc.ch)) + isfirst = false; + + if (!sc.More()) + break; + } + sc.Complete(); +} + +static int CheckBlitzFoldPoint(char const *token, int &level) { + if (!strcmp(token, "function") || + !strcmp(token, "type")) { + level |= SC_FOLDLEVELHEADERFLAG; + return 1; + } + if (!strcmp(token, "end function") || + !strcmp(token, "end type")) { + return -1; + } + return 0; +} + +static int CheckPureFoldPoint(char const *token, int &level) { + if (!strcmp(token, "procedure") || + !strcmp(token, "enumeration") || + !strcmp(token, "interface") || + !strcmp(token, "structure")) { + level |= SC_FOLDLEVELHEADERFLAG; + return 1; + } + if (!strcmp(token, "endprocedure") || + !strcmp(token, "endenumeration") || + !strcmp(token, "endinterface") || + !strcmp(token, "endstructure")) { + return -1; + } + return 0; +} + +static int CheckFreeFoldPoint(char const *token, int &level) { + if (!strcmp(token, "function") || + !strcmp(token, "sub") || + !strcmp(token, "type")) { + level |= SC_FOLDLEVELHEADERFLAG; + return 1; + } + if (!strcmp(token, "end function") || + !strcmp(token, "end sub") || + !strcmp(token, "end type")) { + return -1; + } + return 0; +} + +static void FoldBasicDoc(unsigned int startPos, int length, + Accessor &styler, int (*CheckFoldPoint)(char const *, int &)) { + int line = styler.GetLine(startPos); + int level = styler.LevelAt(line); + int go = 0, done = 0; + int endPos = startPos + length; + char word[256]; + int wordlen = 0; + int i; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + // Scan for tokens at the start of the line (they may include + // whitespace, for tokens like "End Function" + for (i = startPos; i < endPos; i++) { + int c = styler.SafeGetCharAt(i); + if (!done && !go) { + if (wordlen) { // are we scanning a token already? + word[wordlen] = static_cast(LowerCase(c)); + if (!IsIdentifier(c)) { // done with token + word[wordlen] = '\0'; + go = CheckFoldPoint(word, level); + if (!go) { + // Treat any whitespace as single blank, for + // things like "End Function". + if (IsSpace(c) && IsIdentifier(word[wordlen - 1])) { + word[wordlen] = ' '; + if (wordlen < 255) + wordlen++; + } + else // done with this line + done = 1; + } + } else if (wordlen < 255) { + wordlen++; + } + } else { // start scanning at first non-whitespace character + if (!IsSpace(c)) { + if (IsIdentifier(c)) { + word[0] = static_cast(LowerCase(c)); + wordlen = 1; + } else // done with this line + done = 1; + } + } + } + if (c == '\n') { // line end + if (!done && wordlen == 0 && foldCompact) // line was only space + level |= SC_FOLDLEVELWHITEFLAG; + if (level != styler.LevelAt(line)) + styler.SetLevel(line, level); + level += go; + line++; + // reset state + wordlen = 0; + level &= ~SC_FOLDLEVELHEADERFLAG; + level &= ~SC_FOLDLEVELWHITEFLAG; + go = 0; + done = 0; + } + } +} + +static void ColouriseBlitzBasicDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + ColouriseBasicDoc(startPos, length, initStyle, keywordlists, styler, ';'); +} + +static void ColourisePureBasicDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + ColouriseBasicDoc(startPos, length, initStyle, keywordlists, styler, ';'); +} + +static void ColouriseFreeBasicDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + ColouriseBasicDoc(startPos, length, initStyle, keywordlists, styler, '\''); +} + +static void FoldBlitzBasicDoc(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) { + FoldBasicDoc(startPos, length, styler, CheckBlitzFoldPoint); +} + +static void FoldPureBasicDoc(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) { + FoldBasicDoc(startPos, length, styler, CheckPureFoldPoint); +} + +static void FoldFreeBasicDoc(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) { + FoldBasicDoc(startPos, length, styler, CheckFreeFoldPoint); +} + +static const char * const blitzbasicWordListDesc[] = { + "BlitzBasic Keywords", + "user1", + "user2", + "user3", + 0 +}; + +static const char * const purebasicWordListDesc[] = { + "PureBasic Keywords", + "PureBasic PreProcessor Keywords", + "user defined 1", + "user defined 2", + 0 +}; + +static const char * const freebasicWordListDesc[] = { + "FreeBasic Keywords", + "FreeBasic PreProcessor Keywords", + "user defined 1", + "user defined 2", + 0 +}; + +LexerModule lmBlitzBasic(SCLEX_BLITZBASIC, ColouriseBlitzBasicDoc, "blitzbasic", + FoldBlitzBasicDoc, blitzbasicWordListDesc); + +LexerModule lmPureBasic(SCLEX_PUREBASIC, ColourisePureBasicDoc, "purebasic", + FoldPureBasicDoc, purebasicWordListDesc); + +LexerModule lmFreeBasic(SCLEX_FREEBASIC, ColouriseFreeBasicDoc, "freebasic", + FoldFreeBasicDoc, freebasicWordListDesc); + diff --git a/contrib/src/stc/scintilla/src/LexCLW.cxx b/contrib/src/stc/scintilla/src/LexCLW.cxx index e5240776cc..e28e4b13b4 100644 --- a/contrib/src/stc/scintilla/src/LexCLW.cxx +++ b/contrib/src/stc/scintilla/src/LexCLW.cxx @@ -1,15 +1,16 @@ // Scintilla source code edit control /** @file LexClw.cxx ** Lexer for Clarion. + ** 2004/12/17 Updated Lexer **/ -// Copyright 2003 by Ron Schofield +// Copyright 2003-2004 by Ron Schofield // The License.txt file describes the conditions under which this software may be distributed. #include #include -#include #include #include +#include #include "Platform.h" @@ -20,37 +21,53 @@ #include "Scintilla.h" #include "SciLexer.h" -static char MakeUpperCase(char ch) { - if (ch < 'a' || ch > 'z') - return ch; - else - return static_cast(ch - 'a' + 'A'); +// Is an end of line character +inline bool IsEOL(const int ch) { + + return(ch == '\n'); +} + +// Convert character to uppercase +static char CharacterUpper(char chChar) { + + if (chChar < 'a' || chChar > 'z') { + return(chChar); + } + else { + return(static_cast(chChar - 'a' + 'A')); + } } -static void MakeUpperCaseString(char *s) { - while (*s) { - *s = MakeUpperCase(*s); - s++; +// Convert string to uppercase +static void StringUpper(char *szString) { + + while (*szString) { + *szString = CharacterUpper(*szString); + szString++; } } // Is a label start character inline bool IsALabelStart(const int iChar) { + return(isalpha(iChar) || iChar == '_'); } // Is a label character inline bool IsALabelCharacter(const int iChar) { - return(isalnum(iChar) || iChar == '_' || iChar == ':'); + + return(isalnum(iChar) || iChar == '_' || iChar == ':'); } -// Is the character is a ! and the the next character is not a ! -inline bool IsACommentStart(StyleContext &scDoc) { - return(scDoc.ch == '!' && scDoc.chNext != '!'); +// Is the character is a ! and the the next character is not a ! +inline bool IsACommentStart(const int iChar) { + + return(iChar == '!'); } // Is the character a Clarion hex character (ABCDEF) inline bool IsAHexCharacter(const int iChar, bool bCaseSensitive) { + // Case insensitive. if (!bCaseSensitive) { if (strchr("ABCDEFabcdef", iChar) != NULL) { @@ -68,6 +85,7 @@ inline bool IsAHexCharacter(const int iChar, bool bCaseSensitive) { // Is the character a Clarion base character (B=Binary, O=Octal, H=Hex) inline bool IsANumericBaseCharacter(const int iChar, bool bCaseSensitive) { + // Case insensitive. if (!bCaseSensitive) { // If character is a numeric base character @@ -87,8 +105,9 @@ inline bool IsANumericBaseCharacter(const int iChar, bool bCaseSensitive) { // Set the correct numeric constant state inline bool SetNumericConstantState(StyleContext &scDoc) { + int iPoints = 0; // Point counter - char cNumericString[100]; // Numeric string buffer + char cNumericString[512]; // Numeric string buffer // Buffer the current numberic string scDoc.GetCurrent(cNumericString, sizeof(cNumericString)); @@ -103,7 +122,7 @@ inline bool SetNumericConstantState(StyleContext &scDoc) { break; default : break; - } + } } // If points found (can be more than one for improper formatted number if (iPoints > 0) { @@ -115,18 +134,68 @@ inline bool SetNumericConstantState(StyleContext &scDoc) { } } +// Get the next word in uppercase from the current position (keyword lookahead) +inline bool GetNextWordUpper(Accessor &styler, unsigned int uiStartPos, int iLength, char *cWord) { + + unsigned int iIndex = 0; // Buffer Index + + // Loop through the remaining string from the current position + for (int iOffset = uiStartPos; iOffset < iLength; iOffset++) { + // Get the character from the buffer using the offset + char cCharacter = styler[iOffset]; + if (IsEOL(cCharacter)) { + break; + } + // If the character is alphabet character + if (isalpha(cCharacter)) { + // Add UPPERCASE character to the word buffer + cWord[iIndex++] = CharacterUpper(cCharacter); + } + } + // Add null termination + cWord[iIndex] = '\0'; + // If no word was found + if (iIndex == 0) { + // Return failure + return(false); + } + // Else word was found + else { + // Return success + return(true); + } +} + // Clarion Language Colouring Procedure -static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler, bool bCaseSensitive) { +static void ColouriseClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler, bool bCaseSensitive) { + + int iParenthesesLevel = 0; // Parenthese Level + int iColumn1Label = false; // Label starts in Column 1 + + WordList &wlClarionKeywords = *wlKeywords[0]; // Clarion Keywords + WordList &wlCompilerDirectives = *wlKeywords[1]; // Compiler Directives + WordList &wlRuntimeExpressions = *wlKeywords[2]; // Runtime Expressions + WordList &wlBuiltInProcsFuncs = *wlKeywords[3]; // Builtin Procedures and Functions + WordList &wlStructsDataTypes = *wlKeywords[4]; // Structures and Data Types + WordList &wlAttributes = *wlKeywords[5]; // Procedure Attributes + WordList &wlStandardEquates = *wlKeywords[6]; // Standard Equates + WordList &wlLabelReservedWords = *wlKeywords[7]; // Clarion Reserved Keywords (Labels) + WordList &wlProcLabelReservedWords = *wlKeywords[8]; // Clarion Reserved Keywords (Procedure Labels) - int iParenthesesLevel=0; // Parenthese Level + const char wlProcReservedKeywordList[] = + "PROCEDURE FUNCTION"; + WordList wlProcReservedKeywords; + wlProcReservedKeywords.Set(wlProcReservedKeywordList); - WordList &wlClarionKeywords = *wlKeywords[0]; // Clarion Keywords - WordList &wlCompilerDirectives = *wlKeywords[1]; // Compiler Directives - WordList &wlBuiltInProcsFuncs = *wlKeywords[2]; // Builtin Procedures and Functions - WordList &wlStructsDataTypes = *wlKeywords[3]; // Structures and Data Types - WordList &wlAttributes = *wlKeywords[4]; // Procedure Attributes - WordList &wlStandardEquates = *wlKeywords[5]; // Standard Equates - WordList &wlReservedWords = *wlKeywords[6]; // Clarion Reserved Keywords + const char wlCompilerKeywordList[] = + "COMPILE OMIT"; + WordList wlCompilerKeywords; + wlCompilerKeywords.Set(wlCompilerKeywordList); + + const char wlLegacyStatementsList[] = + "BOF EOF FUNCTION POINTER SHARE"; + WordList wlLegacyStatements; + wlLegacyStatements.Set(wlLegacyStatementsList); StyleContext scDoc(uiStartPos, iLength, iInitStyle, accStyler); @@ -143,26 +212,45 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle if (!IsALabelCharacter(scDoc.ch)) { // If the character is a . (dot syntax) if (scDoc.ch == '.') { + // Turn off column 1 label flag as label now cannot be reserved work + iColumn1Label = false; // Uncolour the . (dot) to default state, move forward one character, // and change back to the label state. scDoc.SetState(SCE_CLW_DEFAULT); scDoc.Forward(); scDoc.SetState(SCE_CLW_LABEL); } - // Else terminate the label state + // Else check label else { - char cLabel[100]; // Label buffer + char cLabel[512]; // Label buffer // Buffer the current label string scDoc.GetCurrent(cLabel,sizeof(cLabel)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { - MakeUpperCaseString(cLabel); + StringUpper(cLabel); } - // If label string is in the Clarion reserved keyword list - if (wlReservedWords.InList(cLabel)){ - // change to error state + // Else if UPPERCASE label string is in the Clarion compiler keyword list + if (wlCompilerKeywords.InList(cLabel) && iColumn1Label){ + // change the label to error state + scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); + } + // Else if UPPERCASE label string is in the Clarion reserved keyword list + else if (wlLabelReservedWords.InList(cLabel) && iColumn1Label){ + // change the label to error state scDoc.ChangeState(SCE_CLW_ERROR); } + // Else if UPPERCASE label string is + else if (wlProcLabelReservedWords.InList(cLabel) && iColumn1Label) { + char cWord[512]; // Word buffer + // Get the next word from the current position + if (GetNextWordUpper(accStyler,scDoc.currentPos,uiStartPos+iLength,cWord)) { + // If the next word is a procedure reserved word + if (wlProcReservedKeywords.InList(cWord)) { + // Change the label to error state + scDoc.ChangeState(SCE_CLW_ERROR); + } + } + } // Else if label string is in the compiler directive keyword list else if (wlCompilerDirectives.InList(cLabel)) { // change the state to compiler directive state @@ -177,14 +265,14 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle else if (scDoc.state == SCE_CLW_KEYWORD) { // If character is : (colon) if (scDoc.ch == ':') { - char cEquate[100]; // Equate buffer + char cEquate[512]; // Equate buffer // Move forward to include : (colon) in buffer scDoc.Forward(); // Buffer the equate string scDoc.GetCurrent(cEquate,sizeof(cEquate)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { - MakeUpperCaseString(cEquate); + StringUpper(cEquate); } // If statement string is in the equate list if (wlStandardEquates.InList(cEquate)) { @@ -194,43 +282,58 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle } // If the character is not a valid label character else if (!IsALabelCharacter(scDoc.ch)) { - char cStatement[100]; // Statement buffer + char cStatement[512]; // Statement buffer // Buffer the statement string scDoc.GetCurrent(cStatement,sizeof(cStatement)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { - MakeUpperCaseString(cStatement); + StringUpper(cStatement); } // If statement string is in the Clarion keyword list if (wlClarionKeywords.InList(cStatement)) { - // Set to the Clarion keyword state + // Change the statement string to the Clarion keyword state scDoc.ChangeState(SCE_CLW_KEYWORD); } // Else if statement string is in the compiler directive keyword list else if (wlCompilerDirectives.InList(cStatement)) { - // Set to the compiler directive state + // Change the statement string to the compiler directive state scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); } + // Else if statement string is in the runtime expressions keyword list + else if (wlRuntimeExpressions.InList(cStatement)) { + // Change the statement string to the runtime expressions state + scDoc.ChangeState(SCE_CLW_RUNTIME_EXPRESSIONS); + } // Else if statement string is in the builtin procedures and functions keyword list else if (wlBuiltInProcsFuncs.InList(cStatement)) { - // Set to the builtin procedures and functions state + // Change the statement string to the builtin procedures and functions state scDoc.ChangeState(SCE_CLW_BUILTIN_PROCEDURES_FUNCTION); } // Else if statement string is in the tructures and data types keyword list else if (wlStructsDataTypes.InList(cStatement)) { - // Set to the structures and data types state + // Change the statement string to the structures and data types state scDoc.ChangeState(SCE_CLW_STRUCTURE_DATA_TYPE); } // Else if statement string is in the procedure attribute keyword list else if (wlAttributes.InList(cStatement)) { - // Set to the procedure attribute state + // Change the statement string to the procedure attribute state scDoc.ChangeState(SCE_CLW_ATTRIBUTE); } // Else if statement string is in the standard equate keyword list else if (wlStandardEquates.InList(cStatement)) { - // Set to the standard equate state + // Change the statement string to the standard equate state scDoc.ChangeState(SCE_CLW_STANDARD_EQUATE); } + // Else if statement string is in the deprecated or legacy keyword list + else if (wlLegacyStatements.InList(cStatement)) { + // Change the statement string to the standard equate state + scDoc.ChangeState(SCE_CLW_DEPRECATED); + } + // Else the statement string doesn't match any work list + else { + // Change the statement string to the default state + scDoc.ChangeState(SCE_CLW_DEFAULT); + } // Terminate the keyword state and set to default state scDoc.SetState(SCE_CLW_DEFAULT); } @@ -261,13 +364,13 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle // Increment the parenthese level iParenthesesLevel++; } - // Else if the character is a ) (close parenthese) + // Else if the character is a ) (close parenthese) else if (scDoc.ch == ')') { // If the parenthese level is set to zero // parentheses matched if (!iParenthesesLevel) { scDoc.SetState(SCE_CLW_DEFAULT); - } + } // Else parenthese level is greater than zero // still looking for matching parentheses else { @@ -292,7 +395,7 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle || IsAHexCharacter(scDoc.ch, bCaseSensitive) || scDoc.ch == '.' || IsANumericBaseCharacter(scDoc.ch, bCaseSensitive))) { - // If the number was a real + // If the number was a real if (SetNumericConstantState(scDoc)) { // Colour the matched string to the real constant state scDoc.ChangeState(SCE_CLW_REAL_CONSTANT); @@ -313,8 +416,13 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle // Beginning of Line Handling if (scDoc.atLineStart) { + // Reset the column 1 label flag + iColumn1Label = false; // If column 1 character is a label start character if (IsALabelStart(scDoc.ch)) { + // Label character is found in column 1 + // so set column 1 label flag and clear last column 1 label + iColumn1Label = true; // Set the state to label scDoc.SetState(SCE_CLW_LABEL); } @@ -323,8 +431,8 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle // Set to default state scDoc.SetState(SCE_CLW_DEFAULT); } - // else if the start of a comment or is an * (asterisk) - else if (IsACommentStart(scDoc) || scDoc.ch == '*' ) { + // else if comment start (!) or is an * (asterisk) + else if (IsACommentStart(scDoc.ch) || scDoc.ch == '*' ) { // then set the state to comment. scDoc.SetState(SCE_CLW_COMMENT); } @@ -349,7 +457,7 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle } // Default Handling else { - // If in default state + // If in default state if (scDoc.state == SCE_CLW_DEFAULT) { // If is a letter could be a possible statement if (isalpha(scDoc.ch)) { @@ -362,13 +470,13 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle scDoc.SetState(SCE_CLW_INTEGER_CONSTANT); } // else if the start of a comment or a | (line continuation) - else if (IsACommentStart(scDoc) || scDoc.ch == '|') { + else if (IsACommentStart(scDoc.ch) || scDoc.ch == '|') { // then set the state to comment. scDoc.SetState(SCE_CLW_COMMENT); - } + } // else if the character is a ' (single quote) else if (scDoc.ch == '\'') { - // If the character is also a ' (single quote) + // If the character is also a ' (single quote) // Embedded Apostrophe if (scDoc.chNext == '\'') { // Move forward colouring it as default state @@ -378,8 +486,8 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle // move to the next character and then set the state to comment. scDoc.ForwardSetState(SCE_CLW_STRING); } - } - // else the character is an @ (apersand) + } + // else the character is an @ (ampersand) else if (scDoc.ch == '@') { // Case insensitive. if (!bCaseSensitive) { @@ -397,7 +505,7 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle scDoc.SetState(SCE_CLW_PICTURE_STRING); } } - } + } } } } @@ -406,36 +514,162 @@ static void ColouriseClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle } // Clarion Language Case Sensitive Colouring Procedure -static void ColouriseClwDocSensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { - ColouriseClwDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, true); +static void ColouriseClarionDocSensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { + + ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, true); } // Clarion Language Case Insensitive Colouring Procedure -static void ColouriseClwDocInsensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { - ColouriseClwDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, false); +static void ColouriseClarionDocInsensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { + + ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, false); +} + +// Fill Buffer + +static void FillBuffer(unsigned int uiStart, unsigned int uiEnd, Accessor &accStyler, char *szBuffer, unsigned int uiLength) { + + unsigned int uiPos = 0; + + while ((uiPos < uiEnd - uiStart + 1) && (uiPos < uiLength-1)) { + szBuffer[uiPos] = static_cast(toupper(accStyler[uiStart + uiPos])); + uiPos++; + } + szBuffer[uiPos] = '\0'; +} + +// Classify Clarion Fold Point + +static int ClassifyClarionFoldPoint(int iLevel, const char* szString) { + + if (!(isdigit(szString[0]) || (szString[0] == '.'))) { + if (strcmp(szString, "PROCEDURE") == 0) { + // iLevel = SC_FOLDLEVELBASE + 1; + } + else if (strcmp(szString, "MAP") == 0 || + strcmp(szString,"ACCEPT") == 0 || + strcmp(szString,"BEGIN") == 0 || + strcmp(szString,"CASE") == 0 || + strcmp(szString,"EXECUTE") == 0 || + strcmp(szString,"IF") == 0 || + strcmp(szString,"ITEMIZE") == 0 || + strcmp(szString,"INTERFACE") == 0 || + strcmp(szString,"JOIN") == 0 || + strcmp(szString,"LOOP") == 0 || + strcmp(szString,"MODULE") == 0 || + strcmp(szString,"RECORD") == 0) { + iLevel++; + } + else if (strcmp(szString, "APPLICATION") == 0 || + strcmp(szString, "CLASS") == 0 || + strcmp(szString, "DETAIL") == 0 || + strcmp(szString, "FILE") == 0 || + strcmp(szString, "FOOTER") == 0 || + strcmp(szString, "FORM") == 0 || + strcmp(szString, "GROUP") == 0 || + strcmp(szString, "HEADER") == 0 || + strcmp(szString, "INTERFACE") == 0 || + strcmp(szString, "MENU") == 0 || + strcmp(szString, "MENUBAR") == 0 || + strcmp(szString, "OLE") == 0 || + strcmp(szString, "OPTION") == 0 || + strcmp(szString, "QUEUE") == 0 || + strcmp(szString, "REPORT") == 0 || + strcmp(szString, "SHEET") == 0 || + strcmp(szString, "TAB") == 0 || + strcmp(szString, "TOOLBAR") == 0 || + strcmp(szString, "VIEW") == 0 || + strcmp(szString, "WINDOW") == 0) { + iLevel++; + } + else if (strcmp(szString, "END") == 0 || + strcmp(szString, "UNTIL") == 0 || + strcmp(szString, "WHILE") == 0) { + iLevel--; + } + } + return(iLevel); } // Clarion Language Folding Procedure -#ifdef FOLDING_IMPLEMENTED -static void FoldClwDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { +static void FoldClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *[], Accessor &accStyler) { + + unsigned int uiEndPos = uiStartPos + iLength; + int iLineCurrent = accStyler.GetLine(uiStartPos); + int iLevelPrev = accStyler.LevelAt(iLineCurrent) & SC_FOLDLEVELNUMBERMASK; + int iLevelCurrent = iLevelPrev; + char chNext = accStyler[uiStartPos]; + int iStyle = iInitStyle; + int iStyleNext = accStyler.StyleAt(uiStartPos); + int iVisibleChars = 0; + int iLastStart = 0; + + for (unsigned int uiPos = uiStartPos; uiPos < uiEndPos; uiPos++) { + + char chChar = chNext; + chNext = accStyler.SafeGetCharAt(uiPos + 1); + int iStylePrev = iStyle; + iStyle = iStyleNext; + iStyleNext = accStyler.StyleAt(uiPos + 1); + bool bEOL = (chChar == '\r' && chNext != '\n') || (chChar == '\n'); + + if (iStylePrev == SCE_CLW_DEFAULT) { + if (iStyle == SCE_CLW_KEYWORD || iStyle == SCE_CLW_STRUCTURE_DATA_TYPE) { + // Store last word start point. + iLastStart = uiPos; + } + } + + if (iStylePrev == SCE_CLW_KEYWORD || iStylePrev == SCE_CLW_STRUCTURE_DATA_TYPE) { + if(iswordchar(chChar) && !iswordchar(chNext)) { + char chBuffer[100]; + FillBuffer(iLastStart, uiPos, accStyler, chBuffer, sizeof(chBuffer)); + iLevelCurrent = ClassifyClarionFoldPoint(iLevelCurrent,chBuffer); + // if ((iLevelCurrent == SC_FOLDLEVELBASE + 1) && iLineCurrent > 1) { + // accStyler.SetLevel(iLineCurrent-1,SC_FOLDLEVELBASE); + // iLevelPrev = SC_FOLDLEVELBASE; + // } + } + } + + if (bEOL) { + int iLevel = iLevelPrev; + if ((iLevelCurrent > iLevelPrev) && (iVisibleChars > 0)) + iLevel |= SC_FOLDLEVELHEADERFLAG; + if (iLevel != accStyler.LevelAt(iLineCurrent)) { + accStyler.SetLevel(iLineCurrent,iLevel); + } + iLineCurrent++; + iLevelPrev = iLevelCurrent; + iVisibleChars = 0; + } + + if (!isspacechar(chChar)) + iVisibleChars++; + } + // Fill in the real level of the next line, keeping the current flags + // as they will be filled in later. + int iFlagsNext = accStyler.LevelAt(iLineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + accStyler.SetLevel(iLineCurrent, iLevelPrev | iFlagsNext); } -#endif // Word List Descriptions static const char * const rgWordListDescriptions[] = { "Clarion Keywords", "Compiler Directives", "Built-in Procedures and Functions", + "Runtime Expressions", "Structure and Data Types", "Attributes", "Standard Equates", - "Reserved Words", + "Reserved Words (Labels)", + "Reserved Words (Procedure Labels)", 0, }; // Case Sensitive Clarion Language Lexer -LexerModule lmClw(SCLEX_CLW, ColouriseClwDocSensitive, "clw", NULL, rgWordListDescriptions); +LexerModule lmClw(SCLEX_CLW, ColouriseClarionDocSensitive, "clarion", FoldClarionDoc, rgWordListDescriptions); // Case Insensitive Clarion Language Lexer -LexerModule lmClwNoCase(SCLEX_CLWNOCASE, ColouriseClwDocInsensitive, "clwnocase", NULL, rgWordListDescriptions); +LexerModule lmClwNoCase(SCLEX_CLWNOCASE, ColouriseClarionDocInsensitive, "clarionnocase", FoldClarionDoc, rgWordListDescriptions); diff --git a/contrib/src/stc/scintilla/src/LexCPP.cxx b/contrib/src/stc/scintilla/src/LexCPP.cxx index c6ca065058..40f3a60bd3 100644 --- a/contrib/src/stc/scintilla/src/LexCPP.cxx +++ b/contrib/src/stc/scintilla/src/LexCPP.cxx @@ -1,8 +1,8 @@ // Scintilla source code edit control /** @file LexCPP.cxx - ** Lexer for C++, C, Java, and Javascript. + ** Lexer for C++, C, Java, and JavaScript. **/ -// Copyright 1998-2002 by Neil Hodgson +// Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include @@ -23,35 +23,30 @@ #define KEYWORD_BOXHEADER 1 #define KEYWORD_FOLDCONTRACTED 2 -static bool IsOKBeforeRE(const int ch) { +static bool IsOKBeforeRE(int ch) { return (ch == '(') || (ch == '=') || (ch == ','); } -static inline bool IsAWordChar(const int ch) { +static inline bool IsAWordChar(int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } -static inline bool IsAWordStart(const int ch) { - return (ch < 0x80) && (isalnum(ch) || ch == '_'); +static inline bool IsAWordStart(int ch) { + return (ch < 0x80) && (isalpha(ch) || ch == '_'); } -static inline bool IsADoxygenChar(const int ch) { - return (islower(ch) || ch == '$' || ch == '@' || - ch == '\\' || ch == '&' || ch == '<' || - ch == '>' || ch == '#' || ch == '{' || - ch == '}' || ch == '[' || ch == ']'); +static inline bool IsADoxygenChar(int ch) { + return (ch < 0x80 && islower(ch)) || ch == '$' || ch == '@' || + ch == '\\' || ch == '&' || ch == '<' || + ch == '>' || ch == '#' || ch == '{' || + ch == '}' || ch == '[' || ch == ']'; } -static inline bool IsStateComment(const int state) { - return ((state == SCE_C_COMMENT) || - (state == SCE_C_COMMENTLINE) || - (state == SCE_C_COMMENTDOC) || - (state == SCE_C_COMMENTDOCKEYWORD) || - (state == SCE_C_COMMENTDOCKEYWORDERROR)); -} - -static inline bool IsStateString(const int state) { - return ((state == SCE_C_STRING) || (state == SCE_C_VERBATIM)); +static bool IsSpaceEquiv(int state) { + return (state <= SCE_C_COMMENTDOC) || + // including SCE_C_DEFAULT, SCE_C_COMMENT, SCE_C_COMMENTLINE + (state == SCE_C_COMMENTLINEDOC) || (state == SCE_C_COMMENTDOCKEYWORD) || + (state == SCE_C_COMMENTDOCKEYWORDERROR); } static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], @@ -64,21 +59,52 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0; - // Do not leak onto next line - if (initStyle == SCE_C_STRINGEOL) - initStyle = SCE_C_DEFAULT; - int chPrevNonWhite = ' '; int visibleChars = 0; bool lastWordWasUUID = false; + int styleBeforeDCKeyword = SCE_C_DEFAULT; + bool continuationLine = false; + + if (initStyle == SCE_C_PREPROCESSOR) { + // Set continuationLine if last character of previous line is '\' + int lineCurrent = styler.GetLine(startPos); + if (lineCurrent > 0) { + int chBack = styler.SafeGetCharAt(startPos-1, 0); + int chBack2 = styler.SafeGetCharAt(startPos-2, 0); + int lineEndChar = '!'; + if (chBack2 == '\r' && chBack == '\n') { + lineEndChar = styler.SafeGetCharAt(startPos-3, 0); + } else if (chBack == '\n' || chBack == '\r') { + lineEndChar = chBack2; + } + continuationLine = lineEndChar == '\\'; + } + } + + // look back to set chPrevNonWhite properly for better regex colouring + if (startPos > 0) { + int back = startPos; + while (--back && IsSpaceEquiv(styler.StyleAt(back))) + ; + if (styler.StyleAt(back) == SCE_C_OPERATOR) { + chPrevNonWhite = styler.SafeGetCharAt(back); + } + } StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { - if (sc.atLineStart && (sc.state == SCE_C_STRING)) { - // Prevent SCE_C_STRINGEOL from leaking back to previous line - sc.SetState(SCE_C_STRING); + if (sc.atLineStart) { + if (sc.state == SCE_C_STRING) { + // Prevent SCE_C_STRINGEOL from leaking back to previous line which + // ends with a line continuation by locking in the state upto this position. + sc.SetState(SCE_C_STRING); + } + // Reset states to begining of colourise so no surprises + // if different sets of lines lexed. + visibleChars = 0; + lastWordWasUUID = false; } // Handle line continuation generically. @@ -88,124 +114,161 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } + continuationLine = true; continue; } } // Determine if the current state should terminate. - if (sc.state == SCE_C_OPERATOR) { - sc.SetState(SCE_C_DEFAULT); - } else if (sc.state == SCE_C_NUMBER) { - if (!IsAWordChar(sc.ch)) { - sc.SetState(SCE_C_DEFAULT); - } - } else if (sc.state == SCE_C_IDENTIFIER) { - if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { - char s[100]; - if (caseSensitive) { - sc.GetCurrent(s, sizeof(s)); - } else { - sc.GetCurrentLowered(s, sizeof(s)); - } - if (keywords.InList(s)) { - lastWordWasUUID = strcmp(s, "uuid") == 0; - sc.ChangeState(SCE_C_WORD); - } else if (keywords2.InList(s)) { - sc.ChangeState(SCE_C_WORD2); - } else if (keywords4.InList(s)) { - sc.ChangeState(SCE_C_GLOBALCLASS); - } + switch (sc.state) { + case SCE_C_OPERATOR: sc.SetState(SCE_C_DEFAULT); - } - } else if (sc.state == SCE_C_PREPROCESSOR) { - if (stylingWithinPreprocessor) { - if (IsASpace(sc.ch)) { + break; + case SCE_C_NUMBER: + // We accept almost anything because of hex. and number suffixes + if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_C_DEFAULT); } - } else { - if ((sc.ch == '\r') || (sc.ch == '\n') || (sc.Match('/', '*')) || (sc.Match('/', '/'))) { + break; + case SCE_C_IDENTIFIER: + if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { + char s[1000]; + if (caseSensitive) { + sc.GetCurrent(s, sizeof(s)); + } else { + sc.GetCurrentLowered(s, sizeof(s)); + } + if (keywords.InList(s)) { + lastWordWasUUID = strcmp(s, "uuid") == 0; + sc.ChangeState(SCE_C_WORD); + } else if (keywords2.InList(s)) { + sc.ChangeState(SCE_C_WORD2); + } else if (keywords4.InList(s)) { + sc.ChangeState(SCE_C_GLOBALCLASS); + } sc.SetState(SCE_C_DEFAULT); } - } - } else if (sc.state == SCE_C_COMMENT) { - if (sc.Match('*', '/')) { - sc.Forward(); - sc.ForwardSetState(SCE_C_DEFAULT); - } - } else if (sc.state == SCE_C_COMMENTDOC) { - if (sc.Match('*', '/')) { - sc.Forward(); - sc.ForwardSetState(SCE_C_DEFAULT); - } else if (sc.ch == '@' || sc.ch == '\\') { - sc.SetState(SCE_C_COMMENTDOCKEYWORD); - } - } else if (sc.state == SCE_C_COMMENTLINE || sc.state == SCE_C_COMMENTLINEDOC) { - if (sc.ch == '\r' || sc.ch == '\n') { - sc.SetState(SCE_C_DEFAULT); - visibleChars = 0; - } - } else if (sc.state == SCE_C_COMMENTDOCKEYWORD) { - if (sc.Match('*', '/')) { - sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); - sc.Forward(); - sc.ForwardSetState(SCE_C_DEFAULT); - } else if (!IsADoxygenChar(sc.ch)) { - char s[100]; - if (caseSensitive) { - sc.GetCurrent(s, sizeof(s)); + break; + case SCE_C_PREPROCESSOR: + if (sc.atLineStart && !continuationLine) { + sc.SetState(SCE_C_DEFAULT); + } else if (stylingWithinPreprocessor) { + if (IsASpace(sc.ch)) { + sc.SetState(SCE_C_DEFAULT); + } } else { - sc.GetCurrentLowered(s, sizeof(s)); - } - if (!isspace(sc.ch) || !keywords3.InList(s + 1)) { - sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); + if (sc.Match('/', '*') || sc.Match('/', '/')) { + sc.SetState(SCE_C_DEFAULT); + } } - sc.SetState(SCE_C_COMMENTDOC); - } - } else if (sc.state == SCE_C_STRING) { - if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { + break; + case SCE_C_COMMENT: + if (sc.Match('*', '/')) { sc.Forward(); + sc.ForwardSetState(SCE_C_DEFAULT); } - } else if (sc.ch == '\"') { - sc.ForwardSetState(SCE_C_DEFAULT); - } else if (sc.atLineEnd) { - sc.ChangeState(SCE_C_STRINGEOL); - sc.ForwardSetState(SCE_C_DEFAULT); - visibleChars = 0; - } - } else if (sc.state == SCE_C_CHARACTER) { - if (sc.atLineEnd) { - sc.ChangeState(SCE_C_STRINGEOL); - sc.ForwardSetState(SCE_C_DEFAULT); - visibleChars = 0; - } else if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { + break; + case SCE_C_COMMENTDOC: + if (sc.Match('*', '/')) { sc.Forward(); + sc.ForwardSetState(SCE_C_DEFAULT); + } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support + // Verify that we have the conditions to mark a comment-doc-keyword + if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) { + styleBeforeDCKeyword = SCE_C_COMMENTDOC; + sc.SetState(SCE_C_COMMENTDOCKEYWORD); + } } - } else if (sc.ch == '\'') { - sc.ForwardSetState(SCE_C_DEFAULT); - } - } else if (sc.state == SCE_C_REGEX) { - if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == '/') { - sc.ForwardSetState(SCE_C_DEFAULT); - } else if (sc.ch == '\\') { - // Gobble up the quoted character - if (sc.chNext == '\\' || sc.chNext == '/') { - sc.Forward(); + break; + case SCE_C_COMMENTLINE: + if (sc.atLineStart) { + sc.SetState(SCE_C_DEFAULT); } - } - } else if (sc.state == SCE_C_VERBATIM) { - if (sc.ch == '\"') { - if (sc.chNext == '\"') { + break; + case SCE_C_COMMENTLINEDOC: + if (sc.atLineStart) { + sc.SetState(SCE_C_DEFAULT); + } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support + // Verify that we have the conditions to mark a comment-doc-keyword + if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) { + styleBeforeDCKeyword = SCE_C_COMMENTLINEDOC; + sc.SetState(SCE_C_COMMENTDOCKEYWORD); + } + } + break; + case SCE_C_COMMENTDOCKEYWORD: + if ((styleBeforeDCKeyword == SCE_C_COMMENTDOC) && sc.Match('*', '/')) { + sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); sc.Forward(); - } else { sc.ForwardSetState(SCE_C_DEFAULT); + } else if (!IsADoxygenChar(sc.ch)) { + char s[100]; + if (caseSensitive) { + sc.GetCurrent(s, sizeof(s)); + } else { + sc.GetCurrentLowered(s, sizeof(s)); + } + if (!isspace(sc.ch) || !keywords3.InList(s + 1)) { + sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); + } + sc.SetState(styleBeforeDCKeyword); + } + break; + case SCE_C_STRING: + if (sc.atLineEnd) { + sc.ChangeState(SCE_C_STRINGEOL); + } else if (sc.ch == '\\') { + if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { + sc.Forward(); + } + } else if (sc.ch == '\"') { + sc.ForwardSetState(SCE_C_DEFAULT); + } + break; + case SCE_C_CHARACTER: + if (sc.atLineEnd) { + sc.ChangeState(SCE_C_STRINGEOL); + } else if (sc.ch == '\\') { + if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { + sc.Forward(); + } + } else if (sc.ch == '\'') { + sc.ForwardSetState(SCE_C_DEFAULT); + } + break; + case SCE_C_REGEX: + if (sc.atLineStart) { + sc.SetState(SCE_C_DEFAULT); + } else if (sc.ch == '/') { + sc.Forward(); + while ((sc.ch < 0x80) && islower(sc.ch)) + sc.Forward(); // gobble regex flags + sc.SetState(SCE_C_DEFAULT); + } else if (sc.ch == '\\') { + // Gobble up the quoted character + if (sc.chNext == '\\' || sc.chNext == '/') { + sc.Forward(); + } + } + break; + case SCE_C_STRINGEOL: + if (sc.atLineStart) { + sc.SetState(SCE_C_DEFAULT); + } + break; + case SCE_C_VERBATIM: + if (sc.ch == '\"') { + if (sc.chNext == '\"') { + sc.Forward(); + } else { + sc.ForwardSetState(SCE_C_DEFAULT); + } + } + break; + case SCE_C_UUID: + if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') { + sc.SetState(SCE_C_DEFAULT); } - } - } else if (sc.state == SCE_C_UUID) { - if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') { - sc.SetState(SCE_C_DEFAULT); - } } // Determine if a new state should be entered. @@ -241,7 +304,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo else sc.SetState(SCE_C_COMMENTLINE); } else if (sc.ch == '/' && IsOKBeforeRE(chPrevNonWhite)) { - sc.SetState(SCE_C_REGEX); + sc.SetState(SCE_C_REGEX); // JavaScript's RegEx } else if (sc.ch == '\"') { sc.SetState(SCE_C_STRING); } else if (sc.ch == '\'') { @@ -253,7 +316,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); - if (sc.ch == '\r' || sc.ch == '\n') { + if (sc.atLineEnd) { sc.SetState(SCE_C_DEFAULT); } } else if (isoperator(static_cast(sc.ch))) { @@ -261,26 +324,20 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo } } - if (sc.atLineEnd) { - // Reset states to begining of colourise so no surprises - // if different sets of lines lexed. - chPrevNonWhite = ' '; - visibleChars = 0; - lastWordWasUUID = false; - } - if (!IsASpace(sc.ch)) { + if (!IsASpace(sc.ch) && !IsSpaceEquiv(sc.state)) { chPrevNonWhite = sc.ch; visibleChars++; } + continuationLine = false; } sc.Complete(); } static bool IsStreamCommentStyle(int style) { return style == SCE_C_COMMENT || - style == SCE_C_COMMENTDOC || - style == SCE_C_COMMENTDOCKEYWORD || - style == SCE_C_COMMENTDOCKEYWORDERROR; + style == SCE_C_COMMENTDOC || + style == SCE_C_COMMENTDOCKEYWORD || + style == SCE_C_COMMENTDOCKEYWORDERROR; } // Store both the current line's fold level and the next lines in the diff --git a/contrib/src/stc/scintilla/src/LexCSS.cxx b/contrib/src/stc/scintilla/src/LexCSS.cxx index f45ce1cda4..963a7b3ef7 100644 --- a/contrib/src/stc/scintilla/src/LexCSS.cxx +++ b/contrib/src/stc/scintilla/src/LexCSS.cxx @@ -107,6 +107,25 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo if (lastState == SCE_CSS_DEFAULT) sc.SetState(SCE_CSS_DIRECTIVE); break; + case '*': + if (lastState == SCE_CSS_DEFAULT) + sc.SetState(SCE_CSS_TAG); + break; + case '>': + case '+': + if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_CLASS + || lastState == SCE_CSS_ID || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) + sc.SetState(SCE_CSS_DEFAULT); + break; + case '[': + if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_DEFAULT || + lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) + sc.SetState(SCE_CSS_ATTRIBUTE); + break; + case ']': + if (lastState == SCE_CSS_ATTRIBUTE) + sc.SetState(SCE_CSS_TAG); + break; case '{': if (lastState == SCE_CSS_DIRECTIVE) sc.SetState(SCE_CSS_DEFAULT); @@ -126,11 +145,13 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo sc.SetState(SCE_CSS_VALUE); break; case '.': - if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT) + if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_DEFAULT || + lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) sc.SetState(SCE_CSS_CLASS); break; case '#': - if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT) + if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_DEFAULT || + lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) sc.SetState(SCE_CSS_ID); break; case ',': @@ -208,6 +229,7 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo } else if (sc.state == SCE_CSS_VALUE && (sc.ch == '\"' || sc.ch == '\'')) { sc.SetState((sc.ch == '\"' ? SCE_CSS_DOUBLESTRING : SCE_CSS_SINGLESTRING)); } else if (IsCssOperator(static_cast(sc.ch)) + && (sc.state != SCE_CSS_ATTRIBUTE || sc.ch == ']') && (sc.state != SCE_CSS_VALUE || sc.ch == ';' || sc.ch == '}' || sc.ch == '!') && (sc.state != SCE_CSS_DIRECTIVE || sc.ch == ';' || sc.ch == '{') ) { diff --git a/contrib/src/stc/scintilla/src/LexCaml.cxx b/contrib/src/stc/scintilla/src/LexCaml.cxx new file mode 100644 index 0000000000..5f4fad5fb8 --- /dev/null +++ b/contrib/src/stc/scintilla/src/LexCaml.cxx @@ -0,0 +1,399 @@ +// Scintilla source code edit control +/** @file LexCaml.cxx + ** Lexer for Objective Caml. + **/ +// Copyright 2005 by Robert Roessler +// The License.txt file describes the conditions under which this software may be distributed. +/* Release History + 20050204 Initial release. + 20050205 Quick compiler standards/"cleanliness" adjustment. + 20050206 Added cast for IsLeadByte(). + 20050209 Changes to "external" build support. + 20050306 Fix for 1st-char-in-doc "corner" case. + 20050502 Fix for [harmless] one-past-the-end coloring. + 20050515 Refined numeric token recognition logic. + 20051125 Added 2nd "optional" keywords class. + 20051129 Support "magic" (read-only) comments for RCaml. + 20051204 Swtich to using StyleContext infrastructure. +*/ + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +// Since the Microsoft __iscsym[f] funcs are not ANSI... +inline int iscaml(int c) {return isalnum(c) || c == '_';} +inline int iscamlf(int c) {return isalpha(c) || c == '_';} +inline int iscamld(int c) {return isdigit(c) || c == '_';} + +static const int baseT[24] = { + 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A - L */ + 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,16 /* M - X */ +}; + +#ifdef BUILD_AS_EXTERNAL_LEXER +/* + (actually seems to work!) +*/ +#include "WindowAccessor.h" +#include "ExternalLexer.h" + +#if PLAT_WIN +#include +#endif + +static void ColouriseCamlDoc( + unsigned int startPos, int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler); + +static void FoldCamlDoc( + unsigned int startPos, int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler); + +static void InternalLexOrFold(int lexOrFold, unsigned int startPos, int length, + int initStyle, char *words[], WindowID window, char *props); + +static const char* LexerName = "caml"; + +#ifdef TRACE +void Platform::DebugPrintf(const char *format, ...) { + char buffer[2000]; + va_list pArguments; + va_start(pArguments, format); + vsprintf(buffer,format,pArguments); + va_end(pArguments); + Platform::DebugDisplay(buffer); +} +#else +void Platform::DebugPrintf(const char *, ...) { +} +#endif + +bool Platform::IsDBCSLeadByte(int codePage, char ch) { + return ::IsDBCSLeadByteEx(codePage, ch) != 0; +} + +long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { + return ::SendMessage(reinterpret_cast(w), msg, wParam, lParam); +} + +long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { + return ::SendMessage(reinterpret_cast(w), msg, wParam, + reinterpret_cast(lParam)); +} + +void EXT_LEXER_DECL Fold(unsigned int lexer, unsigned int startPos, int length, + int initStyle, char *words[], WindowID window, char *props) +{ + // below useless evaluation(s) to supress "not used" warnings + lexer; + // build expected data structures and do the Fold + InternalLexOrFold(1, startPos, length, initStyle, words, window, props); + +} + +int EXT_LEXER_DECL GetLexerCount() +{ + return 1; // just us [Objective] Caml lexers here! +} + +void EXT_LEXER_DECL GetLexerName(unsigned int Index, char *name, int buflength) +{ + // below useless evaluation(s) to supress "not used" warnings + Index; + // return as much of our lexer name as will fit (what's up with Index?) + if (buflength > 0) { + buflength--; + int n = strlen(LexerName); + if (n > buflength) + n = buflength; + memcpy(name, LexerName, n), name[n] = '\0'; + } +} + +void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int length, + int initStyle, char *words[], WindowID window, char *props) +{ + // below useless evaluation(s) to supress "not used" warnings + lexer; + // build expected data structures and do the Lex + InternalLexOrFold(0, startPos, length, initStyle, words, window, props); +} + +static void InternalLexOrFold(int foldOrLex, unsigned int startPos, int length, + int initStyle, char *words[], WindowID window, char *props) +{ + // create and initialize a WindowAccessor (including contained PropSet) + PropSet ps; + ps.SetMultiple(props); + WindowAccessor wa(window, ps); + // create and initialize WordList(s) + int nWL = 0; + for (; words[nWL]; nWL++) ; // count # of WordList PTRs needed + WordList** wl = new WordList* [nWL + 1];// alloc WordList PTRs + int i = 0; + for (; i < nWL; i++) { + wl[i] = new WordList(); // (works or THROWS bad_alloc EXCEPTION) + wl[i]->Set(words[i]); + } + wl[i] = 0; + // call our "internal" folder/lexer (... then do Flush!) + if (foldOrLex) + FoldCamlDoc(startPos, length, initStyle, wl, wa); + else + ColouriseCamlDoc(startPos, length, initStyle, wl, wa); + wa.Flush(); + // clean up before leaving + for (i = nWL - 1; i >= 0; i--) + delete wl[i]; + delete [] wl; +} + +static +#endif /* BUILD_AS_EXTERNAL_LEXER */ + +void ColouriseCamlDoc( + unsigned int startPos, int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler) +{ + // initialize styler + StyleContext sc(startPos, length, initStyle, styler); + // set up [initial] state info (terminating states that shouldn't "bleed") + int nesting = 0; + if (sc.state < SCE_CAML_STRING) + sc.state = SCE_CAML_DEFAULT; + if (sc.state >= SCE_CAML_COMMENT) + nesting = (sc.state & 0x0f) - SCE_CAML_COMMENT; + + int chBase = 0, chToken = 0, chLit = 0; + WordList& keywords = *keywordlists[0]; + WordList& keywords2 = *keywordlists[1]; + WordList& keywords3 = *keywordlists[2]; + const int useMagic = styler.GetPropertyInt("lexer.caml.magic", 0); + + // foreach char in range... + while (sc.More()) { + // set up [per-char] state info + int state2 = -1; // (ASSUME no state change) + int chColor = sc.currentPos - 1;// (ASSUME standard coloring range) + bool advance = true; // (ASSUME scanner "eats" 1 char) + + // step state machine + switch (sc.state & 0x0f) { + case SCE_CAML_DEFAULT: + chToken = sc.currentPos; // save [possible] token start (JIC) + // it's wide open; what do we have? + if (iscamlf(sc.ch)) + state2 = SCE_CAML_IDENTIFIER; + else if (sc.Match('`') && iscamlf(sc.chNext)) + state2 = SCE_CAML_TAGNAME; + else if (sc.Match('#') && isdigit(sc.chNext)) + state2 = SCE_CAML_LINENUM; + else if (isdigit(sc.ch)) { + state2 = SCE_CAML_NUMBER, chBase = 10; + if (sc.Match('0') && strchr("bBoOxX", sc.chNext)) + chBase = baseT[tolower(sc.chNext) - 'a'], sc.Forward(); + } else if (sc.Match('\'')) /* (char literal?) */ + state2 = SCE_CAML_CHAR, chLit = 0; + else if (sc.Match('\"')) + state2 = SCE_CAML_STRING; + else if (sc.Match('(', '*')) + state2 = SCE_CAML_COMMENT, + sc.ch = ' ', // (make SURE "(*)" isn't seen as a closed comment) + sc.Forward(); + else if (strchr("!?~" /* Caml "prefix-symbol" */ + "=<>@^|&+-*/$%" /* Caml "infix-symbol" */ + "()[]{};,:.#", sc.ch)) /* Caml "bracket" or ;,:.# */ + state2 = SCE_CAML_OPERATOR; + break; + + case SCE_CAML_IDENTIFIER: + // [try to] interpret as [additional] identifier char + if (!(iscaml(sc.ch) || sc.Match('\''))) { + const int n = sc.currentPos - chToken; + if (n < 24) { + // length is believable as keyword, [re-]construct token + char t[24]; + for (int i = -n; i < 0; i++) + t[n + i] = static_cast(sc.GetRelative(i)); + t[n] = '\0'; + // special-case "_" token as KEYWORD + if ((n == 1 && sc.chPrev == '_') || keywords.InList(t)) + sc.ChangeState(SCE_CAML_KEYWORD); + else if (keywords2.InList(t)) + sc.ChangeState(SCE_CAML_KEYWORD2); + else if (keywords3.InList(t)) + sc.ChangeState(SCE_CAML_KEYWORD3); + } + state2 = SCE_CAML_DEFAULT, advance = false; + } + break; + + case SCE_CAML_TAGNAME: + // [try to] interpret as [additional] tagname char + if (!(iscaml(sc.ch) || sc.Match('\''))) + state2 = SCE_CAML_DEFAULT, advance = false; + break; + + /*case SCE_CAML_KEYWORD: + case SCE_CAML_KEYWORD2: + case SCE_CAML_KEYWORD3: + // [try to] interpret as [additional] keyword char + if (!iscaml(ch)) + state2 = SCE_CAML_DEFAULT, advance = false; + break;*/ + + case SCE_CAML_LINENUM: + // [try to] interpret as [additional] linenum directive char + if (!isdigit(sc.ch)) + state2 = SCE_CAML_DEFAULT, advance = false; + break; + + case SCE_CAML_OPERATOR: { + // [try to] interpret as [additional] operator char + const char* o = 0; + if (iscaml(sc.ch) || isspace(sc.ch) /* ident or whitespace */ + || (o = strchr(")]};,\'\"`#", sc.ch),o)/* "termination" chars */ + || !strchr("!$%&*+-./:<=>?@^|~", sc.ch)/* "operator" chars */) { + // check for INCLUSIVE termination + if (o && strchr(")]};,", sc.ch)) { + if ((sc.Match(')') && sc.chPrev == '(') + || (sc.Match(']') && sc.chPrev == '[')) + // special-case "()" and "[]" tokens as KEYWORDS + sc.ChangeState(SCE_CAML_KEYWORD); + chColor++; + } else + advance = false; + state2 = SCE_CAML_DEFAULT; + } + break; + } + + case SCE_CAML_NUMBER: + // [try to] interpret as [additional] numeric literal char + // N.B. - improperly accepts "extra" digits in base 2 or 8 literals + if (iscamld(sc.ch) || IsADigit(sc.ch, chBase)) + break; + // how about an integer suffix? + if ((sc.Match('l') || sc.Match('L') || sc.Match('n')) + && (iscamld(sc.chPrev) || IsADigit(sc.chPrev, chBase))) + break; + // or a floating-point literal? + if (chBase == 10) { + // with a decimal point? + if (sc.Match('.') && iscamld(sc.chPrev)) + break; + // with an exponent? (I) + if ((sc.Match('e') || sc.Match('E')) + && (iscamld(sc.chPrev) || sc.chPrev == '.')) + break; + // with an exponent? (II) + if ((sc.Match('+') || sc.Match('-')) + && (sc.chPrev == 'e' || sc.chPrev == 'E')) + break; + } + // it looks like we have run out of number + state2 = SCE_CAML_DEFAULT, advance = false; + break; + + case SCE_CAML_CHAR: + // [try to] interpret as [additional] char literal char + if (sc.Match('\\')) { + chLit = 1; // (definitely IS a char literal) + if (sc.chPrev == '\\') + sc.ch = ' '; // (so termination test isn't fooled) + // should we be terminating - one way or another? + } else if ((sc.Match('\'') && sc.chPrev != '\\') || sc.atLineEnd) { + state2 = SCE_CAML_DEFAULT; + if (sc.Match('\'')) + chColor++; + else + sc.ChangeState(SCE_CAML_IDENTIFIER); + // ... maybe a char literal, maybe not + } else if (chLit < 1 && sc.currentPos - chToken >= 2) + sc.ChangeState(SCE_CAML_IDENTIFIER), advance = false; + break; + + case SCE_CAML_STRING: + // [try to] interpret as [additional] string literal char + if (sc.Match('\\') && sc.chPrev == '\\') + sc.ch = ' '; // (so '\\' doesn't cause us trouble) + else if (sc.Match('\"') && sc.chPrev != '\\') + state2 = SCE_CAML_DEFAULT, chColor++; + break; + + case SCE_CAML_COMMENT: + case SCE_CAML_COMMENT1: + case SCE_CAML_COMMENT2: + case SCE_CAML_COMMENT3: + // we're IN a comment - does this start a NESTED comment? + if (sc.Match('(', '*')) + state2 = sc.state + 1, chToken = sc.currentPos, + sc.ch = ' ', // (make SURE "(*)" isn't seen as a closed comment) + sc.Forward(), nesting++; + // [try to] interpret as [additional] comment char + else if (sc.Match(')') && sc.chPrev == '*') { + if (nesting) + state2 = (sc.state & 0x0f) - 1, chToken = 0, nesting--; + else + state2 = SCE_CAML_DEFAULT; + chColor++; + // enable "magic" (read-only) comment AS REQUIRED + } else if (useMagic && sc.currentPos - chToken == 4 + && sc.Match('c') && sc.chPrev == 'r' && sc.GetRelative(-2) == '@') + sc.state |= 0x10; // (switch to read-only comment style) + break; + } + + // handle state change and char coloring as required + if (state2 >= 0) + styler.ColourTo(chColor, sc.state), sc.ChangeState(state2); + // move to next char UNLESS re-scanning current char + if (advance) + sc.Forward(); + } + + // do any required terminal char coloring (JIC) + sc.Complete(); +} + +#ifdef BUILD_AS_EXTERNAL_LEXER +static +#endif /* BUILD_AS_EXTERNAL_LEXER */ +void FoldCamlDoc( + unsigned int startPos, int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler) +{ + // below useless evaluation(s) to supress "not used" warnings + startPos || length || initStyle || keywordlists[0] || styler.Length(); +} + +static const char * const camlWordListDesc[] = { + "Keywords", // primary Objective Caml keywords + "Keywords2", // "optional" keywords (typically from Pervasives) + "Keywords3", // "optional" keywords (typically typenames) + 0 +}; + +#ifndef BUILD_AS_EXTERNAL_LEXER +LexerModule lmCaml(SCLEX_CAML, ColouriseCamlDoc, "caml", FoldCamlDoc, camlWordListDesc); +#endif /* BUILD_AS_EXTERNAL_LEXER */ diff --git a/contrib/src/stc/scintilla/src/LexCsound.cxx b/contrib/src/stc/scintilla/src/LexCsound.cxx new file mode 100644 index 0000000000..27f7b990a2 --- /dev/null +++ b/contrib/src/stc/scintilla/src/LexCsound.cxx @@ -0,0 +1,207 @@ +// Scintilla source code edit control +/** @file LexCsound.cxx + ** Lexer for Csound (Orchestra & Score) + ** Written by Georg Ritter - + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + + +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '.' || + ch == '_' || ch == '?'); +} + +static inline bool IsAWordStart(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' || + ch == '%' || ch == '@' || ch == '$' || ch == '?'); +} + +static inline bool IsCsoundOperator(char ch) { + if (isalnum(ch)) + return false; + // '.' left out as it is used to make up numbers + if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || + ch == '(' || ch == ')' || ch == '=' || ch == '^' || + ch == '[' || ch == ']' || ch == '<' || ch == '&' || + ch == '>' || ch == ',' || ch == '|' || ch == '~' || + ch == '%' || ch == ':') + return true; + return false; +} + +static void ColouriseCsoundDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + + WordList &opcode = *keywordlists[0]; + WordList &headerStmt = *keywordlists[1]; + WordList &otherKeyword = *keywordlists[2]; + + // Do not leak onto next line + if (initStyle == SCE_CSOUND_STRINGEOL) + initStyle = SCE_CSOUND_DEFAULT; + + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) + { + // Handle line continuation generically. + if (sc.ch == '\\') { + if (sc.chNext == '\n' || sc.chNext == '\r') { + sc.Forward(); + if (sc.ch == '\r' && sc.chNext == '\n') { + sc.Forward(); + } + continue; + } + } + + // Determine if the current state should terminate. + if (sc.state == SCE_CSOUND_OPERATOR) { + if (!IsCsoundOperator(static_cast(sc.ch))) { + sc.SetState(SCE_CSOUND_DEFAULT); + } + }else if (sc.state == SCE_CSOUND_NUMBER) { + if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_CSOUND_DEFAULT); + } + } else if (sc.state == SCE_CSOUND_IDENTIFIER) { + if (!IsAWordChar(sc.ch) ) { + char s[100]; + sc.GetCurrent(s, sizeof(s)); + + if (opcode.InList(s)) { + sc.ChangeState(SCE_CSOUND_OPCODE); + } else if (headerStmt.InList(s)) { + sc.ChangeState(SCE_CSOUND_HEADERSTMT); + } else if (otherKeyword.InList(s)) { + sc.ChangeState(SCE_CSOUND_USERKEYWORD); + } else if (s[0] == 'p') { + sc.ChangeState(SCE_CSOUND_PARAM); + } else if (s[0] == 'a') { + sc.ChangeState(SCE_CSOUND_ARATE_VAR); + } else if (s[0] == 'k') { + sc.ChangeState(SCE_CSOUND_KRATE_VAR); + } else if (s[0] == 'i') { // covers both i-rate variables and i-statements + sc.ChangeState(SCE_CSOUND_IRATE_VAR); + } else if (s[0] == 'g') { + sc.ChangeState(SCE_CSOUND_GLOBAL_VAR); + } + sc.SetState(SCE_CSOUND_DEFAULT); + } + } + else if (sc.state == SCE_CSOUND_COMMENT ) { + if (sc.atLineEnd) { + sc.SetState(SCE_CSOUND_DEFAULT); + } + } + else if ((sc.state == SCE_CSOUND_ARATE_VAR) || + (sc.state == SCE_CSOUND_KRATE_VAR) || + (sc.state == SCE_CSOUND_IRATE_VAR)) { + if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_CSOUND_DEFAULT); + } + } + + // Determine if a new state should be entered. + if (sc.state == SCE_CSOUND_DEFAULT) { + if (sc.ch == ';'){ + sc.SetState(SCE_CSOUND_COMMENT); + } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) { + sc.SetState(SCE_CSOUND_NUMBER); + } else if (IsAWordStart(sc.ch)) { + sc.SetState(SCE_CSOUND_IDENTIFIER); + } else if (IsCsoundOperator(static_cast(sc.ch))) { + sc.SetState(SCE_CSOUND_OPERATOR); + } else if (sc.ch == 'p') { + sc.SetState(SCE_CSOUND_PARAM); + } else if (sc.ch == 'a') { + sc.SetState(SCE_CSOUND_ARATE_VAR); + } else if (sc.ch == 'k') { + sc.SetState(SCE_CSOUND_KRATE_VAR); + } else if (sc.ch == 'i') { // covers both i-rate variables and i-statements + sc.SetState(SCE_CSOUND_IRATE_VAR); + } else if (sc.ch == 'g') { + sc.SetState(SCE_CSOUND_GLOBAL_VAR); + } + } + } + sc.Complete(); +} + +static void FoldCsoundInstruments(unsigned int startPos, int length, int /* initStyle */, WordList *[], + Accessor &styler) { + unsigned int lengthDoc = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = styler[startPos]; + int stylePrev = 0; + int styleNext = styler.StyleAt(startPos); + for (unsigned int i = startPos; i < lengthDoc; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + if ((stylePrev != SCE_CSOUND_OPCODE) && (style == SCE_CSOUND_OPCODE)) { + char s[20]; + unsigned int j = 0; + while ((j < (sizeof(s) - 1)) && (iswordchar(styler[i + j]))) { + s[j] = styler[i + j]; + j++; + } + s[j] = '\0'; + + if (strcmp(s, "instr") == 0) + levelCurrent++; + if (strcmp(s, "endin") == 0) + levelCurrent--; + } + + if (atEOL) { + int lev = levelPrev; + if (visibleChars == 0) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + visibleChars = 0; + } + if (!isspacechar(ch)) + visibleChars++; + stylePrev = style; + } + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} + + +static const char * const csoundWordListDesc[] = { + "Opcodes", + "Header Statements", + "User keywords", + 0 +}; + +LexerModule lmCsound(SCLEX_CSOUND, ColouriseCsoundDoc, "csound", FoldCsoundInstruments, csoundWordListDesc); diff --git a/contrib/src/stc/scintilla/src/LexEiffel.cxx b/contrib/src/stc/scintilla/src/LexEiffel.cxx index 974efd9a72..e9e154cd5f 100644 --- a/contrib/src/stc/scintilla/src/LexEiffel.cxx +++ b/contrib/src/stc/scintilla/src/LexEiffel.cxx @@ -10,7 +10,6 @@ #include #include #include -#include #include "Platform.h" diff --git a/contrib/src/stc/scintilla/src/LexFlagship.cxx b/contrib/src/stc/scintilla/src/LexFlagship.cxx new file mode 100644 index 0000000000..db0314eb96 --- /dev/null +++ b/contrib/src/stc/scintilla/src/LexFlagship.cxx @@ -0,0 +1,226 @@ +// Scintilla source code edit control +/** @file LexFlagShip.cxx + ** Lexer for FlagShip + ** (Syntactically compatible to other XBase dialects, like dBase, Clipper, Fox etc.) + **/ +// Copyright 2005 by Randy Butler +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +static bool IsFlagShipComment(Accessor &styler, int pos, int len) { + return len>0 && styler[pos]=='\''; +} + +static inline bool IsTypeCharacter(int ch) { + return ch == '%' || ch == '&' || ch == '@' || ch == '!' || ch == '#' || ch == '$'; +} + +// Extended to accept accented characters +static inline bool IsAWordChar(int ch) { + return ch >= 0x80 || + (isalnum(ch) || ch == '.' || ch == '_'); +} + +static inline bool IsAWordStart(int ch) { + return ch >= 0x80 || + (isalnum(ch) || ch == '_'); +} + +static inline bool IsADateCharacter(const int ch) { + return (ch < 0x80) && + (isalnum(ch) || ch == '|' || ch == '-' || ch == '/' || ch == ':' || ch == ' ' || ch == '\t'); +} + + +static void ColouriseFlagShipDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + + //bool FSScriptSyntax = true; + WordList &keywords = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + WordList &keywords3 = *keywordlists[2]; + WordList &keywords4 = *keywordlists[3]; + + styler.StartAt(startPos); + + int visibleChars = 0; + + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) { + + if (sc.state == SCE_FS_OPERATOR) { + sc.SetState(SCE_FS_DEFAULT); + } else if (sc.state == SCE_FS_IDENTIFIER) { + if (!IsAWordChar(sc.ch)) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + if (keywords.InList(s)) { + sc.ChangeState(SCE_FS_KEYWORD); + } else if (keywords2.InList(s)) { + sc.ChangeState(SCE_FS_KEYWORD2); + } else if (keywords3.InList(s)) { + sc.ChangeState(SCE_FS_KEYWORD3); + } else if (keywords4.InList(s)) { + sc.ChangeState(SCE_FS_KEYWORD4); + }// Else, it is really an identifier... + sc.SetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_NUMBER) { + if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_STRING) { + // VB doubles quotes to preserve them, so just end this string + // state now as a following quote will start again + if (sc.ch == '\"') { + if (tolower(sc.chNext) == 'c') { + sc.Forward(); + } + sc.ForwardSetState(SCE_FS_DEFAULT); + } else if (sc.atLineEnd) { + sc.ChangeState(SCE_FS_STRINGEOL); + sc.ForwardSetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_COMMENT) { + if (sc.Match('*', '/')) { // new code + sc.Forward(); + sc.ForwardSetState(SCE_FS_DEFAULT); + //if (sc.atLineEnd) { // old code + // sc.SetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_COMMENTLINE) { //new code + if (sc.ch == '\r' || sc.ch == '\n') { + sc.SetState(SCE_FS_DEFAULT); + visibleChars = 0; + } + } else if (sc.state == SCE_FS_PREPROCESSOR) { + if (sc.atLineEnd) { + sc.SetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_DATE) { + if (sc.ch == '#' || !IsADateCharacter(sc.chNext)) { + sc.ForwardSetState(SCE_FS_DEFAULT); + } + } + + // Determine if a new state should be entered. + if (sc.state == SCE_FS_DEFAULT) { + if (sc.Match('/', '*')) { // New code + sc.SetState(SCE_FS_COMMENT); + sc.Forward(); // Eat the * so it isn't used for the end of the comment + //if (sc.ch == '\'') { // Old code + // sc.SetState(SCE_FS_COMMENT); // old code + } else if (sc.Match('/', '/')) { // New code + sc.SetState(SCE_FS_COMMENTLINE); + } else if (sc.ch == '\"') { + sc.SetState(SCE_FS_STRING); + } else if (sc.ch == '#' && visibleChars == 0) { + // Preprocessor commands are alone on their line + sc.SetState(SCE_FS_PREPROCESSOR); + } else if (sc.ch == '#') { + int n = 1; + int chSeek = ' '; + while ((n < 100) && (chSeek == ' ' || chSeek == '\t')) { + chSeek = sc.GetRelative(n); + n++; + } + if (IsADigit(chSeek)) { + sc.SetState(SCE_FS_DATE); + } else { + sc.SetState(SCE_FS_OPERATOR); + } + } else if (sc.ch == '&' && tolower(sc.chNext) == 'h') { + sc.SetState(SCE_FS_NUMBER); + } else if (sc.ch == '&' && tolower(sc.chNext) == 'o') { + sc.SetState(SCE_FS_NUMBER); + } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { + sc.SetState(SCE_FS_NUMBER); + } else if (IsAWordStart(sc.ch) || (sc.ch == '[')) { + sc.SetState(SCE_FS_IDENTIFIER); + } else if (isoperator(static_cast(sc.ch)) || (sc.ch == '\\')) { + sc.SetState(SCE_FS_OPERATOR); + } + } + + if (sc.atLineEnd) { + visibleChars = 0; + } + if (!IsASpace(sc.ch)) { + visibleChars++; + } + } + sc.Complete(); +} + +static void FoldFlagShipDoc(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) { + + int endPos = startPos + length; + + // Backtrack to previous line in case need to fix its fold status + int lineCurrent = styler.GetLine(startPos); + if (startPos > 0) { + if (lineCurrent > 0) { + lineCurrent--; + startPos = styler.LineStart(lineCurrent); + } + } + int spaceFlags = 0; + int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsFlagShipComment); + char chNext = styler[startPos]; + for (int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + + if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) { + int lev = indentCurrent; + int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsFlagShipComment); + if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { + // Only non whitespace lines can be headers + if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) { + lev |= SC_FOLDLEVELHEADERFLAG; + } else if (indentNext & SC_FOLDLEVELWHITEFLAG) { + // Line after is blank so check the next - maybe should continue further? + int spaceFlags2 = 0; + int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsFlagShipComment); + if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) { + lev |= SC_FOLDLEVELHEADERFLAG; + } + } + } + indentCurrent = indentNext; + styler.SetLevel(lineCurrent, lev); + lineCurrent++; + } + } +} + + +static const char * const FSWordListDesc[] = { + "Keywords", + "functions", + "user2", + "user3", + 0 +}; + +LexerModule lmFlagShip(SCLEX_FLAGSHIP, ColouriseFlagShipDoc, "flagship", FoldFlagShipDoc, FSWordListDesc); + + + diff --git a/contrib/src/stc/scintilla/src/LexFortran.cxx b/contrib/src/stc/scintilla/src/LexFortran.cxx index 0cc7342e69..3ab1116ea6 100644 --- a/contrib/src/stc/scintilla/src/LexFortran.cxx +++ b/contrib/src/stc/scintilla/src/LexFortran.cxx @@ -273,9 +273,11 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle, int style = initStyle; /***************************************/ int lastStart = 0; - char prevWord[32] = "", Label[6] = ""; + char prevWord[32] = ""; + char Label[6] = ""; // Variables for do label folding. - static int doLabels[100], posLabel=-1; + static int doLabels[100]; + static int posLabel=-1; /***************************************/ for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; diff --git a/contrib/src/stc/scintilla/src/LexGui4Cli.cxx b/contrib/src/stc/scintilla/src/LexGui4Cli.cxx index 2e3c02c1c9..f76fff6cc4 100644 --- a/contrib/src/stc/scintilla/src/LexGui4Cli.cxx +++ b/contrib/src/stc/scintilla/src/LexGui4Cli.cxx @@ -236,7 +236,7 @@ ColouriseGui4CliDoc(unsigned int startPos, int length, int initStyle, if (!noforward) sc.Forward(); } - styler.ColourTo(sc.currentPos, sc.state); + sc.Complete(); } // Main folding function called by Scintilla - (based on props (.ini) files function) diff --git a/contrib/src/stc/scintilla/src/LexHTML.cxx b/contrib/src/stc/scintilla/src/LexHTML.cxx index e3546b436f..d830a46439 100644 --- a/contrib/src/stc/scintilla/src/LexHTML.cxx +++ b/contrib/src/stc/scintilla/src/LexHTML.cxx @@ -2,7 +2,7 @@ /** @file LexHTML.cxx ** Lexer for HTML. **/ -// Copyright 1998-2003 by Neil Hodgson +// Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include @@ -35,13 +35,24 @@ static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } -static script_type segIsScriptingIndicator(Accessor &styler, unsigned int start, unsigned int end, script_type prevValue) { - char s[30 + 1]; - unsigned int i = 0; - for (; i < end - start + 1 && i < 30; i++) { - s[i] = static_cast(tolower(styler[start + i])); +static inline int MakeLowerCase(int ch) { + if (ch < 'A' || ch > 'Z') + return ch; + else + return ch - 'A' + 'a'; +} + +static void GetTextSegment(Accessor &styler, unsigned int start, unsigned int end, char *s, size_t len) { + size_t i = 0; + for (; (i < end - start + 1) && (i < len-1); i++) { + s[i] = static_cast(MakeLowerCase(styler[start + i])); } s[i] = '\0'; +} + +static script_type segIsScriptingIndicator(Accessor &styler, unsigned int start, unsigned int end, script_type prevValue) { + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); //Platform::DebugPrintf("Scripting indicator [%s]\n", s); if (strstr(s, "src")) // External script return eScriptNone; @@ -63,12 +74,8 @@ static script_type segIsScriptingIndicator(Accessor &styler, unsigned int start, static int PrintScriptingIndicatorOffset(Accessor &styler, unsigned int start, unsigned int end) { int iResult = 0; - char s[30 + 1]; - unsigned int i = 0; - for (; i < end - start + 1 && i < 30; i++) { - s[i] = static_cast(tolower(styler[start + i])); - } - s[i] = '\0'; + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); if (0 == strncmp(s, "php", 3)) { iResult = 3; } @@ -183,12 +190,8 @@ static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &k if (wordIsNumber) { chAttr = SCE_H_NUMBER; } else { - char s[30 + 1]; - unsigned int i = 0; - for (; i < end - start + 1 && i < 30; i++) { - s[i] = static_cast(tolower(styler[start + i])); - } - s[i] = '\0'; + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); if (keywords.InList(s)) chAttr = SCE_H_ATTRIBUTE; } @@ -207,7 +210,7 @@ static int classifyTagHTML(unsigned int start, unsigned int end, for (unsigned int cPos = start; cPos <= end && i < 30; cPos++) { char ch = styler[cPos]; if ((ch != '<') && (ch != '/')) { - s[i++] = caseSensitive ? ch : static_cast(tolower(ch)); + s[i++] = caseSensitive ? ch : static_cast(MakeLowerCase(ch)); } } @@ -270,12 +273,8 @@ static int classifyWordHTVB(unsigned int start, unsigned int end, WordList &keyw if (wordIsNumber) chAttr = SCE_HB_NUMBER; else { - char s[30 + 1]; - unsigned int i = 0; - for (; i < end - start + 1 && i < 30; i++) { - s[i] = static_cast(tolower(styler[start + i])); - } - s[i] = '\0'; + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); if (keywords.InList(s)) { chAttr = SCE_HB_WORD; if (strcmp(s, "rem") == 0) @@ -318,12 +317,8 @@ static void classifyWordHTPHP(unsigned int start, unsigned int end, WordList &ke if (wordIsNumber) chAttr = SCE_HPHP_NUMBER; else { - char s[100 + 1]; - unsigned int i = 0; - for (; i < end - start + 1 && i < 100; i++) { - s[i] = static_cast(tolower(styler[start + i])); - } - s[i] = '\0'; + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); if (keywords.InList(s)) chAttr = SCE_HPHP_WORD; } @@ -406,6 +401,11 @@ static bool IsCommentState(const int state) { return state == SCE_H_COMMENT || state == SCE_H_SGML_COMMENT; } +static bool IsScriptCommentState(const int state) { + return state == SCE_HJ_COMMENT || state == SCE_HJ_COMMENTLINE || state == SCE_HJA_COMMENT || + state == SCE_HJA_COMMENTLINE || state == SCE_HB_COMMENTLINE || state == SCE_HBA_COMMENTLINE; +} + static bool isLineEnd(char ch) { return ch == '\r' || ch == '\n'; } @@ -424,6 +424,8 @@ static bool isPHPStringState(int state) { static int FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringDelimiterSize, int i, const int lengthDoc, Accessor &styler) { int j; + while (i < lengthDoc && (styler[i] == ' ' || styler[i] == '\t')) + i++; phpStringDelimiter[0] = '\n'; for (j = i; j < lengthDoc && styler[j] != '\n' && styler[j] != '\r'; j++) { if (j - i < phpStringDelimiterSize - 2) @@ -501,12 +503,28 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty char chPrev = ' '; char ch = ' '; char chPrevNonWhite = ' '; + // look back to set chPrevNonWhite properly for better regex colouring + if (scriptLanguage == eScriptJS && startPos > 0) { + int back = startPos; + int style = 0; + while (--back) { + style = styler.StyleAt(back); + if (style < SCE_HJ_DEFAULT || style > SCE_HJ_COMMENTDOC) + // includes SCE_HJ_COMMENT & SCE_HJ_COMMENTLINE + break; + } + if (style == SCE_HJ_SYMBOLS) { + chPrevNonWhite = styler.SafeGetCharAt(back); + } + } + styler.StartSegment(startPos); const int lengthDoc = startPos + length; for (int i = startPos; i < lengthDoc; i++) { const char chPrev2 = chPrev; chPrev = ch; - if (ch != ' ' && ch != '\t') + if (!isspacechar(ch) && state != SCE_HJ_COMMENT && + state != SCE_HJ_COMMENTLINE && state != SCE_HJ_COMMENTDOC) chPrevNonWhite = ch; ch = styler[i]; char chNext = styler.SafeGetCharAt(i + 1); @@ -605,9 +623,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty case SCE_H_SINGLESTRING: case SCE_HJ_COMMENT: case SCE_HJ_COMMENTDOC: - // SCE_HJ_COMMENTLINE removed as this is a common thing done to hide - // the end of script marker from some JS interpreters. - //case SCE_HJ_COMMENTLINE: + //case SCE_HJ_COMMENTLINE: // removed as this is a common thing done to hide + // the end of script marker from some JS interpreters. case SCE_HJ_DOUBLESTRING: case SCE_HJ_SINGLESTRING: case SCE_HJ_REGEX: @@ -617,6 +634,19 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty case SCE_HP_TRIPLEDOUBLE: break; default : + // check if the closing tag is a script tag + if (state == SCE_HJ_COMMENTLINE) { + char tag[7]; // room for the