diff options
Diffstat (limited to 'src')
82 files changed, 68 insertions, 24905 deletions
diff --git a/src/Makefile b/src/Makefile index c09ca11a..bb6ed657 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,13 +1,15 @@ # Copyright 2007-2018 Mitchell mitchell.att.foicica.com. See LICENSE. CC = gcc +CFLAGS = -Os CXX = g++ +CXXFLAGS = -Os -std=c++11 MAKE = make ifeq (win, $(findstring win, $(MAKECMDGOALS))) # Cross-compile for Win32. CROSS = i686-w64-mingw32- - CFLAGS = -mms-bitfields -Os - CXXFLAGS = -mms-bitfields -static-libgcc -static-libstdc++ -Os -std=c++0x + CFLAGS += -mms-bitfields + CXXFLAGS += -mms-bitfields -static-libgcc -static-libstdc++ LUA_CFLAGS = -DLUA_BUILD_AS_DLL -DLUA_LIB LDFLAGS = -Wl,--retain-symbols-file -Wl,lua.sym ifeq (, $(findstring curses, $(MAKECMDGOALS))) @@ -34,11 +36,11 @@ ifeq (win, $(findstring win, $(MAKECMDGOALS))) libluajit = luajit/src/lua51.dll else ifeq (osx, $(findstring osx, $(MAKECMDGOALS))) # Cross-compile for Mac OSX. - CROSS = i686-apple-darwin10- - CFLAGS = -m32 -arch i386 -mdynamic-no-pic -mmacosx-version-min=10.5 -Os - CXXFLAGS = -m32 -arch i386 -mdynamic-no-pic -mmacosx-version-min=10.5 -Os + CROSS = i386-apple-darwin9- + CFLAGS += -mdynamic-no-pic + CXXFLAGS += -mdynamic-no-pic LUA_CFLAGS = -DLUA_USE_MACOSX - LDFLAGS = -liconv -rdynamic + LDFLAGS = -liconv -Wl,-read_only_relocs,suppress ifeq (, $(findstring curses, $(MAKECMDGOALS))) plat_flag = -DGTK GTK_CFLAGS = $(shell PKG_CONFIG_PATH=`pwd`/gtkosx/lib/pkgconfig \ @@ -58,15 +60,13 @@ else ifeq (osx, $(findstring osx, $(MAKECMDGOALS))) libluajit = luajit/src/libluajit.osx.a else # Build for Linux/BSD. - CFLAGS = -Os - CXXFLAGS = -Os -std=c++0x LUA_CFLAGS = -DLUA_USE_LINUX LDFLAGS = -rdynamic -Wl,--retain-symbols-file -Wl,lua.sym ifeq (Linux, $(shell uname -s)) LDFLAGS += -ldl else - CC=cc - CXX=c++ + CC = cc + CXX = c++ LDFLAGS += -liconv MAKE = gmake endif @@ -104,9 +104,8 @@ endif # Scintilla. -sci_flags = -pedantic $(plat_flag) -DSCI_LEXER -DNDEBUG -DNO_CXX11_REGEX \ - -DSCI_OWNREGEX -Iscintilla/include -Iscintilla/src \ - -Iscintilla/lexlib -Itre/lib -Wall +sci_flags = -pedantic $(plat_flag) -DSCI_LEXER -DLPEG_LEXER -DNDEBUG \ + -Iscintilla/include -Iscintilla/src -Iscintilla/lexlib -Wall sci_objs = AutoComplete.o CallTip.o CaseConvert.o CaseFolder.o Catalogue.o \ CellBuffer.o CharClassify.o ContractionState.o Decoration.o \ @@ -117,16 +116,13 @@ sci_objs = AutoComplete.o CallTip.o CaseConvert.o CaseFolder.o Catalogue.o \ sci_lex_objs = Accessor.o CharacterCategory.o CharacterSet.o LexerBase.o \ LexerModule.o LexerNoExceptions.o LexerSimple.o PropSetSimple.o \ StyleContext.o WordList.o +sci_lexer_objs = LexLPeg.o LexLPegjit.o LexLPeg-curses.o LexLPegjit-curses.o sci_gtk_objs = PlatGTK.o ScintillaGTK.o ScintillaGTKAccessible.o -regex_objs = regcomp.o regerror.o regexec.o tre-ast.o tre-compile.o \ - tre-filter.o tre-match-backtrack.o tre-match-parallel.o tre-mem.o \ - tre-parse.o tre-stack.o xmalloc.o -lexlpeg_objs = LexLPeg.o LexLPegjit.o LexLPeg-curses.o LexLPegjit-curses.o +sci_curses_objs = ScintillaCurses.o # Textadept. -ta_flags = -std=c99 -pedantic $(plat_flag) -Iscintilla/include -Igtdialog \ - -Wall -Wextra -Wno-unused +ta_flags = -std=c99 -pedantic $(plat_flag) -Iscintilla/include -Igtdialog -Wall textadept_gtk_objs = textadept.o textadeptjit.o textadept_curses_objs = textadept-curses.o textadeptjit-curses.o @@ -168,17 +164,14 @@ $(sci_objs): %.o: scintilla/src/%.cxx $(CROSS)$(CXX) -c $(CXXFLAGS) $(sci_flags) $< -o $@ $(sci_lex_objs): %.o: scintilla/lexlib/%.cxx $(CROSS)$(CXX) -c $(CXXFLAGS) $(sci_flags) $< -o $@ +$(sci_lexer_objs): scintilla/lexers/LexLPeg.cxx + $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUA_CFLAGS) $(sci_flags) $< -o $@ $(sci_gtk_objs): %.o: scintilla/gtk/%.cxx $(CROSS)$(CXX) -c $(CXXFLAGS) $(sci_flags) $(GTK_CFLAGS) $< -o $@ scintilla-marshal.o: scintilla/gtk/scintilla-marshal.c $(CROSS)$(CC) -c $(CFLAGS) $(GTK_CFLAGS) $< -o $@ -$(regex_objs): %.o: tre/lib/%.c - $(CROSS)$(CC) -c $(CFLAGS) -Itre/lib $< -o $@ -ScintillaTerm.o: scintilla/term/ScintillaTerm.cxx - $(CROSS)$(CXX) -c $(CXXFLAGS) $(sci_flags) $(CURSES_CFLAGS) -DSCI_COMPAT_4 \ - -DTA_PATCH $< -o $@ -$(lexlpeg_objs): LexLPeg.cxx - $(CROSS)$(CXX) -c $(CXXFLAGS) $(LUA_CFLAGS) $(sci_flags) $< -o $@ +$(sci_curses_objs): %.o: scintilla/curses/%.cxx + $(CROSS)$(CXX) -c $(CXXFLAGS) $(sci_flags) $(CURSES_CFLAGS) $< -o $@ $(textadept_objs): textadept.c $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) $(ta_flags) $< -o $@ $(lua_objs): %.o: lua/src/%.c @@ -197,7 +190,8 @@ luajit/src/libluajit.osx.a: $(MAKE) -C luajit CC="$(CC) -m32" CROSS=$(CROSS) TARGET_SYS=Darwin \ LUAJIT_A=$(notdir $@) || return 0 $(gtdialog_objs): gtdialog/gtdialog.c - $(CROSS)$(CC) -c $(CFLAGS) -std=c99 -pedantic $(gtdialog_flags) $< -o $@ + $(CROSS)$(CC) -c $(CFLAGS) -std=c99 -pedantic $(plat_flag) -DNOHELP \ + -DLIBRARY $(gtdialog_flags) $< -o $@ $(cdk_objs): %.o: cdk/%.c $(CROSS)$(CC) -c $(CFLAGS) -D_GNU_SOURCE -Itermkey -Icdk $(CURSES_CFLAGS) $< \ -o $@ @@ -207,7 +201,6 @@ textadept_rc.o: textadept.rc ; $(CROSS)$(WINDRES) $< $@ # Target-specific variables. -$(lexlpeg_objs): sci_flags += -DLPEG_LEXER -DNO_SCITE -Wno-long-long LexLPeg-curses.o LexLPegjit-curses.o: sci_flags += -DCURSES $(CURSES_CFLAGS) lua_dep_objs = LexLPeg.o LexLPeg-curses.o textadept.o textadept-curses.o \ $(lua_objs) $(lua_lib_objs) lspawn.o lspawn-curses.o @@ -218,9 +211,8 @@ $(lua_dep_objs): LUA_CFLAGS += -Ilua/src $(luajit_dep_objs): LUA_CFLAGS += -Iluajit/src $(textadept_gtk_objs): ta_flags += $(GTK_CFLAGS) $(textadept_curses_objs): \ - ta_flags += -Iscintilla/term -Itermkey -Icdk $(CURSES_CFLAGS) + ta_flags += -Iscintilla/curses -Itermkey -Icdk $(CURSES_CFLAGS) lspawn.o lspawnjit.o: spawn_flags = -DGTK $(GLIB_CFLAGS) -$(gtdialog_objs): gtdialog_flags = $(plat_flag) -DNOHELP -DLIBRARY gtdialog.o: gtdialog_flags += $(GTK_CFLAGS) gtdialog-curses.o: gtdialog_flags += -Icdk $(CURSES_CFLAGS) # Lua 5.3 compatibility with LuaJIT. @@ -229,46 +221,44 @@ lutf8libjit.o: LUA_CFLAGS += -Ilua/src # Executables. -textadept: $(sci_objs) $(sci_lex_objs) $(sci_gtk_objs) scintilla-marshal.o \ - $(regex_objs) LexLPeg.o textadept.o $(lua_objs) $(lua_lib_objs) \ +textadept: $(sci_objs) $(sci_lex_objs) LexLPeg.o $(sci_gtk_objs) \ + scintilla-marshal.o textadept.o $(lua_objs) $(lua_lib_objs) \ lspawn.o gtdialog.o $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS) -textadeptjit: $(sci_objs) $(sci_lex_objs) $(sci_gtk_objs) scintilla-marshal.o \ - $(regex_objs) LexLPegjit.o textadeptjit.o $(luajit_lib_objs) \ +textadeptjit: $(sci_objs) $(sci_lex_objs) LexLPegjit.o $(sci_gtk_objs) \ + scintilla-marshal.o textadeptjit.o $(luajit_lib_objs) \ $(libluajit) lspawnjit.o gtdialog.o $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS) -textadept-curses: $(sci_objs) $(sci_lex_objs) ScintillaTerm.o $(regex_objs) \ - LexLPeg-curses.o textadept-curses.o $(lua_objs) \ +textadept-curses: $(sci_objs) $(sci_lex_objs) LexLPeg-curses.o \ + $(sci_curses_objs) textadept-curses.o $(lua_objs) \ $(lua_lib_objs) lspawn-curses.o gtdialog-curses.o termkey.o \ $(termkey_unix_objs) $(cdk_objs) $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS) -textadeptjit-curses: $(sci_objs) $(sci_lex_objs) ScintillaTerm.o $(regex_objs) \ - LexLPegjit-curses.o textadeptjit-curses.o \ +textadeptjit-curses: $(sci_objs) $(sci_lex_objs) LexLPegjit-curses.o \ + $(sci_curses_objs) textadeptjit-curses.o \ $(luajit_lib_objs) $(libluajit) lspawnjit-curses.o \ gtdialog-curses.o termkey.o $(termkey_unix_objs) \ $(cdk_objs) $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS) -textadept.exe: $(sci_objs) $(sci_lex_objs) $(sci_gtk_objs) scintilla-marshal.o \ - $(regex_objs) LexLPeg.o textadept.o textadept_rc.o $(lua_objs) \ +textadept.exe: $(sci_objs) $(sci_lex_objs) LexLPeg.o $(sci_gtk_objs) \ + scintilla-marshal.o textadept.o textadept_rc.o $(lua_objs) \ $(lua_lib_objs) lspawn.o gtdialog.o $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS) -textadeptjit.exe: $(sci_objs) $(sci_lex_objs) $(sci_gtk_objs) \ - scintilla-marshal.o $(regex_objs) LexLPegjit.o \ - textadeptjit.o textadept_rc.o $(luajit_lib_objs) \ - $(libluajit) lspawnjit.o gtdialog.o +textadeptjit.exe: $(sci_objs) $(sci_lex_objs) LexLPegjit.o $(sci_gtk_objs) \ + scintilla-marshal.o textadeptjit.o textadept_rc.o \ + $(luajit_lib_objs) $(libluajit) lspawnjit.o gtdialog.o $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS) -textadept-curses.exe: $(sci_objs) $(sci_lex_objs) ScintillaTerm.o \ - $(regex_objs) LexLPeg-curses.o textadept-curses.o \ - textadept_rc.o $(lua_objs) $(lua_lib_objs) \ - lspawn-curses.o gtdialog-curses.o termkey.o \ - $(termkey_win32_objs) $(cdk_objs) +textadept-curses.exe: $(sci_objs) $(sci_lex_objs) LexLPeg-curses.o \ + $(sci_curses_objs) textadept-curses.o textadept_rc.o \ + $(lua_objs) $(lua_lib_objs) lspawn-curses.o \ + gtdialog-curses.o termkey.o $(termkey_win32_objs) \ + $(cdk_objs) $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS) -textadeptjit-curses.exe: $(sci_objs) $(sci_lex_objs) ScintillaTerm.o \ - $(regex_objs) LexLPegjit-curses.o \ - textadeptjit-curses.o textadept_rc.o \ - $(luajit_lib_objs) $(libluajit) lspawnjit-curses.o \ - gtdialog-curses.o termkey.o $(termkey_win32_objs) \ - $(cdk_objs) +textadeptjit-curses.exe: $(sci_objs) $(sci_lex_objs) LexLPegjit-curses.o \ + $(sci_curses_objs) textadeptjit-curses.o \ + textadept_rc.o $(luajit_lib_objs) $(libluajit) \ + lspawnjit-curses.o gtdialog-curses.o termkey.o \ + $(termkey_win32_objs) $(cdk_objs) $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS) # Install/uninstall. @@ -337,8 +327,10 @@ release-all: release release64 win32-release osx-release modules-release $(basedir).i386: ; hg archive $@ -X ".hg*" release: $(basedir).i386 make deps clean doc sign-deps - PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig make -j4 - make -j4 CURSES_CFLAGS=-I/opt/ncursesw/include/ncursesw \ + PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig make -j4 \ + CXXFLAGS="$(CXXFLAGS) -static-libstdc++" + make -j4 CXXFLAGS="$(CXXFLAGS) -static-libstdc++" \ + CURSES_CFLAGS=-I/opt/ncursesw/include/ncursesw \ CURSES_LIBS="-L/opt/ncursesw/lib -lncursesw" curses cp -r ../doc ../lexers ../textadept* $< && cp *.asc $</src tar czf /tmp/$<.tgz $< && rm -rf $< && gpg -ab /tmp/$<.tgz @@ -346,8 +338,9 @@ $(basedir).x86_64: ; hg archive $@ -X ".hg*" release64: $(basedir).x86_64 make clean libluajit64 PKG_CONFIG_PATH=/opt/gtk64/lib/pkgconfig make -j4 CFLAGS="$(CFLAGS) -m64" \ - CXXFLAGS="$(CXXFLAGS) -m64" || return 0 - make -j4 CFLAGS="$(CFLAGS) -m64" CXXFLAGS="$(CXXFLAGS) -m64" \ + CXXFLAGS="$(CXXFLAGS) -m64 -static-libstdc++" || return 0 + make -j4 CFLAGS="$(CFLAGS) -m64" \ + CXXFLAGS="$(CXXFLAGS) -m64 -static-libstdc++" \ CURSES_CFLAGS=-I/opt/ncursesw64/include/ncursesw \ CURSES_LIBS="-L/opt/ncursesw64/lib -lncursesw" curses || return 0 cp -r ../doc ../lexers ../textadept* $< && cp *.asc $</src @@ -391,32 +384,22 @@ osx-app: ../textadept ../textadeptjit ../textadept-curses \ # External dependencies. -base_deps = scintilla tre scintilla/term scintillua lua lualibs luajit \ - gtdialog cdk ../doc/bombay +base_deps = scintilla lua lualibs luajit gtdialog cdk ../doc/bombay deps: $(base_deps) termkey win32-deps: $(base_deps) win32gtk win32curses osx-deps: $(base_deps) gtkosx termkey ifndef NIGHTLY - #scinterm_url = http://foicica.com/scinterm/download/$@ - scinterm_url = http://foicica.com/hg/scinterm/archive/$@ - #scintillua_url = http://foicica.com/scintillua/download/$@ - scintillua_url = http://foicica.com/hg/scintillua/archive/$@ #gtdialog_url = http://foicica.com/gtdialog/download/$@ gtdialog_url = http://foicica.com/hg/gtdialog/archive/$@ #lspawn_url = http://foicica.com/lspawn/download/$@ lspawn_url = http://foicica.com/hg/lspawn/archive/$@ else - scinterm_url = http://foicica.com/hg/scinterm/archive/tip.zip - scintillua_url = http://foicica.com/hg/scintillua/archive/tip.zip gtdialog_url = http://foicica.com/hg/gtdialog/archive/tip.zip lspawn_url = http://foicica.com/hg/lspawn/archive/tip.zip endif -scintilla_tgz = scintilla373.tgz -tre_zip = cdce45e8dd7a3b36954022b4a4d3570e1ac5a4f8.zip -scinterm_zip = 46e218082338.zip -scintillua_zip = 3d489664a2af.zip +scintilla_zip = 3dd2baa4e876.zip lua_tgz = lua-5.3.4.tar.gz lpeg_tgz = lpeg-1.0.0.tar.gz lfs_zip = v_1_6_3.zip @@ -435,28 +418,16 @@ gtkosx_zip = gtkosx-2.24.16.zip bombay_zip = bombay.zip cloc = cloc-1.60.pl -$(scintilla_tgz): ; wget http://prdownloads.sourceforge.net/scintilla/$@ -O $@ -scintilla: $(sort $(wildcard scintilla_backports/*.patch)) scintilla.patch | \ - $(scintilla_tgz) +$(scintilla_zip): ; wget http://foicica.com/hg/scintilla/archive/$@ -O $@ +scintilla: scintilla.patch | $(scintilla_zip) if [ -d $@/.hg ]; then \ - hg --cwd $@ update -C -r rel-3-7-3; \ + hg --cwd $@ update -C LongTerm3; \ else \ if [ -d $@ ]; then rm -r $@; fi; \ - mkdir $@ && tar xzf $| -C $@ && mv $@/*/* $@; \ + mkdir $@ && unzip -d $@ $| && mv $@/*/* $@; \ fi for patch in $^; do echo Applying $$patch; patch -d $@ -N -p1 < $$patch; done -$(tre_zip): ; wget https://github.com/laurikari/tre/archive/$@ -O $@ -tre: tre.patch | $(tre_zip) - if [ -d $@ ]; then rm -r $@; fi - mkdir $@ && unzip -d $@ $| && mv $@/*/* $@ - patch -d $@ -N -p1 < $< -$(scinterm_zip): ; wget $(scinterm_url) -O $@ -scintilla/term: | $(scinterm_zip) ; mkdir $@ && unzip -d $@ $| && mv $@/*/* $@ -scintillua: ../lexers LexLPeg.cxx -$(scintillua_zip): ; wget $(scintillua_url) -O $@ -../lexers: | $(scintillua_zip) - mkdir $@ && unzip -d $@ -j $| "*/lexers/*.lua" "*.txt" "*.cxx" -x "*/themes/*" -LexLPeg.cxx: | ../lexers ; ln -s $|/$@ $@ +../lexers: | scintilla ; ln -s src/$|/lexlua $@ $(lua_tgz): ; wget http://www.lua.org/ftp/$@ $(lpeg_tgz): ; wget http://www.inf.puc-rio.br/~roberto/lpeg/$@ $(lfs_zip): ; wget http://github.com/keplerproject/luafilesystem/archive/$@ @@ -525,18 +496,18 @@ $(bombay_zip): ; wget http://foicica.com/hg/bombay/archive/tip.zip -O $@ mkdir $(notdir $@) && unzip -d $(notdir $@) $| && \ mv $(notdir $@)/*/* $(dir $@) $(cloc): ; wget http://prdownloads.sourceforge.net/cloc/$@ -O $@ -sign-deps: | $(scintilla_tgz) $(scinterm_zip) $(scintillua_zip) $(lua_tgz) \ - $(lpeg_tgz) $(lfs_zip) $(lspawn_zip) $(luajit_tgz) \ - $(libluajit_tgz) $(gtdialog_zip) $(cdk_tgz) $(termkey_tgz) \ - $(win32gtk_zip) $(win32iconv_bin_zip) $(win32iconv_lib_zip) \ - $(win32curses_zip) $(pdcurses_zip) $(gtkosx_zip) +sign-deps: | $(scintilla_tgz) $(lua_tgz) $(lpeg_tgz) $(lfs_zip) $(lspawn_zip) \ + $(luajit_tgz) $(libluajit_tgz) $(gtdialog_zip) $(cdk_tgz) \ + $(termkey_tgz) $(win32gtk_zip) $(win32iconv_bin_zip) \ + $(win32iconv_lib_zip) $(win32curses_zip) $(pdcurses_zip) \ + $(gtkosx_zip) @for file in $|; do gpg -ab $$file; done verify-deps: | $(wildcard $(basename $(wildcard *.asc))) @for file in $|; do echo "$$file"; gpg --verify $$file.asc || return 1; done clean-deps: - rm -rf scintilla tre ../lexers LexLPeg.cxx lua luajit gtdialog cdk termkey \ - win32gtk win32curses gtkosx $(notdir ../doc/bombay) + rm -rf scintilla ../lexers lua luajit gtdialog cdk termkey win32gtk \ + win32curses gtkosx $(notdir ../doc/bombay) # Count lines of code and generate ctags. @@ -551,4 +522,4 @@ ctags: --regex-luax="/^\s*function\s+[^[:space:]\.]*\.?([[:alnum:]_]+)\(/\1/f/" \ --regex-luax="/^\s*local\s+function\s+([[:alnum:]_]+)\(/\1/F/" \ --regex-luax="/^[^[:space:]\.]*\.?([[:alnum:]_]+)\s*=\s*[{]/\1/t/" \ - $(sources) LexLPeg.cxx scintilla gtdialog/gtdialog.c + $(sources) scintilla gtdialog/gtdialog.c diff --git a/src/scintilla.patch b/src/scintilla.patch index 9b956f41..64834cc4 100644 --- a/src/scintilla.patch +++ b/src/scintilla.patch @@ -30,167 +30,6 @@ diff -r eb69b2b4bb85 gtk/ScintillaGTK.cxx object_class->finalize = Destroy; #if GTK_CHECK_VERSION(3,0,0) widget_class->get_preferred_width = GetPreferredWidth; -diff -r bfdfb44eb777 src/Document.cxx ---- a/src/Document.cxx Sun May 22 08:57:20 2016 +1000 -+++ b/src/Document.cxx Mon Jul 04 15:23:05 2016 -0400 -@@ -2845,3 +2845,157 @@ - #endif - - #endif -+ -+#include "tre.h" -+ -+class TreRegex : public RegexSearchBase { -+public: -+ explicit TreRegex() : lastS(NULL), lastSLen(0), lastSFlags(0) {} -+ virtual ~TreRegex() { if (lastS) free(lastS), tre_regfree(&preg); } -+ virtual long FindText(Document *doc, int minPos, int maxPos, const char *s, -+ bool caseSensitive, bool word, bool wordStart, int flags, -+ int *length); -+ virtual const char *SubstituteByPosition(Document *doc, const char *text, -+ int *length); -+private: -+ char *lastS; -+ int lastSLen, lastSFlags; -+ regex_t preg; -+ regmatch_t pmatch[10]; -+ std::string substituted; -+}; -+ -+long TreRegex::FindText(Document *doc, int minPos, int maxPos, const char *s, -+ bool caseSensitive, bool, bool, int, -+ int *length) { -+ // Determine the search range. (From Document.cxx::RESearchRange.) -+ int increment, startPos, endPos; -+ if (minPos <= maxPos) -+ increment = 1, startPos = minPos, endPos = maxPos; -+ else -+ increment = -1, startPos = maxPos, endPos = minPos; -+ // Range endpoints should not be inside DBCS characters, but just in case, -+ // move them. -+ startPos = doc->MovePositionOutsideChar(startPos, 1, false); -+ endPos = doc->MovePositionOutsideChar(endPos, 1, false); -+ int lineRangeStart = doc->LineFromPosition(startPos); -+ int lineRangeEnd = doc->LineFromPosition(endPos); -+ if (increment == 1 && startPos >= doc->LineEnd(lineRangeStart) && -+ lineRangeStart < lineRangeEnd) { -+ // The start position is at end of line or between line end characters. -+ lineRangeStart++; -+ startPos = doc->LineStart(lineRangeStart); -+ } else if (increment == -1 && startPos <= doc->LineStart(lineRangeStart) && -+ lineRangeStart > lineRangeEnd) { -+ // The start position is at beginning of line. -+ lineRangeStart--; -+ startPos = doc->LineEnd(lineRangeStart); -+ } -+ -+ // Compile the regex or used the cached one. -+ int cflags = REG_EXTENDED | (!caseSensitive ? REG_ICASE : 0) | REG_NEWLINE; -+ if (!lastS || lastSLen != *length || lastSFlags != cflags || strncmp(lastS, s, *length) != 0) { -+ if (tre_regncomp(&preg, s, *length, cflags) != REG_OK) return -1; -+ if (lastS) free(lastS); -+ lastS = static_cast<char *>(malloc(*length + 1)); -+ strncpy(lastS, s, *length); -+ lastS[*length] = '\0'; -+ lastSLen = *length, lastSFlags = cflags; -+ } -+ -+ // Perform the matching. -+ int pos = -1, lenRet = 0; -+ const char *string = doc->BufferPointer(); -+ size_t len = endPos - startPos; -+ int eflags = ((startPos != doc->LineStart(lineRangeStart)) ? REG_NOTBOL : 0) | -+ ((endPos != doc->LineEnd(lineRangeEnd)) ? REG_NOTEOL : 0); -+ int success = tre_regnexec(&preg, string + startPos, len, 10, pmatch, eflags) == REG_OK; -+ if (success) { -+ for (int i = 0; i < 10 && pmatch[i].rm_so != -1; i++) -+ pmatch[i].rm_so += startPos, pmatch[i].rm_eo += startPos; // adjust -+ pos = pmatch[0].rm_so, lenRet = pmatch[0].rm_eo - pmatch[0].rm_so; -+ if (increment == -1) { -+ // Check for the last match on this line. -+ int repetitions = 1000; // break out of infinite loop -+ while (success && pmatch[0].rm_eo <= endPos && repetitions--) { -+ success = tre_regnexec(&preg, string + pos + 1, len - (pos + 1), 10, -+ pmatch, eflags | REG_NOTBOL) == REG_OK; -+ if (success) { -+ for (int i = 0; i < 10 && pmatch[i].rm_so != -1; i++) -+ pmatch[i].rm_so += pos + 1, pmatch[i].rm_eo += pos + 1; // adjust -+ if (pmatch[0].rm_eo <= minPos) -+ pos = pmatch[0].rm_so, lenRet = pmatch[0].rm_eo - pmatch[0].rm_so; -+ else -+ success = 0; -+ } -+ } -+ } -+ } -+ *length = lenRet; -+ return pos; -+} -+ -+const char *TreRegex::SubstituteByPosition(Document *doc, const char *text, -+ int *length) { -+ substituted.clear(); -+ for (int j = 0; j < *length; j++) { -+ if (text[j] == '\\') { -+ if (text[j + 1] >= '0' && text[j + 1] <= '9') { -+ unsigned int patNum = text[j + 1] - '0'; -+ unsigned int len = pmatch[patNum].rm_eo - pmatch[patNum].rm_so; -+ if (len > 0) // will be -1 for a match that did not occur -+ substituted.append(doc->BufferPointer() + pmatch[patNum].rm_so, len); -+ j++; -+ } else { -+ j++; -+ switch (text[j]) { -+ case 'a': -+ substituted.push_back('\a'); -+ break; -+ case 'b': -+ substituted.push_back('\b'); -+ break; -+ case 'f': -+ substituted.push_back('\f'); -+ break; -+ case 'n': -+ substituted.push_back('\n'); -+ break; -+ case 'r': -+ substituted.push_back('\r'); -+ break; -+ case 't': -+ substituted.push_back('\t'); -+ break; -+ case 'v': -+ substituted.push_back('\v'); -+ break; -+ case '\\': -+ substituted.push_back('\\'); -+ break; -+ default: -+ substituted.push_back('\\'); -+ j--; -+ } -+ } -+ } else { -+ substituted.push_back(text[j]); -+ } -+ } -+ *length = static_cast<int>(substituted.length()); -+ return substituted.c_str(); -+} -+ -+#ifdef SCI_NAMESPACE -+ -+RegexSearchBase *Scintilla::CreateRegexSearch(CharClassify *charClassTable) { -+ return new TreRegex(); -+} -+ -+#else -+ -+RegexSearchBase *CreateRegexSearch(CharClassify *charClassTable) { -+ return new TreRegex(); -+} -+ -+#endif --- a/src/EditView.cxx 2017-10-06 14:21:52.634733696 +0200 +++ b/src/EditView.cxx 2017-10-06 15:06:12.449296662 +0200 @@ -1328,13 +1328,7 @@ diff --git a/src/scintilla_backports/6095_ae52e0c68190.patch b/src/scintilla_backports/6095_ae52e0c68190.patch deleted file mode 100644 index f30f40dc..00000000 --- a/src/scintilla_backports/6095_ae52e0c68190.patch +++ /dev/null @@ -1,43 +0,0 @@ -# HG changeset patch -# User Colomban Wendling <ban@herbesfolles.org> -# Date 1487714930 -3600 -# Node ID ae52e0c68190d423505624ae1d26e442e015d48f -# Parent 966f25e2241058f45500025b0a8e8ed4cae10ee7 -Bug [#1901]. GTK: Fix double scrolling under X11 - -Really restrict smooth scrolling handling to Wayland. - -diff -r 966f25e22410 -r ae52e0c68190 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sun Feb 19 14:13:46 2017 +1100 -+++ b/doc/ScintillaHistory.html Tue Feb 21 23:08:50 2017 +0100 -@@ -520,6 +520,18 @@ - </li> - </ul> - <h3> -+ <a href="http://www.scintilla.org/scite374.zip">Release 3.7.4</a> -+ </h3> -+ <ul> -+ <li> -+ Released 19 February 2017. -+ </li> -+ <li> -+ Fix to prevent double scrolling on GTK+ with X11. -+ <a href="http://sourceforge.net/p/scintilla/bugs/1901/">Bug #1901</a>. -+ </li> -+ </ul> -+ <h3> - <a href="http://www.scintilla.org/scite373.zip">Release 3.7.3</a> - </h3> - <ul> -diff -r 966f25e22410 -r ae52e0c68190 gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Sun Feb 19 14:13:46 2017 +1100 -+++ b/gtk/ScintillaGTK.cxx Tue Feb 21 23:08:50 2017 +0100 -@@ -1801,7 +1801,7 @@ - return FALSE; - - #if defined(GDK_WINDOWING_WAYLAND) -- if (event->direction == GDK_SCROLL_SMOOTH) { -+ if (event->direction == GDK_SCROLL_SMOOTH && GDK_IS_WAYLAND_WINDOW(event->window)) { - const int smoothScrollFactor = 4; - sciThis->smoothScrollY += event->delta_y * smoothScrollFactor; - sciThis->smoothScrollX += event->delta_x * smoothScrollFactor;; diff --git a/src/scintilla_backports/6097_7f22895eaddb.patch b/src/scintilla_backports/6097_7f22895eaddb.patch deleted file mode 100644 index 2ffe1923..00000000 --- a/src/scintilla_backports/6097_7f22895eaddb.patch +++ /dev/null @@ -1,34 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1487827984 -39600 -# Node ID 7f22895eaddb6584d488ed2e606d5d0e930db22c -# Parent cc79ed8e4f8274ba1242150f36e2ab0b40ed68f4 -Bug [#1905]. Fix stream selection mode when moving caret up or down. - -diff -r cc79ed8e4f82 -r 7f22895eaddb doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Wed Feb 22 16:35:01 2017 +1100 -+++ b/doc/ScintillaHistory.html Thu Feb 23 16:33:04 2017 +1100 -@@ -527,6 +527,10 @@ - Released 19 February 2017. - </li> - <li> -+ Fix to stream selection mode when moving caret up or down. -+ <a href="http://sourceforge.net/p/scintilla/bugs/1905/">Bug #1905</a>. -+ </li> -+ <li> - Fix to prevent double scrolling on GTK+ with X11. - <a href="http://sourceforge.net/p/scintilla/bugs/1901/">Bug #1901</a>. - </li> -diff -r cc79ed8e4f82 -r 7f22895eaddb src/Editor.cxx ---- a/src/Editor.cxx Wed Feb 22 16:35:01 2017 +1100 -+++ b/src/Editor.cxx Thu Feb 23 16:33:04 2017 +1100 -@@ -3111,6 +3111,9 @@ - } - - void Editor::CursorUpOrDown(int direction, Selection::selTypes selt) { -+ if ((selt == Selection::noSel) && sel.MoveExtends()) { -+ selt = Selection::selStream; -+ } - SelectionPosition caretToUse = sel.Range(sel.Main()).caret; - if (sel.IsRectangular()) { - if (selt == Selection::noSel) { diff --git a/src/scintilla_backports/6099_809112c81196.patch b/src/scintilla_backports/6099_809112c81196.patch deleted file mode 100644 index 2a10245d..00000000 --- a/src/scintilla_backports/6099_809112c81196.patch +++ /dev/null @@ -1,45 +0,0 @@ -# HG changeset patch -# User Colomban Wendling <ban@herbesfolles.org> -# Date 1488136706 -3600 -# Node ID 809112c8119696afcefdcb145e04ade832fcbe0b -# Parent 4d2ba76f394abe85ce97ae7037db34bdae452dd1 -Bug [#1907]. GTK: Fix crash after destroying the widget on GTK < 3.3.6 - -On GTK2 and GTK3 < 3.3.6 there is no GtkAccessibleClass::widget_unset() -method, so we can't destroy our accessible object right away. So, to -avoid accessing a destroyed widget, we need to check whether the widget -still exists in the the ScintillaGTKAccessible destructor. - -In other methods it's not necessary because the wrapping GObject class -makes sure not to forward other when the widget has been destroyed, but -we still have to destroy the C++ instance no matter what, so the check -has to be on this side. - -diff -r 4d2ba76f394a -r 809112c81196 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sat Feb 25 09:13:40 2017 +1100 -+++ b/doc/ScintillaHistory.html Sun Feb 26 20:18:26 2017 +0100 -@@ -535,6 +535,10 @@ - <a href="http://sourceforge.net/p/scintilla/bugs/1915/">Bug #1915</a>. - </li> - <li> -+ Fix crash in accessibility code on GTK+ < 3.3.6 caused by previous bug fix. -+ <a href="http://sourceforge.net/p/scintilla/bugs/1907/">Bug #1907</a>. -+ </li> -+ <li> - Fix to prevent double scrolling on GTK+ with X11. - <a href="http://sourceforge.net/p/scintilla/bugs/1901/">Bug #1901</a>. - </li> -diff -r 4d2ba76f394a -r 809112c81196 gtk/ScintillaGTKAccessible.cxx ---- a/gtk/ScintillaGTKAccessible.cxx Sat Feb 25 09:13:40 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.cxx Sun Feb 26 20:18:26 2017 +0100 -@@ -162,7 +162,9 @@ - } - - ScintillaGTKAccessible::~ScintillaGTKAccessible() { -- g_signal_handlers_disconnect_matched(sci->sci, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, this); -+ if (gtk_accessible_get_widget(accessible)) { -+ g_signal_handlers_disconnect_matched(sci->sci, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, this); -+ } - } - - gchar *ScintillaGTKAccessible::GetTextRangeUTF8(Position startByte, Position endByte) { diff --git a/src/scintilla_backports/6101_b82fe8d33961.patch b/src/scintilla_backports/6101_b82fe8d33961.patch deleted file mode 100644 index e60f610f..00000000 --- a/src/scintilla_backports/6101_b82fe8d33961.patch +++ /dev/null @@ -1,94 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1488408061 -39600 -# Node ID b82fe8d33961050a7905d6588eef858b85ca804c -# Parent 29534cb8eafb48f9eacc574b8063e9d66520ae8a -Fix potential problems with IME on Cocoa when document contains invalid UTF-8. - -diff -r 29534cb8eafb -r b82fe8d33961 cocoa/ScintillaCocoa.h ---- a/cocoa/ScintillaCocoa.h Thu Mar 02 09:08:04 2017 +1100 -+++ b/cocoa/ScintillaCocoa.h Thu Mar 02 09:41:01 2017 +1100 -@@ -48,6 +48,7 @@ - #include "CaseFolder.h" - #include "Document.h" - #include "CaseConvert.h" -+#include "UniConversion.h" - #include "Selection.h" - #include "PositionCache.h" - #include "EditModel.h" -diff -r 29534cb8eafb -r b82fe8d33961 cocoa/ScintillaView.mm ---- a/cocoa/ScintillaView.mm Thu Mar 02 09:08:04 2017 +1100 -+++ b/cocoa/ScintillaView.mm Thu Mar 02 09:41:01 2017 +1100 -@@ -437,6 +437,7 @@ - [mOwner message: SCI_SETTARGETRANGE wParam: posRange.location lParam: NSMaxRange(posRange)]; - std::string text([mOwner message: SCI_TARGETASUTF8] + 1, 0); - [mOwner message: SCI_TARGETASUTF8 wParam: 0 lParam: reinterpret_cast<sptr_t>(&text[0])]; -+ text = FixInvalidUTF8(text); - NSString *result = [NSString stringWithUTF8String: text.c_str()]; - NSMutableAttributedString *asResult = [[[NSMutableAttributedString alloc] initWithString:result] autorelease]; - -diff -r 29534cb8eafb -r b82fe8d33961 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Thu Mar 02 09:08:04 2017 +1100 -+++ b/doc/ScintillaHistory.html Thu Mar 02 09:41:01 2017 +1100 -@@ -537,6 +537,10 @@ - <a href="http://sourceforge.net/p/scintilla/bugs/1881/">Bug #1881</a>. - </li> - <li> -+ Fix potential problems with IME on Cocoa when document contains invalid -+ UTF-8. -+ </li> -+ <li> - Fix crash on Cocoa with OS X 10.9 due to accessibility API not available. - <a href="http://sourceforge.net/p/scintilla/bugs/1915/">Bug #1915</a>. - </li> -diff -r 29534cb8eafb -r b82fe8d33961 src/UniConversion.cxx ---- a/src/UniConversion.cxx Thu Mar 02 09:08:04 2017 +1100 -+++ b/src/UniConversion.cxx Thu Mar 02 09:41:01 2017 +1100 -@@ -8,6 +8,7 @@ - #include <stdlib.h> - - #include <stdexcept> -+#include <string> - - #include "UniConversion.h" - -@@ -304,6 +305,28 @@ - return (utf8StatusNext & UTF8MaskInvalid) ? 1 : (utf8StatusNext & UTF8MaskWidth); - } - -+// Replace invalid bytes in UTF-8 with the replacement character -+std::string FixInvalidUTF8(const std::string &text) { -+ std::string result; -+ const unsigned char *us = reinterpret_cast<const unsigned char *>(text.c_str()); -+ size_t remaining = text.size(); -+ while (remaining > 0) { -+ const int utf8Status = UTF8Classify(us, static_cast<int>(remaining)); -+ if (utf8Status & UTF8MaskInvalid) { -+ // Replacement character 0xFFFD = UTF8:"efbfbd". -+ result.append("\xef\xbf\xbd"); -+ us++; -+ remaining--; -+ } else { -+ const int len = utf8Status&UTF8MaskWidth; -+ result.append(reinterpret_cast<const char *>(us), len); -+ us += len; -+ remaining -= len; -+ } -+ } -+ return result; -+} -+ - #ifdef SCI_NAMESPACE - } - #endif -diff -r 29534cb8eafb -r b82fe8d33961 src/UniConversion.h ---- a/src/UniConversion.h Thu Mar 02 09:08:04 2017 +1100 -+++ b/src/UniConversion.h Thu Mar 02 09:41:01 2017 +1100 -@@ -23,6 +23,7 @@ - size_t UTF16FromUTF8(const char *s, size_t len, wchar_t *tbuf, size_t tlen); - unsigned int UTF32FromUTF8(const char *s, unsigned int len, unsigned int *tbuf, unsigned int tlen); - unsigned int UTF16FromUTF32Character(unsigned int val, wchar_t *tbuf); -+std::string FixInvalidUTF8(const std::string &text); - - extern int UTF8BytesOfLead[256]; - void UTF8BytesOfLeadInitialise(); diff --git a/src/scintilla_backports/6102_e12538e52567.patch b/src/scintilla_backports/6102_e12538e52567.patch deleted file mode 100644 index 4078bf5f..00000000 --- a/src/scintilla_backports/6102_e12538e52567.patch +++ /dev/null @@ -1,61 +0,0 @@ -# HG changeset patch -# User Colomban Wendling <ban@herbesfolles.org> -# Date 1487712605 -3600 -# Node ID e12538e52567bc5fc011448f42689ac52434f1fd -# Parent b82fe8d33961050a7905d6588eef858b85ca804c -Bug [#1910]. GTK a11y: Speed up converting byte offsets to character offsets - -Use a per-line cache to avoid re-computing the offset from the start of -the buffer each time. This dramatically speeds up multiple replacements -on large files. - -diff -r b82fe8d33961 -r e12538e52567 gtk/ScintillaGTKAccessible.cxx ---- a/gtk/ScintillaGTKAccessible.cxx Thu Mar 02 09:41:01 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.cxx Tue Feb 21 22:30:05 2017 +0100 -@@ -856,6 +856,13 @@ - void ScintillaGTKAccessible::Notify(GtkWidget *, gint, SCNotification *nt) { - switch (nt->nmhdr.code) { - case SCN_MODIFIED: { -+ if (nt->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) { -+ // invalidate character offset cache if applicable -+ const Position line = sci->pdoc->LineFromPosition(nt->position); -+ if (character_offsets.size() > static_cast<size_t>(line + 1)) { -+ character_offsets.resize(line + 1); -+ } -+ } - if (nt->modificationType & SC_MOD_INSERTTEXT) { - int startChar = CharacterOffsetFromByteOffset(nt->position); - int lengthChar = sci->pdoc->CountCharacters(nt->position, nt->position + nt->length); -diff -r b82fe8d33961 -r e12538e52567 gtk/ScintillaGTKAccessible.h ---- a/gtk/ScintillaGTKAccessible.h Thu Mar 02 09:41:01 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.h Tue Feb 21 22:30:05 2017 +0100 -@@ -20,6 +20,9 @@ - GtkAccessible *accessible; - ScintillaGTK *sci; - -+ // cache holding character offset for each line start, see CharacterOffsetFromByteOffset() -+ std::vector<Position> character_offsets; -+ - // cached length of the deletion, in characters (see Notify()) - int deletionLengthChar; - // local state for comparing -@@ -52,7 +55,18 @@ - } - - int CharacterOffsetFromByteOffset(Position byteOffset) { -- return sci->pdoc->CountCharacters(0, byteOffset); -+ const Position line = sci->pdoc->LineFromPosition(byteOffset); -+ if (character_offsets.size() <= static_cast<size_t>(line)) { -+ if (character_offsets.empty()) -+ character_offsets.push_back(0); -+ for (Position i = character_offsets.size(); i <= line; i++) { -+ const Position start = sci->pdoc->LineStart(i - 1); -+ const Position end = sci->pdoc->LineStart(i); -+ character_offsets.push_back(character_offsets[i - 1] + sci->pdoc->CountCharacters(start, end)); -+ } -+ } -+ const Position lineStart = sci->pdoc->LineStart(line); -+ return character_offsets[line] + sci->pdoc->CountCharacters(lineStart, byteOffset); - } - - void CharacterRangeFromByteRange(Position startByte, Position endByte, int *startChar, int *endChar) { diff --git a/src/scintilla_backports/6108_b833c0659497.patch b/src/scintilla_backports/6108_b833c0659497.patch deleted file mode 100644 index b38d426a..00000000 --- a/src/scintilla_backports/6108_b833c0659497.patch +++ /dev/null @@ -1,74 +0,0 @@ -# HG changeset patch -# User Neil Hodgson <nyamatongwe@gmail.com> -# Date 1488583798 -39600 -# Node ID b833c0659497438d3638a1a30ef4c604123f9e3e -# Parent d4f7d1439daa636ffe50cec516667627e04174a7 -Fix minor issues in interface definitions. - -diff -r d4f7d1439daa -r b833c0659497 include/Scintilla.iface ---- a/include/Scintilla.iface Sat Mar 04 10:28:39 2017 +1100 -+++ b/include/Scintilla.iface Sat Mar 04 10:29:58 2017 +1100 -@@ -415,8 +415,7 @@ - # How many margins are there?. - get int GetMargins=2253(,) - --# Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles. --# Style 39 is for future use. -+# Styles in range 32..39 are predefined for parts of the UI and are not used as normal styles. - enu StylesCommon=STYLE_ - val STYLE_DEFAULT=32 - val STYLE_LINENUMBER=33 -@@ -1215,7 +1214,7 @@ - # Switch a header line between expanded and contracted and show some text after the line. - fun void ToggleFoldShowText=2700(int line, string text) - --enu foldDisplayTextStyle=SC_FOLDDISPLAYTEXTSTYLE_ -+enu FoldDisplayTextStyle=SC_FOLDDISPLAYTEXT_ - val SC_FOLDDISPLAYTEXT_HIDDEN=0 - val SC_FOLDDISPLAYTEXT_STANDARD=1 - val SC_FOLDDISPLAYTEXT_BOXED=2 -@@ -1832,6 +1831,7 @@ - fun void WordPartRightExtend=2393(,) - - # Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. -+enu VisiblePolicy=VISIBLE_ - val VISIBLE_SLOP=0x01 - val VISIBLE_STRICT=0x04 - # Set the way the display area is determined when a particular line -@@ -1844,8 +1844,10 @@ - # Delete forwards from the current position to the end of the line. - fun void DelLineRight=2396(,) - --# Get and Set the xOffset (ie, horizontal scroll position). -+# Set the xOffset (ie, horizontal scroll position). - set void SetXOffset=2397(int xOffset,) -+ -+# Get the xOffset (ie, horizontal scroll position). - get int GetXOffset=2398(,) - - # Set the last x chosen value to be the caret x position. -@@ -2117,6 +2119,7 @@ - # Duplicate the selection. If selection empty duplicate the line containing the caret. - fun void SelectionDuplicate=2469(,) - -+enu Alpha=SC_ALPHA_ - val SC_ALPHA_TRANSPARENT=0 - val SC_ALPHA_OPAQUE=255 - val SC_ALPHA_NOALPHA=256 -@@ -2515,6 +2518,7 @@ - # Scroll to end of document. - fun void ScrollToEnd=2629(,) - -+enu Technology=SC_TECHNOLOGY_ - val SC_TECHNOLOGY_DEFAULT=0 - val SC_TECHNOLOGY_DIRECTWRITE=1 - val SC_TECHNOLOGY_DIRECTWRITERETAIN=2 -@@ -4811,7 +4815,7 @@ - evt void MarginClick=2010(int modifiers, int position, int margin) - evt void NeedShown=2011(int position, int length) - evt void Painted=2013(void) --evt void UserListSelection=2014(int listType, string text, int positionint, int ch, CompletionMethods listCompletionMethod) -+evt void UserListSelection=2014(int listType, string text, int position, int ch, CompletionMethods listCompletionMethod) - evt void URIDropped=2015(string text) - evt void DwellStart=2016(int position, int x, int y) - evt void DwellEnd=2017(int position, int x, int y) diff --git a/src/scintilla_backports/6111_225f39cfd931.patch b/src/scintilla_backports/6111_225f39cfd931.patch deleted file mode 100644 index 29caca6d..00000000 --- a/src/scintilla_backports/6111_225f39cfd931.patch +++ /dev/null @@ -1,101 +0,0 @@ -# HG changeset patch -# User johnsonj -# Date 1488691711 -39600 -# Node ID 225f39cfd93159c37966d50db15db7fdb894a503 -# Parent a3894ee30cdba2c1ced617f80bc6eb900e5cbb42 -For IMEs, do not clear selected text when there is no composition text to show. - -diff -r a3894ee30cdb -r 225f39cfd931 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sat Mar 04 14:32:28 2017 +1100 -+++ b/doc/ScintillaHistory.html Sun Mar 05 16:28:31 2017 +1100 -@@ -527,6 +527,9 @@ - Released 19 February 2017. - </li> - <li> -+ For IMEs, do not clear selected text when there is no composition text to show. -+ </li> -+ <li> - Fix to stream selection mode when moving caret up or down. - <a href="http://sourceforge.net/p/scintilla/bugs/1905/">Bug #1905</a>. - </li> -diff -r a3894ee30cdb -r 225f39cfd931 gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Sat Mar 04 14:32:28 2017 +1100 -+++ b/gtk/ScintillaGTK.cxx Sun Mar 05 16:28:31 2017 +1100 -@@ -2323,12 +2323,13 @@ - - view.imeCaretBlockOverride = false; // If backspace. - -+ bool initialCompose = false; - if (pdoc->TentativeActive()) { - pdoc->TentativeUndo(); - } else { - // No tentative undo means start of this composition so - // fill in any virtual spaces. -- ClearBeforeTentativeStart(); -+ initialCompose = true; - } - - PreEditString preeditStr(im_context); -@@ -2345,6 +2346,8 @@ - return; - } - -+ if (initialCompose) -+ ClearBeforeTentativeStart(); - pdoc->TentativeStart(); // TentativeActive() from now on - - std::vector<int> indicator = MapImeIndicators(preeditStr.attrs, preeditStr.str); -diff -r a3894ee30cdb -r 225f39cfd931 qt/ScintillaEditBase/ScintillaEditBase.cpp ---- a/qt/ScintillaEditBase/ScintillaEditBase.cpp Sat Mar 04 14:32:28 2017 +1100 -+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp Sun Mar 05 16:28:31 2017 +1100 -@@ -525,12 +525,13 @@ - return; - } - -+ bool initialCompose = false; - if (sqt->pdoc->TentativeActive()) { - sqt->pdoc->TentativeUndo(); - } else { - // No tentative undo means start of this composition so - // Fill in any virtual spaces. -- sqt->ClearBeforeTentativeStart(); -+ initialCompose = true; - } - - sqt->view.imeCaretBlockOverride = false; -@@ -557,6 +558,8 @@ - return; - } - -+ if (initialCompose) -+ sqt->ClearBeforeTentativeStart(); - sqt->pdoc->TentativeStart(); // TentativeActive() from now on. - - std::vector<int> imeIndicator = MapImeIndicators(event); -diff -r a3894ee30cdb -r 225f39cfd931 win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Sat Mar 04 14:32:28 2017 +1100 -+++ b/win32/ScintillaWin.cxx Sun Mar 05 16:28:31 2017 +1100 -@@ -1061,12 +1061,13 @@ - return 0; - } - -+ bool initialCompose = false; - if (pdoc->TentativeActive()) { - pdoc->TentativeUndo(); - } else { - // No tentative undo means start of this composition so - // fill in any virtual spaces. -- ClearBeforeTentativeStart(); -+ initialCompose = true; - } - - view.imeCaretBlockOverride = false; -@@ -1078,6 +1079,8 @@ - return 0; - } - -+ if (initialCompose) -+ ClearBeforeTentativeStart(); - pdoc->TentativeStart(); // TentativeActive from now on. - - std::vector<int> imeIndicator = MapImeIndicators(imc.GetImeAttributes()); diff --git a/src/scintilla_backports/6116_6c62b379a52e.patch b/src/scintilla_backports/6116_6c62b379a52e.patch deleted file mode 100644 index c4637e88..00000000 --- a/src/scintilla_backports/6116_6c62b379a52e.patch +++ /dev/null @@ -1,59 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1488862473 -39600 -# Node ID 6c62b379a52e1d4a2feda80bcec9b352f120dcb6 -# Parent 313a4618efd5ac735a669f923293f296c0e90886 -Avoid potential problems with memcmp reading past end of object. - -diff -r 313a4618efd5 -r 6c62b379a52e lexers/LexErrorList.cxx ---- a/lexers/LexErrorList.cxx Tue Mar 07 12:05:15 2017 +1100 -+++ b/lexers/LexErrorList.cxx Tue Mar 07 15:54:33 2017 +1100 -@@ -106,7 +106,8 @@ - // perl error message: - // <message> at <file> line <line> - return SCE_ERR_PERL; -- } else if ((memcmp(lineBuffer, " at ", 6) == 0) && -+ } else if ((lengthLine >= 6) && -+ (memcmp(lineBuffer, " at ", 6) == 0) && - strstr(lineBuffer, ":line ")) { - // A .NET traceback - return SCE_ERR_NET; -diff -r 313a4618efd5 -r 6c62b379a52e src/Document.cxx ---- a/src/Document.cxx Tue Mar 07 12:05:15 2017 +1100 -+++ b/src/Document.cxx Tue Mar 07 15:54:33 2017 +1100 -@@ -1887,7 +1887,7 @@ - } - } else if (SC_CP_UTF8 == dbcsCodePage) { - const size_t maxFoldingExpansion = 4; -- std::vector<char> searchThing(lengthFind * UTF8MaxBytes * maxFoldingExpansion + 1); -+ std::vector<char> searchThing((lengthFind+1) * UTF8MaxBytes * maxFoldingExpansion + 1); - const int lenSearch = static_cast<int>( - pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind)); - char bytes[UTF8MaxBytes + 1]; -@@ -1914,6 +1914,8 @@ - break; - const int lenFlat = static_cast<int>(pcf->Fold(folded, sizeof(folded), bytes, widthChar)); - folded[lenFlat] = 0; -+ // memcmp may examine lenFlat bytes in both arguments so assert it doesn't read past end of searchThing -+ assert(static_cast<size_t>(indexSearch + lenFlat) <= searchThing.size()); - // Does folded match the buffer - characterMatches = 0 == memcmp(folded, &searchThing[0] + indexSearch, lenFlat); - if (!characterMatches) -@@ -1939,7 +1941,7 @@ - } else if (dbcsCodePage) { - const size_t maxBytesCharacter = 2; - const size_t maxFoldingExpansion = 4; -- std::vector<char> searchThing(lengthFind * maxBytesCharacter * maxFoldingExpansion + 1); -+ std::vector<char> searchThing((lengthFind+1) * maxBytesCharacter * maxFoldingExpansion + 1); - const int lenSearch = static_cast<int>( - pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind)); - while (forward ? (pos < endPos) : (pos >= endPos)) { -@@ -1959,6 +1961,8 @@ - char folded[maxBytesCharacter * maxFoldingExpansion + 1]; - const int lenFlat = static_cast<int>(pcf->Fold(folded, sizeof(folded), bytes, widthChar)); - folded[lenFlat] = 0; -+ // memcmp may examine lenFlat bytes in both arguments so assert it doesn't read past end of searchThing -+ assert(static_cast<size_t>(indexSearch + lenFlat) <= searchThing.size()); - // Does folded match the buffer - characterMatches = 0 == memcmp(folded, &searchThing[0] + indexSearch, lenFlat); - indexDocument += widthChar; diff --git a/src/scintilla_backports/6117_23546875480b.patch b/src/scintilla_backports/6117_23546875480b.patch deleted file mode 100644 index bd0057ac..00000000 --- a/src/scintilla_backports/6117_23546875480b.patch +++ /dev/null @@ -1,313 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1488885645 -39600 -# Node ID 23546875480b1ee4a3f309c738f64166a0409a46 -# Parent 6c62b379a52e1d4a2feda80bcec9b352f120dcb6 -Bug [#1910]. Accessibility support may be queried and, on GTK+, disabled. - -diff -r 6c62b379a52e -r 23546875480b cocoa/ScintillaCocoa.mm ---- a/cocoa/ScintillaCocoa.mm Tue Mar 07 15:54:33 2017 +1100 -+++ b/cocoa/ScintillaCocoa.mm Tue Mar 07 22:20:45 2017 +1100 -@@ -906,6 +906,9 @@ - return r; - } - -+ case SCI_GETACCESSIBILITY: -+ return SC_ACCESSIBILITY_ENABLED; -+ - default: - sptr_t r = ScintillaBase::WndProc(iMessage, wParam, lParam); - -diff -r 6c62b379a52e -r 23546875480b doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Tue Mar 07 15:54:33 2017 +1100 -+++ b/doc/ScintillaDoc.html Tue Mar 07 22:20:45 2017 +1100 -@@ -367,17 +367,17 @@ - <tr> - <td>○ <a class="toc" href="#LongLines">Long lines</a></td> - -+ <td>○ <a class="toc" href="#Accessibility">Accessibility</a></td> -+ - <td>○ <a class="toc" href="#Lexer">Lexer</a></td> - -+ </tr> -+ -+ <tr> - <td>○ <a class="toc" href="#LexerObjects">Lexer objects</a></td> - -- </tr> -- -- <tr> - <td>○ <a class="toc" href="#Notifications">Notifications</a></td> - -- <td>○ <a class="toc" href="#Accessibility">Accessibility</a></td> -- - <td>○ <a class="toc" href="#Images">Images</a></td> - - </tr> -@@ -6511,6 +6511,60 @@ - of a space character in <code>STYLE_DEFAULT</code>. All the edges can be cleared with - <code>SCI_MULTIEDGECLEARALL</code>.</p> - -+ <h2 id="Accessibility">Accessibility</h2> -+ -+ <p>Scintilla supports some platform accessibility features. -+ This support differs between platforms. -+ On GTK+ and Cocoa the platform accessibility APIs are implemented sufficiently to -+ make screen readers work. -+ On Win32, the system caret is manipulated to help screen readers. -+ </p> -+ -+ <code><a class="message" href="#SCI_SETACCESSIBILITY">SCI_SETACCESSIBILITY(int accessibility)</a><br /> -+ <a class="message" href="#SCI_GETACCESSIBILITY">SCI_GETACCESSIBILITY → int</a><br /> -+ </code> -+ -+ <p><b id="SCI_SETACCESSIBILITY">SCI_SETACCESSIBILITY(int accessibility)</b><br /> -+ <b id="SCI_GETACCESSIBILITY">SCI_GETACCESSIBILITY → int</b><br /> -+ These messages may enable or disable accessibility and report its current status.</p> -+ -+ <p>On most platforms, accessibility is either implemented or not implemented and this can be -+ discovered with <code>SCI_GETACCESSIBILITY</code> with -+ <code>SCI_SETACCESSIBILITY</code> performing no action. -+ On GTK+, there are storage and performance costs to accessibility, so it can be disabled -+ by calling <code>SCI_SETACCESSIBILITY</code>. -+ </p> -+ -+ <table class="standard" summary="Accessibility status"> -+ <tbody> -+ <tr> -+ <th align="left">Symbol</th> -+ -+ <th>Value</th> -+ -+ <th align="left">Accessibility status</th> -+ </tr> -+ </tbody> -+ -+ <tbody valign="top"> -+ <tr> -+ <td align="left"><code>SC_ACCESSIBILITY_DISABLED</code></td> -+ -+ <td align="center">0</td> -+ -+ <td>Accessibility is disabled.</td> -+ </tr> -+ -+ <tr> -+ <td align="left"><code>SC_ACCESSIBILITY_ENABLED</code></td> -+ -+ <td align="center">1</td> -+ -+ <td>Accessibility is enabled.</td> -+ </tr> -+ </tbody> -+ </table> -+ - <h2 id="Lexer">Lexer</h2> - - <p>If you define the symbol <code>SCI_LEXER</code> when building Scintilla, (this is sometimes -@@ -7891,15 +7945,6 @@ - <a class="jump" href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a></code> - notification.</p> - -- <h2 id="Accessibility">Accessibility</h2> -- -- <p>Scintilla supports some platform accessibility features. -- This support differs between platforms. -- On GTK+ and Cocoa the platform accessibility APIs are implemented sufficiently to -- make screen readers work. -- On Win32, the system caret is manipulated to help screen readers. -- </p> -- - <h2 id="Images">Images</h2> - - <p>Two formats are supported for images used in margin markers and autocompletion lists, RGBA and XPM.</p> -diff -r 6c62b379a52e -r 23546875480b doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Tue Mar 07 15:54:33 2017 +1100 -+++ b/doc/ScintillaHistory.html Tue Mar 07 22:20:45 2017 +1100 -@@ -527,6 +527,10 @@ - Released 19 February 2017. - </li> - <li> -+ Accessibility support may be queried with SCI_GETACCESSIBILITY. -+ On GTK+, accessibility may be disabled by calling SCI_SETACCESSIBILITY. -+ </li> -+ <li> - Lexer added for "indent" language which is styled as plain text but folded by indentation level. - </li> - <li> -diff -r 6c62b379a52e -r 23546875480b gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Tue Mar 07 15:54:33 2017 +1100 -+++ b/gtk/ScintillaGTK.cxx Tue Mar 07 22:20:45 2017 +1100 -@@ -175,6 +175,7 @@ - rgnUpdate(0), - repaintFullWindow(false), - styleIdleID(0), -+ accessibilityEnabled(SC_ACCESSIBILITY_ENABLED), - accessible(0) { - sci = sci_; - wMain = GTK_WIDGET(sci); -@@ -875,6 +876,19 @@ - return ret; - } - -+ case SCI_GETACCESSIBILITY: -+ return accessibilityEnabled; -+ -+ case SCI_SETACCESSIBILITY: -+ accessibilityEnabled = wParam; -+ if (accessible) { -+ ScintillaGTKAccessible *sciAccessible = ScintillaGTKAccessible::FromAccessible(accessible); -+ if (sciAccessible) { -+ sciAccessible->SetAccessibility(); -+ } -+ } -+ break; -+ - default: - return ScintillaBase::WndProc(iMessage, wParam, lParam); - } -diff -r 6c62b379a52e -r 23546875480b gtk/ScintillaGTK.h ---- a/gtk/ScintillaGTK.h Tue Mar 07 15:54:33 2017 +1100 -+++ b/gtk/ScintillaGTK.h Tue Mar 07 22:20:45 2017 +1100 -@@ -68,6 +68,7 @@ - bool repaintFullWindow; - - guint styleIdleID; -+ int accessibilityEnabled; - AtkObject *accessible; - - // Private so ScintillaGTK objects can not be copied -diff -r 6c62b379a52e -r 23546875480b gtk/ScintillaGTKAccessible.cxx ---- a/gtk/ScintillaGTKAccessible.cxx Tue Mar 07 15:54:33 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.cxx Tue Mar 07 22:20:45 2017 +1100 -@@ -788,6 +788,10 @@ - //~ iface->set_run_attributes = SetRunAttributes; - } - -+bool ScintillaGTKAccessible::Enabled() const { -+ return sci->accessibilityEnabled == SC_ACCESSIBILITY_ENABLED; -+} -+ - // Callbacks - - void ScintillaGTKAccessible::UpdateCursor() { -@@ -820,6 +824,10 @@ - } - - void ScintillaGTKAccessible::ChangeDocument(Document *oldDoc, Document *newDoc) { -+ if (!Enabled()) { -+ return; -+ } -+ - if (oldDoc == newDoc) { - return; - } -@@ -854,7 +862,15 @@ - #endif - } - -+void ScintillaGTKAccessible::SetAccessibility() { -+ // Called by ScintillaGTK when application has enabled or disabled accessibility -+ character_offsets.resize(0); -+ character_offsets.push_back(0); -+} -+ - void ScintillaGTKAccessible::Notify(GtkWidget *, gint, SCNotification *nt) { -+ if (!Enabled()) -+ return; - switch (nt->nmhdr.code) { - case SCN_MODIFIED: { - if (nt->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) { -@@ -864,6 +880,13 @@ - character_offsets.resize(line + 1); - } - } -+ if (nt->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) { -+ // invalidate character offset cache if applicable -+ const Position line = sci->pdoc->LineFromPosition(nt->position); -+ if (character_offsets.size() > static_cast<size_t>(line + 1)) { -+ character_offsets.resize(line + 1); -+ } -+ } - if (nt->modificationType & SC_MOD_INSERTTEXT) { - int startChar = CharacterOffsetFromByteOffset(nt->position); - int lengthChar = sci->pdoc->CountCharacters(nt->position, nt->position + nt->length); -diff -r 6c62b379a52e -r 23546875480b gtk/ScintillaGTKAccessible.h ---- a/gtk/ScintillaGTKAccessible.h Tue Mar 07 15:54:33 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.h Tue Mar 07 22:20:45 2017 +1100 -@@ -23,12 +23,16 @@ - // cache holding character offset for each line start, see CharacterOffsetFromByteOffset() - std::vector<Position> character_offsets; - -+ // cache holding character offset for each line start, see CharacterOffsetFromByteOffset() -+ std::vector<Position> character_offsets; -+ - // cached length of the deletion, in characters (see Notify()) - int deletionLengthChar; - // local state for comparing - Position old_pos; - std::vector<SelectionRange> old_sels; - -+ bool Enabled() const; - void UpdateCursor(); - void Notify(GtkWidget *widget, gint code, SCNotification *nt); - static void SciNotify(GtkWidget *widget, gint code, SCNotification *nt, gpointer data) { -@@ -136,6 +140,7 @@ - // So ScintillaGTK can notify us - void ChangeDocument(Document *oldDoc, Document *newDoc); - void NotifyReadOnly(); -+ void SetAccessibility(); - - // Helper GtkWidget methods - static AtkObject *WidgetGetAccessibleImpl(GtkWidget *widget, AtkObject **cache, gpointer widget_parent_class); -diff -r 6c62b379a52e -r 23546875480b include/Scintilla.h ---- a/include/Scintilla.h Tue Mar 07 15:54:33 2017 +1100 -+++ b/include/Scintilla.h Tue Mar 07 22:20:45 2017 +1100 -@@ -593,6 +593,10 @@ - #define SCI_LINESSPLIT 2289 - #define SCI_SETFOLDMARGINCOLOUR 2290 - #define SCI_SETFOLDMARGINHICOLOUR 2291 -+#define SC_ACCESSIBILITY_DISABLED 0 -+#define SC_ACCESSIBILITY_ENABLED 1 -+#define SCI_SETACCESSIBILITY 2702 -+#define SCI_GETACCESSIBILITY 2703 - #define SCI_LINEDOWN 2300 - #define SCI_LINEDOWNEXTEND 2301 - #define SCI_LINEUP 2302 -diff -r 6c62b379a52e -r 23546875480b include/Scintilla.iface ---- a/include/Scintilla.iface Tue Mar 07 15:54:33 2017 +1100 -+++ b/include/Scintilla.iface Tue Mar 07 22:20:45 2017 +1100 -@@ -1476,6 +1476,16 @@ - # Set the other colour used as a chequerboard pattern in the fold margin - fun void SetFoldMarginHiColour=2291(bool useSetting, colour fore) - -+enu Accessibility=SC_ACCESSIBILITY_ -+val SC_ACCESSIBILITY_DISABLED=0 -+val SC_ACCESSIBILITY_ENABLED=1 -+ -+# Enable or disable accessibility. -+set void SetAccessibility=2702(int accessibility,) -+ -+# Report accessibility status. -+get int GetAccessibility=2703(,) -+ - ## New messages go here - - ## Start of key messages -diff -r 6c62b379a52e -r 23546875480b src/Editor.cxx ---- a/src/Editor.cxx Tue Mar 07 15:54:33 2017 +1100 -+++ b/src/Editor.cxx Tue Mar 07 22:20:45 2017 +1100 -@@ -7554,6 +7554,13 @@ - std::vector<EdgeProperties>().swap(vs.theMultiEdge); // Free vector and memory, C++03 compatible - InvalidateStyleRedraw(); - break; -+ -+ case SCI_GETACCESSIBILITY: -+ return SC_ACCESSIBILITY_DISABLED; -+ -+ case SCI_SETACCESSIBILITY: -+ // May be implemented by platform code. -+ break; - - case SCI_GETDOCPOINTER: - return reinterpret_cast<sptr_t>(pdoc); diff --git a/src/scintilla_backports/6118_559dea66606f.patch b/src/scintilla_backports/6118_559dea66606f.patch deleted file mode 100644 index cb791fc9..00000000 --- a/src/scintilla_backports/6118_559dea66606f.patch +++ /dev/null @@ -1,20 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1488886060 -39600 -# Node ID 559dea66606f42c080f04db706a1ebe6bef83713 -# Parent 23546875480b1ee4a3f309c738f64166a0409a46 -Bug [#1910]. Fixed double declaration. - -diff -r 23546875480b -r 559dea66606f gtk/ScintillaGTKAccessible.h ---- a/gtk/ScintillaGTKAccessible.h Tue Mar 07 22:20:45 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.h Tue Mar 07 22:27:40 2017 +1100 -@@ -23,9 +23,6 @@ - // cache holding character offset for each line start, see CharacterOffsetFromByteOffset() - std::vector<Position> character_offsets; - -- // cache holding character offset for each line start, see CharacterOffsetFromByteOffset() -- std::vector<Position> character_offsets; -- - // cached length of the deletion, in characters (see Notify()) - int deletionLengthChar; - // local state for comparing diff --git a/src/scintilla_backports/6119_71bee2f06619.patch b/src/scintilla_backports/6119_71bee2f06619.patch deleted file mode 100644 index 693749c7..00000000 --- a/src/scintilla_backports/6119_71bee2f06619.patch +++ /dev/null @@ -1,24 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1488922409 -39600 -# Node ID 71bee2f066197ae012f92de55433700df2bdcd09 -# Parent 559dea66606f42c080f04db706a1ebe6bef83713 -Bug [#1910]. Fixed more duplicate code. - -diff -r 559dea66606f -r 71bee2f06619 gtk/ScintillaGTKAccessible.cxx ---- a/gtk/ScintillaGTKAccessible.cxx Tue Mar 07 22:27:40 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.cxx Wed Mar 08 08:33:29 2017 +1100 -@@ -880,13 +880,6 @@ - character_offsets.resize(line + 1); - } - } -- if (nt->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) { -- // invalidate character offset cache if applicable -- const Position line = sci->pdoc->LineFromPosition(nt->position); -- if (character_offsets.size() > static_cast<size_t>(line + 1)) { -- character_offsets.resize(line + 1); -- } -- } - if (nt->modificationType & SC_MOD_INSERTTEXT) { - int startChar = CharacterOffsetFromByteOffset(nt->position); - int lengthChar = sci->pdoc->CountCharacters(nt->position, nt->position + nt->length); diff --git a/src/scintilla_backports/6120_8e0cb37c4972.patch b/src/scintilla_backports/6120_8e0cb37c4972.patch deleted file mode 100644 index 373e1121..00000000 --- a/src/scintilla_backports/6120_8e0cb37c4972.patch +++ /dev/null @@ -1,71 +0,0 @@ -# HG changeset patch -# User Colomban Wendling <ban@herbesfolles.org> -# Date 1488893049 -3600 -# Node ID 8e0cb37c4972cd66b33293b88031acf453685cfd -# Parent 71bee2f066197ae012f92de55433700df2bdcd09 -GTK: Fix popup positioning on monitors not positioned at 0,0 - -diff -r 71bee2f06619 -r 8e0cb37c4972 gtk/PlatGTK.cxx ---- a/gtk/PlatGTK.cxx Wed Mar 08 08:33:29 2017 +1100 -+++ b/gtk/PlatGTK.cxx Tue Mar 07 14:24:09 2017 +0100 -@@ -1059,25 +1059,21 @@ - GdkWindow *wndRelativeTo = WindowFromWidget(PWidget(relativeTo.wid)); - gdk_window_get_origin(wndRelativeTo, &ox, &oy); - ox += rc.left; -- if (ox < 0) -- ox = 0; - oy += rc.top; -- if (oy < 0) -- oy = 0; - -- GdkRectangle rcScreen = MonitorRectangleForWidget(PWidget(relativeTo.wid)); -+ GdkRectangle rcMonitor = MonitorRectangleForWidget(PWidget(relativeTo.wid)); - - /* do some corrections to fit into screen */ - int sizex = rc.right - rc.left; - int sizey = rc.bottom - rc.top; -- const int screenWidth = rcScreen.width; -- const int screenHeight = rcScreen.height; -- if (sizex > screenWidth) -- ox = 0; /* the best we can do */ -- else if (ox + sizex > screenWidth) -- ox = screenWidth - sizex; -- if (oy + sizey > screenHeight) -- oy = screenHeight - sizey; -+ if (sizex > rcMonitor.width || ox < rcMonitor.x) -+ ox = rcMonitor.x; /* the best we can do */ -+ else if (ox + sizex > rcMonitor.x + rcMonitor.width) -+ ox = rcMonitor.x + rcMonitor.width - sizex; -+ if (sizey > rcMonitor.height || oy < rcMonitor.y) -+ oy = rcMonitor.y; -+ else if (oy + sizey > rcMonitor.y + rcMonitor.height) -+ oy = rcMonitor.y + rcMonitor.height - sizey; - - gtk_window_move(GTK_WINDOW(PWidget(wid)), ox, oy); - -@@ -1929,20 +1925,18 @@ - // Rely on GTK+ to do the right thing with positioning - gtk_menu_popup_at_pointer(widget, NULL); - #else -- GdkRectangle rcScreen = MonitorRectangleForWidget(PWidget(wnd.GetID())); -- const int screenWidth = rcScreen.width; -- const int screenHeight = rcScreen.height; -+ GdkRectangle rcMonitor = MonitorRectangleForWidget(PWidget(wnd.GetID())); - GtkRequisition requisition; - #if GTK_CHECK_VERSION(3,0,0) - gtk_widget_get_preferred_size(GTK_WIDGET(widget), NULL, &requisition); - #else - gtk_widget_size_request(GTK_WIDGET(widget), &requisition); - #endif -- if ((pt.x + requisition.width) > screenWidth) { -- pt.x = screenWidth - requisition.width; -+ if ((pt.x + requisition.width) > rcMonitor.x + rcMonitor.width) { -+ pt.x = rcMonitor.x + rcMonitor.width - requisition.width; - } -- if ((pt.y + requisition.height) > screenHeight) { -- pt.y = screenHeight - requisition.height; -+ if ((pt.y + requisition.height) > rcMonitor.y + rcMonitor.height) { -+ pt.y = rcMonitor.y + rcMonitor.height - requisition.height; - } - gtk_menu_popup(widget, NULL, NULL, MenuPositionFunc, - GINT_TO_POINTER((static_cast<int>(pt.y) << 16) | static_cast<int>(pt.x)), 0, diff --git a/src/scintilla_backports/6124_4527b3c217a4.patch b/src/scintilla_backports/6124_4527b3c217a4.patch deleted file mode 100644 index f439b37e..00000000 --- a/src/scintilla_backports/6124_4527b3c217a4.patch +++ /dev/null @@ -1,43 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1488955608 -39600 -# Node ID 4527b3c217a44e45e4714c2a302f124df7109b2f -# Parent 0fd4b41bcec612df9a3e8204399d0acde55194ce -Fix warnings from Visual Studio 2017. - -diff -r 0fd4b41bcec6 -r 4527b3c217a4 src/PositionCache.cxx ---- a/src/PositionCache.cxx Wed Mar 08 16:36:39 2017 +1100 -+++ b/src/PositionCache.cxx Wed Mar 08 17:46:48 2017 +1100 -@@ -392,7 +392,7 @@ - } - - SpecialRepresentations::SpecialRepresentations() { -- std::fill(startByteHasReprs, startByteHasReprs+0x100, 0); -+ std::fill(startByteHasReprs, startByteHasReprs+0x100, static_cast<short>(0)); - } - - void SpecialRepresentations::SetRepresentation(const char *charBytes, const char *value) { -@@ -433,7 +433,7 @@ - - void SpecialRepresentations::Clear() { - mapReprs.clear(); -- std::fill(startByteHasReprs, startByteHasReprs+0x100, 0); -+ std::fill(startByteHasReprs, startByteHasReprs+0x100, static_cast<short>(0)); - } - - void BreakFinder::Insert(int val) { -diff -r 0fd4b41bcec6 -r 4527b3c217a4 src/RESearch.cxx ---- a/src/RESearch.cxx Wed Mar 08 16:36:39 2017 +1100 -+++ b/src/RESearch.cxx Wed Mar 08 17:46:48 2017 +1100 -@@ -256,9 +256,9 @@ - charClass = charClassTable; - sta = NOP; /* status of lastpat */ - bol = 0; -- std::fill(bittab, bittab + BITBLK, 0); -+ std::fill(bittab, bittab + BITBLK, static_cast<unsigned char>(0)); - std::fill(tagstk, tagstk + MAXTAG, 0); -- std::fill(nfa, nfa + MAXNFA, 0); -+ std::fill(nfa, nfa + MAXNFA, '\0'); - Clear(); - } - diff --git a/src/scintilla_backports/6131_a78e38849624.patch b/src/scintilla_backports/6131_a78e38849624.patch deleted file mode 100644 index 9fb0f43d..00000000 --- a/src/scintilla_backports/6131_a78e38849624.patch +++ /dev/null @@ -1,56 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1489619799 -39600 -# Node ID a78e38849624fca65cd615da3f976d22db03a48b -# Parent e8364d5495d60b675717c68f97cc527ab3fc95ee -Fix use-after-free in fold tags when top line folded then new top line inserted. -In SparseVector, string inserted at start then NULL inserted at start. - -diff -r e8364d5495d6 -r a78e38849624 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sat Mar 11 10:41:32 2017 +1100 -+++ b/doc/ScintillaHistory.html Thu Mar 16 10:16:39 2017 +1100 -@@ -555,6 +555,9 @@ - For IMEs, do not clear selected text when there is no composition text to show. - </li> - <li> -+ Fix to crash with fold tags where line inserted at start. -+ </li> -+ <li> - Fix to stream selection mode when moving caret up or down. - <a href="http://sourceforge.net/p/scintilla/bugs/1905/">Bug #1905</a>. - </li> -diff -r e8364d5495d6 -r a78e38849624 src/SparseVector.h ---- a/src/SparseVector.h Sat Mar 11 10:41:32 2017 +1100 -+++ b/src/SparseVector.h Thu Mar 16 10:16:39 2017 +1100 -@@ -100,7 +100,8 @@ - if (partition == 0) { - // Inserting at start of document so ensure 0 - if (valueCurrent != T()) { -- ClearValue(0); -+ // Since valueCurrent is needed again, should not ClearValue -+ values->SetValueAt(0, T()); - starts->InsertPartition(1, 0); - values->InsertValue(1, 1, valueCurrent); - starts->InsertText(0, insertLength); -diff -r e8364d5495d6 -r a78e38849624 test/unit/testSparseVector.cxx ---- a/test/unit/testSparseVector.cxx Sat Mar 11 10:41:32 2017 +1100 -+++ b/test/unit/testSparseVector.cxx Thu Mar 16 10:16:39 2017 +1100 -@@ -89,6 +89,18 @@ - st.Check(); - } - -+ SECTION("InsertStringAtStartThenInsertSpaceAtStart") { -+ REQUIRE(1 == st.Elements()); -+ st.InsertSpace(0, 5); -+ st.SetValueAt(0, "3"); -+ REQUIRE(1 == st.Elements()); -+ REQUIRE("3----" == Representation(st)); -+ st.InsertSpace(0, 1); -+ REQUIRE(2 == st.Elements()); -+ REQUIRE("-3----" == Representation(st)); -+ st.Check(); -+ } -+ - SECTION("InsertAndDeleteAtEnd") { - REQUIRE(1 == st.Elements()); - st.InsertSpace(0, 5); diff --git a/src/scintilla_backports/6132_6cf19f2bf214.patch b/src/scintilla_backports/6132_6cf19f2bf214.patch deleted file mode 100644 index 3ef0f6c7..00000000 --- a/src/scintilla_backports/6132_6cf19f2bf214.patch +++ /dev/null @@ -1,19 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1489631977 -39600 -# Node ID 6cf19f2bf214b1d1dc0ba05412a6659142c772ec -# Parent a78e38849624fca65cd615da3f976d22db03a48b -Fix difference between right of line end and left of fold tag. - -diff -r a78e38849624 -r 6cf19f2bf214 src/EditView.cxx ---- a/src/EditView.cxx Thu Mar 16 10:16:39 2017 +1100 -+++ b/src/EditView.cxx Thu Mar 16 13:39:37 2017 +1100 -@@ -1087,7 +1087,7 @@ - - const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; - XYPOSITION virtualSpace = model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)) * spaceWidth; -- rcSegment.left = xStart + static_cast<XYPOSITION>(ll->positions[ll->numCharsInLine] - subLineStart) + spaceWidth + virtualSpace; -+ rcSegment.left = xStart + static_cast<XYPOSITION>(ll->positions[ll->numCharsInLine] - subLineStart) + virtualSpace + vsDraw.aveCharWidth; - rcSegment.right = rcSegment.left + static_cast<XYPOSITION>(widthFoldDisplayText); - - ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret); diff --git a/src/scintilla_backports/6133_30f1573f17ac.patch b/src/scintilla_backports/6133_30f1573f17ac.patch deleted file mode 100644 index a69f2c14..00000000 --- a/src/scintilla_backports/6133_30f1573f17ac.patch +++ /dev/null @@ -1,19 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1489632019 -39600 -# Node ID 30f1573f17ace82fd1adba69e733c4726f68e867 -# Parent 6cf19f2bf214b1d1dc0ba05412a6659142c772ec -Fix 1 pixel unpainted as background. - -diff -r 6cf19f2bf214 -r 30f1573f17ac src/EditView.cxx ---- a/src/EditView.cxx Thu Mar 16 13:39:37 2017 +1100 -+++ b/src/EditView.cxx Thu Mar 16 13:40:19 2017 +1100 -@@ -1111,7 +1111,7 @@ - - // Fill Remainder of the line - PRectangle rcRemainder = rcSegment; -- rcRemainder.left = rcRemainder.right + 1; -+ rcRemainder.left = rcRemainder.right; - if (rcRemainder.left < rcLine.left) - rcRemainder.left = rcLine.left; - rcRemainder.right = rcLine.right; diff --git a/src/scintilla_backports/6134_0253f113f223.patch b/src/scintilla_backports/6134_0253f113f223.patch deleted file mode 100644 index aa1ffe61..00000000 --- a/src/scintilla_backports/6134_0253f113f223.patch +++ /dev/null @@ -1,36 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1489704595 -39600 -# Node ID 0253f113f22359c009f415099cf635b2637def1e -# Parent 30f1573f17ace82fd1adba69e733c4726f68e867 -Round left and right sides of fold text box to ensure within the allocation. - -diff -r 30f1573f17ac -r 0253f113f223 src/EditView.cxx ---- a/src/EditView.cxx Thu Mar 16 13:40:19 2017 +1100 -+++ b/src/EditView.cxx Fri Mar 17 09:49:55 2017 +1100 -@@ -1133,14 +1133,17 @@ - if (phase & drawIndicatorsFore) { - if (model.foldDisplayTextStyle == SC_FOLDDISPLAYTEXT_BOXED) { - surface->PenColour(textFore); -- surface->MoveTo(static_cast<int>(rcSegment.left), static_cast<int>(rcSegment.top)); -- surface->LineTo(static_cast<int>(rcSegment.left), static_cast<int>(rcSegment.bottom)); -- surface->MoveTo(static_cast<int>(rcSegment.right), static_cast<int>(rcSegment.top)); -- surface->LineTo(static_cast<int>(rcSegment.right), static_cast<int>(rcSegment.bottom)); -- surface->MoveTo(static_cast<int>(rcSegment.left), static_cast<int>(rcSegment.top)); -- surface->LineTo(static_cast<int>(rcSegment.right), static_cast<int>(rcSegment.top)); -- surface->MoveTo(static_cast<int>(rcSegment.left), static_cast<int>(rcSegment.bottom - 1)); -- surface->LineTo(static_cast<int>(rcSegment.right), static_cast<int>(rcSegment.bottom - 1)); -+ PRectangle rcBox = rcSegment; -+ rcBox.left = static_cast<XYPOSITION>(RoundXYPosition(rcSegment.left)); -+ rcBox.right = static_cast<XYPOSITION>(RoundXYPosition(rcSegment.right)); -+ surface->MoveTo(static_cast<int>(rcBox.left), static_cast<int>(rcBox.top)); -+ surface->LineTo(static_cast<int>(rcBox.left), static_cast<int>(rcBox.bottom)); -+ surface->MoveTo(static_cast<int>(rcBox.right), static_cast<int>(rcBox.top)); -+ surface->LineTo(static_cast<int>(rcBox.right), static_cast<int>(rcBox.bottom)); -+ surface->MoveTo(static_cast<int>(rcBox.left), static_cast<int>(rcBox.top)); -+ surface->LineTo(static_cast<int>(rcBox.right), static_cast<int>(rcBox.top)); -+ surface->MoveTo(static_cast<int>(rcBox.left), static_cast<int>(rcBox.bottom - 1)); -+ surface->LineTo(static_cast<int>(rcBox.right), static_cast<int>(rcBox.bottom - 1)); - } - } - diff --git a/src/scintilla_backports/6135_34665edc7efd.patch b/src/scintilla_backports/6135_34665edc7efd.patch deleted file mode 100644 index 3f807467..00000000 --- a/src/scintilla_backports/6135_34665edc7efd.patch +++ /dev/null @@ -1,20 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1489632594 -39600 -# Node ID 34665edc7efdd526c62e426bb0f6267f64e156e7 -# Parent 0253f113f22359c009f415099cf635b2637def1e -For multiphase drawing ensure edges and mark underline drawn over fold tags by -moving background drawing of fold tags before edge line and mark underline. - -diff -r 0253f113f223 -r 34665edc7efd src/EditView.cxx ---- a/src/EditView.cxx Fri Mar 17 09:49:55 2017 +1100 -+++ b/src/EditView.cxx Thu Mar 16 13:49:54 2017 +1100 -@@ -1849,6 +1849,8 @@ - if ((phasesDraw != phasesOne) && (phase & drawBack)) { - DrawBackground(surface, model, vsDraw, ll, rcLine, lineRange, posLineStart, xStart, - subLine, background); -+ DrawFoldDisplayText(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, subLineStart, drawBack); -+ phase = static_cast<DrawPhase>(phase & ~drawBack); - DrawEOL(surface, model, vsDraw, ll, rcLine, line, lineRange.end, - xStart, subLine, subLineStart, background); - } diff --git a/src/scintilla_backports/6136_2b25287311d0.patch b/src/scintilla_backports/6136_2b25287311d0.patch deleted file mode 100644 index cea704d2..00000000 --- a/src/scintilla_backports/6136_2b25287311d0.patch +++ /dev/null @@ -1,43 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1489633459 -39600 -# Node ID 2b25287311d015ecc9971c101f0f40ae00c8ca4e -# Parent 34665edc7efdd526c62e426bb0f6267f64e156e7 -For single phase drawing ensure edges and mark underline drawn over fold tags by -moving drawing of edge line and mark underline after fold tags. - -diff -r 34665edc7efd -r 2b25287311d0 src/EditView.cxx ---- a/src/EditView.cxx Thu Mar 16 13:49:54 2017 +1100 -+++ b/src/EditView.cxx Thu Mar 16 14:04:19 2017 +1100 -@@ -1857,8 +1857,10 @@ - - if (phase & drawIndicatorsBack) { - DrawIndicators(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, lineRange.end, true, model.hoverIndicatorPos); -- DrawEdgeLine(surface, vsDraw, ll, rcLine, lineRange, xStart); -- DrawMarkUnderline(surface, model, vsDraw, line, rcLine); -+ if (phasesDraw != phasesOne) { -+ DrawEdgeLine(surface, vsDraw, ll, rcLine, lineRange, xStart); -+ DrawMarkUnderline(surface, model, vsDraw, line, rcLine); -+ } - } - - if (phase & drawText) { -@@ -1874,14 +1876,15 @@ - DrawIndicators(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, lineRange.end, false, model.hoverIndicatorPos); - } - -- // End of the drawing of the current line -+ DrawFoldDisplayText(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, subLineStart, phase); -+ - if (phasesDraw == phasesOne) { - DrawEOL(surface, model, vsDraw, ll, rcLine, line, lineRange.end, - xStart, subLine, subLineStart, background); -+ DrawEdgeLine(surface, vsDraw, ll, rcLine, lineRange, xStart); -+ DrawMarkUnderline(surface, model, vsDraw, line, rcLine); - } - -- DrawFoldDisplayText(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, subLineStart, phase); -- - if (!hideSelection && (phase & drawSelectionTranslucent)) { - DrawTranslucentSelection(surface, model, vsDraw, ll, line, rcLine, subLine, lineRange, xStart); - } diff --git a/src/scintilla_backports/6137_c3bba4a9193e.patch b/src/scintilla_backports/6137_c3bba4a9193e.patch deleted file mode 100644 index d87dec5c..00000000 --- a/src/scintilla_backports/6137_c3bba4a9193e.patch +++ /dev/null @@ -1,20 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1489633522 -39600 -# Node ID c3bba4a9193ea55175c309109e5bab8c87f2a0bd -# Parent 2b25287311d015ecc9971c101f0f40ae00c8ca4e -For single phase drawing ensure remainder of line filled by always filling -in tag fold drawing. - -diff -r 2b25287311d0 -r c3bba4a9193e src/EditView.cxx ---- a/src/EditView.cxx Thu Mar 16 14:04:19 2017 +1100 -+++ b/src/EditView.cxx Thu Mar 16 14:05:22 2017 +1100 -@@ -1106,7 +1106,7 @@ - } - } - -- if ((phasesDraw != phasesOne) && (phase & drawBack)) { -+ if (phase & drawBack) { - surface->FillRectangle(rcSegment, textBack); - - // Fill Remainder of the line diff --git a/src/scintilla_backports/6138_55368b05bb72.patch b/src/scintilla_backports/6138_55368b05bb72.patch deleted file mode 100644 index 7d6d4519..00000000 --- a/src/scintilla_backports/6138_55368b05bb72.patch +++ /dev/null @@ -1,40 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1489925352 -39600 -# Node ID 55368b05bb72a05862c4ffb6cb01a1ce70f64c0f -# Parent c3bba4a9193ea55175c309109e5bab8c87f2a0bd -Group non-single-phase drawing before text. - -diff -r c3bba4a9193e -r 55368b05bb72 src/EditView.cxx ---- a/src/EditView.cxx Thu Mar 16 14:05:22 2017 +1100 -+++ b/src/EditView.cxx Sun Mar 19 23:09:12 2017 +1100 -@@ -1846,18 +1846,18 @@ - xStart += static_cast<int>(ll->wrapIndent); - } - -- if ((phasesDraw != phasesOne) && (phase & drawBack)) { -- DrawBackground(surface, model, vsDraw, ll, rcLine, lineRange, posLineStart, xStart, -- subLine, background); -- DrawFoldDisplayText(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, subLineStart, drawBack); -- phase = static_cast<DrawPhase>(phase & ~drawBack); -- DrawEOL(surface, model, vsDraw, ll, rcLine, line, lineRange.end, -- xStart, subLine, subLineStart, background); -- } -+ if (phasesDraw != phasesOne) { -+ if (phase & drawBack) { -+ DrawBackground(surface, model, vsDraw, ll, rcLine, lineRange, posLineStart, xStart, -+ subLine, background); -+ DrawFoldDisplayText(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, subLineStart, drawBack); -+ phase = static_cast<DrawPhase>(phase & ~drawBack); // Remove drawBack to not draw again in DrawFoldDisplayText -+ DrawEOL(surface, model, vsDraw, ll, rcLine, line, lineRange.end, -+ xStart, subLine, subLineStart, background); -+ } - -- if (phase & drawIndicatorsBack) { -- DrawIndicators(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, lineRange.end, true, model.hoverIndicatorPos); -- if (phasesDraw != phasesOne) { -+ if (phase & drawIndicatorsBack) { -+ DrawIndicators(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, lineRange.end, true, model.hoverIndicatorPos); - DrawEdgeLine(surface, vsDraw, ll, rcLine, lineRange, xStart); - DrawMarkUnderline(surface, model, vsDraw, line, rcLine); - } diff --git a/src/scintilla_backports/6145_b3eaa82b3750.patch b/src/scintilla_backports/6145_b3eaa82b3750.patch deleted file mode 100644 index dcc41362..00000000 --- a/src/scintilla_backports/6145_b3eaa82b3750.patch +++ /dev/null @@ -1,1426 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1490250637 -39600 -# Node ID b3eaa82b3750a3b4159838fee4180139554d4544 -# Parent 3115ddbbf95d0ea06e5dd8ecba8fbafb1cad639d -Updated case conversion and character categories to Unicode 9. - -diff -r 3115ddbbf95d -r b3eaa82b3750 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Tue Mar 21 09:59:45 2017 +1100 -+++ b/doc/ScintillaHistory.html Thu Mar 23 17:30:37 2017 +1100 -@@ -527,6 +527,17 @@ - Released 21 March 2017. - </li> - <li> -+ Updated case conversion and character categories to Unicode 9. -+ </li> -+ </ul> -+ <h3> -+ <a href="http://www.scintilla.org/scite374.zip">Release 3.7.4</a> -+ </h3> -+ <ul> -+ <li> -+ Released 21 March 2017. -+ </li> -+ <li> - Requires a C++11 compiler. GCC 4.8 and MSVC 2015 are supported. - </li> - <li> -diff -r 3115ddbbf95d -r b3eaa82b3750 lexlib/CharacterCategory.cxx ---- a/lexlib/CharacterCategory.cxx Tue Mar 21 09:59:45 2017 +1100 -+++ b/lexlib/CharacterCategory.cxx Thu Mar 23 17:30:37 2017 +1100 -@@ -21,7 +21,7 @@ - - const int catRanges[] = { - //++Autogenerated -- start of section automatically generated --// Created with Python 3.3.0, Unicode 6.1.0 -+// Created with Python 3.6.1, Unicode 9.0.0 - 25, - 1046, - 1073, -@@ -395,7 +395,8 @@ - 28483, - 28513, - 28625, --28669, -+28640, -+28701, - 28820, - 28864, - 28913, -@@ -639,7 +640,15 @@ - 42145, - 42176, - 42209, --42269, -+42240, -+42273, -+42304, -+42337, -+42368, -+42401, -+42432, -+42465, -+42525, - 42528, - 43773, - 43811, -@@ -650,6 +659,7 @@ - 45361, - 45388, - 45437, -+45493, - 45555, - 45597, - 45605, -@@ -668,7 +678,6 @@ - 48753, - 48829, - 49178, --49341, - 49362, - 49457, - 49523, -@@ -676,7 +685,8 @@ - 49621, - 49669, - 50033, --50077, -+50074, -+50109, - 50129, - 50180, - 51203, -@@ -739,12 +749,12 @@ - 68561, - 68605, - 70660, --70717, --70724, --71101, --72837, --73725, --73733, -+71357, -+71364, -+71645, -+72325, -+72794, -+72805, - 73830, - 73860, - 75589, -@@ -765,9 +775,6 @@ - 77329, - 77347, - 77380, --77597, --77604, --77853, - 77861, - 77894, - 77981, -@@ -880,6 +887,8 @@ - 89617, - 89651, - 89693, -+89892, -+89949, - 90149, - 90182, - 90269, -@@ -960,6 +969,7 @@ - 98099, - 98133, - 98173, -+98309, - 98342, - 98461, - 98468, -@@ -969,8 +979,6 @@ - 98884, - 99645, - 99652, --99997, --100004, - 100189, - 100260, - 100293, -@@ -983,7 +991,7 @@ - 101029, - 101117, - 101124, --101213, -+101245, - 101380, - 101445, - 101533, -@@ -991,7 +999,8 @@ - 101917, - 102154, - 102389, --102429, -+102404, -+102437, - 102470, - 102557, - 102564, -@@ -1027,6 +1036,7 @@ - 106013, - 106020, - 106109, -+106533, - 106566, - 106653, - 106660, -@@ -1044,15 +1054,16 @@ - 108870, - 108965, - 108996, --109053, -+109045, -+109085, -+109188, - 109286, --109341, --109572, -+109322, -+109540, - 109637, - 109725, - 109768, - 110090, --110301, - 110389, - 110404, - 110621, -@@ -1077,6 +1088,8 @@ - 113405, - 113414, - 113693, -+113864, -+114205, - 114246, - 114321, - 114365, -@@ -1260,8 +1273,10 @@ - 159748, - 160277, - 160605, --160772, --163517, -+160768, -+163549, -+163585, -+163805, - 163852, - 163876, - 183729, -@@ -1274,7 +1289,8 @@ - 185348, - 187761, - 187849, --187965, -+187940, -+188221, - 188420, - 188861, - 188868, -@@ -1316,7 +1332,7 @@ - 196812, - 196849, - 196965, --197078, -+197082, - 197117, - 197128, - 197469, -@@ -1325,13 +1341,15 @@ - 198788, - 200477, - 200708, -+200869, -+200932, - 202021, - 202052, - 202109, - 202244, - 204509, - 204804, --205757, -+205821, - 205829, - 205926, - 206053, -@@ -1352,9 +1370,7 @@ - 208573, - 208900, - 210333, --210438, --210980, --211206, -+210436, - 211293, - 211464, - 211786, -@@ -1363,6 +1379,7 @@ - 212996, - 213733, - 213798, -+213861, - 213917, - 213969, - 214020, -@@ -1388,6 +1405,9 @@ - 218339, - 218385, - 218589, -+218629, -+219079, -+219133, - 221189, - 221318, - 221348, -@@ -1416,7 +1436,6 @@ - 226565, - 226630, - 226661, --226694, - 226756, - 226824, - 227140, -@@ -1444,7 +1463,8 @@ - 232260, - 233219, - 233425, --233501, -+233473, -+233789, - 235537, - 235805, - 236037, -@@ -1459,6 +1479,8 @@ - 237189, - 237220, - 237309, -+237317, -+237405, - 237569, - 238979, - 240993, -@@ -1466,8 +1488,8 @@ - 241441, - 242531, - 243717, --244989, --245637, -+245469, -+245605, - 245760, - 245793, - 245824, -@@ -1812,7 +1834,7 @@ - 265206, - 265242, - 265405, --265562, -+265434, - 265738, - 265763, - 265821, -@@ -1829,7 +1851,7 @@ - 266755, - 267197, - 267283, --268125, -+268285, - 268805, - 269223, - 269349, -@@ -1882,7 +1904,8 @@ - 274561, - 274601, - 274730, --274781, -+274773, -+274845, - 274962, - 275125, - 275282, -@@ -1903,7 +1926,10 @@ - 277173, - 278162, - 286741, --286994, -+286989, -+287022, -+287053, -+287086, - 287125, - 287762, - 287829, -@@ -1916,7 +1942,7 @@ - 292501, - 293778, - 293973, --294557, -+294909, - 294933, - 296189, - 296981, -@@ -1933,8 +1959,6 @@ - 311317, - 314866, - 314901, --319517, --319541, - 322829, - 322862, - 322893, -@@ -2003,9 +2027,18 @@ - 353810, - 354485, - 354546, --354749, --354837, --355165, -+354741, -+355997, -+356053, -+357085, -+357141, -+358237, -+358325, -+358717, -+358741, -+359005, -+359829, -+359965, - 360448, - 361981, - 361985, -@@ -2203,7 +2236,12 @@ - 378339, - 378385, - 378700, --378781, -+378769, -+378892, -+378929, -+378957, -+378993, -+379069, - 380949, - 381789, - 381813, -@@ -2295,7 +2333,7 @@ - 636637, - 636949, - 638980, --1309117, -+1309405, - 1310724, - 1311395, - 1311428, -@@ -2389,8 +2427,12 @@ - 1364641, - 1364672, - 1364705, --1364765, --1364965, -+1364736, -+1364769, -+1364800, -+1364833, -+1364867, -+1364933, - 1364996, - 1367241, - 1367557, -@@ -2497,12 +2539,21 @@ - 1372545, - 1372576, - 1372609, --1372669, -+1372644, - 1372672, - 1372705, - 1372736, - 1372769, --1372829, -+1372864, -+1372897, -+1372928, -+1372961, -+1372992, -+1373025, -+1373056, -+1373089, -+1373120, -+1373153, - 1373184, - 1373217, - 1373248, -@@ -2514,7 +2565,13 @@ - 1373440, - 1373473, - 1373504, --1373565, -+1373693, -+1373696, -+1373857, -+1373888, -+1373921, -+1373981, -+1375972, - 1376003, - 1376065, - 1376100, -@@ -2541,7 +2598,7 @@ - 1380420, - 1382022, - 1382533, --1382589, -+1382621, - 1382865, - 1382920, - 1383261, -@@ -2549,7 +2606,9 @@ - 1384004, - 1384209, - 1384292, --1384349, -+1384337, -+1384356, -+1384413, - 1384456, - 1384772, - 1385669, -@@ -2576,7 +2635,13 @@ - 1391112, - 1391453, - 1391569, --1391645, -+1391620, -+1391781, -+1391811, -+1391844, -+1392136, -+1392452, -+1392637, - 1392644, - 1393957, - 1394150, -@@ -2599,8 +2664,9 @@ - 1396469, - 1396548, - 1396582, --1396637, --1396740, -+1396613, -+1396646, -+1396676, - 1398277, - 1398308, - 1398341, -@@ -2635,6 +2701,12 @@ - 1402109, - 1402116, - 1402365, -+1402369, -+1403764, -+1403779, -+1403905, -+1404125, -+1404417, - 1406980, - 1408102, - 1408165, -@@ -2681,8 +2753,8 @@ - 2061908, - 2062429, - 2062948, --2074573, --2074606, -+2074574, -+2074605, - 2074653, - 2075140, - 2077213, -@@ -2699,7 +2771,6 @@ - 2081585, - 2081629, - 2081797, --2082045, - 2082321, - 2082348, - 2082411, -@@ -2831,9 +2902,12 @@ - 2109098, - 2109237, - 2109770, --2109821, -+2109845, -+2109949, - 2109973, - 2110365, -+2110485, -+2110525, - 2112021, - 2113445, - 2113501, -@@ -2841,8 +2915,10 @@ - 2118589, - 2118660, - 2120253, -+2120709, -+2120746, -+2121629, - 2121732, --2122749, - 2122762, - 2122909, - 2123268, -@@ -2850,6 +2926,9 @@ - 2123844, - 2124105, - 2124157, -+2124292, -+2125509, -+2125693, - 2125828, - 2126813, - 2126833, -@@ -2865,6 +2944,22 @@ - 2135005, - 2135048, - 2135389, -+2135552, -+2136733, -+2136833, -+2138013, -+2138116, -+2139421, -+2139652, -+2141341, -+2141681, -+2141725, -+2146308, -+2156285, -+2156548, -+2157277, -+2157572, -+2157853, - 2162692, - 2162909, - 2162948, -@@ -2879,7 +2974,18 @@ - 2165469, - 2165489, - 2165514, --2165789, -+2165764, -+2166517, -+2166570, -+2166788, -+2167805, -+2168042, -+2168349, -+2169860, -+2170493, -+2170500, -+2170589, -+2170730, - 2170884, - 2171594, - 2171805, -@@ -2890,8 +2996,11 @@ - 2172957, - 2174980, - 2176797, -+2176906, - 2176964, --2177053, -+2177034, -+2177565, -+2177610, - 2179076, - 2179109, - 2179229, -@@ -2914,7 +3023,17 @@ - 2182148, - 2183082, - 2183153, --2183197, -+2183172, -+2184106, -+2184221, -+2185220, -+2185493, -+2185508, -+2186405, -+2186493, -+2186602, -+2186769, -+2187005, - 2187268, - 2189021, - 2189105, -@@ -2924,9 +3043,20 @@ - 2190340, - 2190973, - 2191114, --2191389, -+2191364, -+2191965, -+2192177, -+2192317, -+2192682, -+2192925, - 2195460, - 2197821, -+2199552, -+2201213, -+2201601, -+2203261, -+2203466, -+2203677, - 2214922, - 2215933, - 2228230, -@@ -2939,7 +3069,7 @@ - 2230858, - 2231496, - 2231837, --2232325, -+2232293, - 2232390, - 2232420, - 2233862, -@@ -2963,6 +3093,11 @@ - 2238152, - 2238481, - 2238621, -+2238980, -+2240101, -+2240145, -+2240196, -+2240253, - 2240517, - 2240582, - 2240612, -@@ -2971,9 +3106,139 @@ - 2242534, - 2242596, - 2242737, --2242877, -+2242885, -+2242993, -+2243037, - 2243080, --2243421, -+2243396, -+2243441, -+2243460, -+2243505, -+2243613, -+2243626, -+2244285, -+2244612, -+2245213, -+2245220, -+2246022, -+2246117, -+2246214, -+2246277, -+2246310, -+2246341, -+2246417, -+2246597, -+2246653, -+2248708, -+2248957, -+2248964, -+2249021, -+2249028, -+2249181, -+2249188, -+2249693, -+2249700, -+2250033, -+2250077, -+2250244, -+2251749, -+2251782, -+2251877, -+2252157, -+2252296, -+2252637, -+2252805, -+2252870, -+2252957, -+2252964, -+2253245, -+2253284, -+2253373, -+2253412, -+2254141, -+2254148, -+2254397, -+2254404, -+2254493, -+2254500, -+2254685, -+2254725, -+2254756, -+2254790, -+2254853, -+2254886, -+2255037, -+2255078, -+2255165, -+2255206, -+2255325, -+2255364, -+2255421, -+2255590, -+2255645, -+2255780, -+2255942, -+2256029, -+2256069, -+2256317, -+2256389, -+2256573, -+2260996, -+2262694, -+2262789, -+2263046, -+2263109, -+2263206, -+2263237, -+2263268, -+2263409, -+2263560, -+2263901, -+2263921, -+2263965, -+2263985, -+2264029, -+2265092, -+2266630, -+2266725, -+2266918, -+2266949, -+2266982, -+2267109, -+2267174, -+2267205, -+2267268, -+2267345, -+2267364, -+2267421, -+2267656, -+2267997, -+2273284, -+2274790, -+2274885, -+2275037, -+2275078, -+2275205, -+2275270, -+2275301, -+2275377, -+2276100, -+2276229, -+2276317, -+2277380, -+2278918, -+2279013, -+2279270, -+2279333, -+2279366, -+2279397, -+2279473, -+2279556, -+2279613, -+2279944, -+2280285, -+2280465, -+2280893, - 2281476, - 2282853, - 2282886, -@@ -2985,16 +3250,96 @@ - 2283293, - 2283528, - 2283869, -+2285572, -+2286429, -+2286501, -+2286598, -+2286661, -+2286790, -+2286821, -+2287005, -+2287112, -+2287434, -+2287505, -+2287605, -+2287645, -+2298880, -+2299905, -+2300936, -+2301258, -+2301565, -+2301924, -+2301981, -+2316292, -+2318141, -+2326532, -+2326845, -+2326852, -+2328038, -+2328069, -+2328317, -+2328325, -+2328518, -+2328549, -+2328580, -+2328625, -+2328797, -+2329096, -+2329418, -+2330045, -+2330129, -+2330180, -+2331165, -+2331205, -+2331933, -+2331942, -+2331973, -+2332198, -+2332229, -+2332294, -+2332325, -+2332413, - 2359300, --2387453, -+2388829, - 2392073, --2395261, -+2395645, - 2395665, --2395805, -+2395837, -+2396164, -+2402461, - 2490372, - 2524669, -+2654212, -+2672893, - 2949124, - 2967357, -+2967556, -+2968573, -+2968584, -+2968925, -+2969041, -+2969117, -+2972164, -+2973149, -+2973189, -+2973361, -+2973405, -+2973700, -+2975237, -+2975473, -+2975637, -+2975747, -+2975889, -+2975925, -+2975965, -+2976264, -+2976605, -+2976618, -+2976861, -+2976868, -+2977565, -+2977700, -+2978333, - 3006468, - 3008701, - 3009028, -@@ -3003,8 +3348,27 @@ - 3011045, - 3011171, - 3011613, -+3013635, -+3013693, -+3014660, -+3210685, -+3211268, -+3235453, - 3538948, - 3539037, -+3637252, -+3640701, -+3640836, -+3641277, -+3641348, -+3641661, -+3641860, -+3642205, -+3642261, -+3642277, -+3642353, -+3642394, -+3642525, - 3801109, - 3808989, - 3809301, -@@ -3021,7 +3385,7 @@ - 3813781, - 3814725, - 3814869, --3816413, -+3816765, - 3817493, - 3819589, - 3819701, -@@ -3120,7 +3484,44 @@ - 3864929, - 3864989, - 3865032, --3866653, -+3866645, -+3883013, -+3884789, -+3884901, -+3886517, -+3886757, -+3886805, -+3887237, -+3887285, -+3887345, -+3887517, -+3887973, -+3888157, -+3888165, -+3888669, -+3932165, -+3932413, -+3932421, -+3932989, -+3933029, -+3933277, -+3933285, -+3933373, -+3933381, -+3933565, -+3997700, -+4004029, -+4004074, -+4004357, -+4004605, -+4005888, -+4006977, -+4008069, -+4008317, -+4008456, -+4008797, -+4008913, -+4008989, - 4046852, - 4047005, - 4047012, -@@ -3196,69 +3597,73 @@ - 4068373, - 4068861, - 4068917, --4069373, -+4069405, - 4069429, - 4069917, - 4069941, --4070429, -+4071133, - 4071434, --4071805, -+4071869, - 4071957, - 4072957, - 4072981, - 4074909, - 4075029, --4076413, -+4076989, - 4078805, - 4079741, - 4080149, --4081533, -+4081565, - 4081685, - 4081981, - 4082197, - 4082269, - 4087829, --4088893, --4089365, --4089565, --4089589, --4091837, --4091925, --4092573, --4092949, --4094141, --4094165, --4094333, --4094997, --4095549, -+4095860, - 4096021, --4098045, --4098069, --4098109, --4098133, --4103965, --4103989, --4104125, --4104213, --4106205, --4106261, --4106397, --4106773, --4107549, --4112245, --4114493, --4114613, --4114973, --4116501, --4118749, -+4119165, -+4119573, -+4119997, -+4120085, -+4120317, - 4120597, - 4124317, -+4124693, -+4127421, -+4128789, -+4129181, -+4129301, -+4131101, -+4131349, -+4131677, -+4131861, -+4133149, -+4133397, -+4134365, -+4137493, -+4137981, -+4138005, -+4138269, -+4138517, -+4138557, -+4138613, -+4139005, -+4139029, -+4139421, -+4139541, -+4140029, -+4141077, -+4141661, -+4143125, -+4143165, - 4194308, - 5561085, - 5562372, - 5695165, - 5695492, - 5702621, -+5702660, -+5887069, - 6225924, - 6243293, - 29360186, -diff -r 3115ddbbf95d -r b3eaa82b3750 src/CaseConvert.cxx ---- a/src/CaseConvert.cxx Tue Mar 21 09:59:45 2017 +1100 -+++ b/src/CaseConvert.cxx Thu Mar 23 17:30:37 2017 +1100 -@@ -56,7 +56,7 @@ - 1121,1120,17,2, - 1163,1162,27,2, - 1218,1217,7,2, --1233,1232,44,2, -+1233,1232,48,2, - 1377,1329,38,1, - 7681,7680,75,2, - 7841,7840,48,2, -@@ -72,13 +72,17 @@ - 11393,11392,50,2, - 11520,4256,38,1, - 42561,42560,23,2, --42625,42624,12,2, -+42625,42624,14,2, - 42787,42786,7,2, - 42803,42802,31,2, - 42879,42878,5,2, --42913,42912,5,2, -+42903,42902,10,2, - 65345,65313,26,1, - 66600,66560,40,1, -+66776,66736,36,1, -+68800,68736,51,1, -+71872,71840,32,1, -+125218,125184,34,1, - - //--Autogenerated -- end of section automatically generated - }; -@@ -137,13 +141,17 @@ - 599,394, - 601,399, - 603,400, -+604,42923, - 608,403, -+609,42924, - 611,404, - 613,42893, - 614,42922, - 616,407, - 617,406, -+618,42926, - 619,11362, -+620,42925, - 623,412, - 625,11374, - 626,413, -@@ -151,12 +159,15 @@ - 637,11364, - 640,422, - 643,425, -+647,42929, - 648,430, - 649,580, - 650,433, - 651,434, - 652,581, - 658,439, -+669,42930, -+670,42928, - 881,880, - 883,882, - 887,886, -@@ -172,6 +183,7 @@ - 974,911, - 983,975, - 1010,1017, -+1011,895, - 1016,1015, - 1019,1018, - 1231,1216, -@@ -222,6 +234,9 @@ - 42892,42891, - 42897,42896, - 42899,42898, -+42933,42932, -+42935,42934, -+43859,42931, - - //--Autogenerated -- end of section automatically generated - }; -@@ -259,6 +274,107 @@ - "\xcf\xb4|\xce\xb8||\xce\xb8|" - "\xcf\xb5|\xce\xb5|\xce\x95||" - "\xd6\x87|\xd5\xa5\xd6\x82|\xd4\xb5\xd5\x92||" -+"\xe1\x8e\xa0|||\xea\xad\xb0|" -+"\xe1\x8e\xa1|||\xea\xad\xb1|" -+"\xe1\x8e\xa2|||\xea\xad\xb2|" -+"\xe1\x8e\xa3|||\xea\xad\xb3|" -+"\xe1\x8e\xa4|||\xea\xad\xb4|" -+"\xe1\x8e\xa5|||\xea\xad\xb5|" -+"\xe1\x8e\xa6|||\xea\xad\xb6|" -+"\xe1\x8e\xa7|||\xea\xad\xb7|" -+"\xe1\x8e\xa8|||\xea\xad\xb8|" -+"\xe1\x8e\xa9|||\xea\xad\xb9|" -+"\xe1\x8e\xaa|||\xea\xad\xba|" -+"\xe1\x8e\xab|||\xea\xad\xbb|" -+"\xe1\x8e\xac|||\xea\xad\xbc|" -+"\xe1\x8e\xad|||\xea\xad\xbd|" -+"\xe1\x8e\xae|||\xea\xad\xbe|" -+"\xe1\x8e\xaf|||\xea\xad\xbf|" -+"\xe1\x8e\xb0|||\xea\xae\x80|" -+"\xe1\x8e\xb1|||\xea\xae\x81|" -+"\xe1\x8e\xb2|||\xea\xae\x82|" -+"\xe1\x8e\xb3|||\xea\xae\x83|" -+"\xe1\x8e\xb4|||\xea\xae\x84|" -+"\xe1\x8e\xb5|||\xea\xae\x85|" -+"\xe1\x8e\xb6|||\xea\xae\x86|" -+"\xe1\x8e\xb7|||\xea\xae\x87|" -+"\xe1\x8e\xb8|||\xea\xae\x88|" -+"\xe1\x8e\xb9|||\xea\xae\x89|" -+"\xe1\x8e\xba|||\xea\xae\x8a|" -+"\xe1\x8e\xbb|||\xea\xae\x8b|" -+"\xe1\x8e\xbc|||\xea\xae\x8c|" -+"\xe1\x8e\xbd|||\xea\xae\x8d|" -+"\xe1\x8e\xbe|||\xea\xae\x8e|" -+"\xe1\x8e\xbf|||\xea\xae\x8f|" -+"\xe1\x8f\x80|||\xea\xae\x90|" -+"\xe1\x8f\x81|||\xea\xae\x91|" -+"\xe1\x8f\x82|||\xea\xae\x92|" -+"\xe1\x8f\x83|||\xea\xae\x93|" -+"\xe1\x8f\x84|||\xea\xae\x94|" -+"\xe1\x8f\x85|||\xea\xae\x95|" -+"\xe1\x8f\x86|||\xea\xae\x96|" -+"\xe1\x8f\x87|||\xea\xae\x97|" -+"\xe1\x8f\x88|||\xea\xae\x98|" -+"\xe1\x8f\x89|||\xea\xae\x99|" -+"\xe1\x8f\x8a|||\xea\xae\x9a|" -+"\xe1\x8f\x8b|||\xea\xae\x9b|" -+"\xe1\x8f\x8c|||\xea\xae\x9c|" -+"\xe1\x8f\x8d|||\xea\xae\x9d|" -+"\xe1\x8f\x8e|||\xea\xae\x9e|" -+"\xe1\x8f\x8f|||\xea\xae\x9f|" -+"\xe1\x8f\x90|||\xea\xae\xa0|" -+"\xe1\x8f\x91|||\xea\xae\xa1|" -+"\xe1\x8f\x92|||\xea\xae\xa2|" -+"\xe1\x8f\x93|||\xea\xae\xa3|" -+"\xe1\x8f\x94|||\xea\xae\xa4|" -+"\xe1\x8f\x95|||\xea\xae\xa5|" -+"\xe1\x8f\x96|||\xea\xae\xa6|" -+"\xe1\x8f\x97|||\xea\xae\xa7|" -+"\xe1\x8f\x98|||\xea\xae\xa8|" -+"\xe1\x8f\x99|||\xea\xae\xa9|" -+"\xe1\x8f\x9a|||\xea\xae\xaa|" -+"\xe1\x8f\x9b|||\xea\xae\xab|" -+"\xe1\x8f\x9c|||\xea\xae\xac|" -+"\xe1\x8f\x9d|||\xea\xae\xad|" -+"\xe1\x8f\x9e|||\xea\xae\xae|" -+"\xe1\x8f\x9f|||\xea\xae\xaf|" -+"\xe1\x8f\xa0|||\xea\xae\xb0|" -+"\xe1\x8f\xa1|||\xea\xae\xb1|" -+"\xe1\x8f\xa2|||\xea\xae\xb2|" -+"\xe1\x8f\xa3|||\xea\xae\xb3|" -+"\xe1\x8f\xa4|||\xea\xae\xb4|" -+"\xe1\x8f\xa5|||\xea\xae\xb5|" -+"\xe1\x8f\xa6|||\xea\xae\xb6|" -+"\xe1\x8f\xa7|||\xea\xae\xb7|" -+"\xe1\x8f\xa8|||\xea\xae\xb8|" -+"\xe1\x8f\xa9|||\xea\xae\xb9|" -+"\xe1\x8f\xaa|||\xea\xae\xba|" -+"\xe1\x8f\xab|||\xea\xae\xbb|" -+"\xe1\x8f\xac|||\xea\xae\xbc|" -+"\xe1\x8f\xad|||\xea\xae\xbd|" -+"\xe1\x8f\xae|||\xea\xae\xbe|" -+"\xe1\x8f\xaf|||\xea\xae\xbf|" -+"\xe1\x8f\xb0|||\xe1\x8f\xb8|" -+"\xe1\x8f\xb1|||\xe1\x8f\xb9|" -+"\xe1\x8f\xb2|||\xe1\x8f\xba|" -+"\xe1\x8f\xb3|||\xe1\x8f\xbb|" -+"\xe1\x8f\xb4|||\xe1\x8f\xbc|" -+"\xe1\x8f\xb5|||\xe1\x8f\xbd|" -+"\xe1\x8f\xb8|\xe1\x8f\xb0|\xe1\x8f\xb0||" -+"\xe1\x8f\xb9|\xe1\x8f\xb1|\xe1\x8f\xb1||" -+"\xe1\x8f\xba|\xe1\x8f\xb2|\xe1\x8f\xb2||" -+"\xe1\x8f\xbb|\xe1\x8f\xb3|\xe1\x8f\xb3||" -+"\xe1\x8f\xbc|\xe1\x8f\xb4|\xe1\x8f\xb4||" -+"\xe1\x8f\xbd|\xe1\x8f\xb5|\xe1\x8f\xb5||" -+"\xe1\xb2\x80|\xd0\xb2|\xd0\x92||" -+"\xe1\xb2\x81|\xd0\xb4|\xd0\x94||" -+"\xe1\xb2\x82|\xd0\xbe|\xd0\x9e||" -+"\xe1\xb2\x83|\xd1\x81|\xd0\xa1||" -+"\xe1\xb2\x84|\xd1\x82|\xd0\xa2||" -+"\xe1\xb2\x85|\xd1\x82|\xd0\xa2||" -+"\xe1\xb2\x86|\xd1\x8a|\xd0\xaa||" -+"\xe1\xb2\x87|\xd1\xa3|\xd1\xa2||" -+"\xe1\xb2\x88|\xea\x99\x8b|\xea\x99\x8a||" - "\xe1\xba\x96|h\xcc\xb1|H\xcc\xb1||" - "\xe1\xba\x97|t\xcc\x88|T\xcc\x88||" - "\xe1\xba\x98|w\xcc\x8a|W\xcc\x8a||" -@@ -349,6 +465,86 @@ - "\xe2\x84\xa6|\xcf\x89||\xcf\x89|" - "\xe2\x84\xaa|k||k|" - "\xe2\x84\xab|\xc3\xa5||\xc3\xa5|" -+"\xea\xad\xb0|\xe1\x8e\xa0|\xe1\x8e\xa0||" -+"\xea\xad\xb1|\xe1\x8e\xa1|\xe1\x8e\xa1||" -+"\xea\xad\xb2|\xe1\x8e\xa2|\xe1\x8e\xa2||" -+"\xea\xad\xb3|\xe1\x8e\xa3|\xe1\x8e\xa3||" -+"\xea\xad\xb4|\xe1\x8e\xa4|\xe1\x8e\xa4||" -+"\xea\xad\xb5|\xe1\x8e\xa5|\xe1\x8e\xa5||" -+"\xea\xad\xb6|\xe1\x8e\xa6|\xe1\x8e\xa6||" -+"\xea\xad\xb7|\xe1\x8e\xa7|\xe1\x8e\xa7||" -+"\xea\xad\xb8|\xe1\x8e\xa8|\xe1\x8e\xa8||" -+"\xea\xad\xb9|\xe1\x8e\xa9|\xe1\x8e\xa9||" -+"\xea\xad\xba|\xe1\x8e\xaa|\xe1\x8e\xaa||" -+"\xea\xad\xbb|\xe1\x8e\xab|\xe1\x8e\xab||" -+"\xea\xad\xbc|\xe1\x8e\xac|\xe1\x8e\xac||" -+"\xea\xad\xbd|\xe1\x8e\xad|\xe1\x8e\xad||" -+"\xea\xad\xbe|\xe1\x8e\xae|\xe1\x8e\xae||" -+"\xea\xad\xbf|\xe1\x8e\xaf|\xe1\x8e\xaf||" -+"\xea\xae\x80|\xe1\x8e\xb0|\xe1\x8e\xb0||" -+"\xea\xae\x81|\xe1\x8e\xb1|\xe1\x8e\xb1||" -+"\xea\xae\x82|\xe1\x8e\xb2|\xe1\x8e\xb2||" -+"\xea\xae\x83|\xe1\x8e\xb3|\xe1\x8e\xb3||" -+"\xea\xae\x84|\xe1\x8e\xb4|\xe1\x8e\xb4||" -+"\xea\xae\x85|\xe1\x8e\xb5|\xe1\x8e\xb5||" -+"\xea\xae\x86|\xe1\x8e\xb6|\xe1\x8e\xb6||" -+"\xea\xae\x87|\xe1\x8e\xb7|\xe1\x8e\xb7||" -+"\xea\xae\x88|\xe1\x8e\xb8|\xe1\x8e\xb8||" -+"\xea\xae\x89|\xe1\x8e\xb9|\xe1\x8e\xb9||" -+"\xea\xae\x8a|\xe1\x8e\xba|\xe1\x8e\xba||" -+"\xea\xae\x8b|\xe1\x8e\xbb|\xe1\x8e\xbb||" -+"\xea\xae\x8c|\xe1\x8e\xbc|\xe1\x8e\xbc||" -+"\xea\xae\x8d|\xe1\x8e\xbd|\xe1\x8e\xbd||" -+"\xea\xae\x8e|\xe1\x8e\xbe|\xe1\x8e\xbe||" -+"\xea\xae\x8f|\xe1\x8e\xbf|\xe1\x8e\xbf||" -+"\xea\xae\x90|\xe1\x8f\x80|\xe1\x8f\x80||" -+"\xea\xae\x91|\xe1\x8f\x81|\xe1\x8f\x81||" -+"\xea\xae\x92|\xe1\x8f\x82|\xe1\x8f\x82||" -+"\xea\xae\x93|\xe1\x8f\x83|\xe1\x8f\x83||" -+"\xea\xae\x94|\xe1\x8f\x84|\xe1\x8f\x84||" -+"\xea\xae\x95|\xe1\x8f\x85|\xe1\x8f\x85||" -+"\xea\xae\x96|\xe1\x8f\x86|\xe1\x8f\x86||" -+"\xea\xae\x97|\xe1\x8f\x87|\xe1\x8f\x87||" -+"\xea\xae\x98|\xe1\x8f\x88|\xe1\x8f\x88||" -+"\xea\xae\x99|\xe1\x8f\x89|\xe1\x8f\x89||" -+"\xea\xae\x9a|\xe1\x8f\x8a|\xe1\x8f\x8a||" -+"\xea\xae\x9b|\xe1\x8f\x8b|\xe1\x8f\x8b||" -+"\xea\xae\x9c|\xe1\x8f\x8c|\xe1\x8f\x8c||" -+"\xea\xae\x9d|\xe1\x8f\x8d|\xe1\x8f\x8d||" -+"\xea\xae\x9e|\xe1\x8f\x8e|\xe1\x8f\x8e||" -+"\xea\xae\x9f|\xe1\x8f\x8f|\xe1\x8f\x8f||" -+"\xea\xae\xa0|\xe1\x8f\x90|\xe1\x8f\x90||" -+"\xea\xae\xa1|\xe1\x8f\x91|\xe1\x8f\x91||" -+"\xea\xae\xa2|\xe1\x8f\x92|\xe1\x8f\x92||" -+"\xea\xae\xa3|\xe1\x8f\x93|\xe1\x8f\x93||" -+"\xea\xae\xa4|\xe1\x8f\x94|\xe1\x8f\x94||" -+"\xea\xae\xa5|\xe1\x8f\x95|\xe1\x8f\x95||" -+"\xea\xae\xa6|\xe1\x8f\x96|\xe1\x8f\x96||" -+"\xea\xae\xa7|\xe1\x8f\x97|\xe1\x8f\x97||" -+"\xea\xae\xa8|\xe1\x8f\x98|\xe1\x8f\x98||" -+"\xea\xae\xa9|\xe1\x8f\x99|\xe1\x8f\x99||" -+"\xea\xae\xaa|\xe1\x8f\x9a|\xe1\x8f\x9a||" -+"\xea\xae\xab|\xe1\x8f\x9b|\xe1\x8f\x9b||" -+"\xea\xae\xac|\xe1\x8f\x9c|\xe1\x8f\x9c||" -+"\xea\xae\xad|\xe1\x8f\x9d|\xe1\x8f\x9d||" -+"\xea\xae\xae|\xe1\x8f\x9e|\xe1\x8f\x9e||" -+"\xea\xae\xaf|\xe1\x8f\x9f|\xe1\x8f\x9f||" -+"\xea\xae\xb0|\xe1\x8f\xa0|\xe1\x8f\xa0||" -+"\xea\xae\xb1|\xe1\x8f\xa1|\xe1\x8f\xa1||" -+"\xea\xae\xb2|\xe1\x8f\xa2|\xe1\x8f\xa2||" -+"\xea\xae\xb3|\xe1\x8f\xa3|\xe1\x8f\xa3||" -+"\xea\xae\xb4|\xe1\x8f\xa4|\xe1\x8f\xa4||" -+"\xea\xae\xb5|\xe1\x8f\xa5|\xe1\x8f\xa5||" -+"\xea\xae\xb6|\xe1\x8f\xa6|\xe1\x8f\xa6||" -+"\xea\xae\xb7|\xe1\x8f\xa7|\xe1\x8f\xa7||" -+"\xea\xae\xb8|\xe1\x8f\xa8|\xe1\x8f\xa8||" -+"\xea\xae\xb9|\xe1\x8f\xa9|\xe1\x8f\xa9||" -+"\xea\xae\xba|\xe1\x8f\xaa|\xe1\x8f\xaa||" -+"\xea\xae\xbb|\xe1\x8f\xab|\xe1\x8f\xab||" -+"\xea\xae\xbc|\xe1\x8f\xac|\xe1\x8f\xac||" -+"\xea\xae\xbd|\xe1\x8f\xad|\xe1\x8f\xad||" -+"\xea\xae\xbe|\xe1\x8f\xae|\xe1\x8f\xae||" -+"\xea\xae\xbf|\xe1\x8f\xaf|\xe1\x8f\xaf||" - "\xef\xac\x80|ff|FF||" - "\xef\xac\x81|fi|FI||" - "\xef\xac\x82|fl|FL||" diff --git a/src/scintilla_backports/6153_a0f26eaf474d.patch b/src/scintilla_backports/6153_a0f26eaf474d.patch deleted file mode 100644 index 34c90ce7..00000000 --- a/src/scintilla_backports/6153_a0f26eaf474d.patch +++ /dev/null @@ -1,7832 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1490944778 -39600 -# Node ID a0f26eaf474d98cb999629f79a3d082c0028925b -# Parent 1788f6795302a077e98c9cea25100068eef8624b -Using Sci::Position and Sci::Line to mark variables that are document positions -and lines. - -diff -r 1788f6795302 -r a0f26eaf474d cocoa/ScintillaCocoa.h ---- a/cocoa/ScintillaCocoa.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/cocoa/ScintillaCocoa.h Fri Mar 31 18:19:38 2017 +1100 -@@ -158,10 +158,10 @@ - void SetMouseCapture(bool on) override; - bool HaveMouseCapture() override; - void WillDraw(NSRect rect); -- void ScrollText(int linesToMove) override; -+ void ScrollText(Sci::Line linesToMove) override; - void SetVerticalScrollPos() override; - void SetHorizontalScrollPos() override; -- bool ModifyScrollBars(int nMax, int nPage) override; -+ bool ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) override; - bool SetScrollingSize(void); - void Resize(); - void UpdateForScroll(); -@@ -197,7 +197,7 @@ - void ObserverAdd(); - void ObserverRemove(); - void IdleWork() override; -- void QueueIdleWork(WorkNeeded::workItems items, int upTo) override; -+ void QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo) override; - int InsertText(NSString* input); - NSRange PositionsFromCharacters(NSRange rangeCharacters) const; - NSRange CharactersFromPositions(NSRange rangePositions) const; -diff -r 1788f6795302 -r a0f26eaf474d cocoa/ScintillaCocoa.mm ---- a/cocoa/ScintillaCocoa.mm Thu Mar 30 09:11:48 2017 +1100 -+++ b/cocoa/ScintillaCocoa.mm Fri Mar 31 18:19:38 2017 +1100 -@@ -522,7 +522,7 @@ - - //-------------------------------------------------------------------------------------------------- - --void ScintillaCocoa::QueueIdleWork(WorkNeeded::workItems items, int upTo) { -+void ScintillaCocoa::QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo) { - Editor::QueueIdleWork(items, upTo); - ObserverAdd(); - } -@@ -1236,7 +1236,7 @@ - */ - NSPoint ScintillaCocoa::GetCaretPosition() - { -- const int line = pdoc->LineFromPosition(sel.RangeMain().caret.Position()); -+ const Sci::Line line = pdoc->LineFromPosition(sel.RangeMain().caret.Position()); - NSPoint result; - - result.y = line; -@@ -1261,9 +1261,9 @@ - } - - // TODO: does not work for wrapped lines, fix it. -- int line = pdoc->LineFromPosition(posDrag.Position()); -- int currentVisibleLine = cs.DisplayFromDoc(line); -- int lastVisibleLine = Platform::Minimum(topLine + LinesOnScreen(), cs.LinesDisplayed()) - 2; -+ Sci::Line line = pdoc->LineFromPosition(posDrag.Position()); -+ Sci::Line currentVisibleLine = cs.DisplayFromDoc(line); -+ Sci::Line lastVisibleLine = Platform::Minimum(topLine + LinesOnScreen(), cs.LinesDisplayed()) - 2; - - if (currentVisibleLine <= topLine && topLine > 0) - ScrollTo(topLine - scrollSpeed); -@@ -1368,10 +1368,10 @@ - - // calculate the bounds of the selection - PRectangle client = GetTextRectangle(); -- int selStart = sel.RangeMain().Start().Position(); -- int selEnd = sel.RangeMain().End().Position(); -- int startLine = pdoc->LineFromPosition(selStart); -- int endLine = pdoc->LineFromPosition(selEnd); -+ Sci::Position selStart = sel.RangeMain().Start().Position(); -+ Sci::Position selEnd = sel.RangeMain().End().Position(); -+ Sci::Line startLine = pdoc->LineFromPosition(selStart); -+ Sci::Line endLine = pdoc->LineFromPosition(selEnd); - Point pt; - long startPos, endPos, ep; - PRectangle rcSel; -@@ -1561,7 +1561,7 @@ - void ScintillaCocoa::DraggingExited(id <NSDraggingInfo> info) - { - #pragma unused(info) -- SetDragPosition(SelectionPosition(invalidPosition)); -+ SetDragPosition(SelectionPosition(Sci::invalidPosition)); - FineTickerCancel(tickPlatform); - inDragDrop = ddNone; - } -@@ -1914,7 +1914,7 @@ - /** - * ScrollText is empty because scrolling is handled by the NSScrollView. - */ --void ScintillaCocoa::ScrollText(int) -+void ScintillaCocoa::ScrollText(Sci::Line) - { - } - -@@ -1968,7 +1968,7 @@ - * @param nPage Number of lines per scroll page. - * @return True if there was a change, otherwise false. - */ --bool ScintillaCocoa::ModifyScrollBars(int nMax, int nPage) -+bool ScintillaCocoa::ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) - { - #pragma unused(nMax, nPage) - return SetScrollingSize(); -diff -r 1788f6795302 -r a0f26eaf474d gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/gtk/ScintillaGTK.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -1029,7 +1029,7 @@ - return rc; - } - --void ScintillaGTK::ScrollText(int linesToMove) { -+void ScintillaGTK::ScrollText(Sci::Line linesToMove) { - int diff = vs.lineHeight * -linesToMove; - //Platform::DebugPrintf("ScintillaGTK::ScrollText %d %d %0d,%0d %0d,%0d\n", linesToMove, diff, - // rc.left, rc.top, rc.right, rc.bottom); -@@ -1052,7 +1052,7 @@ - gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustmenth), xOffset); - } - --bool ScintillaGTK::ModifyScrollBars(int nMax, int nPage) { -+bool ScintillaGTK::ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) { - bool modified = false; - int pageScroll = LinesToScroll(); - -@@ -2763,7 +2763,7 @@ - void ScintillaGTK::DragLeave(GtkWidget *widget, GdkDragContext * /*context*/, guint) { - ScintillaGTK *sciThis = FromWidget(widget); - try { -- sciThis->SetDragPosition(SelectionPosition(invalidPosition)); -+ sciThis->SetDragPosition(SelectionPosition(Sci::invalidPosition)); - //Platform::DebugPrintf("DragLeave %x\n", sciThis); - } catch (...) { - sciThis->errorStatus = SC_STATUS_FAILURE; -@@ -2776,7 +2776,7 @@ - // If drag did not result in drop here or elsewhere - if (!sciThis->dragWasDropped) - sciThis->SetEmptySelection(sciThis->posDrag); -- sciThis->SetDragPosition(SelectionPosition(invalidPosition)); -+ sciThis->SetDragPosition(SelectionPosition(Sci::invalidPosition)); - //Platform::DebugPrintf("DragEnd %x %d\n", sciThis, sciThis->dragWasDropped); - sciThis->inDragDrop = ddNone; - } catch (...) { -@@ -2789,7 +2789,7 @@ - ScintillaGTK *sciThis = FromWidget(widget); - try { - //Platform::DebugPrintf("Drop %x\n", sciThis); -- sciThis->SetDragPosition(SelectionPosition(invalidPosition)); -+ sciThis->SetDragPosition(SelectionPosition(Sci::invalidPosition)); - } catch (...) { - sciThis->errorStatus = SC_STATUS_FAILURE; - } -@@ -2801,7 +2801,7 @@ - ScintillaGTK *sciThis = FromWidget(widget); - try { - sciThis->ReceivedDrop(selection_data); -- sciThis->SetDragPosition(SelectionPosition(invalidPosition)); -+ sciThis->SetDragPosition(SelectionPosition(Sci::invalidPosition)); - } catch (...) { - sciThis->errorStatus = SC_STATUS_FAILURE; - } -@@ -2832,7 +2832,7 @@ - } - sciThis->ClearSelection(); - } -- sciThis->SetDragPosition(SelectionPosition(invalidPosition)); -+ sciThis->SetDragPosition(SelectionPosition(Sci::invalidPosition)); - } catch (...) { - sciThis->errorStatus = SC_STATUS_FAILURE; - } -@@ -2870,7 +2870,7 @@ - styleIdleID = 0; - } - --void ScintillaGTK::QueueIdleWork(WorkNeeded::workItems items, int upTo) { -+void ScintillaGTK::QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo) { - Editor::QueueIdleWork(items, upTo); - if (!styleIdleID) { - // Only allow one style needed to be queued -diff -r 1788f6795302 -r a0f26eaf474d gtk/ScintillaGTK.h ---- a/gtk/ScintillaGTK.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/gtk/ScintillaGTK.h Fri Mar 31 18:19:38 2017 +1100 -@@ -111,10 +111,10 @@ - virtual bool PaintContains(PRectangle rc); - void FullPaint(); - virtual PRectangle GetClientRectangle() const; -- virtual void ScrollText(int linesToMove); -+ virtual void ScrollText(Sci::Line linesToMove); - virtual void SetVerticalScrollPos(); - virtual void SetHorizontalScrollPos(); -- virtual bool ModifyScrollBars(int nMax, int nPage); -+ virtual bool ModifyScrollBars(Sci::Line nMax, Sci::Line nPage); - void ReconfigureScrollBars(); - virtual void NotifyChange(); - virtual void NotifyFocus(bool focus); -@@ -231,7 +231,7 @@ - static gboolean IdleCallback(gpointer pSci); - static gboolean StyleIdle(gpointer pSci); - virtual void IdleWork(); -- virtual void QueueIdleWork(WorkNeeded::workItems items, int upTo); -+ virtual void QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo); - virtual void SetDocPointer(Document *document); - static void PopUpCB(GtkMenuItem *menuItem, ScintillaGTK *sciThis); - -diff -r 1788f6795302 -r a0f26eaf474d gtk/ScintillaGTKAccessible.cxx ---- a/gtk/ScintillaGTKAccessible.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -168,7 +168,7 @@ - } - } - --gchar *ScintillaGTKAccessible::GetTextRangeUTF8(Position startByte, Position endByte) { -+gchar *ScintillaGTKAccessible::GetTextRangeUTF8(Sci::Position startByte, Sci::Position endByte) { - g_return_val_if_fail(startByte >= 0, NULL); - // FIXME: should we swap start/end if necessary? - g_return_val_if_fail(endByte >= startByte, NULL); -@@ -196,7 +196,7 @@ - } - - gchar *ScintillaGTKAccessible::GetText(int startChar, int endChar) { -- Position startByte, endByte; -+ Sci::Position startByte, endByte; - if (endChar == -1) { - startByte = ByteOffsetFromCharacterOffset(startChar); - endByte = sci->pdoc->Length(); -@@ -210,8 +210,8 @@ - AtkTextBoundary boundaryType, int *startChar, int *endChar) { - g_return_val_if_fail(charOffset >= 0, NULL); - -- Position startByte, endByte; -- Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); -+ Sci::Position startByte, endByte; -+ Sci::Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); - - switch (boundaryType) { - case ATK_TEXT_BOUNDARY_CHAR: -@@ -261,8 +261,8 @@ - AtkTextBoundary boundaryType, int *startChar, int *endChar) { - g_return_val_if_fail(charOffset >= 0, NULL); - -- Position startByte, endByte; -- Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); -+ Sci::Position startByte, endByte; -+ Sci::Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); - - switch (boundaryType) { - case ATK_TEXT_BOUNDARY_CHAR: -@@ -323,8 +323,8 @@ - AtkTextBoundary boundaryType, int *startChar, int *endChar) { - g_return_val_if_fail(charOffset >= 0, NULL); - -- Position startByte, endByte; -- Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); -+ Sci::Position startByte, endByte; -+ Sci::Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); - - switch (boundaryType) { - case ATK_TEXT_BOUNDARY_CHAR: -@@ -386,8 +386,8 @@ - AtkTextGranularity granularity, int *startChar, int *endChar) { - g_return_val_if_fail(charOffset >= 0, NULL); - -- Position startByte, endByte; -- Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); -+ Sci::Position startByte, endByte; -+ Sci::Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); - - switch (granularity) { - case ATK_TEXT_GRANULARITY_CHAR: -@@ -417,8 +417,8 @@ - gunichar ScintillaGTKAccessible::GetCharacterAtOffset(int charOffset) { - g_return_val_if_fail(charOffset >= 0, 0); - -- Position startByte = ByteOffsetFromCharacterOffset(charOffset); -- Position endByte = PositionAfter(startByte); -+ Sci::Position startByte = ByteOffsetFromCharacterOffset(charOffset); -+ Sci::Position endByte = PositionAfter(startByte); - gchar *ch = GetTextRangeUTF8(startByte, endByte); - gunichar unichar = g_utf8_get_char_validated(ch, -1); - g_free(ch); -@@ -466,7 +466,7 @@ - gint *x, gint *y, gint *width, gint *height, AtkCoordType coords) { - *x = *y = *height = *width = 0; - -- Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); -+ Sci::Position byteOffset = ByteOffsetFromCharacterOffset(charOffset); - - // FIXME: should we handle scrolling? - *x = sci->WndProc(SCI_POINTXFROMPOSITION, 0, byteOffset); -@@ -550,7 +550,7 @@ - AtkAttributeSet *ScintillaGTKAccessible::GetRunAttributes(int charOffset, int *startChar, int *endChar) { - g_return_val_if_fail(charOffset >= -1, NULL); - -- Position byteOffset; -+ Sci::Position byteOffset; - if (charOffset == -1) { - byteOffset = sci->WndProc(SCI_GETCURRENTPOS, 0, 0); - } else { -@@ -562,11 +562,11 @@ - - const char style = StyleAt(byteOffset, true); - // compute the range for this style -- Position startByte = byteOffset; -+ Sci::Position startByte = byteOffset; - // when going backwards, we know the style is already computed - while (startByte > 0 && sci->pdoc->StyleAt((startByte) - 1) == style) - (startByte)--; -- Position endByte = byteOffset + 1; -+ Sci::Position endByte = byteOffset + 1; - while (endByte < length && StyleAt(endByte, true) == style) - (endByte)++; - -@@ -586,8 +586,8 @@ - if (selection_num < 0 || (unsigned int) selection_num >= sci->sel.Count()) - return NULL; - -- Position startByte = sci->sel.Range(selection_num).Start().Position(); -- Position endByte = sci->sel.Range(selection_num).End().Position(); -+ Sci::Position startByte = sci->sel.Range(selection_num).Start().Position(); -+ Sci::Position endByte = sci->sel.Range(selection_num).End().Position(); - - CharacterRangeFromByteRange(startByte, endByte, startChar, endChar); - return GetTextRangeUTF8(startByte, endByte); -@@ -595,7 +595,7 @@ - - gboolean ScintillaGTKAccessible::AddSelection(int startChar, int endChar) { - size_t n_selections = sci->sel.Count(); -- Position startByte, endByte; -+ Sci::Position startByte, endByte; - ByteRangeFromCharacterRange(startChar, endChar, startByte, endByte); - // use WndProc() to set the selections so it notifies as needed - if (n_selections > 1 || ! sci->sel.Empty()) { -@@ -627,7 +627,7 @@ - if (selection_num < 0 || (unsigned int) selection_num >= sci->sel.Count()) - return FALSE; - -- Position startByte, endByte; -+ Sci::Position startByte, endByte; - ByteRangeFromCharacterRange(startChar, endChar, startByte, endByte); - - sci->WndProc(SCI_SETSELECTIONNSTART, selection_num, startByte); -@@ -668,7 +668,7 @@ - } - } - --bool ScintillaGTKAccessible::InsertStringUTF8(Position bytePos, const gchar *utf8, int lengthBytes) { -+bool ScintillaGTKAccessible::InsertStringUTF8(Sci::Position bytePos, const gchar *utf8, Sci::Position lengthBytes) { - if (sci->pdoc->IsReadOnly()) { - return false; - } -@@ -688,7 +688,7 @@ - } - - void ScintillaGTKAccessible::InsertText(const gchar *text, int lengthBytes, int *charPosition) { -- Position bytePosition = ByteOffsetFromCharacterOffset(*charPosition); -+ Sci::Position bytePosition = ByteOffsetFromCharacterOffset(*charPosition); - - // FIXME: should we update the target? - if (InsertStringUTF8(bytePosition, text, lengthBytes)) { -@@ -697,7 +697,7 @@ - } - - void ScintillaGTKAccessible::CopyText(int startChar, int endChar) { -- Position startByte, endByte; -+ Sci::Position startByte, endByte; - ByteRangeFromCharacterRange(startChar, endChar, startByte, endByte); - sci->CopyRangeToClipboard(startByte, endByte); - } -@@ -716,7 +716,7 @@ - g_return_if_fail(endChar >= startChar); - - if (! sci->pdoc->IsReadOnly()) { -- Position startByte, endByte; -+ Sci::Position startByte, endByte; - ByteRangeFromCharacterRange(startChar, endChar, startByte, endByte); - - if (! sci->RangeContainsProtected(startByte, endByte)) { -@@ -735,13 +735,13 @@ - // has always done that without problems, so let's guess it's a fairly safe bet. - struct Helper : GObjectWatcher { - ScintillaGTKAccessible *scia; -- Position bytePosition; -+ Sci::Position bytePosition; - - virtual void Destroyed() { - scia = 0; - } - -- Helper(ScintillaGTKAccessible *scia_, Position bytePos_) : -+ Helper(ScintillaGTKAccessible *scia_, Sci::Position bytePos_) : - GObjectWatcher(G_OBJECT(scia_->sci->sci)), - scia(scia_), - bytePosition(bytePos_) { -@@ -757,7 +757,7 @@ - len = convertedText.length(); - text = convertedText.c_str(); - } -- scia->InsertStringUTF8(bytePosition, text, static_cast<int>(len)); -+ scia->InsertStringUTF8(bytePosition, text, static_cast<Sci::Position>(len)); - } - } - -@@ -795,7 +795,7 @@ - // Callbacks - - void ScintillaGTKAccessible::UpdateCursor() { -- Position pos = sci->WndProc(SCI_GETCURRENTPOS, 0, 0); -+ Sci::Position pos = sci->WndProc(SCI_GETCURRENTPOS, 0, 0); - if (old_pos != pos) { - int charPosition = CharacterOffsetFromByteOffset(pos); - g_signal_emit_by_name(accessible, "text-caret-moved", charPosition); -@@ -875,7 +875,7 @@ - case SCN_MODIFIED: { - if (nt->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) { - // invalidate character offset cache if applicable -- const Position line = sci->pdoc->LineFromPosition(nt->position); -+ const Sci::Line line = sci->pdoc->LineFromPosition(nt->position); - if (character_offsets.size() > static_cast<size_t>(line + 1)) { - character_offsets.resize(line + 1); - } -diff -r 1788f6795302 -r a0f26eaf474d gtk/ScintillaGTKAccessible.h ---- a/gtk/ScintillaGTKAccessible.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.h Fri Mar 31 18:19:38 2017 +1100 -@@ -21,12 +21,12 @@ - ScintillaGTK *sci; - - // cache holding character offset for each line start, see CharacterOffsetFromByteOffset() -- std::vector<Position> character_offsets; -+ std::vector<Sci::Position> character_offsets; - - // cached length of the deletion, in characters (see Notify()) - int deletionLengthChar; - // local state for comparing -- Position old_pos; -+ Sci::Position old_pos; - std::vector<SelectionRange> old_sels; - - bool Enabled() const; -@@ -38,8 +38,8 @@ - } catch (...) {} - } - -- Position ByteOffsetFromCharacterOffset(Position startByte, int characterOffset) { -- Position pos = sci->pdoc->GetRelativePosition(startByte, characterOffset); -+ Sci::Position ByteOffsetFromCharacterOffset(Sci::Position startByte, int characterOffset) { -+ Sci::Position pos = sci->pdoc->GetRelativePosition(startByte, characterOffset); - if (pos == INVALID_POSITION) { - // clamp invalid positions inside the document - if (characterOffset > 0) { -@@ -51,51 +51,51 @@ - return pos; - } - -- Position ByteOffsetFromCharacterOffset(int characterOffset) { -+ Sci::Position ByteOffsetFromCharacterOffset(Sci::Position characterOffset) { - return ByteOffsetFromCharacterOffset(0, characterOffset); - } - -- int CharacterOffsetFromByteOffset(Position byteOffset) { -- const Position line = sci->pdoc->LineFromPosition(byteOffset); -+ Sci::Position CharacterOffsetFromByteOffset(Sci::Position byteOffset) { -+ const Sci::Line line = sci->pdoc->LineFromPosition(byteOffset); - if (character_offsets.size() <= static_cast<size_t>(line)) { - if (character_offsets.empty()) - character_offsets.push_back(0); -- for (Position i = character_offsets.size(); i <= line; i++) { -- const Position start = sci->pdoc->LineStart(i - 1); -- const Position end = sci->pdoc->LineStart(i); -+ for (Sci::Position i = character_offsets.size(); i <= line; i++) { -+ const Sci::Position start = sci->pdoc->LineStart(i - 1); -+ const Sci::Position end = sci->pdoc->LineStart(i); - character_offsets.push_back(character_offsets[i - 1] + sci->pdoc->CountCharacters(start, end)); - } - } -- const Position lineStart = sci->pdoc->LineStart(line); -+ const Sci::Position lineStart = sci->pdoc->LineStart(line); - return character_offsets[line] + sci->pdoc->CountCharacters(lineStart, byteOffset); - } - -- void CharacterRangeFromByteRange(Position startByte, Position endByte, int *startChar, int *endChar) { -+ void CharacterRangeFromByteRange(Sci::Position startByte, Sci::Position endByte, int *startChar, int *endChar) { - *startChar = CharacterOffsetFromByteOffset(startByte); - *endChar = *startChar + sci->pdoc->CountCharacters(startByte, endByte); - } - -- void ByteRangeFromCharacterRange(int startChar, int endChar, Position& startByte, Position& endByte) { -+ void ByteRangeFromCharacterRange(int startChar, int endChar, Sci::Position& startByte, Sci::Position& endByte) { - startByte = ByteOffsetFromCharacterOffset(startChar); - endByte = ByteOffsetFromCharacterOffset(startByte, endChar - startChar); - } - -- Position PositionBefore(Position pos) { -+ Sci::Position PositionBefore(Sci::Position pos) { - return sci->pdoc->MovePositionOutsideChar(pos - 1, -1, true); - } - -- Position PositionAfter(Position pos) { -+ Sci::Position PositionAfter(Sci::Position pos) { - return sci->pdoc->MovePositionOutsideChar(pos + 1, 1, true); - } - -- int StyleAt(Position position, bool ensureStyle = false) { -+ int StyleAt(Sci::Position position, bool ensureStyle = false) { - if (ensureStyle) - sci->pdoc->EnsureStyledTo(position); - return sci->pdoc->StyleAt(position); - } - - // For AtkText -- gchar *GetTextRangeUTF8(Position startByte, Position endByte); -+ gchar *GetTextRangeUTF8(Sci::Position startByte, Sci::Position endByte); - gchar *GetText(int startChar, int endChar); - gchar *GetTextAfterOffset(int charOffset, AtkTextBoundary boundaryType, int *startChar, int *endChar); - gchar *GetTextBeforeOffset(int charOffset, AtkTextBoundary boundaryType, int *startChar, int *endChar); -@@ -118,7 +118,7 @@ - gboolean RemoveSelection(int selection_num); - gboolean SetSelection(gint selection_num, int startChar, int endChar); - // for AtkEditableText -- bool InsertStringUTF8(Position bytePos, const gchar *utf8, int lengthBytes); -+ bool InsertStringUTF8(Sci::Position bytePos, const gchar *utf8, Sci::Position lengthBytes); - void SetTextContents(const gchar *contents); - void InsertText(const gchar *contents, int lengthBytes, int *charPosition); - void CopyText(int startChar, int endChar); -diff -r 1788f6795302 -r a0f26eaf474d qt/ScintillaEdit/ScintillaDocument.cpp ---- a/qt/ScintillaEdit/ScintillaDocument.cpp Thu Mar 30 09:11:48 2017 +1100 -+++ b/qt/ScintillaEdit/ScintillaDocument.cpp Fri Mar 31 18:19:38 2017 +1100 -@@ -45,7 +45,7 @@ - void NotifySavePoint(Document *doc, void *userData, bool atSavePoint); - void NotifyModified(Document *doc, DocModification mh, void *userData); - void NotifyDeleted(Document *doc, void *userData); -- void NotifyStyleNeeded(Document *doc, void *userData, int endPos); -+ void NotifyStyleNeeded(Document *doc, void *userData, Sci::Position endPos); - void NotifyLexerChanged(Document *doc, void *userData); - void NotifyErrorOccurred(Document *doc, void *userData, int status); - }; -@@ -76,7 +76,7 @@ - void WatcherHelper::NotifyDeleted(Document *, void *) { - } - --void WatcherHelper::NotifyStyleNeeded(Document *, void *, int endPos) { -+void WatcherHelper::NotifyStyleNeeded(Document *, void *, Sci::Position endPos) { - owner->emit_style_needed(endPos); - } - -diff -r 1788f6795302 -r a0f26eaf474d qt/ScintillaEditBase/ScintillaQt.cpp ---- a/qt/ScintillaEditBase/ScintillaQt.cpp Thu Mar 30 09:11:48 2017 +1100 -+++ b/qt/ScintillaEditBase/ScintillaQt.cpp Fri Mar 31 18:19:38 2017 +1100 -@@ -239,7 +239,7 @@ - } - - --void ScintillaQt::ScrollText(int linesToMove) -+void ScintillaQt::ScrollText(Sci::Line linesToMove) - { - int dy = vs.lineHeight * (linesToMove); - scrollArea->viewport()->scroll(0, dy); -@@ -257,7 +257,7 @@ - emit horizontalScrolled(xOffset); - } - --bool ScintillaQt::ModifyScrollBars(int nMax, int nPage) -+bool ScintillaQt::ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) - { - bool modified = false; - -@@ -613,7 +613,7 @@ - } - } - inDragDrop = ddNone; -- SetDragPosition(SelectionPosition(invalidPosition)); -+ SetDragPosition(SelectionPosition(Sci::invalidPosition)); - } - - void ScintillaQt::CreateCallTipWindow(PRectangle rc) -@@ -740,7 +740,7 @@ - - void ScintillaQt::DragLeave() - { -- SetDragPosition(SelectionPosition(invalidPosition)); -+ SetDragPosition(SelectionPosition(Sci::invalidPosition)); - } - - void ScintillaQt::Drop(const Point &point, const QMimeData *data, bool move) -diff -r 1788f6795302 -r a0f26eaf474d qt/ScintillaEditBase/ScintillaQt.h ---- a/qt/ScintillaEditBase/ScintillaQt.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/qt/ScintillaEditBase/ScintillaQt.h Fri Mar 31 18:19:38 2017 +1100 -@@ -107,7 +107,7 @@ - virtual void ScrollText(int linesToMove); - virtual void SetVerticalScrollPos(); - virtual void SetHorizontalScrollPos(); -- virtual bool ModifyScrollBars(int nMax, int nPage); -+ virtual bool ModifyScrollBars(Sci::Line nMax, Sci::Line nPage); - virtual void ReconfigureScrollBars(); - void CopyToModeClipboard(const SelectionText &selectedText, QClipboard::Mode clipboardMode_); - virtual void Copy(); -diff -r 1788f6795302 -r a0f26eaf474d src/AutoComplete.cxx ---- a/src/AutoComplete.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/AutoComplete.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -58,7 +58,7 @@ - } - - void AutoComplete::Start(Window &parent, int ctrlID, -- int position, Point location, int startLen_, -+ Sci::Position position, Point location, int startLen_, - int lineHeight, bool unicodeMode, int technology) { - if (active) { - Cancel(); -diff -r 1788f6795302 -r a0f26eaf474d src/AutoComplete.h ---- a/src/AutoComplete.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/AutoComplete.h Fri Mar 31 18:19:38 2017 +1100 -@@ -28,7 +28,7 @@ - bool ignoreCase; - bool chooseSingle; - ListBox *lb; -- int posStart; -+ Sci::Position posStart; - int startLen; - /// Should autocompletion be canceled if editor's currentPos <= startPos? - bool cancelAtStartPos; -@@ -50,7 +50,7 @@ - bool Active() const; - - /// Display the auto completion list positioned to be near a character position -- void Start(Window &parent, int ctrlID, int position, Point location, -+ void Start(Window &parent, int ctrlID, Sci::Position position, Point location, - int startLen_, int lineHeight, bool unicodeMode, int technology); - - /// The stop chars are characters which, when typed, cause the auto completion list to disappear -diff -r 1788f6795302 -r a0f26eaf474d src/CallTip.cxx ---- a/src/CallTip.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/CallTip.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -250,7 +250,7 @@ - clickPlace = 2; - } - --PRectangle CallTip::CallTipStart(int pos, Point pt, int textHeight, const char *defn, -+PRectangle CallTip::CallTipStart(Sci::Position pos, Point pt, int textHeight, const char *defn, - const char *faceName, int size, - int codePage_, int characterSet, - int technology, Window &wParent) { -diff -r 1788f6795302 -r a0f26eaf474d src/CallTip.h ---- a/src/CallTip.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/CallTip.h Fri Mar 31 18:19:38 2017 +1100 -@@ -41,7 +41,7 @@ - Window wCallTip; - Window wDraw; - bool inCallTipMode; -- int posStartCallTip; -+ Sci::Position posStartCallTip; - ColourDesired colourBG; - ColourDesired colourUnSel; - ColourDesired colourSel; -@@ -63,7 +63,7 @@ - void MouseClick(Point pt); - - /// Setup the calltip and return a rectangle of the area required. -- PRectangle CallTipStart(int pos, Point pt, int textHeight, const char *defn, -+ PRectangle CallTipStart(Sci::Position pos, Point pt, int textHeight, const char *defn, - const char *faceName, int size, int codePage_, - int characterSet, int technology, Window &wParent); - -diff -r 1788f6795302 -r a0f26eaf474d src/CellBuffer.cxx ---- a/src/CellBuffer.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/CellBuffer.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -45,11 +45,11 @@ - perLine = pl; - } - --void LineVector::InsertText(int line, int delta) { -+void LineVector::InsertText(Sci::Line line, Sci::Position delta) { - starts.InsertText(line, delta); - } - --void LineVector::InsertLine(int line, int position, bool lineStart) { -+void LineVector::InsertLine(Sci::Line line, Sci::Position position, bool lineStart) { - starts.InsertPartition(line, position); - if (perLine) { - if ((line > 0) && lineStart) -@@ -58,18 +58,18 @@ - } - } - --void LineVector::SetLineStart(int line, int position) { -+void LineVector::SetLineStart(Sci::Line line, Sci::Position position) { - starts.SetPartitionStartPosition(line, position); - } - --void LineVector::RemoveLine(int line) { -+void LineVector::RemoveLine(Sci::Line line) { - starts.RemovePartition(line); - if (perLine) { - perLine->RemoveLine(line); - } - } - --int LineVector::LineFromPosition(int pos) const { -+Sci::Line LineVector::LineFromPosition(Sci::Position pos) const { - return starts.PartitionFromPosition(pos); - } - -@@ -85,7 +85,7 @@ - Destroy(); - } - --void Action::Create(actionType at_, int position_, const char *data_, int lenData_, bool mayCoalesce_) { -+void Action::Create(actionType at_, Sci::Position position_, const char *data_, Sci::Position lenData_, bool mayCoalesce_) { - delete []data; - data = NULL; - position = position_; -@@ -171,7 +171,7 @@ - } - } - --const char *UndoHistory::AppendAction(actionType at, int position, const char *data, int lengthData, -+const char *UndoHistory::AppendAction(actionType at, Sci::Position position, const char *data, Sci::Position lengthData, - bool &startSequence, bool mayCoalesce) { - EnsureUndoRoom(); - //Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, lengthData, currentAction); -@@ -375,11 +375,11 @@ - CellBuffer::~CellBuffer() { - } - --char CellBuffer::CharAt(int position) const { -+char CellBuffer::CharAt(Sci::Position position) const { - return substance.ValueAt(position); - } - --void CellBuffer::GetCharRange(char *buffer, int position, int lengthRetrieve) const { -+void CellBuffer::GetCharRange(char *buffer, Sci::Position position, Sci::Position lengthRetrieve) const { - if (lengthRetrieve <= 0) - return; - if (position < 0) -@@ -392,11 +392,11 @@ - substance.GetRange(buffer, position, lengthRetrieve); - } - --char CellBuffer::StyleAt(int position) const { -+char CellBuffer::StyleAt(Sci::Position position) const { - return style.ValueAt(position); - } - --void CellBuffer::GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const { -+void CellBuffer::GetStyleRange(unsigned char *buffer, Sci::Position position, Sci::Position lengthRetrieve) const { - if (lengthRetrieve < 0) - return; - if (position < 0) -@@ -413,16 +413,16 @@ - return substance.BufferPointer(); - } - --const char *CellBuffer::RangePointer(int position, int rangeLength) { -+const char *CellBuffer::RangePointer(Sci::Position position, Sci::Position rangeLength) { - return substance.RangePointer(position, rangeLength); - } - --int CellBuffer::GapPosition() const { -+Sci::Position CellBuffer::GapPosition() const { - return substance.GapPosition(); - } - - // The char* returned is to an allocation owned by the undo history --const char *CellBuffer::InsertString(int position, const char *s, int insertLength, bool &startSequence) { -+const char *CellBuffer::InsertString(Sci::Position position, const char *s, Sci::Position insertLength, bool &startSequence) { - // InsertString and DeleteChars are the bottleneck though which all changes occur - const char *data = s; - if (!readOnly) { -@@ -437,7 +437,7 @@ - return data; - } - --bool CellBuffer::SetStyleAt(int position, char styleValue) { -+bool CellBuffer::SetStyleAt(Sci::Position position, char styleValue) { - char curVal = style.ValueAt(position); - if (curVal != styleValue) { - style.SetValueAt(position, styleValue); -@@ -447,7 +447,7 @@ - } - } - --bool CellBuffer::SetStyleFor(int position, int lengthStyle, char styleValue) { -+bool CellBuffer::SetStyleFor(Sci::Position position, Sci::Position lengthStyle, char styleValue) { - bool changed = false; - PLATFORM_ASSERT(lengthStyle == 0 || - (lengthStyle > 0 && lengthStyle + position <= style.Length())); -@@ -463,7 +463,7 @@ - } - - // The char* returned is to an allocation owned by the undo history --const char *CellBuffer::DeleteChars(int position, int deleteLength, bool &startSequence) { -+const char *CellBuffer::DeleteChars(Sci::Position position, Sci::Position deleteLength, bool &startSequence) { - // InsertString and DeleteChars are the bottleneck though which all changes occur - PLATFORM_ASSERT(deleteLength > 0); - const char *data = 0; -@@ -480,11 +480,11 @@ - return data; - } - --int CellBuffer::Length() const { -+Sci::Position CellBuffer::Length() const { - return substance.Length(); - } - --void CellBuffer::Allocate(int newSize) { -+void CellBuffer::Allocate(Sci::Position newSize) { - substance.ReAllocate(newSize); - style.ReAllocate(newSize); - } -@@ -496,10 +496,10 @@ - } - } - --bool CellBuffer::ContainsLineEnd(const char *s, int length) const { -+bool CellBuffer::ContainsLineEnd(const char *s, Sci::Position length) const { - unsigned char chBeforePrev = 0; - unsigned char chPrev = 0; -- for (int i = 0; i < length; i++) { -+ for (Sci::Position i = 0; i < length; i++) { - const unsigned char ch = s[i]; - if ((ch == '\r') || (ch == '\n')) { - return true; -@@ -519,11 +519,11 @@ - lv.SetPerLine(pl); - } - --int CellBuffer::Lines() const { -+Sci::Line CellBuffer::Lines() const { - return lv.Lines(); - } - --int CellBuffer::LineStart(int line) const { -+Sci::Position CellBuffer::LineStart(Sci::Line line) const { - if (line < 0) - return 0; - else if (line >= Lines()) -@@ -566,15 +566,15 @@ - - // Without undo - --void CellBuffer::InsertLine(int line, int position, bool lineStart) { -+void CellBuffer::InsertLine(Sci::Line line, Sci::Position position, bool lineStart) { - lv.InsertLine(line, position, lineStart); - } - --void CellBuffer::RemoveLine(int line) { -+void CellBuffer::RemoveLine(Sci::Line line) { - lv.RemoveLine(line); - } - --bool CellBuffer::UTF8LineEndOverlaps(int position) const { -+bool CellBuffer::UTF8LineEndOverlaps(Sci::Position position) const { - unsigned char bytes[] = { - static_cast<unsigned char>(substance.ValueAt(position-2)), - static_cast<unsigned char>(substance.ValueAt(position-1)), -@@ -588,14 +588,14 @@ - // Reinitialize line data -- too much work to preserve - lv.Init(); - -- int position = 0; -- int length = Length(); -- int lineInsert = 1; -+ Sci::Position position = 0; -+ Sci::Position length = Length(); -+ Sci::Line lineInsert = 1; - bool atLineStart = true; - lv.InsertText(lineInsert-1, length); - unsigned char chBeforePrev = 0; - unsigned char chPrev = 0; -- for (int i = 0; i < length; i++) { -+ for (Sci::Position i = 0; i < length; i++) { - unsigned char ch = substance.ValueAt(position + i); - if (ch == '\r') { - InsertLine(lineInsert, (position + i) + 1, atLineStart); -@@ -620,7 +620,7 @@ - } - } - --void CellBuffer::BasicInsertString(int position, const char *s, int insertLength) { -+void CellBuffer::BasicInsertString(Sci::Position position, const char *s, Sci::Position insertLength) { - if (insertLength == 0) - return; - PLATFORM_ASSERT(insertLength > 0); -@@ -634,7 +634,7 @@ - substance.InsertFromArray(position, s, 0, insertLength); - style.InsertValue(position, insertLength, 0); - -- int lineInsert = lv.LineFromPosition(position) + 1; -+ Sci::Line lineInsert = lv.LineFromPosition(position) + 1; - bool atLineStart = lv.LineStart(lineInsert-1) == position; - // Point all the lines after the insertion point further along in the buffer - lv.InsertText(lineInsert-1, insertLength); -@@ -649,7 +649,7 @@ - RemoveLine(lineInsert); - } - unsigned char ch = ' '; -- for (int i = 0; i < insertLength; i++) { -+ for (Sci::Position i = 0; i < insertLength; i++) { - ch = s[i]; - if (ch == '\r') { - InsertLine(lineInsert, (position + i) + 1, atLineStart); -@@ -697,7 +697,7 @@ - } - } - --void CellBuffer::BasicDeleteChars(int position, int deleteLength) { -+void CellBuffer::BasicDeleteChars(Sci::Position position, Sci::Position deleteLength) { - if (deleteLength == 0) - return; - -@@ -709,7 +709,7 @@ - // Have to fix up line positions before doing deletion as looking at text in buffer - // to work out which lines have been removed - -- int lineRemove = lv.LineFromPosition(position) + 1; -+ Sci::Line lineRemove = lv.LineFromPosition(position) + 1; - lv.InsertText(lineRemove-1, - (deleteLength)); - unsigned char chPrev = substance.ValueAt(position - 1); - unsigned char chBefore = chPrev; -@@ -728,7 +728,7 @@ - } - - unsigned char ch = chNext; -- for (int i = 0; i < deleteLength; i++) { -+ for (Sci::Position i = 0; i < deleteLength; i++) { - chNext = substance.ValueAt(position + i + 1); - if (ch == '\r') { - if (chNext != '\n') { -@@ -783,7 +783,7 @@ - uh.EndUndoAction(); - } - --void CellBuffer::AddUndoAction(int token, bool mayCoalesce) { -+void CellBuffer::AddUndoAction(Sci::Position token, bool mayCoalesce) { - bool startSequence; - uh.AppendAction(containerAction, token, 0, 0, startSequence, mayCoalesce); - } -diff -r 1788f6795302 -r a0f26eaf474d src/CellBuffer.h ---- a/src/CellBuffer.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/CellBuffer.h Fri Mar 31 18:19:38 2017 +1100 -@@ -17,8 +17,8 @@ - public: - virtual ~PerLine() {} - virtual void Init()=0; -- virtual void InsertLine(int line)=0; -- virtual void RemoveLine(int line)=0; -+ virtual void InsertLine(Sci::Line line)=0; -+ virtual void RemoveLine(Sci::Line line)=0; - }; - - /** -@@ -36,15 +36,15 @@ - void Init(); - void SetPerLine(PerLine *pl); - -- void InsertText(int line, int delta); -- void InsertLine(int line, int position, bool lineStart); -- void SetLineStart(int line, int position); -- void RemoveLine(int line); -- int Lines() const { -+ void InsertText(Sci::Line line, Sci::Position delta); -+ void InsertLine(Sci::Line line, Sci::Position position, bool lineStart); -+ void SetLineStart(Sci::Line line, Sci::Position position); -+ void RemoveLine(Sci::Line line); -+ Sci::Line Lines() const { - return starts.Partitions(); - } -- int LineFromPosition(int pos) const; -- int LineStart(int line) const { -+ Sci::Line LineFromPosition(Sci::Position pos) const; -+ Sci::Position LineStart(Sci::Line line) const { - return starts.PositionFromPartition(line); - } - }; -@@ -57,14 +57,14 @@ - class Action { - public: - actionType at; -- int position; -+ Sci::Position position; - char *data; -- int lenData; -+ Sci::Position lenData; - bool mayCoalesce; - - Action(); - ~Action(); -- void Create(actionType at_, int position_=0, const char *data_=0, int lenData_=0, bool mayCoalesce_=true); -+ void Create(actionType at_, Sci::Position position_=0, const char *data_=0, Sci::Position lenData_=0, bool mayCoalesce_=true); - void Destroy(); - void Grab(Action *source); - }; -@@ -90,7 +90,7 @@ - UndoHistory(); - ~UndoHistory(); - -- const char *AppendAction(actionType at, int position, const char *data, int length, bool &startSequence, bool mayCoalesce=true); -+ const char *AppendAction(actionType at, Sci::Position position, const char *data, Sci::Position length, bool &startSequence, bool mayCoalesce=true); - - void BeginUndoAction(); - void EndUndoAction(); -@@ -137,11 +137,11 @@ - - LineVector lv; - -- bool UTF8LineEndOverlaps(int position) const; -+ bool UTF8LineEndOverlaps(Sci::Position position) const; - void ResetLineEnds(); - /// Actions without undo -- void BasicInsertString(int position, const char *s, int insertLength); -- void BasicDeleteChars(int position, int deleteLength); -+ void BasicInsertString(Sci::Position position, const char *s, Sci::Position insertLength); -+ void BasicDeleteChars(Sci::Position position, Sci::Position deleteLength); - - public: - -@@ -149,33 +149,33 @@ - ~CellBuffer(); - - /// Retrieving positions outside the range of the buffer works and returns 0 -- char CharAt(int position) const; -- void GetCharRange(char *buffer, int position, int lengthRetrieve) const; -- char StyleAt(int position) const; -- void GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const; -+ char CharAt(Sci::Position position) const; -+ void GetCharRange(char *buffer, Sci::Position position, Sci::Position lengthRetrieve) const; -+ char StyleAt(Sci::Position position) const; -+ void GetStyleRange(unsigned char *buffer, Sci::Position position, Sci::Position lengthRetrieve) const; - const char *BufferPointer(); -- const char *RangePointer(int position, int rangeLength); -- int GapPosition() const; -+ const char *RangePointer(Sci::Position position, Sci::Position rangeLength); -+ Sci::Position GapPosition() const; - -- int Length() const; -- void Allocate(int newSize); -+ Sci::Position Length() const; -+ void Allocate(Sci::Position newSize); - int GetLineEndTypes() const { return utf8LineEnds; } - void SetLineEndTypes(int utf8LineEnds_); -- bool ContainsLineEnd(const char *s, int length) const; -+ bool ContainsLineEnd(const char *s, Sci::Position length) const; - void SetPerLine(PerLine *pl); -- int Lines() const; -- int LineStart(int line) const; -- int LineFromPosition(int pos) const { return lv.LineFromPosition(pos); } -- void InsertLine(int line, int position, bool lineStart); -- void RemoveLine(int line); -- const char *InsertString(int position, const char *s, int insertLength, bool &startSequence); -+ Sci::Line Lines() const; -+ Sci::Position LineStart(Sci::Line line) const; -+ Sci::Line LineFromPosition(Sci::Position pos) const { return lv.LineFromPosition(pos); } -+ void InsertLine(Sci::Line line, Sci::Position position, bool lineStart); -+ void RemoveLine(Sci::Line line); -+ const char *InsertString(Sci::Position position, const char *s, Sci::Position insertLength, bool &startSequence); - - /// 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. -- bool SetStyleAt(int position, char styleValue); -- bool SetStyleFor(int position, int length, char styleValue); -+ bool SetStyleAt(Sci::Position position, char styleValue); -+ bool SetStyleFor(Sci::Position position, Sci::Position length, char styleValue); - -- const char *DeleteChars(int position, int deleteLength, bool &startSequence); -+ const char *DeleteChars(Sci::Position position, Sci::Position deleteLength, bool &startSequence); - - bool IsReadOnly() const; - void SetReadOnly(bool set); -@@ -194,7 +194,7 @@ - bool IsCollectingUndo() const; - void BeginUndoAction(); - void EndUndoAction(); -- void AddUndoAction(int token, bool mayCoalesce); -+ void AddUndoAction(Sci::Position token, bool mayCoalesce); - void DeleteUndoHistory(); - - /// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is -diff -r 1788f6795302 -r a0f26eaf474d src/ContractionState.cxx ---- a/src/ContractionState.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/ContractionState.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -57,7 +57,7 @@ - linesInDocument = 1; - } - --int ContractionState::LinesInDoc() const { -+Sci::Line ContractionState::LinesInDoc() const { - if (OneToOne()) { - return linesInDocument; - } else { -@@ -65,7 +65,7 @@ - } - } - --int ContractionState::LinesDisplayed() const { -+Sci::Line ContractionState::LinesDisplayed() const { - if (OneToOne()) { - return linesInDocument; - } else { -@@ -73,7 +73,7 @@ - } - } - --int ContractionState::DisplayFromDoc(int lineDoc) const { -+Sci::Line ContractionState::DisplayFromDoc(Sci::Line lineDoc) const { - if (OneToOne()) { - return (lineDoc <= linesInDocument) ? lineDoc : linesInDocument; - } else { -@@ -83,11 +83,11 @@ - } - } - --int ContractionState::DisplayLastFromDoc(int lineDoc) const { -+Sci::Line ContractionState::DisplayLastFromDoc(Sci::Line lineDoc) const { - return DisplayFromDoc(lineDoc) + GetHeight(lineDoc) - 1; - } - --int ContractionState::DocFromDisplay(int lineDisplay) const { -+Sci::Line ContractionState::DocFromDisplay(Sci::Line lineDisplay) const { - if (OneToOne()) { - return lineDisplay; - } else { -@@ -97,13 +97,13 @@ - if (lineDisplay > LinesDisplayed()) { - return displayLines->PartitionFromPosition(LinesDisplayed()); - } -- int lineDoc = displayLines->PartitionFromPosition(lineDisplay); -+ Sci::Line lineDoc = displayLines->PartitionFromPosition(lineDisplay); - PLATFORM_ASSERT(GetVisible(lineDoc)); - return lineDoc; - } - } - --void ContractionState::InsertLine(int lineDoc) { -+void ContractionState::InsertLine(Sci::Line lineDoc) { - if (OneToOne()) { - linesInDocument++; - } else { -@@ -115,20 +115,20 @@ - heights->SetValueAt(lineDoc, 1); - foldDisplayTexts->InsertSpace(lineDoc, 1); - foldDisplayTexts->SetValueAt(lineDoc, NULL); -- int lineDisplay = DisplayFromDoc(lineDoc); -+ Sci::Line lineDisplay = DisplayFromDoc(lineDoc); - displayLines->InsertPartition(lineDoc, lineDisplay); - displayLines->InsertText(lineDoc, 1); - } - } - --void ContractionState::InsertLines(int lineDoc, int lineCount) { -+void ContractionState::InsertLines(Sci::Line lineDoc, Sci::Line lineCount) { - for (int l = 0; l < lineCount; l++) { - InsertLine(lineDoc + l); - } - Check(); - } - --void ContractionState::DeleteLine(int lineDoc) { -+void ContractionState::DeleteLine(Sci::Line lineDoc) { - if (OneToOne()) { - linesInDocument--; - } else { -@@ -143,14 +143,14 @@ - } - } - --void ContractionState::DeleteLines(int lineDoc, int lineCount) { -- for (int l = 0; l < lineCount; l++) { -+void ContractionState::DeleteLines(Sci::Line lineDoc, Sci::Line lineCount) { -+ for (Sci::Line l = 0; l < lineCount; l++) { - DeleteLine(lineDoc); - } - Check(); - } - --bool ContractionState::GetVisible(int lineDoc) const { -+bool ContractionState::GetVisible(Sci::Line lineDoc) const { - if (OneToOne()) { - return true; - } else { -@@ -160,15 +160,15 @@ - } - } - --bool ContractionState::SetVisible(int lineDocStart, int lineDocEnd, bool isVisible) { -+bool ContractionState::SetVisible(Sci::Line lineDocStart, Sci::Line lineDocEnd, bool isVisible) { - if (OneToOne() && isVisible) { - return false; - } else { - EnsureData(); -- int delta = 0; -+ Sci::Line delta = 0; - Check(); - if ((lineDocStart <= lineDocEnd) && (lineDocStart >= 0) && (lineDocEnd < LinesInDoc())) { -- for (int line = lineDocStart; line <= lineDocEnd; line++) { -+ for (Sci::Line line = lineDocStart; line <= lineDocEnd; line++) { - if (GetVisible(line) != isVisible) { - int difference = isVisible ? heights->ValueAt(line) : -heights->ValueAt(line); - visible->SetValueAt(line, isVisible ? 1 : 0); -@@ -192,12 +192,12 @@ - } - } - --const char *ContractionState::GetFoldDisplayText(int lineDoc) const { -+const char *ContractionState::GetFoldDisplayText(Sci::Line lineDoc) const { - Check(); - return foldDisplayTexts->ValueAt(lineDoc); - } - --bool ContractionState::SetFoldDisplayText(int lineDoc, const char *text) { -+bool ContractionState::SetFoldDisplayText(Sci::Line lineDoc, const char *text) { - EnsureData(); - const char *foldText = foldDisplayTexts->ValueAt(lineDoc); - if (!foldText || 0 != strcmp(text, foldText)) { -@@ -210,7 +210,7 @@ - } - } - --bool ContractionState::GetExpanded(int lineDoc) const { -+bool ContractionState::GetExpanded(Sci::Line lineDoc) const { - if (OneToOne()) { - return true; - } else { -@@ -219,7 +219,7 @@ - } - } - --bool ContractionState::SetExpanded(int lineDoc, bool isExpanded) { -+bool ContractionState::SetExpanded(Sci::Line lineDoc, bool isExpanded) { - if (OneToOne() && isExpanded) { - return false; - } else { -@@ -235,11 +235,11 @@ - } - } - --bool ContractionState::GetFoldDisplayTextShown(int lineDoc) const { -+bool ContractionState::GetFoldDisplayTextShown(Sci::Line lineDoc) const { - return !GetExpanded(lineDoc) && GetFoldDisplayText(lineDoc); - } - --int ContractionState::ContractedNext(int lineDocStart) const { -+Sci::Line ContractionState::ContractedNext(Sci::Line lineDocStart) const { - if (OneToOne()) { - return -1; - } else { -@@ -247,7 +247,7 @@ - if (!expanded->ValueAt(lineDocStart)) { - return lineDocStart; - } else { -- int lineDocNextChange = expanded->EndRun(lineDocStart); -+ Sci::Line lineDocNextChange = expanded->EndRun(lineDocStart); - if (lineDocNextChange < LinesInDoc()) - return lineDocNextChange; - else -@@ -256,7 +256,7 @@ - } - } - --int ContractionState::GetHeight(int lineDoc) const { -+int ContractionState::GetHeight(Sci::Line lineDoc) const { - if (OneToOne()) { - return 1; - } else { -@@ -266,7 +266,7 @@ - - // Set the number of display lines needed for this line. - // Return true if this is a change. --bool ContractionState::SetHeight(int lineDoc, int height) { -+bool ContractionState::SetHeight(Sci::Line lineDoc, int height) { - if (OneToOne() && (height == 1)) { - return false; - } else if (lineDoc < LinesInDoc()) { -@@ -288,7 +288,7 @@ - } - - void ContractionState::ShowAll() { -- int lines = LinesInDoc(); -+ Sci::Line lines = LinesInDoc(); - Clear(); - linesInDocument = lines; - } -@@ -297,14 +297,14 @@ - - void ContractionState::Check() const { - #ifdef CHECK_CORRECTNESS -- for (int vline = 0; vline < LinesDisplayed(); vline++) { -- const int lineDoc = DocFromDisplay(vline); -+ for (Sci::Line vline = 0; vline < LinesDisplayed(); vline++) { -+ const Sci::Line lineDoc = DocFromDisplay(vline); - PLATFORM_ASSERT(GetVisible(lineDoc)); - } -- for (int lineDoc = 0; lineDoc < LinesInDoc(); lineDoc++) { -- const int displayThis = DisplayFromDoc(lineDoc); -- const int displayNext = DisplayFromDoc(lineDoc + 1); -- const int height = displayNext - displayThis; -+ for (Sci::Line lineDoc = 0; lineDoc < LinesInDoc(); lineDoc++) { -+ const Sci::Line displayThis = DisplayFromDoc(lineDoc); -+ const Sci::Line displayNext = DisplayFromDoc(lineDoc + 1); -+ const Sci::Line height = displayNext - displayThis; - PLATFORM_ASSERT(height >= 0); - if (GetVisible(lineDoc)) { - PLATFORM_ASSERT(GetHeight(lineDoc) == height); -diff -r 1788f6795302 -r a0f26eaf474d src/ContractionState.h ---- a/src/ContractionState.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/ContractionState.h Fri Mar 31 18:19:38 2017 +1100 -@@ -24,7 +24,7 @@ - RunStyles *heights; - SparseVector<const char *> *foldDisplayTexts; - Partitioning *displayLines; -- int linesInDocument; -+ Sci::Line linesInDocument; - - void EnsureData(); - -@@ -40,31 +40,31 @@ - - void Clear(); - -- int LinesInDoc() const; -- int LinesDisplayed() const; -- int DisplayFromDoc(int lineDoc) const; -- int DisplayLastFromDoc(int lineDoc) const; -- int DocFromDisplay(int lineDisplay) const; -+ Sci::Line LinesInDoc() const; -+ Sci::Line LinesDisplayed() const; -+ Sci::Line DisplayFromDoc(Sci::Line lineDoc) const; -+ Sci::Line DisplayLastFromDoc(Sci::Line lineDoc) const; -+ Sci::Line DocFromDisplay(Sci::Line lineDisplay) const; - -- void InsertLine(int lineDoc); -- void InsertLines(int lineDoc, int lineCount); -- void DeleteLine(int lineDoc); -- void DeleteLines(int lineDoc, int lineCount); -+ void InsertLine(Sci::Line lineDoc); -+ void InsertLines(Sci::Line lineDoc, Sci::Line lineCount); -+ void DeleteLine(Sci::Line lineDoc); -+ void DeleteLines(Sci::Line lineDoc, Sci::Line lineCount); - -- bool GetVisible(int lineDoc) const; -- bool SetVisible(int lineDocStart, int lineDocEnd, bool isVisible); -+ bool GetVisible(Sci::Line lineDoc) const; -+ bool SetVisible(Sci::Line lineDocStart, Sci::Line lineDocEnd, bool isVisible); - bool HiddenLines() const; - -- const char *GetFoldDisplayText(int lineDoc) const; -- bool SetFoldDisplayText(int lineDoc, const char *text); -+ const char *GetFoldDisplayText(Sci::Line lineDoc) const; -+ bool SetFoldDisplayText(Sci::Line lineDoc, const char *text); - -- bool GetExpanded(int lineDoc) const; -- bool SetExpanded(int lineDoc, bool isExpanded); -- bool GetFoldDisplayTextShown(int lineDoc) const; -- int ContractedNext(int lineDocStart) const; -+ bool GetExpanded(Sci::Line lineDoc) const; -+ bool SetExpanded(Sci::Line lineDoc, bool isExpanded); -+ bool GetFoldDisplayTextShown(Sci::Line lineDoc) const; -+ Sci::Line ContractedNext(Sci::Line lineDocStart) const; - -- int GetHeight(int lineDoc) const; -- bool SetHeight(int lineDoc, int height); -+ int GetHeight(Sci::Line lineDoc) const; -+ bool SetHeight(Sci::Line lineDoc, int height); - - void ShowAll(); - void Check() const; -diff -r 1788f6795302 -r a0f26eaf474d src/Document.cxx ---- a/src/Document.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/Document.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -54,17 +54,17 @@ - using namespace Scintilla; - #endif - --void LexInterface::Colourise(int start, int end) { -+void LexInterface::Colourise(Sci::Position start, Sci::Position end) { - if (pdoc && instance && !performingStyle) { - // Protect against reentrance, which may occur, for example, when - // fold points are discovered while performing styling and the folding - // code looks for child lines which may trigger styling. - performingStyle = true; - -- int lengthDoc = pdoc->Length(); -+ Sci::Position lengthDoc = pdoc->Length(); - if (end == -1) - end = lengthDoc; -- int len = end - start; -+ Sci::Position len = end - start; - - PLATFORM_ASSERT(len >= 0); - PLATFORM_ASSERT(start + len <= lengthDoc); -@@ -189,14 +189,14 @@ - } - } - --void Document::InsertLine(int line) { -+void Document::InsertLine(Sci::Line line) { - for (int j=0; j<ldSize; j++) { - if (perLineData[j]) - perLineData[j]->InsertLine(line); - } - } - --void Document::RemoveLine(int line) { -+void Document::RemoveLine(Sci::Line line) { - for (int j=0; j<ldSize; j++) { - if (perLineData[j]) - perLineData[j]->RemoveLine(line); -@@ -234,7 +234,7 @@ - int steps = cb.TentativeSteps(); - //Platform::DebugPrintf("Steps=%d\n", steps); - for (int step = 0; step < steps; step++) { -- const int prevLinesTotal = LinesTotal(); -+ const Sci::Line prevLinesTotal = LinesTotal(); - const Action &action = cb.GetUndoStep(); - if (action.at == removeAction) { - NotifyModified(DocModification( -@@ -261,7 +261,7 @@ - } - if (steps > 1) - modFlags |= SC_MULTISTEPUNDOREDO; -- const int linesAdded = LinesTotal() - prevLinesTotal; -+ const Sci::Line linesAdded = LinesTotal() - prevLinesTotal; - if (linesAdded != 0) - multiLine = true; - if (step == steps - 1) { -@@ -283,15 +283,15 @@ - } - } - --int Document::GetMark(int line) { -+int Document::GetMark(Sci::Line line) { - return static_cast<LineMarkers *>(perLineData[ldMarkers])->MarkValue(line); - } - --int Document::MarkerNext(int lineStart, int mask) const { -+Sci::Line Document::MarkerNext(Sci::Line lineStart, int mask) const { - return static_cast<LineMarkers *>(perLineData[ldMarkers])->MarkerNext(lineStart, mask); - } - --int Document::AddMark(int line, int markerNum) { -+int Document::AddMark(Sci::Line line, int markerNum) { - if (line >= 0 && line <= LinesTotal()) { - int prev = static_cast<LineMarkers *>(perLineData[ldMarkers])-> - AddMark(line, markerNum, LinesTotal()); -@@ -303,7 +303,7 @@ - } - } - --void Document::AddMarkSet(int line, int valueSet) { -+void Document::AddMarkSet(Sci::Line line, int valueSet) { - if (line < 0 || line > LinesTotal()) { - return; - } -@@ -316,7 +316,7 @@ - NotifyModified(mh); - } - --void Document::DeleteMark(int line, int markerNum) { -+void Document::DeleteMark(Sci::Line line, int markerNum) { - static_cast<LineMarkers *>(perLineData[ldMarkers])->DeleteMark(line, markerNum, false); - DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); - NotifyModified(mh); -@@ -331,7 +331,7 @@ - - void Document::DeleteAllMarks(int markerNum) { - bool someChanges = false; -- for (int line = 0; line < LinesTotal(); line++) { -+ for (Sci::Line line = 0; line < LinesTotal(); line++) { - if (static_cast<LineMarkers *>(perLineData[ldMarkers])->DeleteMark(line, markerNum, true)) - someChanges = true; - } -@@ -342,7 +342,7 @@ - } - } - --int Document::LineFromHandle(int markerHandle) { -+Sci::Line Document::LineFromHandle(int markerHandle) { - return static_cast<LineMarkers *>(perLineData[ldMarkers])->LineFromHandle(markerHandle); - } - -@@ -350,7 +350,7 @@ - return cb.LineStart(line); - } - --bool Document::IsLineStartPosition(int position) const { -+bool Document::IsLineStartPosition(Sci::Position position) const { - return LineStart(LineFromPosition(position)) == position; - } - -@@ -358,7 +358,7 @@ - if (line >= LinesTotal() - 1) { - return LineStart(line + 1); - } else { -- int position = LineStart(line + 1); -+ Sci::Position position = LineStart(line + 1); - if (SC_CP_UTF8 == dbcsCodePage) { - unsigned char bytes[] = { - static_cast<unsigned char>(cb.CharAt(position-3)), -@@ -392,23 +392,23 @@ - return cb.LineFromPosition(pos); - } - --int Document::LineEndPosition(int position) const { -+Sci::Position Document::LineEndPosition(Sci::Position position) const { - return LineEnd(LineFromPosition(position)); - } - --bool Document::IsLineEndPosition(int position) const { -+bool Document::IsLineEndPosition(Sci::Position position) const { - return LineEnd(LineFromPosition(position)) == position; - } - --bool Document::IsPositionInLineEnd(int position) const { -+bool Document::IsPositionInLineEnd(Sci::Position position) const { - return position >= LineEnd(LineFromPosition(position)); - } - --int Document::VCHomePosition(int position) const { -- int line = LineFromPosition(position); -- int startPosition = LineStart(line); -- int endLine = LineEnd(line); -- int startText = startPosition; -+Sci::Position Document::VCHomePosition(Sci::Position position) const { -+ Sci::Line line = LineFromPosition(position); -+ Sci::Position startPosition = LineStart(line); -+ Sci::Position endLine = LineEnd(line); -+ Sci::Position startText = startPosition; - while (startText < endLine && (cb.CharAt(startText) == ' ' || cb.CharAt(startText) == '\t')) - startText++; - if (position == startText) -@@ -444,12 +444,12 @@ - return LevelNumber(levelStart) < LevelNumber(levelTry); - } - --int Document::GetLastChild(int lineParent, int level, int lastLine) { -+Sci::Line Document::GetLastChild(Sci::Line lineParent, int level, Sci::Line lastLine) { - if (level == -1) - level = LevelNumber(GetLevel(lineParent)); -- int maxLine = LinesTotal(); -- int lookLastLine = (lastLine != -1) ? Platform::Minimum(LinesTotal() - 1, lastLine) : -1; -- int lineMaxSubord = lineParent; -+ Sci::Line maxLine = LinesTotal(); -+ Sci::Line lookLastLine = (lastLine != -1) ? Platform::Minimum(LinesTotal() - 1, lastLine) : -1; -+ Sci::Line lineMaxSubord = lineParent; - while (lineMaxSubord < maxLine - 1) { - EnsureStyledTo(LineStart(lineMaxSubord + 2)); - if (!IsSubordinate(level, GetLevel(lineMaxSubord + 1))) -@@ -469,9 +469,9 @@ - return lineMaxSubord; - } - --int Document::GetFoldParent(int line) const { -+Sci::Line Document::GetFoldParent(Sci::Line line) const { - int level = LevelNumber(GetLevel(line)); -- int lineLook = line - 1; -+ Sci::Line lineLook = line - 1; - while ((lineLook > 0) && ( - (!(GetLevel(lineLook) & SC_FOLDLEVELHEADERFLAG)) || - (LevelNumber(GetLevel(lineLook)) >= level)) -@@ -486,11 +486,11 @@ - } - } - --void Document::GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, int line, int lastLine) { -+void Document::GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, Sci::Line line, Sci::Line lastLine) { - int level = GetLevel(line); -- int lookLastLine = Platform::Maximum(line, lastLine) + 1; -+ Sci::Line lookLastLine = Platform::Maximum(line, lastLine) + 1; - -- int lookLine = line; -+ Sci::Line lookLine = line; - int lookLineLevel = level; - int lookLineLevelNum = LevelNumber(lookLineLevel); - while ((lookLine > 0) && ((lookLineLevel & SC_FOLDLEVELWHITEFLAG) || -@@ -499,14 +499,14 @@ - lookLineLevelNum = LevelNumber(lookLineLevel); - } - -- int beginFoldBlock = (lookLineLevel & SC_FOLDLEVELHEADERFLAG) ? lookLine : GetFoldParent(lookLine); -+ Sci::Line beginFoldBlock = (lookLineLevel & SC_FOLDLEVELHEADERFLAG) ? lookLine : GetFoldParent(lookLine); - if (beginFoldBlock == -1) { - highlightDelimiter.Clear(); - return; - } - -- int endFoldBlock = GetLastChild(beginFoldBlock, -1, lookLastLine); -- int firstChangeableLineBefore = -1; -+ Sci::Line endFoldBlock = GetLastChild(beginFoldBlock, -1, lookLastLine); -+ Sci::Line firstChangeableLineBefore = -1; - if (endFoldBlock < line) { - lookLine = beginFoldBlock - 1; - lookLineLevel = GetLevel(lookLine); -@@ -538,7 +538,7 @@ - if (firstChangeableLineBefore == -1) - firstChangeableLineBefore = beginFoldBlock - 1; - -- int firstChangeableLineAfter = -1; -+ Sci::Line firstChangeableLineAfter = -1; - for (lookLine = line + 1, lookLineLevel = GetLevel(lookLine), lookLineLevelNum = LevelNumber(lookLineLevel); - lookLine <= endFoldBlock; - lookLineLevel = GetLevel(++lookLine), lookLineLevelNum = LevelNumber(lookLineLevel)) { -@@ -556,11 +556,11 @@ - highlightDelimiter.firstChangeableLineAfter = firstChangeableLineAfter; - } - --int Document::ClampPositionIntoDocument(int pos) const { -+Sci::Position Document::ClampPositionIntoDocument(Sci::Position pos) const { - return Platform::Clamp(pos, 0, Length()); - } - --bool Document::IsCrLf(int pos) const { -+bool Document::IsCrLf(Sci::Position pos) const { - if (pos < 0) - return false; - if (pos >= (Length() - 1)) -@@ -568,7 +568,7 @@ - return (cb.CharAt(pos) == '\r') && (cb.CharAt(pos + 1) == '\n'); - } - --int Document::LenChar(int pos) { -+int Document::LenChar(Sci::Position pos) { - if (pos < 0) { - return 1; - } else if (IsCrLf(pos)) { -@@ -576,7 +576,7 @@ - } else if (SC_CP_UTF8 == dbcsCodePage) { - const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(pos)); - const int widthCharBytes = UTF8BytesOfLead[leadByte]; -- int lengthDoc = Length(); -+ Sci::Position lengthDoc = Length(); - if ((pos + widthCharBytes) > lengthDoc) - return lengthDoc - pos; - else -@@ -588,8 +588,8 @@ - } - } - --bool Document::InGoodUTF8(int pos, int &start, int &end) const { -- int trail = pos; -+bool Document::InGoodUTF8(Sci::Position pos, Sci::Position &start, Sci::Position &end) const { -+ Sci::Position trail = pos; - while ((trail>0) && (pos-trail < UTF8MaxBytes) && UTF8IsTrailByte(static_cast<unsigned char>(cb.CharAt(trail-1)))) - trail--; - start = (trail > 0) ? trail-1 : trail; -@@ -600,13 +600,13 @@ - return false; - } else { - int trailBytes = widthCharBytes - 1; -- int len = pos - start; -+ Sci::Position len = pos - start; - if (len > trailBytes) - // pos too far from lead - return false; - char charBytes[UTF8MaxBytes] = {static_cast<char>(leadByte),0,0,0}; - for (int b=1; b<widthCharBytes && ((start+b) < Length()); b++) -- charBytes[b] = cb.CharAt(static_cast<int>(start+b)); -+ charBytes[b] = cb.CharAt(static_cast<Sci::Position>(start+b)); - int utf8status = UTF8Classify(reinterpret_cast<const unsigned char *>(charBytes), widthCharBytes); - if (utf8status & UTF8MaskInvalid) - return false; -@@ -620,7 +620,7 @@ - // When lines are terminated with \r\n pairs which should be treated as one character. - // When displaying DBCS text such as Japanese. - // If moving, move the position in the indicated direction. --int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) const { -+Sci::Position Document::MovePositionOutsideChar(Sci::Position pos, Sci::Position moveDir, bool checkLineEnd) const { - //Platform::DebugPrintf("NoCRLF %d %d\n", pos, moveDir); - // If out of range, just return minimum/maximum value. - if (pos <= 0) -@@ -641,8 +641,8 @@ - unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos)); - // If ch is not a trail byte then pos is valid intercharacter position - if (UTF8IsTrailByte(ch)) { -- int startUTF = pos; -- int endUTF = pos; -+ Sci::Position startUTF = pos; -+ Sci::Position endUTF = pos; - if (InGoodUTF8(pos, startUTF, endUTF)) { - // ch is a trail byte within a UTF-8 character - if (moveDir > 0) -@@ -655,12 +655,12 @@ - } else { - // Anchor DBCS calculations at start of line because start of line can - // not be a DBCS trail byte. -- int posStartLine = LineStart(LineFromPosition(pos)); -+ Sci::Position posStartLine = LineStart(LineFromPosition(pos)); - if (pos == posStartLine) - return pos; - - // Step back until a non-lead-byte is found. -- int posCheck = pos; -+ Sci::Position posCheck = pos; - while ((posCheck > posStartLine) && IsDBCSLeadByte(cb.CharAt(posCheck-1))) - posCheck--; - -@@ -687,7 +687,7 @@ - // NextPosition moves between valid positions - it can not handle a position in the middle of a - // multi-byte character. It is used to iterate through text more efficiently than MovePositionOutsideChar. - // A \r\n pair is treated as two characters. --int Document::NextPosition(int pos, int moveDir) const { -+Sci::Position Document::NextPosition(Sci::Position pos, int moveDir) const { - // If out of range, just return minimum/maximum value. - int increment = (moveDir > 0) ? 1 : -1; - if (pos + increment <= 0) -@@ -721,8 +721,8 @@ - // If ch is not a trail byte then pos is valid intercharacter position - if (UTF8IsTrailByte(ch)) { - // If ch is a trail byte in a valid UTF-8 character then return start of character -- int startUTF = pos; -- int endUTF = pos; -+ Sci::Position startUTF = pos; -+ Sci::Position endUTF = pos; - if (InGoodUTF8(pos, startUTF, endUTF)) { - pos = startUTF; - } -@@ -738,7 +738,7 @@ - } else { - // Anchor DBCS calculations at start of line because start of line can - // not be a DBCS trail byte. -- int posStartLine = LineStart(LineFromPosition(pos)); -+ Sci::Position posStartLine = LineStart(LineFromPosition(pos)); - // See http://msdn.microsoft.com/en-us/library/cc194792%28v=MSDN.10%29.aspx - // http://msdn.microsoft.com/en-us/library/cc194790.aspx - if ((pos - 1) <= posStartLine) { -@@ -748,7 +748,7 @@ - return pos - 2; - } else { - // Otherwise, step back until a non-lead-byte is found. -- int posTemp = pos - 1; -+ Sci::Position posTemp = pos - 1; - while (posStartLine <= --posTemp && IsDBCSLeadByte(cb.CharAt(posTemp))) - ; - // Now posTemp+1 must point to the beginning of a character, -@@ -765,9 +765,9 @@ - return pos; - } - --bool Document::NextCharacter(int &pos, int moveDir) const { -+bool Document::NextCharacter(Sci::Position &pos, int moveDir) const { - // Returns true if pos changed -- int posNext = NextPosition(pos, moveDir); -+ Sci::Position posNext = NextPosition(pos, moveDir); - if (posNext == pos) { - return false; - } else { -@@ -776,7 +776,7 @@ - } - } - --Document::CharacterExtracted Document::CharacterAfter(int position) const { -+Document::CharacterExtracted Document::CharacterAfter(Sci::Position position) const { - if (position >= Length()) { - return CharacterExtracted(unicodeReplacementChar, 0); - } -@@ -806,7 +806,7 @@ - } - } - --Document::CharacterExtracted Document::CharacterBefore(int position) const { -+Document::CharacterExtracted Document::CharacterBefore(Sci::Position position) const { - if (position <= 0) { - return CharacterExtracted(unicodeReplacementChar, 0); - } -@@ -822,8 +822,8 @@ - // If previousByte is not a trail byte then its invalid - if (UTF8IsTrailByte(previousByte)) { - // If previousByte is a trail byte in a valid UTF-8 character then find start of character -- int startUTF = position; -- int endUTF = position; -+ Sci::Position startUTF = position; -+ Sci::Position endUTF = position; - if (InGoodUTF8(position, startUTF, endUTF)) { - const int widthCharBytes = endUTF - startUTF; - unsigned char charBytes[UTF8MaxBytes] = { 0, 0, 0, 0 }; -@@ -842,18 +842,18 @@ - return CharacterExtracted(unicodeReplacementChar, 1); - } else { - // Moving backwards in DBCS is complex so use NextPosition -- const int posStartCharacter = NextPosition(position, -1); -+ const Sci::Position posStartCharacter = NextPosition(position, -1); - return CharacterAfter(posStartCharacter); - } - } - - // Return -1 on out-of-bounds - Sci_Position SCI_METHOD Document::GetRelativePosition(Sci_Position positionStart, Sci_Position characterOffset) const { -- int pos = positionStart; -+ Sci::Position pos = positionStart; - if (dbcsCodePage) { - const int increment = (characterOffset > 0) ? 1 : -1; - while (characterOffset != 0) { -- const int posNext = NextPosition(pos, increment); -+ const Sci::Position posNext = NextPosition(pos, increment); - if (posNext == pos) - return INVALID_POSITION; - pos = posNext; -@@ -867,12 +867,12 @@ - return pos; - } - --int Document::GetRelativePositionUTF16(int positionStart, int characterOffset) const { -- int pos = positionStart; -+Sci::Position Document::GetRelativePositionUTF16(Sci::Position positionStart, Sci::Position characterOffset) const { -+ Sci::Position pos = positionStart; - if (dbcsCodePage) { - const int increment = (characterOffset > 0) ? 1 : -1; - while (characterOffset != 0) { -- const int posNext = NextPosition(pos, increment); -+ const Sci::Position posNext = NextPosition(pos, increment); - if (posNext == pos) - return INVALID_POSITION; - if (abs(pos-posNext) > 3) // 4 byte character = 2*UTF16. -@@ -1018,7 +1018,7 @@ - return efEightBit; - } - --void Document::ModifiedAt(int pos) { -+void Document::ModifiedAt(Sci::Position pos) { - if (endStyled > pos) - endStyled = pos; - } -@@ -1034,7 +1034,7 @@ - // Document only modified by gateways DeleteChars, InsertString, Undo, Redo, and SetStyleAt. - // SetStyleAt does not change the persistent state of a document - --bool Document::DeleteChars(int pos, int len) { -+bool Document::DeleteChars(Sci::Position pos, Sci::Position len) { - if (pos < 0) - return false; - if (len <= 0) -@@ -1052,7 +1052,7 @@ - SC_MOD_BEFOREDELETE | SC_PERFORMED_USER, - pos, len, - 0, 0)); -- int prevLinesTotal = LinesTotal(); -+ Sci::Line prevLinesTotal = LinesTotal(); - bool startSavePoint = cb.IsSavePoint(); - bool startSequence = false; - const char *text = cb.DeleteChars(pos, len, startSequence); -@@ -1076,7 +1076,7 @@ - /** - * Insert a string with a length. - */ --int Document::InsertString(int position, const char *s, int insertLength) { -+Sci::Position Document::InsertString(Sci::Position position, const char *s, Sci::Position insertLength) { - if (insertLength <= 0) { - return 0; - } -@@ -1104,7 +1104,7 @@ - SC_MOD_BEFOREINSERT | SC_PERFORMED_USER, - position, insertLength, - 0, s)); -- int prevLinesTotal = LinesTotal(); -+ Sci::Line prevLinesTotal = LinesTotal(); - bool startSavePoint = cb.IsSavePoint(); - bool startSequence = false; - const char *text = cb.InsertString(position, s, insertLength, startSequence); -@@ -1123,14 +1123,14 @@ - return insertLength; - } - --void Document::ChangeInsertion(const char *s, int length) { -+void Document::ChangeInsertion(const char *s, Sci::Position length) { - insertionSet = true; - insertion.assign(s, length); - } - - int SCI_METHOD Document::AddData(char *data, Sci_Position length) { - try { -- int position = Length(); -+ Sci::Position position = Length(); - InsertString(position, data, length); - } catch (std::bad_alloc &) { - return SC_STATUS_BADALLOC; -@@ -1144,8 +1144,8 @@ - return this; - } - --int Document::Undo() { -- int newPos = -1; -+Sci::Position Document::Undo() { -+ Sci::Position newPos = -1; - CheckReadOnly(); - if ((enteredModification == 0) && (cb.IsCollectingUndo())) { - enteredModification++; -@@ -1154,12 +1154,12 @@ - bool multiLine = false; - int steps = cb.StartUndo(); - //Platform::DebugPrintf("Steps=%d\n", steps); -- int coalescedRemovePos = -1; -- int coalescedRemoveLen = 0; -- int prevRemoveActionPos = -1; -- int prevRemoveActionLen = 0; -+ Sci::Position coalescedRemovePos = -1; -+ Sci::Position coalescedRemoveLen = 0; -+ Sci::Position prevRemoveActionPos = -1; -+ Sci::Position prevRemoveActionLen = 0; - for (int step = 0; step < steps; step++) { -- const int prevLinesTotal = LinesTotal(); -+ const Sci::Line prevLinesTotal = LinesTotal(); - const Action &action = cb.GetUndoStep(); - if (action.at == removeAction) { - NotifyModified(DocModification( -@@ -1208,7 +1208,7 @@ - } - if (steps > 1) - modFlags |= SC_MULTISTEPUNDOREDO; -- const int linesAdded = LinesTotal() - prevLinesTotal; -+ const Sci::Line linesAdded = LinesTotal() - prevLinesTotal; - if (linesAdded != 0) - multiLine = true; - if (step == steps - 1) { -@@ -1229,8 +1229,8 @@ - return newPos; - } - --int Document::Redo() { -- int newPos = -1; -+Sci::Position Document::Redo() { -+ Sci::Position newPos = -1; - CheckReadOnly(); - if ((enteredModification == 0) && (cb.IsCollectingUndo())) { - enteredModification++; -@@ -1239,7 +1239,7 @@ - bool multiLine = false; - int steps = cb.StartRedo(); - for (int step = 0; step < steps; step++) { -- const int prevLinesTotal = LinesTotal(); -+ const Sci::Line prevLinesTotal = LinesTotal(); - const Action &action = cb.GetRedoStep(); - if (action.at == insertAction) { - NotifyModified(DocModification( -@@ -1267,7 +1267,7 @@ - } - if (steps > 1) - modFlags |= SC_MULTISTEPUNDOREDO; -- const int linesAdded = LinesTotal() - prevLinesTotal; -+ const Sci::Line linesAdded = LinesTotal() - prevLinesTotal; - if (linesAdded != 0) - multiLine = true; - if (step == steps - 1) { -@@ -1289,28 +1289,28 @@ - return newPos; - } - --void Document::DelChar(int pos) { -+void Document::DelChar(Sci::Position pos) { - DeleteChars(pos, LenChar(pos)); - } - --void Document::DelCharBack(int pos) { -+void Document::DelCharBack(Sci::Position pos) { - if (pos <= 0) { - return; - } else if (IsCrLf(pos - 2)) { - DeleteChars(pos - 2, 2); - } else if (dbcsCodePage) { -- int startChar = NextPosition(pos, -1); -+ Sci::Position startChar = NextPosition(pos, -1); - DeleteChars(startChar, pos - startChar); - } else { - DeleteChars(pos - 1, 1); - } - } - --static int NextTab(int pos, int tabSize) { -+static Sci::Position NextTab(Sci::Position pos, Sci::Position tabSize) { - return ((pos / tabSize) + 1) * tabSize; - } - --static std::string CreateIndentation(int indent, int tabSize, bool insertSpaces) { -+static std::string CreateIndentation(Sci::Position indent, int tabSize, bool insertSpaces) { - std::string indentation; - if (!insertSpaces) { - while (indent >= tabSize) { -@@ -1328,9 +1328,9 @@ - int SCI_METHOD Document::GetLineIndentation(Sci_Position line) { - int indent = 0; - if ((line >= 0) && (line < LinesTotal())) { -- int lineStart = LineStart(line); -- int length = Length(); -- for (int i = lineStart; i < length; i++) { -+ Sci::Position lineStart = LineStart(line); -+ Sci::Position length = Length(); -+ for (Sci::Position i = lineStart; i < length; i++) { - char ch = cb.CharAt(i); - if (ch == ' ') - indent++; -@@ -1343,39 +1343,39 @@ - return indent; - } - --int Document::SetLineIndentation(int line, int indent) { -+Sci::Position Document::SetLineIndentation(Sci::Line line, Sci::Position indent) { - int indentOfLine = GetLineIndentation(line); - if (indent < 0) - indent = 0; - if (indent != indentOfLine) { - std::string linebuf = CreateIndentation(indent, tabInChars, !useTabs); -- int thisLineStart = LineStart(line); -- int indentPos = GetLineIndentPosition(line); -+ Sci::Position thisLineStart = LineStart(line); -+ Sci::Position indentPos = GetLineIndentPosition(line); - UndoGroup ug(this); - DeleteChars(thisLineStart, indentPos - thisLineStart); - return thisLineStart + InsertString(thisLineStart, linebuf.c_str(), -- static_cast<int>(linebuf.length())); -+ static_cast<Sci::Position>(linebuf.length())); - } else { - return GetLineIndentPosition(line); - } - } - --int Document::GetLineIndentPosition(int line) const { -+Sci::Position Document::GetLineIndentPosition(Sci::Line line) const { - if (line < 0) - return 0; -- int pos = LineStart(line); -- int length = Length(); -+ Sci::Position pos = LineStart(line); -+ Sci::Position length = Length(); - while ((pos < length) && IsSpaceOrTab(cb.CharAt(pos))) { - pos++; - } - return pos; - } - --int Document::GetColumn(int pos) { -- int column = 0; -- int line = LineFromPosition(pos); -+Sci::Position Document::GetColumn(Sci::Position pos) { -+ Sci::Position column = 0; -+ Sci::Line line = LineFromPosition(pos); - if ((line >= 0) && (line < LinesTotal())) { -- for (int i = LineStart(line); i < pos;) { -+ for (Sci::Position i = LineStart(line); i < pos;) { - char ch = cb.CharAt(i); - if (ch == '\t') { - column = NextTab(column, tabInChars); -@@ -1395,11 +1395,11 @@ - return column; - } - --int Document::CountCharacters(int startPos, int endPos) const { -+Sci::Position Document::CountCharacters(Sci::Position startPos, Sci::Position endPos) const { - startPos = MovePositionOutsideChar(startPos, 1, false); - endPos = MovePositionOutsideChar(endPos, -1, false); -- int count = 0; -- int i = startPos; -+ Sci::Position count = 0; -+ Sci::Position i = startPos; - while (i < endPos) { - count++; - i = NextPosition(i, 1); -@@ -1407,14 +1407,14 @@ - return count; - } - --int Document::CountUTF16(int startPos, int endPos) const { -+Sci::Position Document::CountUTF16(Sci::Position startPos, Sci::Position endPos) const { - startPos = MovePositionOutsideChar(startPos, 1, false); - endPos = MovePositionOutsideChar(endPos, -1, false); -- int count = 0; -- int i = startPos; -+ Sci::Position count = 0; -+ Sci::Position i = startPos; - while (i < endPos) { - count++; -- const int next = NextPosition(i, 1); -+ const Sci::Position next = NextPosition(i, 1); - if ((next - i) > 3) - count++; - i = next; -@@ -1422,10 +1422,10 @@ - return count; - } - --int Document::FindColumn(int line, int column) { -- int position = LineStart(line); -+Sci::Position Document::FindColumn(Sci::Line line, Sci::Position column) { -+ Sci::Position position = LineStart(line); - if ((line >= 0) && (line < LinesTotal())) { -- int columnCurrent = 0; -+ Sci::Position columnCurrent = 0; - while ((columnCurrent < column) && (position < Length())) { - char ch = cb.CharAt(position); - if (ch == '\t') { -@@ -1446,10 +1446,10 @@ - return position; - } - --void Document::Indent(bool forwards, int lineBottom, int lineTop) { -+void Document::Indent(bool forwards, Sci::Line lineBottom, Sci::Line 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); -+ for (Sci::Line line = lineBottom; line >= lineTop; line--) { -+ Sci::Position indentOfLine = GetLineIndentation(line); - if (forwards) { - if (LineStart(line) < LineEnd(line)) { - SetLineIndentation(line, indentOfLine + IndentSize()); -@@ -1487,7 +1487,7 @@ - void Document::ConvertLineEnds(int eolModeSet) { - UndoGroup ug(this); - -- for (int pos = 0; pos < Length(); pos++) { -+ for (Sci::Position pos = 0; pos < Length(); pos++) { - if (cb.CharAt(pos) == '\r') { - if (cb.CharAt(pos + 1) == '\n') { - // CRLF -@@ -1522,9 +1522,9 @@ - - } - --bool Document::IsWhiteLine(int line) const { -- int currentChar = LineStart(line); -- int endLine = LineEnd(line); -+bool Document::IsWhiteLine(Sci::Line line) const { -+ Sci::Position currentChar = LineStart(line); -+ Sci::Position endLine = LineEnd(line); - while (currentChar < endLine) { - if (cb.CharAt(currentChar) != ' ' && cb.CharAt(currentChar) != '\t') { - return false; -@@ -1534,8 +1534,8 @@ - return true; - } - --int Document::ParaUp(int pos) const { -- int line = LineFromPosition(pos); -+Sci::Position Document::ParaUp(Sci::Position pos) const { -+ Sci::Line line = LineFromPosition(pos); - line--; - while (line >= 0 && IsWhiteLine(line)) { // skip empty lines - line--; -@@ -1547,8 +1547,8 @@ - return LineStart(line); - } - --int Document::ParaDown(int pos) const { -- int line = LineFromPosition(pos); -+Sci::Position Document::ParaDown(Sci::Position pos) const { -+ Sci::Line line = LineFromPosition(pos); - while (line < LinesTotal() && !IsWhiteLine(line)) { // skip non-empty lines - line++; - } -@@ -1635,7 +1635,7 @@ - * Used by commmands that want to select whole words. - * Finds the start of word at pos when delta < 0 or the end of the word when delta >= 0. - */ --int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) const { -+Sci::Position Document::ExtendWordSelect(Sci::Position pos, int delta, bool onlyWordCharacters) const { - CharClassify::cc ccStart = CharClassify::ccWord; - if (delta < 0) { - if (!onlyWordCharacters) { -@@ -1670,7 +1670,7 @@ - * additional movement to transit white space. - * Used by cursor movement by word commands. - */ --int Document::NextWordStart(int pos, int delta) const { -+Sci::Position Document::NextWordStart(Sci::Position pos, int delta) const { - if (delta < 0) { - while (pos > 0) { - const CharacterExtracted ce = CharacterBefore(pos); -@@ -1714,7 +1714,7 @@ - * additional movement to transit white space. - * Used by cursor movement by word commands. - */ --int Document::NextWordEnd(int pos, int delta) const { -+Sci::Position Document::NextWordEnd(Sci::Position pos, int delta) const { - if (delta < 0) { - if (pos > 0) { - CharacterExtracted ce = CharacterBefore(pos); -@@ -1759,7 +1759,7 @@ - * Check that the character at the given position is a word or punctuation character and that - * the previous character is of a different character class. - */ --bool Document::IsWordStartAt(int pos) const { -+bool Document::IsWordStartAt(Sci::Position pos) const { - if (pos >= Length()) - return false; - if (pos > 0) { -@@ -1777,7 +1777,7 @@ - * Check that the character at the given position is a word or punctuation character and that - * the next character is of a different character class. - */ --bool Document::IsWordEndAt(int pos) const { -+bool Document::IsWordEndAt(Sci::Position pos) const { - if (pos <= 0) - return false; - if (pos < Length()) { -@@ -1795,11 +1795,11 @@ - * Check that the given range is has transitions between character classes at both - * ends and where the characters on the inside are word or punctuation characters. - */ --bool Document::IsWordAt(int start, int end) const { -+bool Document::IsWordAt(Sci::Position start, Sci::Position end) const { - return (start < end) && IsWordStartAt(start) && IsWordEndAt(end); - } - --bool Document::MatchesWordOptions(bool word, bool wordStart, int pos, int length) const { -+bool Document::MatchesWordOptions(bool word, bool wordStart, Sci::Position pos, Sci::Position length) const { - return (!word && !wordStart) || - (word && IsWordAt(pos, pos + length)) || - (wordStart && IsWordStartAt(pos)); -@@ -1814,7 +1814,7 @@ - pcf = pcf_; - } - --Document::CharacterExtracted Document::ExtractCharacter(int position) const { -+Document::CharacterExtracted Document::ExtractCharacter(Sci::Position position) const { - const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(position)); - if (UTF8IsAscii(leadByte)) { - // Common case: ASCII character -@@ -1838,8 +1838,8 @@ - * searches (just pass minPos > maxPos to do a backward search) - * Has not been tested with backwards DBCS searches yet. - */ --long Document::FindText(int minPos, int maxPos, const char *search, -- int flags, int *length) { -+long Document::FindText(Sci::Position minPos, Sci::Position maxPos, const char *search, -+ int flags, Sci::Position *length) { - if (*length <= 0) - return minPos; - const bool caseSensitive = (flags & SCFIND_MATCHCASE) != 0; -@@ -1856,21 +1856,21 @@ - const int increment = forward ? 1 : -1; - - // Range endpoints should not be inside DBCS characters, but just in case, move them. -- const int startPos = MovePositionOutsideChar(minPos, increment, false); -- const int endPos = MovePositionOutsideChar(maxPos, increment, false); -+ const Sci::Position startPos = MovePositionOutsideChar(minPos, increment, false); -+ const Sci::Position endPos = MovePositionOutsideChar(maxPos, increment, false); - - // Compute actual search ranges needed -- const int lengthFind = *length; -+ const Sci::Position lengthFind = *length; - - //Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind); -- const int limitPos = Platform::Maximum(startPos, endPos); -- int pos = startPos; -+ const Sci::Position limitPos = Platform::Maximum(startPos, endPos); -+ Sci::Position pos = startPos; - if (!forward) { - // Back all of a character - pos = NextPosition(pos, increment); - } - if (caseSensitive) { -- const int endSearch = (startPos <= endPos) ? endPos - lengthFind + 1 : endPos; -+ const Sci::Position endSearch = (startPos <= endPos) ? endPos - lengthFind + 1 : endPos; - const char charStartSearch = search[0]; - while (forward ? (pos < endSearch) : (pos >= endSearch)) { - if (CharAt(pos) == charStartSearch) { -@@ -1894,7 +1894,7 @@ - char folded[UTF8MaxBytes * maxFoldingExpansion + 1]; - while (forward ? (pos < endPos) : (pos >= endPos)) { - int widthFirstCharacter = 0; -- int posIndexDocument = pos; -+ Sci::Position posIndexDocument = pos; - int indexSearch = 0; - bool characterMatches = true; - for (;;) { -@@ -1978,7 +1978,7 @@ - break; - } - } else { -- const int endSearch = (startPos <= endPos) ? endPos - lengthFind + 1 : endPos; -+ const Sci::Position endSearch = (startPos <= endPos) ? endPos - lengthFind + 1 : endPos; - std::vector<char> searchThing(lengthFind + 1); - pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind); - while (forward ? (pos < endSearch) : (pos >= endSearch)) { -@@ -2001,14 +2001,14 @@ - return -1; - } - --const char *Document::SubstituteByPosition(const char *text, int *length) { -+const char *Document::SubstituteByPosition(const char *text, Sci::Position *length) { - if (regex) - return regex->SubstituteByPosition(this, text, length); - else - return 0; - } - --int Document::LinesTotal() const { -+Sci::Line Document::LinesTotal() const { - return cb.Lines(); - } - -@@ -2033,7 +2033,7 @@ - return false; - } else { - enteredStyling++; -- int prevEndStyled = endStyled; -+ Sci::Position prevEndStyled = endStyled; - if (cb.SetStyleFor(endStyled, length, style)) { - DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER, - prevEndStyled, length); -@@ -2051,8 +2051,8 @@ - } else { - enteredStyling++; - bool didChange = false; -- int startMod = 0; -- int endMod = 0; -+ Sci::Position startMod = 0; -+ Sci::Position endMod = 0; - for (int iPos = 0; iPos < length; iPos++, endStyled++) { - PLATFORM_ASSERT(endStyled < Length()); - if (cb.SetStyleAt(endStyled, styles[iPos])) { -@@ -2073,12 +2073,12 @@ - } - } - --void Document::EnsureStyledTo(int pos) { -+void Document::EnsureStyledTo(Sci::Position pos) { - if ((enteredStyling == 0) && (pos > GetEndStyled())) { - IncrementStyleClock(); - if (pli && !pli->UseContainerLexing()) { -- int lineEndStyled = LineFromPosition(GetEndStyled()); -- int endStyledTo = LineStart(lineEndStyled); -+ Sci::Line lineEndStyled = LineFromPosition(GetEndStyled()); -+ Sci::Position endStyledTo = LineStart(lineEndStyled); - pli->Colourise(endStyledTo, pos); - } else { - // Ask the watchers to style, and stop as soon as one responds. -@@ -2090,7 +2090,7 @@ - } - } - --void Document::StyleToAdjustingLineDuration(int pos) { -+void Document::StyleToAdjustingLineDuration(Sci::Position pos) { - // Place bounds on the duration used to avoid glitches spiking it - // and so causing slow styling or non-responsive scrolling - const double minDurationOneLine = 0.000001; -@@ -2100,11 +2100,11 @@ - // Most recent value contributes 25% to smoothed value. - const double alpha = 0.25; - -- const Sci_Position lineFirst = LineFromPosition(GetEndStyled()); -+ const Sci::Line lineFirst = LineFromPosition(GetEndStyled()); - ElapsedTime etStyling; - EnsureStyledTo(pos); - const double durationStyling = etStyling.Duration(); -- const Sci_Position lineLast = LineFromPosition(GetEndStyled()); -+ const Sci::Line lineLast = LineFromPosition(GetEndStyled()); - if (lineLast >= lineFirst + 8) { - // Only adjust for styling multiple lines to avoid instability - const double durationOneLine = durationStyling / (lineLast - lineFirst); -@@ -2137,7 +2137,7 @@ - return static_cast<LineState *>(perLineData[ldState])->GetLineState(line); - } - --int Document::GetMaxLineState() { -+Sci::Line Document::GetMaxLineState() { - return static_cast<LineState *>(perLineData[ldState])->GetMaxLineState(); - } - -@@ -2146,45 +2146,45 @@ - NotifyModified(mh); - } - --StyledText Document::MarginStyledText(int line) const { -+StyledText Document::MarginStyledText(Sci::Line line) const { - LineAnnotation *pla = static_cast<LineAnnotation *>(perLineData[ldMargin]); - return StyledText(pla->Length(line), pla->Text(line), - pla->MultipleStyles(line), pla->Style(line), pla->Styles(line)); - } - --void Document::MarginSetText(int line, const char *text) { -+void Document::MarginSetText(Sci::Line line, const char *text) { - static_cast<LineAnnotation *>(perLineData[ldMargin])->SetText(line, text); - DocModification mh(SC_MOD_CHANGEMARGIN, LineStart(line), 0, 0, 0, line); - NotifyModified(mh); - } - --void Document::MarginSetStyle(int line, int style) { -+void Document::MarginSetStyle(Sci::Line line, int style) { - static_cast<LineAnnotation *>(perLineData[ldMargin])->SetStyle(line, style); - NotifyModified(DocModification(SC_MOD_CHANGEMARGIN, LineStart(line), 0, 0, 0, line)); - } - --void Document::MarginSetStyles(int line, const unsigned char *styles) { -+void Document::MarginSetStyles(Sci::Line line, const unsigned char *styles) { - static_cast<LineAnnotation *>(perLineData[ldMargin])->SetStyles(line, styles); - NotifyModified(DocModification(SC_MOD_CHANGEMARGIN, LineStart(line), 0, 0, 0, line)); - } - - void Document::MarginClearAll() { -- int maxEditorLine = LinesTotal(); -- for (int l=0; l<maxEditorLine; l++) -+ Sci::Line maxEditorLine = LinesTotal(); -+ for (Sci::Line l=0; l<maxEditorLine; l++) - MarginSetText(l, 0); - // Free remaining data - static_cast<LineAnnotation *>(perLineData[ldMargin])->ClearAll(); - } - --StyledText Document::AnnotationStyledText(int line) const { -+StyledText Document::AnnotationStyledText(Sci::Line line) const { - LineAnnotation *pla = static_cast<LineAnnotation *>(perLineData[ldAnnotation]); - return StyledText(pla->Length(line), pla->Text(line), - pla->MultipleStyles(line), pla->Style(line), pla->Styles(line)); - } - --void Document::AnnotationSetText(int line, const char *text) { -+void Document::AnnotationSetText(Sci::Line line, const char *text) { - if (line >= 0 && line < LinesTotal()) { -- const int linesBefore = AnnotationLines(line); -+ const Sci::Line linesBefore = AnnotationLines(line); - static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetText(line, text); - const int linesAfter = AnnotationLines(line); - DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line), 0, 0, 0, line); -@@ -2193,25 +2193,25 @@ - } - } - --void Document::AnnotationSetStyle(int line, int style) { -+void Document::AnnotationSetStyle(Sci::Line line, int style) { - static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetStyle(line, style); - DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line), 0, 0, 0, line); - NotifyModified(mh); - } - --void Document::AnnotationSetStyles(int line, const unsigned char *styles) { -+void Document::AnnotationSetStyles(Sci::Line line, const unsigned char *styles) { - if (line >= 0 && line < LinesTotal()) { - static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetStyles(line, styles); - } - } - --int Document::AnnotationLines(int line) const { -+int Document::AnnotationLines(Sci::Line line) const { - return static_cast<LineAnnotation *>(perLineData[ldAnnotation])->Lines(line); - } - - void Document::AnnotationClearAll() { -- int maxEditorLine = LinesTotal(); -- for (int l=0; l<maxEditorLine; l++) -+ Sci::Line maxEditorLine = LinesTotal(); -+ for (Sci::Line l=0; l<maxEditorLine; l++) - AnnotationSetText(l, 0); - // Free remaining data - static_cast<LineAnnotation *>(perLineData[ldAnnotation])->ClearAll(); -@@ -2317,7 +2317,7 @@ - return (WordCharacterClass(ch) == CharClassify::ccWord) && IsASCIIPunctuationCharacter(ch); - } - --int Document::WordPartLeft(int pos) const { -+Sci::Position Document::WordPartLeft(Sci::Position pos) const { - if (pos > 0) { - pos -= CharacterBefore(pos).widthBytes; - CharacterExtracted ceStart = CharacterAfter(pos); -@@ -2367,9 +2367,9 @@ - return pos; - } - --int Document::WordPartRight(int pos) const { -+Sci::Position Document::WordPartRight(Sci::Position pos) const { - CharacterExtracted ceStart = CharacterAfter(pos); -- const int length = Length(); -+ const Sci::Position length = Length(); - if (IsWordPartSeparator(ceStart.character)) { - while (pos < length && IsWordPartSeparator(CharacterAfter(pos).character)) - pos += CharacterAfter(pos).widthBytes; -@@ -2411,7 +2411,7 @@ - return (c == '\n' || c == '\r'); - } - --int Document::ExtendStyleRange(int pos, int delta, bool singleLine) { -+Sci::Position Document::ExtendStyleRange(Sci::Position pos, int delta, bool singleLine) { - int sStart = cb.StyleAt(pos); - if (delta < 0) { - while (pos > 0 && (cb.StyleAt(pos) == sStart) && (!singleLine || !IsLineEndChar(cb.CharAt(pos)))) -@@ -2448,7 +2448,7 @@ - } - - // TODO: should be able to extend styled region to find matching brace --int Document::BraceMatch(int position, int /*maxReStyle*/) { -+Sci::Position Document::BraceMatch(Sci::Position position, Sci::Position /*maxReStyle*/) { - char chBrace = CharAt(position); - char chSeek = BraceOpposite(chBrace); - if (chSeek == '\0') -@@ -2470,7 +2470,7 @@ - if (depth == 0) - return position; - } -- int positionBeforeMove = position; -+ Sci::Position positionBeforeMove = position; - position = NextPosition(position, direction); - if (position == positionBeforeMove) - break; -@@ -2488,11 +2488,11 @@ - virtual ~BuiltinRegex() { - } - -- virtual long FindText(Document *doc, int minPos, int maxPos, const char *s, -+ virtual long FindText(Document *doc, Sci::Position minPos, Sci::Position maxPos, const char *s, - bool caseSensitive, bool word, bool wordStart, int flags, -- int *length); -+ Sci::Position *length); - -- virtual const char *SubstituteByPosition(Document *doc, const char *text, int *length); -+ virtual const char *SubstituteByPosition(Document *doc, const char *text, Sci::Position *length); - - private: - RESearch search; -@@ -2508,12 +2508,12 @@ - public: - const Document *doc; - int increment; -- int startPos; -- int endPos; -- int lineRangeStart; -- int lineRangeEnd; -- int lineRangeBreak; -- RESearchRange(const Document *doc_, int minPos, int maxPos) : doc(doc_) { -+ Sci::Position startPos; -+ Sci::Position endPos; -+ Sci::Line lineRangeStart; -+ Sci::Line lineRangeEnd; -+ Sci::Line lineRangeBreak; -+ RESearchRange(const Document *doc_, Sci::Position minPos, Sci::Position maxPos) : doc(doc_) { - increment = (minPos <= maxPos) ? 1 : -1; - - // Range endpoints should not be inside DBCS characters, but just in case, move them. -@@ -2537,7 +2537,7 @@ - } - lineRangeBreak = lineRangeEnd + increment; - } -- Range LineRange(int line) const { -+ Range LineRange(Sci::Line line) const { - Range range(doc->LineStart(line), doc->LineEnd(line)); - if (increment == 1) { - if (line == lineRangeStart) -@@ -2557,16 +2557,16 @@ - // Define a way for the Regular Expression code to access the document - class DocumentIndexer : public CharacterIndexer { - Document *pdoc; -- int end; -+ Sci::Position end; - public: -- DocumentIndexer(Document *pdoc_, int end_) : -+ DocumentIndexer(Document *pdoc_, Sci::Position end_) : - pdoc(pdoc_), end(end_) { - } - - virtual ~DocumentIndexer() { - } - -- virtual char CharAt(int index) { -+ virtual char CharAt(Sci::Position index) { - if (index < 0 || index >= end) - return 0; - else -@@ -2579,8 +2579,8 @@ - class ByteIterator : public std::iterator<std::bidirectional_iterator_tag, char> { - public: - const Document *doc; -- Position position; -- ByteIterator(const Document *doc_ = 0, Position position_ = 0) : doc(doc_), position(position_) { -+ Sci::Position position; -+ ByteIterator(const Document *doc_ = 0, Sci::Position position_ = 0) : doc(doc_), position(position_) { - } - ByteIterator(const ByteIterator &other) NOEXCEPT { - doc = other.doc; -@@ -2615,10 +2615,10 @@ - bool operator!=(const ByteIterator &other) const { - return doc != other.doc || position != other.position; - } -- int Pos() const { -+ Sci::Position Pos() const { - return position; - } -- int PosRoundUp() const { -+ Sci::Position PosRoundUp() const { - return position; - } - }; -@@ -2642,14 +2642,14 @@ - class UTF8Iterator : public std::iterator<std::bidirectional_iterator_tag, wchar_t> { - // These 3 fields determine the iterator position and are used for comparisons - const Document *doc; -- Position position; -+ Sci::Position position; - size_t characterIndex; - // Remaining fields are derived from the determining fields so are excluded in comparisons - unsigned int lenBytes; - size_t lenCharacters; - wchar_t buffered[2]; - public: -- UTF8Iterator(const Document *doc_ = 0, Position position_ = 0) : -+ UTF8Iterator(const Document *doc_ = 0, Sci::Position position_ = 0) : - doc(doc_), position(position_), characterIndex(0), lenBytes(0), lenCharacters(0) { - buffered[0] = 0; - buffered[1] = 0; -@@ -2725,10 +2725,10 @@ - position != other.position || - characterIndex != other.characterIndex; - } -- int Pos() const { -+ Sci::Position Pos() const { - return position; - } -- int PosRoundUp() const { -+ Sci::Position PosRoundUp() const { - if (characterIndex) - return position + lenBytes; // Force to end of character - else -@@ -2753,9 +2753,9 @@ - - class UTF8Iterator : public std::iterator<std::bidirectional_iterator_tag, wchar_t> { - const Document *doc; -- Position position; -+ Sci::Position position; - public: -- UTF8Iterator(const Document *doc_=0, Position position_=0) : doc(doc_), position(position_) { -+ UTF8Iterator(const Document *doc_=0, Sci::Position position_=0) : doc(doc_), position(position_) { - } - UTF8Iterator(const UTF8Iterator &other) NOEXCEPT { - doc = other.doc; -@@ -2791,17 +2791,17 @@ - bool operator!=(const UTF8Iterator &other) const { - return doc != other.doc || position != other.position; - } -- int Pos() const { -+ Sci::Position Pos() const { - return position; - } -- int PosRoundUp() const { -+ Sci::Position PosRoundUp() const { - return position; - } - }; - - #endif - --std::regex_constants::match_flag_type MatchFlags(const Document *doc, int startPos, int endPos) { -+std::regex_constants::match_flag_type MatchFlags(const Document *doc, Sci::Position startPos, Sci::Position endPos) { - std::regex_constants::match_flag_type flagsMatch = std::regex_constants::match_default; - if (!doc->IsLineStartPosition(startPos)) - flagsMatch |= std::regex_constants::match_not_bol; -@@ -2824,7 +2824,7 @@ - // matched = std::regex_search(uiStart, uiEnd, match, regexp, flagsMatch); - - // Line by line. -- for (int line = resr.lineRangeStart; line != resr.lineRangeBreak; line += resr.increment) { -+ for (Sci::Line line = resr.lineRangeStart; line != resr.lineRangeBreak; line += resr.increment) { - const Range lineRange = resr.LineRange(line); - Iterator itStart(doc, lineRange.start); - Iterator itEnd(doc, lineRange.end); -@@ -2865,8 +2865,8 @@ - return matched; - } - --long Cxx11RegexFindText(Document *doc, int minPos, int maxPos, const char *s, -- bool caseSensitive, int *length, RESearch &search) { -+Sci::Position Cxx11RegexFindText(Document *doc, Sci::Position minPos, Sci::Position maxPos, const char *s, -+ bool caseSensitive, Sci::Position *length, RESearch &search) { - const RESearchRange resr(doc, minPos, maxPos); - try { - //ElapsedTime et; -@@ -2906,7 +2906,7 @@ - matched = MatchOnLines<ByteIterator>(doc, regexp, resr, search); - } - -- int posMatch = -1; -+ Sci::Position posMatch = -1; - if (matched) { - posMatch = search.bopat[0]; - *length = search.eopat[0] - search.bopat[0]; -@@ -2930,9 +2930,9 @@ - - } - --long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s, -+long BuiltinRegex::FindText(Document *doc, Sci::Position minPos, Sci::Position maxPos, const char *s, - bool caseSensitive, bool, bool, int flags, -- int *length) { -+ Sci::Position *length) { - - #ifndef NO_CXX11_REGEX - if (flags & SCFIND_CXX11REGEX) { -@@ -2953,13 +2953,13 @@ - // Replace first '.' with '-' in each property file variable reference: - // Search: \$(\([A-Za-z0-9_-]+\)\.\([A-Za-z0-9_.]+\)) - // Replace: $(\1-\2) -- int pos = -1; -- int lenRet = 0; -+ Sci::Position pos = -1; -+ Sci::Position lenRet = 0; - const char searchEnd = s[*length - 1]; - const char searchEndPrev = (*length > 1) ? s[*length - 2] : '\0'; -- for (int line = resr.lineRangeStart; line != resr.lineRangeBreak; line += resr.increment) { -- int startOfLine = doc->LineStart(line); -- int endOfLine = doc->LineEnd(line); -+ for (Sci::Line line = resr.lineRangeStart; line != resr.lineRangeBreak; line += resr.increment) { -+ Sci::Position startOfLine = doc->LineStart(line); -+ Sci::Position endOfLine = doc->LineEnd(line); - if (resr.increment == 1) { - if (line == resr.lineRangeStart) { - if ((resr.startPos != startOfLine) && (s[0] == '^')) -@@ -3014,7 +3014,7 @@ - return pos; - } - --const char *BuiltinRegex::SubstituteByPosition(Document *doc, const char *text, int *length) { -+const char *BuiltinRegex::SubstituteByPosition(Document *doc, const char *text, Sci::Position *length) { - substituted.clear(); - DocumentIndexer di(doc, doc->Length()); - search.GrabMatches(di); -@@ -3022,7 +3022,7 @@ - if (text[j] == '\\') { - if (text[j + 1] >= '0' && text[j + 1] <= '9') { - unsigned int patNum = text[j + 1] - '0'; -- unsigned int len = search.eopat[patNum] - search.bopat[patNum]; -+ Sci::Position len = search.eopat[patNum] - search.bopat[patNum]; - if (!search.pat[patNum].empty()) // Will be null if try for a match that did not occur - substituted.append(search.pat[patNum].c_str(), len); - j++; -diff -r 1788f6795302 -r a0f26eaf474d src/Document.h ---- a/src/Document.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/Document.h Fri Mar 31 18:19:38 2017 +1100 -@@ -12,13 +12,6 @@ - namespace Scintilla { - #endif - --/** -- * A Position is a position within a document between two characters or at the beginning or end. -- * Sometimes used as a character index where it identifies the character after the position. -- */ --typedef int Position; --const Position invalidPosition = -1; -- - enum EncodingFamily { efEightBit, efUnicode, efDBCS }; - - /** -@@ -29,13 +22,13 @@ - */ - class Range { - public: -- Position start; -- Position end; -+ Sci::Position start; -+ Sci::Position end; - -- explicit Range(Position pos=0) : -+ explicit Range(Sci::Position pos=0) : - start(pos), end(pos) { - } -- Range(Position start_, Position end_) : -+ Range(Sci::Position start_, Sci::Position end_) : - start(start_), end(end_) { - } - -@@ -44,19 +37,19 @@ - } - - bool Valid() const { -- return (start != invalidPosition) && (end != invalidPosition); -+ return (start != Sci::invalidPosition) && (end != Sci::invalidPosition); - } - -- Position First() const { -+ Sci::Position First() const { - return (start <= end) ? start : end; - } - -- Position Last() const { -+ Sci::Position Last() const { - return (start > end) ? start : end; - } - - // Is the position within the range? -- bool Contains(Position pos) const { -+ bool Contains(Sci::Position pos) const { - if (start < end) { - return (pos >= start && pos <= end); - } else { -@@ -65,7 +58,7 @@ - } - - // Is the character after pos within the range? -- bool ContainsCharacter(Position pos) const { -+ bool ContainsCharacter(Sci::Position pos) const { - if (start < end) { - return (pos >= start && pos < end); - } else { -@@ -97,11 +90,11 @@ - public: - virtual ~RegexSearchBase() {} - -- virtual long FindText(Document *doc, int minPos, int maxPos, const char *s, -- bool caseSensitive, bool word, bool wordStart, int flags, int *length) = 0; -+ virtual long FindText(Document *doc, Sci::Position minPos, Sci::Position maxPos, const char *s, -+ bool caseSensitive, bool word, bool wordStart, int flags, Sci::Position *length) = 0; - - ///@return String with the substitutions, must remain valid until the next call or destruction -- virtual const char *SubstituteByPosition(Document *doc, const char *text, int *length) = 0; -+ virtual const char *SubstituteByPosition(Document *doc, const char *text, Sci::Position *length) = 0; - }; - - /// Factory function for RegexSearchBase -@@ -142,30 +135,30 @@ - firstChangeableLineAfter = -1; - } - -- bool NeedsDrawing(int line) const { -+ bool NeedsDrawing(Sci::Line line) const { - return isEnabled && (line <= firstChangeableLineBefore || line >= firstChangeableLineAfter); - } - -- bool IsFoldBlockHighlighted(int line) const { -+ bool IsFoldBlockHighlighted(Sci::Line line) const { - return isEnabled && beginFoldBlock != -1 && beginFoldBlock <= line && line <= endFoldBlock; - } - -- bool IsHeadOfFoldBlock(int line) const { -+ bool IsHeadOfFoldBlock(Sci::Line line) const { - return beginFoldBlock == line && line < endFoldBlock; - } - -- bool IsBodyOfFoldBlock(int line) const { -+ bool IsBodyOfFoldBlock(Sci::Line line) const { - return beginFoldBlock != -1 && beginFoldBlock < line && line < endFoldBlock; - } - -- bool IsTailOfFoldBlock(int line) const { -+ bool IsTailOfFoldBlock(Sci::Line line) const { - return beginFoldBlock != -1 && beginFoldBlock < line && line == endFoldBlock; - } - -- int beginFoldBlock; // Begin of current fold block -- int endFoldBlock; // End of current fold block -- int firstChangeableLineBefore; // First line that triggers repaint before starting line that determined current fold block -- int firstChangeableLineAfter; // First line that triggers repaint after starting line that determined current fold block -+ Sci::Line beginFoldBlock; // Begin of current fold block -+ Sci::Line endFoldBlock; // End of current fold block -+ Sci::Line firstChangeableLineBefore; // First line that triggers repaint before starting line that determined current fold block -+ Sci::Line firstChangeableLineAfter; // First line that triggers repaint after starting line that determined current fold block - bool isEnabled; - }; - -@@ -185,7 +178,7 @@ - } - virtual ~LexInterface() { - } -- void Colourise(int start, int end); -+ void Colourise(Sci::Position start, Sci::Position end); - int LineEndTypesSupported(); - bool UseContainerLexing() const { - return instance == 0; -@@ -218,7 +211,7 @@ - CellBuffer cb; - CharClassify charClass; - CaseFolder *pcf; -- int endStyled; -+ Sci::Position endStyled; - int styleClock; - int enteredModification; - int enteredStyling; -@@ -278,8 +271,8 @@ - int GetLineEndTypesAllowed() const { return cb.GetLineEndTypes(); } - bool SetLineEndTypesAllowed(int lineEndBitSet_); - int GetLineEndTypesActive() const { return cb.GetLineEndTypes(); } -- virtual void InsertLine(int line); -- virtual void RemoveLine(int line); -+ virtual void InsertLine(Sci::Line line); -+ virtual void RemoveLine(Sci::Line line); - - int SCI_METHOD Version() const { - return dvLineEnd; -@@ -288,18 +281,18 @@ - void SCI_METHOD SetErrorStatus(int status); - - Sci_Position SCI_METHOD LineFromPosition(Sci_Position pos) const; -- int ClampPositionIntoDocument(int pos) const; -- bool ContainsLineEnd(const char *s, int length) const { return cb.ContainsLineEnd(s, length); } -- bool IsCrLf(int pos) const; -- int LenChar(int pos); -- bool InGoodUTF8(int pos, int &start, int &end) const; -- int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true) const; -- int NextPosition(int pos, int moveDir) const; -- bool NextCharacter(int &pos, int moveDir) const; // Returns true if pos changed -- Document::CharacterExtracted CharacterAfter(int position) const; -- Document::CharacterExtracted CharacterBefore(int position) const; -+ Sci::Position ClampPositionIntoDocument(Sci::Position pos) const; -+ bool ContainsLineEnd(const char *s, Sci::Position length) const { return cb.ContainsLineEnd(s, length); } -+ bool IsCrLf(Sci::Position pos) const; -+ int LenChar(Sci::Position pos); -+ bool InGoodUTF8(Sci::Position pos, Sci::Position &start, Sci::Position &end) const; -+ Sci::Position MovePositionOutsideChar(Sci::Position pos, Sci::Position moveDir, bool checkLineEnd=true) const; -+ Sci::Position NextPosition(Sci::Position pos, int moveDir) const; -+ bool NextCharacter(Sci::Position &pos, int moveDir) const; // Returns true if pos changed -+ Document::CharacterExtracted CharacterAfter(Sci::Position position) const; -+ Document::CharacterExtracted CharacterBefore(Sci::Position position) const; - Sci_Position SCI_METHOD GetRelativePosition(Sci_Position positionStart, Sci_Position characterOffset) const; -- int GetRelativePositionUTF16(int positionStart, int characterOffset) const; -+ Sci::Position GetRelativePositionUTF16(Sci::Position positionStart, Sci::Position characterOffset) const; - int SCI_METHOD GetCharacterAndWidth(Sci_Position position, Sci_Position *pWidth) const; - int SCI_METHOD CodePage() const; - bool SCI_METHOD IsDBCSLeadByte(char ch) const; -@@ -307,15 +300,15 @@ - EncodingFamily CodePageFamily() const; - - // Gateways to modifying document -- void ModifiedAt(int pos); -+ void ModifiedAt(Sci::Position pos); - void CheckReadOnly(); -- bool DeleteChars(int pos, int len); -- int InsertString(int position, const char *s, int insertLength); -- void ChangeInsertion(const char *s, int length); -+ bool DeleteChars(Sci::Position pos, Sci::Position len); -+ Sci::Position InsertString(Sci::Position position, const char *s, Sci::Position insertLength); -+ void ChangeInsertion(const char *s, Sci::Position length); - int SCI_METHOD AddData(char *data, Sci_Position length); - void * SCI_METHOD ConvertToDocument(); -- int Undo(); -- int Redo(); -+ Sci::Position Undo(); -+ Sci::Position Redo(); - bool CanUndo() const { return cb.CanUndo(); } - bool CanRedo() const { return cb.CanRedo(); } - void DeleteUndoHistory() { cb.DeleteUndoHistory(); } -@@ -325,7 +318,7 @@ - bool IsCollectingUndo() const { return cb.IsCollectingUndo(); } - void BeginUndoAction() { cb.BeginUndoAction(); } - void EndUndoAction() { cb.EndUndoAction(); } -- void AddUndoAction(int token, bool mayCoalesce) { cb.AddUndoAction(token, mayCoalesce); } -+ void AddUndoAction(Sci::Position token, bool mayCoalesce) { cb.AddUndoAction(token, mayCoalesce); } - void SetSavePoint(); - bool IsSavePoint() const { return cb.IsSavePoint(); } - -@@ -335,76 +328,76 @@ - bool TentativeActive() const { return cb.TentativeActive(); } - - const char * SCI_METHOD BufferPointer() { return cb.BufferPointer(); } -- const char *RangePointer(int position, int rangeLength) { return cb.RangePointer(position, rangeLength); } -- int GapPosition() const { return cb.GapPosition(); } -+ const char *RangePointer(Sci::Position position, Sci::Position rangeLength) { return cb.RangePointer(position, rangeLength); } -+ Sci::Position GapPosition() const { return cb.GapPosition(); } - - int SCI_METHOD GetLineIndentation(Sci_Position line); -- int SetLineIndentation(int line, int indent); -- int GetLineIndentPosition(int line) const; -- int GetColumn(int position); -- int CountCharacters(int startPos, int endPos) const; -- int CountUTF16(int startPos, int endPos) const; -- int FindColumn(int line, int column); -- void Indent(bool forwards, int lineBottom, int lineTop); -+ Sci::Position SetLineIndentation(Sci::Line line, Sci::Position indent); -+ Sci::Position GetLineIndentPosition(Sci::Line line) const; -+ Sci::Position GetColumn(Sci::Position position); -+ Sci::Position CountCharacters(Sci::Position startPos, Sci::Position endPos) const; -+ Sci::Position CountUTF16(Sci::Position startPos, Sci::Position endPos) const; -+ Sci::Position FindColumn(Sci::Line line, Sci::Position column); -+ void Indent(bool forwards, Sci::Line lineBottom, Sci::Line lineTop); - static std::string TransformLineEnds(const char *s, size_t len, int eolModeWanted); - void ConvertLineEnds(int eolModeSet); - void SetReadOnly(bool set) { cb.SetReadOnly(set); } - bool IsReadOnly() const { return cb.IsReadOnly(); } - -- void DelChar(int pos); -- void DelCharBack(int pos); -+ void DelChar(Sci::Position pos); -+ void DelCharBack(Sci::Position pos); - -- char CharAt(int position) const { return cb.CharAt(position); } -+ char CharAt(Sci::Position position) const { return cb.CharAt(position); } - void SCI_METHOD GetCharRange(char *buffer, Sci_Position position, Sci_Position lengthRetrieve) const { - cb.GetCharRange(buffer, position, lengthRetrieve); - } - char SCI_METHOD StyleAt(Sci_Position position) const { return cb.StyleAt(position); } - int StyleIndexAt(Sci_Position position) const { return static_cast<unsigned char>(cb.StyleAt(position)); } -- void GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const { -+ void GetStyleRange(unsigned char *buffer, Sci::Position position, Sci::Position lengthRetrieve) const { - cb.GetStyleRange(buffer, position, lengthRetrieve); - } -- int GetMark(int line); -- int MarkerNext(int lineStart, int mask) const; -- int AddMark(int line, int markerNum); -- void AddMarkSet(int line, int valueSet); -- void DeleteMark(int line, int markerNum); -+ int GetMark(Sci::Line line); -+ Sci::Line MarkerNext(Sci::Line lineStart, int mask) const; -+ int AddMark(Sci::Line line, int markerNum); -+ void AddMarkSet(Sci::Line line, int valueSet); -+ void DeleteMark(Sci::Line line, int markerNum); - void DeleteMarkFromHandle(int markerHandle); - void DeleteAllMarks(int markerNum); -- int LineFromHandle(int markerHandle); -+ Sci::Line LineFromHandle(int markerHandle); - Sci_Position SCI_METHOD LineStart(Sci_Position line) const; -- bool IsLineStartPosition(int position) const; -+ bool IsLineStartPosition(Sci::Position position) const; - Sci_Position SCI_METHOD LineEnd(Sci_Position line) const; -- int LineEndPosition(int position) const; -- bool IsLineEndPosition(int position) const; -- bool IsPositionInLineEnd(int position) const; -- int VCHomePosition(int position) const; -+ Sci::Position LineEndPosition(Sci::Position position) const; -+ bool IsLineEndPosition(Sci::Position position) const; -+ bool IsPositionInLineEnd(Sci::Position position) const; -+ Sci::Position VCHomePosition(Sci::Position position) const; - - int SCI_METHOD SetLevel(Sci_Position line, int level); - int SCI_METHOD GetLevel(Sci_Position line) const; - void ClearLevels(); -- int GetLastChild(int lineParent, int level=-1, int lastLine=-1); -- int GetFoldParent(int line) const; -- void GetHighlightDelimiters(HighlightDelimiter &hDelimiter, int line, int lastLine); -+ Sci::Line GetLastChild(Sci::Line lineParent, int level=-1, Sci::Line lastLine=-1); -+ Sci::Line GetFoldParent(Sci::Line line) const; -+ void GetHighlightDelimiters(HighlightDelimiter &hDelimiter, Sci::Line line, Sci::Line lastLine); - - void Indent(bool forwards); -- int ExtendWordSelect(int pos, int delta, bool onlyWordCharacters=false) const; -- int NextWordStart(int pos, int delta) const; -- int NextWordEnd(int pos, int delta) const; -+ Sci::Position ExtendWordSelect(Sci::Position pos, int delta, bool onlyWordCharacters=false) const; -+ Sci::Position NextWordStart(Sci::Position pos, int delta) const; -+ Sci::Position NextWordEnd(Sci::Position pos, int delta) const; - Sci_Position SCI_METHOD Length() const { return cb.Length(); } -- void Allocate(int newSize) { cb.Allocate(newSize); } -+ void Allocate(Sci::Position newSize) { cb.Allocate(newSize); } - -- CharacterExtracted ExtractCharacter(int position) const; -+ CharacterExtracted ExtractCharacter(Sci::Position position) const; - -- bool IsWordStartAt(int pos) const; -- bool IsWordEndAt(int pos) const; -- bool IsWordAt(int start, int end) const; -+ bool IsWordStartAt(Sci::Position pos) const; -+ bool IsWordEndAt(Sci::Position pos) const; -+ bool IsWordAt(Sci::Position start, Sci::Position end) const; - -- bool MatchesWordOptions(bool word, bool wordStart, int pos, int length) const; -+ bool MatchesWordOptions(bool word, bool wordStart, Sci::Position pos, Sci::Position length) const; - bool HasCaseFolder() const; - void SetCaseFolder(CaseFolder *pcf_); -- long FindText(int minPos, int maxPos, const char *search, int flags, int *length); -- const char *SubstituteByPosition(const char *text, int *length); -- int LinesTotal() const; -+ long FindText(Sci::Position minPos, Sci::Position maxPos, const char *search, int flags, Sci::Position *length); -+ const char *SubstituteByPosition(const char *text, Sci::Position *length); -+ Sci::Line LinesTotal() const; - - void SetDefaultCharClasses(bool includeWordClass); - void SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass); -@@ -412,9 +405,9 @@ - void SCI_METHOD StartStyling(Sci_Position position, char mask); - bool SCI_METHOD SetStyleFor(Sci_Position length, char style); - bool SCI_METHOD SetStyles(Sci_Position length, const char *styles); -- int GetEndStyled() const { return endStyled; } -- void EnsureStyledTo(int pos); -- void StyleToAdjustingLineDuration(int pos); -+ Sci::Position GetEndStyled() const { return endStyled; } -+ void EnsureStyledTo(Sci::Position pos); -+ void StyleToAdjustingLineDuration(Sci::Position pos); - void LexerChanged(); - int GetStyleClock() const { return styleClock; } - void IncrementStyleClock(); -@@ -425,20 +418,20 @@ - - int SCI_METHOD SetLineState(Sci_Position line, int state); - int SCI_METHOD GetLineState(Sci_Position line) const; -- int GetMaxLineState(); -+ Sci::Line GetMaxLineState(); - void SCI_METHOD ChangeLexerState(Sci_Position start, Sci_Position end); - -- StyledText MarginStyledText(int line) const; -- void MarginSetStyle(int line, int style); -- void MarginSetStyles(int line, const unsigned char *styles); -- void MarginSetText(int line, const char *text); -+ StyledText MarginStyledText(Sci::Line line) const; -+ void MarginSetStyle(Sci::Line line, int style); -+ void MarginSetStyles(Sci::Line line, const unsigned char *styles); -+ void MarginSetText(Sci::Line line, const char *text); - void MarginClearAll(); - -- StyledText AnnotationStyledText(int line) const; -- void AnnotationSetText(int line, const char *text); -- void AnnotationSetStyle(int line, int style); -- void AnnotationSetStyles(int line, const unsigned char *styles); -- int AnnotationLines(int line) const; -+ StyledText AnnotationStyledText(Sci::Line line) const; -+ void AnnotationSetText(Sci::Line line, const char *text); -+ void AnnotationSetStyle(Sci::Line line, int style); -+ void AnnotationSetStyles(Sci::Line line, const unsigned char *styles); -+ int AnnotationLines(Sci::Line line) const; - void AnnotationClearAll(); - - bool AddWatcher(DocWatcher *watcher, void *userData); -@@ -447,14 +440,14 @@ - bool IsASCIIWordByte(unsigned char ch) const; - CharClassify::cc WordCharacterClass(unsigned int ch) const; - bool IsWordPartSeparator(unsigned int ch) const; -- int WordPartLeft(int pos) const; -- int WordPartRight(int pos) const; -- int ExtendStyleRange(int pos, int delta, bool singleLine = false); -- bool IsWhiteLine(int line) const; -- int ParaUp(int pos) const; -- int ParaDown(int pos) const; -+ Sci::Position WordPartLeft(Sci::Position pos) const; -+ Sci::Position WordPartRight(Sci::Position pos) const; -+ Sci::Position ExtendStyleRange(Sci::Position pos, int delta, bool singleLine = false); -+ bool IsWhiteLine(Sci::Line line) const; -+ Sci::Position ParaUp(Sci::Position pos) const; -+ Sci::Position ParaDown(Sci::Position pos) const; - int IndentSize() const { return actualIndentInChars; } -- int BraceMatch(int position, int maxReStyle); -+ Sci::Position BraceMatch(Sci::Position position, Sci::Position maxReStyle); - - private: - void NotifyModifyAttempt(); -@@ -491,18 +484,18 @@ - class DocModification { - public: - int modificationType; -- int position; -- int length; -- int linesAdded; /**< Negative if lines deleted. */ -+ Sci::Position position; -+ Sci::Position length; -+ Sci::Line linesAdded; /**< Negative if lines deleted. */ - const char *text; /**< Only valid for changes to text, not for changes to style. */ -- int line; -+ Sci::Line line; - int foldLevelNow; - int foldLevelPrev; -- int annotationLinesAdded; -- int token; -+ Sci::Line annotationLinesAdded; -+ Sci::Position token; - -- DocModification(int modificationType_, int position_=0, int length_=0, -- int linesAdded_=0, const char *text_=0, int line_=0) : -+ DocModification(int modificationType_, Sci::Position position_=0, Sci::Position length_=0, -+ Sci::Line linesAdded_=0, const char *text_=0, Sci::Line line_=0) : - modificationType(modificationType_), - position(position_), - length(length_), -@@ -514,7 +507,7 @@ - annotationLinesAdded(0), - token(0) {} - -- DocModification(int modificationType_, const Action &act, int linesAdded_=0) : -+ DocModification(int modificationType_, const Action &act, Sci::Line linesAdded_=0) : - modificationType(modificationType_), - position(act.position), - length(act.lenData), -@@ -539,7 +532,7 @@ - virtual void NotifySavePoint(Document *doc, void *userData, bool atSavePoint) = 0; - virtual void NotifyModified(Document *doc, DocModification mh, void *userData) = 0; - virtual void NotifyDeleted(Document *doc, void *userData) = 0; -- virtual void NotifyStyleNeeded(Document *doc, void *userData, int endPos) = 0; -+ virtual void NotifyStyleNeeded(Document *doc, void *userData, Sci::Position endPos) = 0; - virtual void NotifyLexerChanged(Document *doc, void *userData) = 0; - virtual void NotifyErrorOccurred(Document *doc, void *userData, int status) = 0; - }; -diff -r 1788f6795302 -r a0f26eaf474d src/EditModel.cxx ---- a/src/EditModel.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/EditModel.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -57,17 +57,17 @@ - inOverstrike = false; - xOffset = 0; - trackLineWidth = false; -- posDrag = SelectionPosition(invalidPosition); -- braces[0] = invalidPosition; -- braces[1] = invalidPosition; -+ posDrag = SelectionPosition(Sci::invalidPosition); -+ braces[0] = Sci::invalidPosition; -+ braces[1] = Sci::invalidPosition; - bracesMatchStyle = STYLE_BRACEBAD; - highlightGuideColumn = 0; - primarySelection = true; - imeInteraction = imeWindowed; - foldFlags = 0; - foldDisplayTextStyle = SC_FOLDDISPLAYTEXT_HIDDEN; -- hotspot = Range(invalidPosition); -- hoverIndicatorPos = invalidPosition; -+ hotspot = Range(Sci::invalidPosition); -+ hoverIndicatorPos = Sci::invalidPosition; - wrapWidth = LineLayout::wrapWidthInfinite; - pdoc = new Document(); - pdoc->AddRef(); -diff -r 1788f6795302 -r a0f26eaf474d src/EditModel.h ---- a/src/EditModel.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/EditModel.h Fri Mar 31 18:19:38 2017 +1100 -@@ -36,7 +36,7 @@ - SpecialRepresentations reprs; - Caret caret; - SelectionPosition posDrag; -- Position braces[2]; -+ Sci::Position braces[2]; - int bracesMatchStyle; - int highlightGuideColumn; - Selection sel; -@@ -49,7 +49,7 @@ - ContractionState cs; - // Hotspot support - Range hotspot; -- int hoverIndicatorPos; -+ Sci::Position hoverIndicatorPos; - - // Wrapping support - int wrapWidth; -@@ -58,9 +58,9 @@ - - EditModel(); - virtual ~EditModel(); -- virtual int TopLineOfMain() const = 0; -+ virtual Sci::Line TopLineOfMain() const = 0; - virtual Point GetVisibleOriginInMain() const = 0; -- virtual int LinesOnScreen() const = 0; -+ virtual Sci::Line LinesOnScreen() const = 0; - virtual Range GetHotSpotRange() const = 0; - }; - -diff -r 1788f6795302 -r a0f26eaf474d src/EditView.cxx ---- a/src/EditView.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/EditView.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -222,19 +222,19 @@ - ldTabstops = 0; - } - --XYPOSITION EditView::NextTabstopPos(int line, XYPOSITION x, XYPOSITION tabWidth) const { -+XYPOSITION EditView::NextTabstopPos(Sci::Line line, XYPOSITION x, XYPOSITION tabWidth) const { - int next = GetNextTabstop(line, static_cast<int>(x + tabWidthMinimumPixels)); - if (next > 0) - return static_cast<XYPOSITION>(next); - return (static_cast<int>((x + tabWidthMinimumPixels) / tabWidth) + 1) * tabWidth; - } - --bool EditView::ClearTabstops(int line) { -+bool EditView::ClearTabstops(Sci::Line line) { - LineTabstops *lt = static_cast<LineTabstops *>(ldTabstops); - return lt && lt->ClearTabstops(line); - } - --bool EditView::AddTabstop(int line, int x) { -+bool EditView::AddTabstop(Sci::Line line, int x) { - if (!ldTabstops) { - ldTabstops = new LineTabstops(); - } -@@ -242,7 +242,7 @@ - return lt && lt->AddTabstop(line, x); - } - --int EditView::GetNextTabstop(int line, int x) const { -+int EditView::GetNextTabstop(Sci::Line line, int x) const { - LineTabstops *lt = static_cast<LineTabstops *>(ldTabstops); - if (lt) { - return lt->GetNextTabstop(line, x); -@@ -251,14 +251,14 @@ - } - } - --void EditView::LinesAddedOrRemoved(int lineOfPos, int linesAdded) { -+void EditView::LinesAddedOrRemoved(Sci::Line lineOfPos, Sci::Line linesAdded) { - if (ldTabstops) { - if (linesAdded > 0) { -- for (int line = lineOfPos; line < lineOfPos + linesAdded; line++) { -+ for (Sci::Line line = lineOfPos; line < lineOfPos + linesAdded; line++) { - ldTabstops->InsertLine(line); - } - } else { -- for (int line = (lineOfPos + -linesAdded) - 1; line >= lineOfPos; line--) { -+ for (Sci::Line line = (lineOfPos + -linesAdded) - 1; line >= lineOfPos; line--) { - ldTabstops->RemoveLine(line); - } - } -@@ -345,11 +345,11 @@ - } - } - --LineLayout *EditView::RetrieveLineLayout(int lineNumber, const EditModel &model) { -- int posLineStart = model.pdoc->LineStart(lineNumber); -- int posLineEnd = model.pdoc->LineStart(lineNumber + 1); -+LineLayout *EditView::RetrieveLineLayout(Sci::Line lineNumber, const EditModel &model) { -+ Sci::Position posLineStart = model.pdoc->LineStart(lineNumber); -+ Sci::Position posLineEnd = model.pdoc->LineStart(lineNumber + 1); - PLATFORM_ASSERT(posLineEnd >= posLineStart); -- int lineCaret = model.pdoc->LineFromPosition(model.sel.MainCaret()); -+ Sci::Line lineCaret = model.pdoc->LineFromPosition(model.sel.MainCaret()); - return llc.Retrieve(lineNumber, lineCaret, - posLineEnd - posLineStart, model.pdoc->GetStyleClock(), - model.LinesOnScreen() + 1, model.pdoc->LinesTotal()); -@@ -360,20 +360,20 @@ - * Copy the given @a line and its styles from the document into local arrays. - * Also determine the x position at which each character starts. - */ --void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, const ViewStyle &vstyle, LineLayout *ll, int width) { -+void EditView::LayoutLine(const EditModel &model, Sci::Line line, Surface *surface, const ViewStyle &vstyle, LineLayout *ll, int width) { - if (!ll) - return; - - PLATFORM_ASSERT(line < model.pdoc->LinesTotal()); - PLATFORM_ASSERT(ll->chars != NULL); -- int posLineStart = model.pdoc->LineStart(line); -- int posLineEnd = model.pdoc->LineStart(line + 1); -+ Sci::Position posLineStart = model.pdoc->LineStart(line); -+ Sci::Position posLineEnd = model.pdoc->LineStart(line + 1); - // If the line is very long, limit the treatment to a length that should fit in the viewport - if (posLineEnd >(posLineStart + ll->maxLineLength)) { - posLineEnd = posLineStart + ll->maxLineLength; - } - if (ll->validity == LineLayout::llCheckTextAndStyle) { -- int lineLength = posLineEnd - posLineStart; -+ Sci::Position lineLength = posLineEnd - posLineStart; - if (!vstyle.viewEOL) { - lineLength = model.pdoc->LineEnd(line) - posLineStart; - } -@@ -384,7 +384,7 @@ - int styleByte = 0; - int numCharsInLine = 0; - while (numCharsInLine < lineLength) { -- int charInDoc = numCharsInLine + posLineStart; -+ Sci::Position charInDoc = numCharsInLine + posLineStart; - char chDoc = model.pdoc->CharAt(charInDoc); - styleByte = model.pdoc->StyleIndexAt(charInDoc); - allSame = allSame && -@@ -436,7 +436,7 @@ - model.pdoc->GetStyleRange(ll->styles, posLineStart, lineLength); - int numCharsBeforeEOL = model.pdoc->LineEnd(line) - posLineStart; - const int numCharsInLine = (vstyle.viewEOL) ? lineLength : numCharsBeforeEOL; -- for (int styleInLine = 0; styleInLine < numCharsInLine; styleInLine++) { -+ for (Sci::Position styleInLine = 0; styleInLine < numCharsInLine; styleInLine++) { - const unsigned char styleByte = ll->styles[styleInLine]; - ll->styles[styleInLine] = styleByte; - } -@@ -503,7 +503,7 @@ - lastSegItalics = (!ts.representation) && ((ll->chars[ts.end() - 1] != ' ') && vstyle.styles[ll->styles[ts.start]].italic); - } - -- for (int posToIncrease = ts.start + 1; posToIncrease <= ts.end(); posToIncrease++) { -+ for (Sci::Position posToIncrease = ts.start + 1; posToIncrease <= ts.end(); posToIncrease++) { - ll->positions[posToIncrease] += ll->positions[ts.start]; - } - } -@@ -600,19 +600,19 @@ - } - } - --Point EditView::LocationFromPosition(Surface *surface, const EditModel &model, SelectionPosition pos, int topLine, -+Point EditView::LocationFromPosition(Surface *surface, const EditModel &model, SelectionPosition pos, Sci::Line topLine, - const ViewStyle &vs, PointEnd pe) { - Point pt; - if (pos.Position() == INVALID_POSITION) - return pt; -- int lineDoc = model.pdoc->LineFromPosition(pos.Position()); -- int posLineStart = model.pdoc->LineStart(lineDoc); -+ Sci::Line lineDoc = model.pdoc->LineFromPosition(pos.Position()); -+ Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); - if ((pe & peLineEnd) && (lineDoc > 0) && (pos.Position() == posLineStart)) { - // Want point at end of first line - lineDoc--; - posLineStart = model.pdoc->LineStart(lineDoc); - } -- const int lineVisible = model.cs.DisplayFromDoc(lineDoc); -+ const Sci::Line lineVisible = model.cs.DisplayFromDoc(lineDoc); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); -@@ -625,17 +625,17 @@ - return pt; - } - --Range EditView::RangeDisplayLine(Surface *surface, const EditModel &model, int lineVisible, const ViewStyle &vs) { -+Range EditView::RangeDisplayLine(Surface *surface, const EditModel &model, Sci::Line lineVisible, const ViewStyle &vs) { - Range rangeSubLine = Range(0,0); - if (lineVisible < 0) { - return rangeSubLine; - } -- const int lineDoc = model.cs.DocFromDisplay(lineVisible); -- const int positionLineStart = model.pdoc->LineStart(lineDoc); -+ const Sci::Line lineDoc = model.cs.DocFromDisplay(lineVisible); -+ const Sci::Position positionLineStart = model.pdoc->LineStart(lineDoc); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); -- const int lineStartSet = model.cs.DisplayFromDoc(lineDoc); -+ const Sci::Line lineStartSet = model.cs.DisplayFromDoc(lineDoc); - const int subLine = lineVisible - lineStartSet; - if (subLine < ll->lines) { - rangeSubLine = ll->SubLineRange(subLine); -@@ -652,26 +652,26 @@ - - SelectionPosition EditView::SPositionFromLocation(Surface *surface, const EditModel &model, PointDocument pt, bool canReturnInvalid, bool charPosition, bool virtualSpace, const ViewStyle &vs) { - pt.x = pt.x - vs.textStart; -- int visibleLine = static_cast<int>(floor(pt.y / vs.lineHeight)); -+ Sci::Line visibleLine = static_cast<int>(floor(pt.y / vs.lineHeight)); - if (!canReturnInvalid && (visibleLine < 0)) - visibleLine = 0; -- const int lineDoc = model.cs.DocFromDisplay(visibleLine); -+ const Sci::Line lineDoc = model.cs.DocFromDisplay(visibleLine); - if (canReturnInvalid && (lineDoc < 0)) - return SelectionPosition(INVALID_POSITION); - if (lineDoc >= model.pdoc->LinesTotal()) - return SelectionPosition(canReturnInvalid ? INVALID_POSITION : model.pdoc->Length()); -- const int posLineStart = model.pdoc->LineStart(lineDoc); -+ const Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); -- const int lineStartSet = model.cs.DisplayFromDoc(lineDoc); -+ const Sci::Line lineStartSet = model.cs.DisplayFromDoc(lineDoc); - const int subLine = visibleLine - lineStartSet; - if (subLine < ll->lines) { - const Range rangeSubLine = ll->SubLineRange(subLine); - const XYPOSITION subLineStart = ll->positions[rangeSubLine.start]; - if (subLine > 0) // Wrapped - pt.x -= ll->wrapIndent; -- const int positionInLine = ll->FindPositionFromX(static_cast<XYPOSITION>(pt.x + subLineStart), -+ const Sci::Position positionInLine = ll->FindPositionFromX(static_cast<XYPOSITION>(pt.x + subLineStart), - rangeSubLine, charPosition); - if (positionInLine < rangeSubLine.end) { - return SelectionPosition(model.pdoc->MovePositionOutsideChar(positionInLine + posLineStart, 1)); -@@ -700,14 +700,14 @@ - * Ensure is between whole characters when document is in multi-byte or UTF-8 mode. - * This method is used for rectangular selections and does not work on wrapped lines. - */ --SelectionPosition EditView::SPositionFromLineX(Surface *surface, const EditModel &model, int lineDoc, int x, const ViewStyle &vs) { -+SelectionPosition EditView::SPositionFromLineX(Surface *surface, const EditModel &model, Sci::Line lineDoc, int x, const ViewStyle &vs) { - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { -- const int posLineStart = model.pdoc->LineStart(lineDoc); -+ const Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); - const Range rangeSubLine = ll->SubLineRange(0); - const XYPOSITION subLineStart = ll->positions[rangeSubLine.start]; -- const int positionInLine = ll->FindPositionFromX(x + subLineStart, rangeSubLine, false); -+ const Sci::Position positionInLine = ll->FindPositionFromX(x + subLineStart, rangeSubLine, false); - if (positionInLine < rangeSubLine.end) { - return SelectionPosition(model.pdoc->MovePositionOutsideChar(positionInLine + posLineStart, 1)); - } -@@ -719,14 +719,14 @@ - return SelectionPosition(0); - } - --int EditView::DisplayFromPosition(Surface *surface, const EditModel &model, int pos, const ViewStyle &vs) { -- int lineDoc = model.pdoc->LineFromPosition(pos); -- int lineDisplay = model.cs.DisplayFromDoc(lineDoc); -+Sci::Line EditView::DisplayFromPosition(Surface *surface, const EditModel &model, int pos, const ViewStyle &vs) { -+ Sci::Line lineDoc = model.pdoc->LineFromPosition(pos); -+ Sci::Line lineDisplay = model.cs.DisplayFromDoc(lineDoc); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); -- unsigned int posLineStart = model.pdoc->LineStart(lineDoc); -- int posInLine = pos - posLineStart; -+ Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); -+ Sci::Position posInLine = pos - posLineStart; - lineDisplay--; // To make up for first increment ahead. - for (int subLine = 0; subLine < ll->lines; subLine++) { - if (posInLine >= ll->LineStart(subLine)) { -@@ -737,14 +737,14 @@ - return lineDisplay; - } - --int EditView::StartEndDisplayLine(Surface *surface, const EditModel &model, int pos, bool start, const ViewStyle &vs) { -- int line = model.pdoc->LineFromPosition(pos); -+Sci::Position EditView::StartEndDisplayLine(Surface *surface, const EditModel &model, Sci::Position pos, bool start, const ViewStyle &vs) { -+ Sci::Line line = model.pdoc->LineFromPosition(pos); - AutoLineLayout ll(llc, RetrieveLineLayout(line, model)); -- int posRet = INVALID_POSITION; -+ Sci::Position posRet = INVALID_POSITION; - if (surface && ll) { -- unsigned int posLineStart = model.pdoc->LineStart(line); -+ Sci::Position posLineStart = model.pdoc->LineStart(line); - LayoutLine(model, line, surface, vs, ll, model.wrapWidth); -- int posInLine = pos - posLineStart; -+ Sci::Position posInLine = pos - posLineStart; - if (posInLine <= ll->maxLineLength) { - for (int subLine = 0; subLine < ll->lines; subLine++) { - if ((posInLine >= ll->LineStart(subLine)) && -@@ -772,7 +772,7 @@ - } - - static ColourDesired TextBackground(const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- ColourOptional background, int inSelection, bool inHotspot, int styleMain, int i) { -+ ColourOptional background, int inSelection, bool inHotspot, int styleMain, Sci::Position i) { - if (inSelection == 1) { - if (vsDraw.selColours.back.isSet && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) { - return SelectionBackground(vsDraw, true, model.primarySelection); -@@ -796,7 +796,7 @@ - } - } - --void EditView::DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight) { -+void EditView::DrawIndentGuide(Surface *surface, Sci::Line lineVisible, int lineHeight, Sci::Position start, PRectangle rcSegment, bool highlight) { - Point from = Point::FromInts(0, ((lineVisible & 1) && (lineHeight & 1)) ? 1 : 0); - PRectangle rcCopyArea = PRectangle::FromInts(start + 1, static_cast<int>(rcSegment.top), start + 2, static_cast<int>(rcSegment.bottom)); - surface->Copy(rcCopyArea, from, -@@ -836,10 +836,10 @@ - } - - void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- PRectangle rcLine, int line, int lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart, -+ PRectangle rcLine, Sci::Line line, Sci::Position lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart, - ColourOptional background) { - -- const int posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = model.pdoc->LineStart(line); - PRectangle rcSegment = rcLine; - - const bool lastSubLine = subLine == (ll->lines - 1); -@@ -879,7 +879,7 @@ - int eolInSelection = 0; - int alpha = SC_ALPHA_NOALPHA; - if (!hideSelection) { -- int posAfterLineEnd = model.pdoc->LineStart(line + 1); -+ Sci::Position posAfterLineEnd = model.pdoc->LineStart(line + 1); - eolInSelection = (lastSubLine == true) ? model.sel.InSelectionForEOL(posAfterLineEnd) : 0; - alpha = (eolInSelection == 1) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - } -@@ -887,7 +887,7 @@ - // Draw the [CR], [LF], or [CR][LF] blobs if visible line ends are on - XYPOSITION blobsWidth = 0; - if (lastSubLine) { -- for (int eolPos = ll->numCharsBeforeEOL; eolPos<ll->numCharsInLine; eolPos++) { -+ for (Sci::Position eolPos = ll->numCharsBeforeEOL; eolPos<ll->numCharsInLine; eolPos++) { - rcSegment.left = xStart + ll->positions[eolPos] - static_cast<XYPOSITION>(subLineStart)+virtualSpace; - rcSegment.right = xStart + ll->positions[eolPos + 1] - static_cast<XYPOSITION>(subLineStart)+virtualSpace; - blobsWidth += rcSegment.Width(); -@@ -987,8 +987,8 @@ - } - } - --static void DrawIndicator(int indicNum, int startPos, int endPos, Surface *surface, const ViewStyle &vsDraw, -- const LineLayout *ll, int xStart, PRectangle rcLine, int secondCharacter, int subLine, Indicator::DrawState drawState, int value) { -+static void DrawIndicator(int indicNum, Sci::Position startPos, Sci::Position endPos, Surface *surface, const ViewStyle &vsDraw, -+ const LineLayout *ll, int xStart, PRectangle rcLine, Sci::Position secondCharacter, int subLine, Indicator::DrawState drawState, int value) { - const XYPOSITION subLineStart = ll->positions[ll->LineStart(subLine)]; - PRectangle rcIndic( - ll->positions[startPos] + xStart - subLineStart, -@@ -1008,26 +1008,26 @@ - } - - static void DrawIndicators(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, int xStart, PRectangle rcLine, int subLine, int lineEnd, bool under, int hoverIndicatorPos) { -+ Sci::Line line, int xStart, PRectangle rcLine, int subLine, Sci::Position lineEnd, bool under, Sci::Position hoverIndicatorPos) { - // Draw decorators -- const int posLineStart = model.pdoc->LineStart(line); -- const int lineStart = ll->LineStart(subLine); -- const int posLineEnd = posLineStart + lineEnd; -+ const Sci::Position posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position lineStart = ll->LineStart(subLine); -+ const Sci::Position posLineEnd = posLineStart + lineEnd; - - for (Decoration *deco = model.pdoc->decorations.root; deco; deco = deco->next) { - if (under == vsDraw.indicators[deco->indicator].under) { -- int startPos = posLineStart + lineStart; -+ Sci::Position startPos = posLineStart + lineStart; - if (!deco->rs.ValueAt(startPos)) { - startPos = deco->rs.EndRun(startPos); - } - while ((startPos < posLineEnd) && (deco->rs.ValueAt(startPos))) { - const Range rangeRun(deco->rs.StartRun(startPos), deco->rs.EndRun(startPos)); -- const int endPos = std::min(rangeRun.end, posLineEnd); -+ const Sci::Position endPos = std::min(rangeRun.end, posLineEnd); - const bool hover = vsDraw.indicators[deco->indicator].IsDynamic() && - rangeRun.ContainsCharacter(hoverIndicatorPos); - const int value = deco->rs.ValueAt(startPos); - Indicator::DrawState drawState = hover ? Indicator::drawHover : Indicator::drawNormal; -- const int posSecond = model.pdoc->MovePositionOutsideChar(rangeRun.First() + 1, 1); -+ const Sci::Position posSecond = model.pdoc->MovePositionOutsideChar(rangeRun.First() + 1, 1); - DrawIndicator(deco->indicator, startPos - posLineStart, endPos - posLineStart, - surface, vsDraw, ll, xStart, rcLine, posSecond - posLineStart, subLine, drawState, value); - startPos = endPos; -@@ -1045,16 +1045,16 @@ - if (under == vsDraw.indicators[braceIndicator].under) { - Range rangeLine(posLineStart + lineStart, posLineEnd); - if (rangeLine.ContainsCharacter(model.braces[0])) { -- int braceOffset = model.braces[0] - posLineStart; -+ Sci::Position braceOffset = model.braces[0] - posLineStart; - if (braceOffset < ll->numCharsInLine) { -- const int secondOffset = model.pdoc->MovePositionOutsideChar(model.braces[0] + 1, 1) - posLineStart; -+ const Sci::Position secondOffset = model.pdoc->MovePositionOutsideChar(model.braces[0] + 1, 1) - posLineStart; - DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, ll, xStart, rcLine, secondOffset, subLine, Indicator::drawNormal, 1); - } - } - if (rangeLine.ContainsCharacter(model.braces[1])) { -- int braceOffset = model.braces[1] - posLineStart; -+ Sci::Position braceOffset = model.braces[1] - posLineStart; - if (braceOffset < ll->numCharsInLine) { -- const int secondOffset = model.pdoc->MovePositionOutsideChar(model.braces[1] + 1, 1) - posLineStart; -+ const Sci::Position secondOffset = model.pdoc->MovePositionOutsideChar(model.braces[1] + 1, 1) - posLineStart; - DrawIndicator(braceIndicator, braceOffset, braceOffset + 1, surface, vsDraw, ll, xStart, rcLine, secondOffset, subLine, Indicator::drawNormal, 1); - } - } -@@ -1063,7 +1063,7 @@ - } - - void EditView::DrawFoldDisplayText(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, int xStart, PRectangle rcLine, int subLine, XYACCUMULATOR subLineStart, DrawPhase phase) { -+ Sci::Line line, int xStart, PRectangle rcLine, int subLine, XYACCUMULATOR subLineStart, DrawPhase phase) { - const bool lastSubLine = subLine == (ll->lines - 1); - if (!lastSubLine) - return; -@@ -1080,7 +1080,7 @@ - int eolInSelection = 0; - int alpha = SC_ALPHA_NOALPHA; - if (!hideSelection) { -- int posAfterLineEnd = model.pdoc->LineStart(line + 1); -+ Sci::Position posAfterLineEnd = model.pdoc->LineStart(line + 1); - eolInSelection = (subLine == (ll->lines - 1)) ? model.sel.InSelectionForEOL(posAfterLineEnd) : 0; - alpha = (eolInSelection == 1) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - } -@@ -1159,7 +1159,7 @@ - } - - void EditView::DrawAnnotation(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, int xStart, PRectangle rcLine, int subLine, DrawPhase phase) { -+ Sci::Line line, int xStart, PRectangle rcLine, int subLine, DrawPhase phase) { - int indent = static_cast<int>(model.pdoc->GetLineIndentation(line) * vsDraw.spaceWidth); - PRectangle rcSegment = rcLine; - int annotationLine = subLine - ll->lines; -@@ -1216,18 +1216,18 @@ - } - - static void DrawBlockCaret(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int subLine, int xStart, int offset, int posCaret, PRectangle rcCaret, ColourDesired caretColour) { -+ int subLine, int xStart, Sci::Position offset, Sci::Position posCaret, PRectangle rcCaret, ColourDesired caretColour) { - -- int lineStart = ll->LineStart(subLine); -- int posBefore = posCaret; -- int posAfter = model.pdoc->MovePositionOutsideChar(posCaret + 1, 1); -- int numCharsToDraw = posAfter - posCaret; -+ Sci::Position lineStart = ll->LineStart(subLine); -+ Sci::Position posBefore = posCaret; -+ Sci::Position posAfter = model.pdoc->MovePositionOutsideChar(posCaret + 1, 1); -+ Sci::Position numCharsToDraw = posAfter - posCaret; - - // Work out where the starting and ending offsets are. We need to - // see if the previous character shares horizontal space, such as a - // glyph / combining character. If so we'll need to draw that too. -- int offsetFirstChar = offset; -- int offsetLastChar = offset + (posAfter - posCaret); -+ Sci::Position offsetFirstChar = offset; -+ Sci::Position offsetLastChar = offset + (posAfter - posCaret); - while ((posBefore > 0) && ((offsetLastChar - numCharsToDraw) >= lineStart)) { - if ((ll->positions[offsetLastChar] - ll->positions[offsetLastChar - numCharsToDraw]) > 0) { - // The char does not share horizontal space -@@ -1282,12 +1282,12 @@ - } - - void EditView::DrawCarets(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int lineDoc, int xStart, PRectangle rcLine, int subLine) const { -+ Sci::Line lineDoc, int xStart, PRectangle rcLine, int subLine) const { - // When drag is active it is the only caret drawn - bool drawDrag = model.posDrag.IsValid(); - if (hideSelection && !drawDrag) - return; -- const int posLineStart = model.pdoc->LineStart(lineDoc); -+ const Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); - // For each selection draw - for (size_t r = 0; (r<model.sel.Count()) || drawDrag; r++) { - const bool mainCaret = r == model.sel.Main(); -@@ -1304,7 +1304,7 @@ - if (ll->InLine(offset, subLine) && offset <= ll->numCharsBeforeEOL) { - XYPOSITION xposCaret = ll->positions[offset] + virtualOffset - ll->positions[ll->LineStart(subLine)]; - if (ll->wrapIndent != 0) { -- int lineStart = ll->LineStart(subLine); -+ Sci::Position lineStart = ll->LineStart(subLine); - if (lineStart != 0) // Wrapped - xposCaret += ll->wrapIndent; - } -@@ -1399,7 +1399,7 @@ - } - - void EditView::DrawBackground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- PRectangle rcLine, Range lineRange, int posLineStart, int xStart, -+ PRectangle rcLine, Range lineRange, Sci::Position posLineStart, int xStart, - int subLine, ColourOptional background) const { - - const bool selBackDrawn = vsDraw.SelectionBackgroundDrawn(); -@@ -1416,8 +1416,8 @@ - while (bfBack.More()) { - - const TextSegment ts = bfBack.Next(); -- const int i = ts.end() - 1; -- const int iDoc = i + posLineStart; -+ const Sci::Position i = ts.end() - 1; -+ const Sci::Position iDoc = i + posLineStart; - - PRectangle rcSegment = rcLine; - rcSegment.left = ll->positions[ts.start] + xStart - static_cast<XYPOSITION>(subLineStart); -@@ -1498,7 +1498,7 @@ - - // Draw underline mark as part of background if not transparent - static void DrawMarkUnderline(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, -- int line, PRectangle rcLine) { -+ Sci::Line line, PRectangle rcLine) { - int marks = model.pdoc->GetMark(line); - for (int markBit = 0; (markBit < 32) && marks; markBit++) { - if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_UNDERLINE) && -@@ -1511,12 +1511,12 @@ - } - } - static void DrawTranslucentSelection(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, PRectangle rcLine, int subLine, Range lineRange, int xStart) { -+ Sci::Line line, PRectangle rcLine, int subLine, Range lineRange, int xStart) { - if ((vsDraw.selAlpha != SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha != SC_ALPHA_NOALPHA)) { -- const int posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = model.pdoc->LineStart(line); - const XYACCUMULATOR subLineStart = ll->positions[lineRange.start]; - // For each selection draw -- int virtualSpaces = 0; -+ Sci::Position virtualSpaces = 0; - if (subLine == (ll->lines - 1)) { - virtualSpaces = model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)); - } -@@ -1550,7 +1550,7 @@ - - // Draw any translucent whole line states - static void DrawTranslucentLineState(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, PRectangle rcLine) { -+ Sci::Line line, PRectangle rcLine) { - if ((model.caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && ll->containsCaret) { - SimpleAlphaRectangle(surface, rcLine, vsDraw.caretLineBackground, vsDraw.caretLineAlpha); - } -@@ -1578,7 +1578,7 @@ - } - - void EditView::DrawForeground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int lineVisible, PRectangle rcLine, Range lineRange, int posLineStart, int xStart, -+ Sci::Line lineVisible, PRectangle rcLine, Range lineRange, Sci::Position posLineStart, int xStart, - int subLine, ColourOptional background) { - - const bool selBackDrawn = vsDraw.SelectionBackgroundDrawn(); -@@ -1598,8 +1598,8 @@ - while (bfFore.More()) { - - const TextSegment ts = bfFore.Next(); -- const int i = ts.end() - 1; -- const int iDoc = i + posLineStart; -+ const Sci::Position i = ts.end() - 1; -+ const Sci::Position iDoc = i + posLineStart; - - PRectangle rcSegment = rcLine; - rcSegment.left = ll->positions[ts.start] + xStart - static_cast<XYPOSITION>(subLineStart); -@@ -1770,16 +1770,16 @@ - } - - void EditView::DrawIndentGuidesOverEmpty(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, int lineVisible, PRectangle rcLine, int xStart, int subLine) { -+ Sci::Line line, Sci::Line lineVisible, PRectangle rcLine, int xStart, int subLine) { - if ((vsDraw.viewIndentationGuides == ivLookForward || vsDraw.viewIndentationGuides == ivLookBoth) - && (subLine == 0)) { -- const int posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = model.pdoc->LineStart(line); - int indentSpace = model.pdoc->GetLineIndentation(line); - int xStartText = static_cast<int>(ll->positions[model.pdoc->GetLineIndentPosition(line) - posLineStart]); - - // Find the most recent line with some text - -- int lineLastWithText = line; -+ Sci::Line lineLastWithText = line; - while (lineLastWithText > Platform::Maximum(line - 20, 0) && model.pdoc->IsWhiteLine(lineLastWithText)) { - lineLastWithText--; - } -@@ -1802,7 +1802,7 @@ - } - } - -- int lineNextWithText = line; -+ Sci::Line lineNextWithText = line; - while (lineNextWithText < Platform::Minimum(line + 20, model.pdoc->LinesTotal()) && model.pdoc->IsWhiteLine(lineNextWithText)) { - lineNextWithText++; - } -@@ -1824,7 +1824,7 @@ - } - - void EditView::DrawLine(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, int lineVisible, int xStart, PRectangle rcLine, int subLine, DrawPhase phase) { -+ Sci::Line line, Sci::Line lineVisible, int xStart, PRectangle rcLine, int subLine, DrawPhase phase) { - - if (subLine >= ll->lines) { - DrawAnnotation(surface, model, vsDraw, ll, line, xStart, rcLine, subLine, phase); -@@ -1834,7 +1834,7 @@ - // See if something overrides the line background color. - const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret); - -- const int posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = model.pdoc->LineStart(line); - - const Range lineRange = ll->SubLineRange(subLine); - const XYACCUMULATOR subLineStart = ll->positions[lineRange.start]; -@@ -1894,7 +1894,7 @@ - } - } - --static void DrawFoldLines(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, int line, PRectangle rcLine) { -+static void DrawFoldLines(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, Sci::Line line, PRectangle rcLine) { - bool expanded = model.cs.GetExpanded(line); - const int level = model.pdoc->GetLevel(line); - const int levelNext = model.pdoc->GetLevel(line + 1); -@@ -1944,7 +1944,7 @@ - SelectionPosition posCaret = model.sel.RangeMain().caret; - if (model.posDrag.IsValid()) - posCaret = model.posDrag; -- const int lineCaret = model.pdoc->LineFromPosition(posCaret.Position()); -+ const Sci::Line lineCaret = model.pdoc->LineFromPosition(posCaret.Position()); - - PRectangle rcTextArea = rcClient; - if (vsDraw.marginInside) { -@@ -1971,7 +1971,7 @@ - const bool bracesIgnoreStyle = ((vsDraw.braceHighlightIndicatorSet && (model.bracesMatchStyle == STYLE_BRACELIGHT)) || - (vsDraw.braceBadLightIndicatorSet && (model.bracesMatchStyle == STYLE_BRACEBAD))); - -- int lineDocPrevious = -1; // Used to avoid laying out one document line multiple times -+ Sci::Line lineDocPrevious = -1; // Used to avoid laying out one document line multiple times - AutoLineLayout ll(llc, 0); - std::vector<DrawPhase> phases; - if ((phasesDraw == phasesMultiple) && !bufferedDraw) { -@@ -1986,13 +1986,13 @@ - if (!bufferedDraw) - ypos += screenLinePaintFirst * vsDraw.lineHeight; - int yposScreen = screenLinePaintFirst * vsDraw.lineHeight; -- int visibleLine = model.TopLineOfMain() + screenLinePaintFirst; -+ Sci::Line visibleLine = model.TopLineOfMain() + screenLinePaintFirst; - while (visibleLine < model.cs.LinesDisplayed() && yposScreen < rcArea.bottom) { - -- const int lineDoc = model.cs.DocFromDisplay(visibleLine); -+ const Sci::Line lineDoc = model.cs.DocFromDisplay(visibleLine); - // Only visible lines should be handled by the code within the loop - PLATFORM_ASSERT(model.cs.GetVisible(lineDoc)); -- const int lineStartSet = model.cs.DisplayFromDoc(lineDoc); -+ const Sci::Line lineStartSet = model.cs.DisplayFromDoc(lineDoc); - const int subLine = visibleLine - lineStartSet; - - // Copy this line and its styles from the document into local arrays -@@ -2099,11 +2099,11 @@ - } - - void EditView::FillLineRemainder(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, PRectangle rcArea, int subLine) const { -+ Sci::Line line, PRectangle rcArea, int subLine) const { - int eolInSelection = 0; - int alpha = SC_ALPHA_NOALPHA; - if (!hideSelection) { -- int posAfterLineEnd = model.pdoc->LineStart(line + 1); -+ Sci::Position posAfterLineEnd = model.pdoc->LineStart(line + 1); - eolInSelection = (subLine == (ll->lines - 1)) ? model.sel.InSelectionForEOL(posAfterLineEnd) : 0; - alpha = (eolInSelection == 1) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - } -@@ -2212,17 +2212,17 @@ - vsPrint.Refresh(*surfaceMeasure, model.pdoc->tabInChars); // Recalculate fixedColumnWidth - } - -- int linePrintStart = model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMin)); -- int linePrintLast = linePrintStart + (pfr->rc.bottom - pfr->rc.top) / vsPrint.lineHeight - 1; -+ Sci::Line linePrintStart = model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMin)); -+ Sci::Line linePrintLast = linePrintStart + (pfr->rc.bottom - pfr->rc.top) / vsPrint.lineHeight - 1; - if (linePrintLast < linePrintStart) - linePrintLast = linePrintStart; -- int linePrintMax = model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMax)); -+ Sci::Line linePrintMax = model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMax)); - if (linePrintLast > linePrintMax) - linePrintLast = linePrintMax; - //Platform::DebugPrintf("Formatting lines=[%0d,%0d,%0d] top=%0d bottom=%0d line=%0d %0d\n", - // linePrintStart, linePrintLast, linePrintMax, pfr->rc.top, pfr->rc.bottom, vsPrint.lineHeight, - // surfaceMeasure->Height(vsPrint.styles[STYLE_LINENUMBER].font)); -- int endPosPrint = model.pdoc->Length(); -+ Sci::Position endPosPrint = model.pdoc->Length(); - if (linePrintLast < model.pdoc->LinesTotal()) - endPosPrint = model.pdoc->LineStart(linePrintLast + 1); - -@@ -2232,9 +2232,9 @@ - int xStart = vsPrint.fixedColumnWidth + pfr->rc.left; - int ypos = pfr->rc.top; - -- int lineDoc = linePrintStart; -+ Sci::Line lineDoc = linePrintStart; - -- int nPrintPos = static_cast<int>(pfr->chrg.cpMin); -+ Sci::Position nPrintPos = static_cast<Sci::Position>(pfr->chrg.cpMin); - int visibleLine = 0; - int widthPrint = pfr->rc.right - pfr->rc.left - vsPrint.fixedColumnWidth; - if (printParameters.wrapState == eWrapNone) -@@ -2265,7 +2265,7 @@ - // to start printing from to ensure a particular position is on the first - // line of the page. - if (visibleLine == 0) { -- int startWithinLine = nPrintPos - model.pdoc->LineStart(lineDoc); -+ Sci::Position startWithinLine = nPrintPos - model.pdoc->LineStart(lineDoc); - for (int iwl = 0; iwl < ll.lines - 1; iwl++) { - if (ll.LineStart(iwl) <= startWithinLine && ll.LineStart(iwl + 1) >= startWithinLine) { - visibleLine = -iwl; -diff -r 1788f6795302 -r a0f26eaf474d src/EditView.h ---- a/src/EditView.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/EditView.h Fri Mar 31 18:19:38 2017 +1100 -@@ -97,53 +97,53 @@ - bool LinesOverlap() const; - - void ClearAllTabstops(); -- XYPOSITION NextTabstopPos(int line, XYPOSITION x, XYPOSITION tabWidth) const; -- bool ClearTabstops(int line); -- bool AddTabstop(int line, int x); -- int GetNextTabstop(int line, int x) const; -- void LinesAddedOrRemoved(int lineOfPos, int linesAdded); -+ XYPOSITION NextTabstopPos(Sci::Line line, XYPOSITION x, XYPOSITION tabWidth) const; -+ bool ClearTabstops(Sci::Line line); -+ bool AddTabstop(Sci::Line line, int x); -+ int GetNextTabstop(Sci::Line line, int x) const; -+ void LinesAddedOrRemoved(Sci::Line lineOfPos, Sci::Line linesAdded); - - void DropGraphics(bool freeObjects); - void AllocateGraphics(const ViewStyle &vsDraw); - void RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw); - -- LineLayout *RetrieveLineLayout(int lineNumber, const EditModel &model); -- void LayoutLine(const EditModel &model, int line, Surface *surface, const ViewStyle &vstyle, -+ LineLayout *RetrieveLineLayout(Sci::Line lineNumber, const EditModel &model); -+ void LayoutLine(const EditModel &model, Sci::Line line, Surface *surface, const ViewStyle &vstyle, - LineLayout *ll, int width = LineLayout::wrapWidthInfinite); - -- Point LocationFromPosition(Surface *surface, const EditModel &model, SelectionPosition pos, int topLine, -+ Point LocationFromPosition(Surface *surface, const EditModel &model, SelectionPosition pos, Sci::Line topLine, - const ViewStyle &vs, PointEnd pe); -- Range RangeDisplayLine(Surface *surface, const EditModel &model, int lineVisible, const ViewStyle &vs); -+ Range RangeDisplayLine(Surface *surface, const EditModel &model, Sci::Line lineVisible, const ViewStyle &vs); - SelectionPosition SPositionFromLocation(Surface *surface, const EditModel &model, PointDocument pt, bool canReturnInvalid, - bool charPosition, bool virtualSpace, const ViewStyle &vs); -- SelectionPosition SPositionFromLineX(Surface *surface, const EditModel &model, int lineDoc, int x, const ViewStyle &vs); -- int DisplayFromPosition(Surface *surface, const EditModel &model, int pos, const ViewStyle &vs); -- int StartEndDisplayLine(Surface *surface, const EditModel &model, int pos, bool start, const ViewStyle &vs); -+ SelectionPosition SPositionFromLineX(Surface *surface, const EditModel &model, Sci::Line lineDoc, int x, const ViewStyle &vs); -+ Sci::Line DisplayFromPosition(Surface *surface, const EditModel &model, int pos, const ViewStyle &vs); -+ Sci::Position StartEndDisplayLine(Surface *surface, const EditModel &model, Sci::Position pos, bool start, const ViewStyle &vs); - -- void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight); -+ void DrawIndentGuide(Surface *surface, Sci::Line lineVisible, int lineHeight, Sci::Position start, PRectangle rcSegment, bool highlight); - void DrawEOL(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, PRectangle rcLine, -- int line, int lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart, -+ Sci::Line line, Sci::Position lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart, - ColourOptional background); - void DrawFoldDisplayText(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, int xStart, PRectangle rcLine, int subLine, XYACCUMULATOR subLineStart, DrawPhase phase); -+ Sci::Line line, int xStart, PRectangle rcLine, int subLine, XYACCUMULATOR subLineStart, DrawPhase phase); - void DrawAnnotation(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, int xStart, PRectangle rcLine, int subLine, DrawPhase phase); -- void DrawCarets(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, int line, -+ Sci::Line line, int xStart, PRectangle rcLine, int subLine, DrawPhase phase); -+ void DrawCarets(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, Sci::Line line, - int xStart, PRectangle rcLine, int subLine) const; - void DrawBackground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, PRectangle rcLine, -- Range lineRange, int posLineStart, int xStart, -+ Range lineRange, Sci::Position posLineStart, int xStart, - int subLine, ColourOptional background) const; -- void DrawForeground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, int lineVisible, -- PRectangle rcLine, Range lineRange, int posLineStart, int xStart, -+ void DrawForeground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, Sci::Line lineVisible, -+ PRectangle rcLine, Range lineRange, Sci::Position posLineStart, int xStart, - int subLine, ColourOptional background); - void DrawIndentGuidesOverEmpty(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, int lineVisible, PRectangle rcLine, int xStart, int subLine); -- void DrawLine(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, int line, -- int lineVisible, int xStart, PRectangle rcLine, int subLine, DrawPhase phase); -+ Sci::Line line, Sci::Line lineVisible, PRectangle rcLine, int xStart, int subLine); -+ void DrawLine(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, Sci::Line line, -+ Sci::Line lineVisible, int xStart, PRectangle rcLine, int subLine, DrawPhase phase); - void PaintText(Surface *surfaceWindow, const EditModel &model, PRectangle rcArea, PRectangle rcClient, - const ViewStyle &vsDraw); - void FillLineRemainder(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- int line, PRectangle rcArea, int subLine) const; -+ Sci::Line line, PRectangle rcArea, int subLine) const; - long FormatRange(bool draw, Sci_RangeToFormat *pfr, Surface *surface, Surface *surfaceMeasure, - const EditModel &model, const ViewStyle &vs); - }; -diff -r 1788f6795302 -r a0f26eaf474d src/Editor.cxx ---- a/src/Editor.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/Editor.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -123,7 +123,7 @@ - ptMouseLast.y = 0; - inDragDrop = ddNone; - dropWentOutside = false; -- posDrop = SelectionPosition(invalidPosition); -+ posDrop = SelectionPosition(Sci::invalidPosition); - hotSpotClickPos = INVALID_POSITION; - selectionType = selChar; - -@@ -296,7 +296,7 @@ - return ptDocument; - } - --int Editor::TopLineOfMain() const { -+Sci::Line Editor::TopLineOfMain() const { - if (wMargin.GetID()) - return 0; - else -@@ -319,25 +319,25 @@ - return rc; - } - --int Editor::LinesOnScreen() const { -+Sci::Line Editor::LinesOnScreen() const { - PRectangle rcClient = GetClientRectangle(); - int htClient = static_cast<int>(rcClient.bottom - rcClient.top); - //Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1); - return htClient / vs.lineHeight; - } - --int Editor::LinesToScroll() const { -- int retVal = LinesOnScreen() - 1; -+Sci::Line Editor::LinesToScroll() const { -+ Sci::Line retVal = LinesOnScreen() - 1; - if (retVal < 1) - return 1; - else - return retVal; - } - --int Editor::MaxScrollPos() const { -+Sci::Line Editor::MaxScrollPos() const { - //Platform::DebugPrintf("Lines %d screen = %d maxScroll = %d\n", - //LinesTotal(), LinesOnScreen(), LinesTotal() - LinesOnScreen() + 1); -- int retVal = cs.LinesDisplayed(); -+ Sci::Line retVal = cs.LinesDisplayed(); - if (endAtLastLine) { - retVal -= LinesOnScreen(); - } else { -@@ -369,11 +369,11 @@ - return view.LocationFromPosition(surface, *this, pos, topLine, vs, pe); - } - --Point Editor::LocationFromPosition(int pos, PointEnd pe) { -+Point Editor::LocationFromPosition(Sci::Position pos, PointEnd pe) { - return LocationFromPosition(SelectionPosition(pos), pe); - } - --int Editor::XFromPosition(int pos) { -+int Editor::XFromPosition(Sci::Position pos) { - Point pt = LocationFromPosition(pos); - return static_cast<int>(pt.x) - vs.textStart + xOffset; - } -@@ -403,7 +403,7 @@ - return view.SPositionFromLocation(surface, *this, ptdoc, canReturnInvalid, charPosition, virtualSpace, vs); - } - --int Editor::PositionFromLocation(Point pt, bool canReturnInvalid, bool charPosition) { -+Sci::Position Editor::PositionFromLocation(Point pt, bool canReturnInvalid, bool charPosition) { - return SPositionFromLocation(pt, canReturnInvalid, charPosition, false).Position(); - } - -@@ -412,7 +412,7 @@ - * Ensure is between whole characters when document is in multi-byte or UTF-8 mode. - * This method is used for rectangular selections and does not work on wrapped lines. - */ --SelectionPosition Editor::SPositionFromLineX(int lineDoc, int x) { -+SelectionPosition Editor::SPositionFromLineX(Sci::Line lineDoc, int x) { - RefreshStyleData(); - if (lineDoc >= pdoc->LinesTotal()) - return SelectionPosition(pdoc->Length()); -@@ -421,15 +421,15 @@ - return view.SPositionFromLineX(surface, *this, lineDoc, x, vs); - } - --int Editor::PositionFromLineX(int lineDoc, int x) { -+Sci::Position Editor::PositionFromLineX(Sci::Line lineDoc, int x) { - return SPositionFromLineX(lineDoc, x).Position(); - } - --int Editor::LineFromLocation(Point pt) const { -+Sci::Line Editor::LineFromLocation(Point pt) const { - return cs.DocFromDisplay(static_cast<int>(pt.y) / vs.lineHeight + topLine); - } - --void Editor::SetTopLine(int topLineNew) { -+void Editor::SetTopLine(Sci::Line topLineNew) { - if ((topLine != topLineNew) && (topLineNew >= 0)) { - topLine = topLineNew; - ContainerNeedsUpdate(SC_UPDATE_V_SCROLL); -@@ -480,7 +480,7 @@ - //wMain.InvalidateAll(); - } - --void Editor::RedrawSelMargin(int line, bool allAfter) { -+void Editor::RedrawSelMargin(Sci::Line line, bool allAfter) { - const bool markersInText = vs.maskInLine || vs.maskDrawInText; - if (!wMargin.GetID() || markersInText) { // May affect text area so may need to abandon and retry - if (AbandonPaint()) { -@@ -526,8 +526,8 @@ - } - - PRectangle Editor::RectangleFromRange(Range r, int overlap) { -- const int minLine = cs.DisplayFromDoc(pdoc->LineFromPosition(r.First())); -- const int maxLine = cs.DisplayLastFromDoc(pdoc->LineFromPosition(r.Last())); -+ const Sci::Line minLine = cs.DisplayFromDoc(pdoc->LineFromPosition(r.First())); -+ const Sci::Line maxLine = cs.DisplayLastFromDoc(pdoc->LineFromPosition(r.Last())); - const PRectangle rcClientDrawing = GetClientDrawingRectangle(); - PRectangle rc; - const int leftTextOverlap = ((xOffset == 0) && (vs.leftMarginWidth > 0)) ? 1 : 0; -@@ -542,11 +542,11 @@ - return rc; - } - --void Editor::InvalidateRange(int start, int end) { -+void Editor::InvalidateRange(Sci::Position start, Sci::Position end) { - RedrawRect(RectangleFromRange(Range(start, end), view.LinesOverlap() ? vs.lineOverlap : 0)); - } - --int Editor::CurrentPosition() const { -+Sci::Position Editor::CurrentPosition() const { - return sel.MainCaret(); - } - -@@ -569,10 +569,10 @@ - if (sel.selType == Selection::selThin) { - xCaret = xAnchor; - } -- int lineAnchorRect = pdoc->LineFromPosition(sel.Rectangular().anchor.Position()); -- int lineCaret = pdoc->LineFromPosition(sel.Rectangular().caret.Position()); -+ Sci::Line lineAnchorRect = pdoc->LineFromPosition(sel.Rectangular().anchor.Position()); -+ Sci::Line lineCaret = pdoc->LineFromPosition(sel.Rectangular().caret.Position()); - int increment = (lineCaret > lineAnchorRect) ? 1 : -1; -- for (int line=lineAnchorRect; line != lineCaret+increment; line += increment) { -+ for (Sci::Line line=lineAnchorRect; line != lineCaret+increment; line += increment) { - SelectionRange range(SPositionFromLineX(line, xCaret), SPositionFromLineX(line, xAnchor)); - if ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) == 0) - range.ClearVirtualSpace(); -@@ -600,9 +600,9 @@ - if (sel.Count() > 1 || !(sel.RangeMain().anchor == newMain.anchor) || sel.IsRectangular()) { - invalidateWholeSelection = true; - } -- int firstAffected = Platform::Minimum(sel.RangeMain().Start().Position(), newMain.Start().Position()); -+ Sci::Position firstAffected = Platform::Minimum(sel.RangeMain().Start().Position(), newMain.Start().Position()); - // +1 for lastAffected ensures caret repainted -- int lastAffected = Platform::Maximum(newMain.caret.Position()+1, newMain.anchor.Position()); -+ Sci::Position lastAffected = Platform::Maximum(newMain.caret.Position()+1, newMain.anchor.Position()); - lastAffected = Platform::Maximum(lastAffected, sel.RangeMain().End().Position()); - if (invalidateWholeSelection) { - for (size_t r=0; r<sel.Count(); r++) { -@@ -623,7 +623,7 @@ - void Editor::SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_) { - currentPos_ = ClampPositionIntoDocument(currentPos_); - anchor_ = ClampPositionIntoDocument(anchor_); -- int currentLine = pdoc->LineFromPosition(currentPos_.Position()); -+ Sci::Line currentLine = pdoc->LineFromPosition(currentPos_.Position()); - /* For Line selection - ensure the anchor and caret are always - at the beginning and end of the region lines. */ - if (sel.selType == Selection::selLines) { -@@ -650,14 +650,14 @@ - QueueIdleWork(WorkNeeded::workUpdateUI); - } - --void Editor::SetSelection(int currentPos_, int anchor_) { -+void Editor::SetSelection(Sci::Position currentPos_, Sci::Position anchor_) { - SetSelection(SelectionPosition(currentPos_), SelectionPosition(anchor_)); - } - - // Just move the caret on the main selection - void Editor::SetSelection(SelectionPosition currentPos_) { - currentPos_ = ClampPositionIntoDocument(currentPos_); -- int currentLine = pdoc->LineFromPosition(currentPos_.Position()); -+ Sci::Line currentLine = pdoc->LineFromPosition(currentPos_.Position()); - if (sel.Count() > 1 || !(sel.RangeMain().caret == currentPos_)) { - InvalidateSelection(SelectionRange(currentPos_)); - } -@@ -683,7 +683,7 @@ - } - - void Editor::SetEmptySelection(SelectionPosition currentPos_) { -- int currentLine = pdoc->LineFromPosition(currentPos_.Position()); -+ Sci::Line currentLine = pdoc->LineFromPosition(currentPos_.Position()); - SelectionRange rangeNew(ClampPositionIntoDocument(currentPos_)); - if (sel.Count() > 1 || !(sel.RangeMain() == rangeNew)) { - InvalidateSelection(rangeNew); -@@ -700,15 +700,15 @@ - QueueIdleWork(WorkNeeded::workUpdateUI); - } - --void Editor::SetEmptySelection(int currentPos_) { -+void Editor::SetEmptySelection(Sci::Position currentPos_) { - SetEmptySelection(SelectionPosition(currentPos_)); - } - - void Editor::MultipleSelectAdd(AddNumber addNumber) { - if (SelectionEmpty() || !multipleSelection) { - // Select word at caret -- const int startWord = pdoc->ExtendWordSelect(sel.MainCaret(), -1, true); -- const int endWord = pdoc->ExtendWordSelect(startWord, 1, true); -+ const Sci::Position startWord = pdoc->ExtendWordSelect(sel.MainCaret(), -1, true); -+ const Sci::Position endWord = pdoc->ExtendWordSelect(startWord, 1, true); - TrimAndSetSelection(endWord, startWord); - - } else { -@@ -736,11 +736,11 @@ - } - - for (std::vector<Range>::const_iterator it = searchRanges.begin(); it != searchRanges.end(); ++it) { -- int searchStart = it->start; -- const int searchEnd = it->end; -+ Sci::Position searchStart = it->start; -+ const Sci::Position searchEnd = it->end; - for (;;) { -- int lengthFound = static_cast<int>(selectedText.length()); -- int pos = static_cast<int>(pdoc->FindText(searchStart, searchEnd, -+ Sci::Position lengthFound = static_cast<Sci::Position>(selectedText.length()); -+ Sci::Position pos = static_cast<Sci::Position>(pdoc->FindText(searchStart, searchEnd, - selectedText.c_str(), searchFlags, &lengthFound)); - if (pos >= 0) { - sel.AddSelection(SelectionRange(pos + lengthFound, pos)); -@@ -757,14 +757,14 @@ - } - } - --bool Editor::RangeContainsProtected(int start, int end) const { -+bool Editor::RangeContainsProtected(Sci::Position start, Sci::Position end) const { - if (vs.ProtectionActive()) { - if (start > end) { -- int t = start; -+ Sci::Position t = start; - start = end; - end = t; - } -- for (int pos = start; pos < end; pos++) { -+ for (Sci::Position pos = start; pos < end; pos++) { - if (vs.styles[pdoc->StyleIndexAt(pos)].IsProtected()) - return true; - } -@@ -785,12 +785,12 @@ - /** - * Asks document to find a good position and then moves out of any invisible positions. - */ --int Editor::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) const { -+Sci::Position Editor::MovePositionOutsideChar(Sci::Position pos, Sci::Position moveDir, bool checkLineEnd) const { - return MovePositionOutsideChar(SelectionPosition(pos), moveDir, checkLineEnd).Position(); - } - --SelectionPosition Editor::MovePositionOutsideChar(SelectionPosition pos, int moveDir, bool checkLineEnd) const { -- int posMoved = pdoc->MovePositionOutsideChar(pos.Position(), moveDir, checkLineEnd); -+SelectionPosition Editor::MovePositionOutsideChar(SelectionPosition pos, Sci::Position moveDir, bool checkLineEnd) const { -+ Sci::Position posMoved = pdoc->MovePositionOutsideChar(pos.Position(), moveDir, checkLineEnd); - if (posMoved != pos.Position()) - pos.SetPosition(posMoved); - if (vs.ProtectionActive()) { -@@ -812,7 +812,7 @@ - } - - void Editor::MovedCaret(SelectionPosition newPos, SelectionPosition previousPos, bool ensureVisible) { -- const int currentLine = pdoc->LineFromPosition(newPos.Position()); -+ const Sci::Line currentLine = pdoc->LineFromPosition(newPos.Position()); - if (ensureVisible) { - // In case in need of wrapping to ensure DisplayFromDoc works. - if (currentLine >= wrapPending.start) -@@ -844,7 +844,7 @@ - const SelectionPosition spCaret = ((sel.Count() == 1) && sel.Empty()) ? - sel.Last() : SelectionPosition(INVALID_POSITION); - -- int delta = newPos.Position() - sel.MainCaret(); -+ Sci::Position delta = newPos.Position() - sel.MainCaret(); - newPos = ClampPositionIntoDocument(newPos); - newPos = MovePositionOutsideChar(newPos, delta); - if (!multipleSelection && sel.IsRectangular() && (selt == Selection::selStream)) { -@@ -871,18 +871,18 @@ - MovedCaret(newPos, spCaret, ensureVisible); - } - --void Editor::MovePositionTo(int newPos, Selection::selTypes selt, bool ensureVisible) { -+void Editor::MovePositionTo(Sci::Position newPos, Selection::selTypes selt, bool ensureVisible) { - MovePositionTo(SelectionPosition(newPos), selt, ensureVisible); - } - - SelectionPosition Editor::MovePositionSoVisible(SelectionPosition pos, int moveDir) { - pos = ClampPositionIntoDocument(pos); - pos = MovePositionOutsideChar(pos, moveDir); -- int lineDoc = pdoc->LineFromPosition(pos.Position()); -+ Sci::Line lineDoc = pdoc->LineFromPosition(pos.Position()); - if (cs.GetVisible(lineDoc)) { - return pos; - } else { -- int lineDisplay = cs.DisplayFromDoc(lineDoc); -+ Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); - if (moveDir > 0) { - // lineDisplay is already line before fold as lines in fold use display line of line after fold - lineDisplay = Platform::Clamp(lineDisplay, 0, cs.LinesDisplayed()); -@@ -894,7 +894,7 @@ - } - } - --SelectionPosition Editor::MovePositionSoVisible(int pos, int moveDir) { -+SelectionPosition Editor::MovePositionSoVisible(Sci::Position pos, int moveDir) { - return MovePositionSoVisible(SelectionPosition(pos), moveDir); - } - -@@ -908,15 +908,15 @@ - */ - void Editor::SetLastXChosen() { - Point pt = PointMainCaret(); -- lastXChosen = static_cast<int>(pt.x) + xOffset; --} -- --void Editor::ScrollTo(int line, bool moveThumb) { -- int topLineNew = Platform::Clamp(line, 0, MaxScrollPos()); -+ lastXChosen = static_cast<Sci::Position>(pt.x) + xOffset; -+} -+ -+void Editor::ScrollTo(Sci::Line line, bool moveThumb) { -+ Sci::Line topLineNew = Platform::Clamp(line, 0, MaxScrollPos()); - if (topLineNew != topLine) { - // Try to optimise small scrolls - #ifndef UNDER_CE -- int linesToMove = topLine - topLineNew; -+ Sci::Line linesToMove = topLine - topLineNew; - bool performBlit = (abs(linesToMove) <= 10) && (paintState == notPainting); - willRedrawAll = !performBlit; - #endif -@@ -941,7 +941,7 @@ - } - } - --void Editor::ScrollText(int /* linesToMove */) { -+void Editor::ScrollText(Sci::Line /* linesToMove */) { - //Platform::DebugPrintf("Editor::ScrollText %d\n", linesToMove); - Redraw(); - } -@@ -959,9 +959,9 @@ - } - - void Editor::VerticalCentreCaret() { -- int lineDoc = pdoc->LineFromPosition(sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret()); -- int lineDisplay = cs.DisplayFromDoc(lineDoc); -- int newTop = lineDisplay - (LinesOnScreen() / 2); -+ Sci::Line lineDoc = pdoc->LineFromPosition(sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret()); -+ Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); -+ Sci::Line newTop = lineDisplay - (LinesOnScreen() / 2); - if (topLine != newTop) { - SetTopLine(newTop > 0 ? newTop : 0); - RedrawRect(GetClientRectangle()); -@@ -977,16 +977,16 @@ - void Editor::MoveSelectedLines(int lineDelta) { - - // if selection doesn't start at the beginning of the line, set the new start -- int selectionStart = SelectionStart().Position(); -- int startLine = pdoc->LineFromPosition(selectionStart); -- int beginningOfStartLine = pdoc->LineStart(startLine); -+ Sci::Position selectionStart = SelectionStart().Position(); -+ Sci::Line startLine = pdoc->LineFromPosition(selectionStart); -+ Sci::Position beginningOfStartLine = pdoc->LineStart(startLine); - selectionStart = beginningOfStartLine; - - // if selection doesn't end at the beginning of a line greater than that of the start, - // then set it at the beginning of the next one -- int selectionEnd = SelectionEnd().Position(); -- int endLine = pdoc->LineFromPosition(selectionEnd); -- int beginningOfEndLine = pdoc->LineStart(endLine); -+ Sci::Position selectionEnd = SelectionEnd().Position(); -+ Sci::Line endLine = pdoc->LineFromPosition(selectionEnd); -+ Sci::Position beginningOfEndLine = pdoc->LineStart(endLine); - bool appendEol = false; - if (selectionEnd > beginningOfEndLine - || selectionStart == selectionEnd) { -@@ -1015,9 +1015,9 @@ - SelectionText selectedText; - CopySelectionRange(&selectedText); - -- int selectionLength = SelectionRange(selectionStart, selectionEnd).Length(); -+ Sci::Position selectionLength = SelectionRange(selectionStart, selectionEnd).Length(); - Point currentLocation = LocationFromPosition(CurrentPosition()); -- int currentLine = LineFromLocation(currentLocation); -+ Sci::Line currentLine = LineFromLocation(currentLocation); - - if (appendEol) - SetSelection(pdoc->MovePositionOutsideChar(selectionStart - 1, -1), selectionEnd); -@@ -1030,7 +1030,7 @@ - - selectionLength = pdoc->InsertString(CurrentPosition(), selectedText.Data(), selectionLength); - if (appendEol) { -- const int lengthInserted = pdoc->InsertString(CurrentPosition() + selectionLength, eol, istrlen(eol)); -+ const Sci::Position lengthInserted = pdoc->InsertString(CurrentPosition() + selectionLength, eol, istrlen(eol)); - selectionLength += lengthInserted; - } - SetSelection(CurrentPosition(), CurrentPosition() + selectionLength); -@@ -1053,7 +1053,7 @@ - false, false, UserVirtualSpace()), - Selection::noSel, ensureVisible); - } else if ((pt.y + vs.lineHeight - 1) > rcClient.bottom) { -- int yOfLastLineFullyDisplayed = static_cast<int>(rcClient.top) + (LinesOnScreen() - 1) * vs.lineHeight; -+ Sci::Position yOfLastLineFullyDisplayed = static_cast<Sci::Position>(rcClient.top) + (LinesOnScreen() - 1) * vs.lineHeight; - MovePositionTo(SPositionFromLocation( - Point::FromInts(lastXChosen - xOffset, static_cast<int>(rcClient.top) + yOfLastLineFullyDisplayed), - false, false, UserVirtualSpace()), -@@ -1061,7 +1061,7 @@ - } - } - --int Editor::DisplayFromPosition(int pos) { -+Sci::Line Editor::DisplayFromPosition(Sci::Position pos) { - AutoSurface surface(this); - return view.DisplayFromPosition(surface, *this, pos, vs); - } -@@ -1130,9 +1130,9 @@ - - // Vertical positioning - if ((options & xysVertical) && (pt.y < rcClient.top || ptBottomCaret.y >= rcClient.bottom || (caretYPolicy & CARET_STRICT) != 0)) { -- const int lineCaret = DisplayFromPosition(range.caret.Position()); -- const int linesOnScreen = LinesOnScreen(); -- const int halfScreen = Platform::Maximum(linesOnScreen - 1, 2) / 2; -+ const Sci::Line lineCaret = DisplayFromPosition(range.caret.Position()); -+ const Sci::Line linesOnScreen = LinesOnScreen(); -+ const Sci::Line halfScreen = Platform::Maximum(linesOnScreen - 1, 2) / 2; - const bool bSlop = (caretYPolicy & CARET_SLOP) != 0; - const bool bStrict = (caretYPolicy & CARET_STRICT) != 0; - const bool bJump = (caretYPolicy & CARET_JUMPS) != 0; -@@ -1141,9 +1141,9 @@ - // It should be possible to scroll the window to show the caret, - // but this fails to remove the caret on GTK+ - if (bSlop) { // A margin is defined -- int yMoveT, yMoveB; -+ Sci::Line yMoveT, yMoveB; - if (bStrict) { -- int yMarginT, yMarginB; -+ Sci::Line yMarginT, yMarginB; - if (!(options & xysUseMargin)) { - // In drag mode, avoid moves - // otherwise, a double click will select several lines. -@@ -1215,7 +1215,7 @@ - } - } - if (!(range.caret == range.anchor)) { -- const int lineAnchor = DisplayFromPosition(range.anchor.Position()); -+ const Sci::Line lineAnchor = DisplayFromPosition(range.anchor.Position()); - if (lineAnchor < lineCaret) { - // Shift up to show anchor or as much of range as possible - newXY.topLine = std::min(newXY.topLine, lineAnchor); -@@ -1339,8 +1339,8 @@ - newXY.xOffset = std::max(newXY.xOffset, minOffset); - } else { - // Shift to right to show anchor or as much of range as possible -- int minOffset = static_cast<int>(ptAnchor.x + xOffset - rcClient.right) + 1; -- int maxOffset = static_cast<int>(pt.x + xOffset - rcClient.left) - 1; -+ int minOffset = static_cast<Sci::Position>(ptAnchor.x + xOffset - rcClient.right) + 1; -+ int maxOffset = static_cast<Sci::Position>(pt.x + xOffset - rcClient.left) - 1; - newXY.xOffset = std::max(newXY.xOffset, minOffset); - newXY.xOffset = std::min(newXY.xOffset, maxOffset); - } -@@ -1366,7 +1366,7 @@ - PRectangle rcText = GetTextRectangle(); - if (horizontalScrollBarVisible && - rcText.Width() + xOffset > scrollWidth) { -- scrollWidth = xOffset + static_cast<int>(rcText.Width()); -+ scrollWidth = xOffset + static_cast<Sci::Position>(rcText.Width()); - SetScrollBars(); - } - } -@@ -1449,7 +1449,7 @@ - return vs.wrapState != eWrapNone; - } - --void Editor::NeedWrapping(int docLineStart, int docLineEnd) { -+void Editor::NeedWrapping(Sci::Line docLineStart, Sci::Line docLineEnd) { - //Platform::DebugPrintf("\nNeedWrapping: %0d..%0d\n", docLineStart, docLineEnd); - if (wrapPending.AddRange(docLineStart, docLineEnd)) { - view.llc.Invalidate(LineLayout::llPositions); -@@ -1460,7 +1460,7 @@ - } - } - --bool Editor::WrapOneLine(Surface *surface, int lineToWrap) { -+bool Editor::WrapOneLine(Surface *surface, Sci::Line lineToWrap) { - AutoLineLayout ll(view.llc, view.RetrieveLineLayout(lineToWrap, *this)); - int linesWrapped = 1; - if (ll) { -@@ -1477,12 +1477,12 @@ - // wsIdle: wrap one page + 100 lines - // Return true if wrapping occurred. - bool Editor::WrapLines(enum wrapScope ws) { -- int goodTopLine = topLine; -+ Sci::Line goodTopLine = topLine; - bool wrapOccurred = false; - if (!Wrapping()) { - if (wrapWidth != LineLayout::wrapWidthInfinite) { - wrapWidth = LineLayout::wrapWidthInfinite; -- for (int lineDoc = 0; lineDoc < pdoc->LinesTotal(); lineDoc++) { -+ for (Sci::Line lineDoc = 0; lineDoc < pdoc->LinesTotal(); lineDoc++) { - cs.SetHeight(lineDoc, 1 + - (vs.annotationVisible ? pdoc->AnnotationLines(lineDoc) : 0)); - } -@@ -1497,9 +1497,9 @@ - ws = WrapScope::wsAll; - } - // Decide where to start wrapping -- int lineToWrap = wrapPending.start; -- int lineToWrapEnd = std::min(wrapPending.end, pdoc->LinesTotal()); -- const int lineDocTop = cs.DocFromDisplay(topLine); -+ Sci::Line lineToWrap = wrapPending.start; -+ Sci::Line lineToWrapEnd = std::min(wrapPending.end, pdoc->LinesTotal()); -+ const Sci::Line lineDocTop = cs.DocFromDisplay(topLine); - const int subLineTop = topLine - cs.DisplayFromDoc(lineDocTop); - if (ws == WrapScope::wsVisible) { - lineToWrap = Platform::Clamp(lineDocTop-5, wrapPending.start, pdoc->LinesTotal()); -@@ -1507,7 +1507,7 @@ - // Since wrapping could reduce display lines, treat each - // as taking only one display line. - lineToWrapEnd = lineDocTop; -- int lines = LinesOnScreen() + 1; -+ Sci::Line lines = LinesOnScreen() + 1; - while ((lineToWrapEnd < cs.LinesInDoc()) && (lines>0)) { - if (cs.GetVisible(lineToWrapEnd)) - lines--; -@@ -1521,7 +1521,7 @@ - } else if (ws == WrapScope::wsIdle) { - lineToWrapEnd = lineToWrap + LinesOnScreen() + 100; - } -- const int lineEndNeedWrap = std::min(wrapPending.end, pdoc->LinesTotal()); -+ const Sci::Line lineEndNeedWrap = std::min(wrapPending.end, pdoc->LinesTotal()); - lineToWrapEnd = std::min(lineToWrapEnd, lineEndNeedWrap); - - // Ensure all lines being wrapped are styled. -@@ -1569,13 +1569,13 @@ - if (!RangeContainsProtected(targetStart, targetEnd)) { - UndoGroup ug(pdoc); - bool prevNonWS = true; -- for (int pos = targetStart; pos < targetEnd; pos++) { -+ for (Sci::Position pos = targetStart; pos < targetEnd; pos++) { - if (pdoc->IsPositionInLineEnd(pos)) { - targetEnd -= pdoc->LenChar(pos); - pdoc->DelChar(pos); - if (prevNonWS) { - // Ensure at least one space separating previous lines -- const int lengthInserted = pdoc->InsertString(pos, " ", 1); -+ const Sci::Position lengthInserted = pdoc->InsertString(pos, " ", 1); - targetEnd += lengthInserted; - } - } else { -@@ -1601,19 +1601,19 @@ - PRectangle rcText = GetTextRectangle(); - pixelWidth = static_cast<int>(rcText.Width()); - } -- int lineStart = pdoc->LineFromPosition(targetStart); -- int lineEnd = pdoc->LineFromPosition(targetEnd); -+ Sci::Line lineStart = pdoc->LineFromPosition(targetStart); -+ Sci::Line lineEnd = pdoc->LineFromPosition(targetEnd); - const char *eol = StringFromEOLMode(pdoc->eolMode); - UndoGroup ug(pdoc); -- for (int line = lineStart; line <= lineEnd; line++) { -+ for (Sci::Line line = lineStart; line <= lineEnd; line++) { - AutoSurface surface(this); - AutoLineLayout ll(view.llc, view.RetrieveLineLayout(line, *this)); - if (surface && ll) { -- unsigned int posLineStart = pdoc->LineStart(line); -+ Sci::Position posLineStart = pdoc->LineStart(line); - view.LayoutLine(*this, line, surface, vs, ll, pixelWidth); -- int lengthInsertedTotal = 0; -+ Sci::Position lengthInsertedTotal = 0; - for (int subLine = 1; subLine < ll->lines; subLine++) { -- const int lengthInserted = pdoc->InsertString( -+ const Sci::Position lengthInserted = pdoc->InsertString( - static_cast<int>(posLineStart + lengthInsertedTotal + - ll->LineStart(subLine)), - eol, istrlen(eol)); -@@ -1803,8 +1803,8 @@ - void Editor::SetScrollBars() { - RefreshStyleData(); - -- int nMax = MaxScrollPos(); -- int nPage = LinesOnScreen(); -+ Sci::Line nMax = MaxScrollPos(); -+ Sci::Line nPage = LinesOnScreen(); - bool modified = ModifyScrollBars(nMax + nPage - 1, nPage); - if (modified) { - DwellEnd(true); -@@ -1838,15 +1838,15 @@ - } - } - --int Editor::RealizeVirtualSpace(int position, unsigned int virtualSpace) { -+Sci::Position Editor::RealizeVirtualSpace(Sci::Position position, Sci::Position virtualSpace) { - if (virtualSpace > 0) { -- const int line = pdoc->LineFromPosition(position); -- const int indent = pdoc->GetLineIndentPosition(line); -+ const Sci::Line line = pdoc->LineFromPosition(position); -+ const Sci::Position indent = pdoc->GetLineIndentPosition(line); - if (indent == position) { - return pdoc->SetLineIndentation(line, pdoc->GetLineIndentation(line) + virtualSpace); - } else { - std::string spaceText(virtualSpace, ' '); -- const int lengthInserted = pdoc->InsertString(position, spaceText.c_str(), virtualSpace); -+ const Sci::Position lengthInserted = pdoc->InsertString(position, spaceText.c_str(), virtualSpace); - position += lengthInserted; - } - } -@@ -1893,7 +1893,7 @@ - SelectionRange *currentSel = *rit; - if (!RangeContainsProtected(currentSel->Start().Position(), - currentSel->End().Position())) { -- int positionInsert = currentSel->Start().Position(); -+ Sci::Position positionInsert = currentSel->Start().Position(); - if (!currentSel->Empty()) { - if (currentSel->Length()) { - pdoc->DeleteChars(positionInsert, currentSel->Length()); -@@ -1911,7 +1911,7 @@ - } - } - positionInsert = RealizeVirtualSpace(positionInsert, currentSel->caret.VirtualSpace()); -- const int lengthInserted = pdoc->InsertString(positionInsert, s, len); -+ const Sci::Position lengthInserted = pdoc->InsertString(positionInsert, s, len); - if (lengthInserted > 0) { - currentSel->caret.SetPosition(positionInsert + lengthInserted); - currentSel->anchor.SetPosition(positionInsert + lengthInserted); -@@ -1974,7 +1974,7 @@ - for (size_t r = 0; r<sel.Count(); r++) { - if (!RangeContainsProtected(sel.Range(r).Start().Position(), - sel.Range(r).End().Position())) { -- int positionInsert = sel.Range(r).Start().Position(); -+ Sci::Position positionInsert = sel.Range(r).Start().Position(); - if (!sel.Range(r).Empty()) { - if (sel.Range(r).Length()) { - pdoc->DeleteChars(positionInsert, sel.Range(r).Length()); -@@ -1994,7 +1994,7 @@ - if (multiPasteMode == SC_MULTIPASTE_ONCE) { - SelectionPosition selStart = sel.Start(); - selStart = RealizeVirtualSpace(selStart); -- const int lengthInserted = pdoc->InsertString(selStart.Position(), text, len); -+ const Sci::Position lengthInserted = pdoc->InsertString(selStart.Position(), text, len); - if (lengthInserted > 0) { - SetEmptySelection(selStart.Position() + lengthInserted); - } -@@ -2003,7 +2003,7 @@ - for (size_t r=0; r<sel.Count(); r++) { - if (!RangeContainsProtected(sel.Range(r).Start().Position(), - sel.Range(r).End().Position())) { -- int positionInsert = sel.Range(r).Start().Position(); -+ Sci::Position positionInsert = sel.Range(r).Start().Position(); - if (!sel.Range(r).Empty()) { - if (sel.Range(r).Length()) { - pdoc->DeleteChars(positionInsert, sel.Range(r).Length()); -@@ -2014,7 +2014,7 @@ - } - } - positionInsert = RealizeVirtualSpace(positionInsert, sel.Range(r).caret.VirtualSpace()); -- const int lengthInserted = pdoc->InsertString(positionInsert, text, len); -+ const Sci::Position lengthInserted = pdoc->InsertString(positionInsert, text, len); - if (lengthInserted > 0) { - sel.Range(r).caret.SetPosition(positionInsert + lengthInserted); - sel.Range(r).anchor.SetPosition(positionInsert + lengthInserted); -@@ -2037,8 +2037,8 @@ - PasteRectangular(sel.Start(), text, len); - } else { - if (shape == pasteLine) { -- int insertPos = pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())); -- int lengthInserted = pdoc->InsertString(insertPos, text, len); -+ Sci::Position insertPos = pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())); -+ Sci::Position lengthInserted = pdoc->InsertString(insertPos, text, len); - // add the newline if necessary - if ((len > 0) && (text[len - 1] != '\n' && text[len - 1] != '\r')) { - const char *endline = StringFromEOLMode(pdoc->eolMode); -@@ -2127,20 +2127,20 @@ - } - } - --void Editor::PasteRectangular(SelectionPosition pos, const char *ptr, int len) { -+void Editor::PasteRectangular(SelectionPosition pos, const char *ptr, Sci::Position len) { - if (pdoc->IsReadOnly() || SelectionContainsProtected()) { - return; - } - sel.Clear(); - sel.RangeMain() = SelectionRange(pos); -- int line = pdoc->LineFromPosition(sel.MainCaret()); -+ Sci::Line line = pdoc->LineFromPosition(sel.MainCaret()); - UndoGroup ug(pdoc); - sel.RangeMain().caret = RealizeVirtualSpace(sel.RangeMain().caret); - int xInsert = XFromPosition(sel.RangeMain().caret); - bool prevCr = false; - while ((len > 0) && IsEOLChar(ptr[len-1])) - len--; -- for (int i = 0; i < len; i++) { -+ for (Sci::Position i = 0; i < len; i++) { - if (IsEOLChar(ptr[i])) { - if ((ptr[i] == '\r') || (!prevCr)) - line++; -@@ -2155,13 +2155,13 @@ - if ((XFromPosition(sel.MainCaret()) < xInsert) && (i + 1 < len)) { - while (XFromPosition(sel.MainCaret()) < xInsert) { - assert(pdoc); -- const int lengthInserted = pdoc->InsertString(sel.MainCaret(), " ", 1); -+ const Sci::Position lengthInserted = pdoc->InsertString(sel.MainCaret(), " ", 1); - sel.RangeMain().caret.Add(lengthInserted); - } - } - prevCr = ptr[i] == '\r'; - } else { -- const int lengthInserted = pdoc->InsertString(sel.MainCaret(), ptr + i, 1); -+ const Sci::Position lengthInserted = pdoc->InsertString(sel.MainCaret(), ptr + i, 1); - sel.RangeMain().caret.Add(lengthInserted); - prevCr = false; - } -@@ -2215,7 +2215,7 @@ - void Editor::Undo() { - if (pdoc->CanUndo()) { - InvalidateCaret(); -- int newPos = pdoc->Undo(); -+ Sci::Position newPos = pdoc->Undo(); - if (newPos >= 0) - SetEmptySelection(newPos); - EnsureCaretVisible(); -@@ -2224,7 +2224,7 @@ - - void Editor::Redo() { - if (pdoc->CanRedo()) { -- int newPos = pdoc->Redo(); -+ Sci::Position newPos = pdoc->Redo(); - if (newPos >= 0) - SetEmptySelection(newPos); - EnsureCaretVisible(); -@@ -2245,7 +2245,7 @@ - sel.Range(r).caret.SetVirtualSpace(sel.Range(r).caret.VirtualSpace() - 1); - sel.Range(r).anchor.SetVirtualSpace(sel.Range(r).caret.VirtualSpace()); - } else { -- int lineCurrentPos = pdoc->LineFromPosition(sel.Range(r).caret.Position()); -+ Sci::Line lineCurrentPos = pdoc->LineFromPosition(sel.Range(r).caret.Position()); - if (allowLineStartDeletion || (pdoc->LineStart(lineCurrentPos) != sel.Range(r).caret.Position())) { - if (pdoc->GetColumn(sel.Range(r).caret.Position()) <= pdoc->GetLineIndentation(lineCurrentPos) && - pdoc->GetColumn(sel.Range(r).caret.Position()) > 0 && pdoc->backspaceUnindents) { -@@ -2255,7 +2255,7 @@ - int indentationChange = indentation % indentationStep; - if (indentationChange == 0) - indentationChange = indentationStep; -- const int posSelect = pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationChange); -+ const Sci::Position posSelect = pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationChange); - // SetEmptySelection - sel.Range(r) = SelectionRange(posSelect); - } else { -@@ -2296,14 +2296,14 @@ - ctrlID = identifier; - } - --void Editor::NotifyStyleToNeeded(int endStyleNeeded) { -+void Editor::NotifyStyleToNeeded(Sci::Position endStyleNeeded) { - SCNotification scn = {}; - scn.nmhdr.code = SCN_STYLENEEDED; - scn.position = endStyleNeeded; - NotifyParent(scn); - } - --void Editor::NotifyStyleNeeded(Document *, void *, int endStyleNeeded) { -+void Editor::NotifyStyleNeeded(Document *, void *, Sci::Position endStyleNeeded) { - NotifyStyleToNeeded(endStyleNeeded); - } - -@@ -2350,7 +2350,7 @@ - NotifyDoubleClick(pt, ModifierFlags(shift, ctrl, alt)); - } - --void Editor::NotifyHotSpotDoubleClicked(int position, int modifiers) { -+void Editor::NotifyHotSpotDoubleClicked(Sci::Position position, int modifiers) { - SCNotification scn = {}; - scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK; - scn.position = position; -@@ -2358,11 +2358,11 @@ - NotifyParent(scn); - } - --void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) { -+void Editor::NotifyHotSpotDoubleClicked(Sci::Position position, bool shift, bool ctrl, bool alt) { - NotifyHotSpotDoubleClicked(position, ModifierFlags(shift, ctrl, alt)); - } - --void Editor::NotifyHotSpotClicked(int position, int modifiers) { -+void Editor::NotifyHotSpotClicked(Sci::Position position, int modifiers) { - SCNotification scn = {}; - scn.nmhdr.code = SCN_HOTSPOTCLICK; - scn.position = position; -@@ -2370,11 +2370,11 @@ - NotifyParent(scn); - } - --void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) { -+void Editor::NotifyHotSpotClicked(Sci::Position position, bool shift, bool ctrl, bool alt) { - NotifyHotSpotClicked(position, ModifierFlags(shift, ctrl, alt)); - } - --void Editor::NotifyHotSpotReleaseClick(int position, int modifiers) { -+void Editor::NotifyHotSpotReleaseClick(Sci::Position position, int modifiers) { - SCNotification scn = {}; - scn.nmhdr.code = SCN_HOTSPOTRELEASECLICK; - scn.position = position; -@@ -2382,7 +2382,7 @@ - NotifyParent(scn); - } - --void Editor::NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool alt) { -+void Editor::NotifyHotSpotReleaseClick(Sci::Position position, bool shift, bool ctrl, bool alt) { - NotifyHotSpotReleaseClick(position, ModifierFlags(shift, ctrl, alt)); - } - -@@ -2404,7 +2404,7 @@ - NotifyParent(scn); - } - --void Editor::NotifyIndicatorClick(bool click, int position, int modifiers) { -+void Editor::NotifyIndicatorClick(bool click, Sci::Position position, int modifiers) { - int mask = pdoc->decorations.AllOnFor(position); - if ((click && mask) || pdoc->decorations.clickNotified) { - SCNotification scn = {}; -@@ -2416,18 +2416,18 @@ - } - } - --void Editor::NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt) { -+void Editor::NotifyIndicatorClick(bool click, Sci::Position position, bool shift, bool ctrl, bool alt) { - NotifyIndicatorClick(click, position, ModifierFlags(shift, ctrl, alt)); - } - - bool Editor::NotifyMarginClick(Point pt, int modifiers) { - const int marginClicked = vs.MarginFromLocation(pt); - if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) { -- int position = pdoc->LineStart(LineFromLocation(pt)); -+ Sci::Position position = pdoc->LineStart(LineFromLocation(pt)); - if ((vs.ms[marginClicked].mask & SC_MASK_FOLDERS) && (foldAutomatic & SC_AUTOMATICFOLD_CLICK)) { - const bool ctrl = (modifiers & SCI_CTRL) != 0; - const bool shift = (modifiers & SCI_SHIFT) != 0; -- int lineClick = pdoc->LineFromPosition(position); -+ Sci::Line lineClick = pdoc->LineFromPosition(position); - if (shift && ctrl) { - FoldAll(SC_FOLDACTION_TOGGLE); - } else { -@@ -2465,7 +2465,7 @@ - bool Editor::NotifyMarginRightClick(Point pt, int modifiers) { - int marginRightClicked = vs.MarginFromLocation(pt); - if ((marginRightClicked >= 0) && vs.ms[marginRightClicked].sensitive) { -- int position = pdoc->LineStart(LineFromLocation(pt)); -+ Sci::Position position = pdoc->LineStart(LineFromLocation(pt)); - SCNotification scn = {}; - scn.nmhdr.code = SCN_MARGINRIGHTCLICK; - scn.modifiers = modifiers; -@@ -2478,7 +2478,7 @@ - } - } - --void Editor::NotifyNeedShown(int pos, int len) { -+void Editor::NotifyNeedShown(Sci::Position pos, Sci::Position len) { - SCNotification scn = {}; - scn.nmhdr.code = SCN_NEEDSHOWN; - scn.position = pos; -@@ -2515,8 +2515,8 @@ - void Editor::CheckModificationForWrap(DocModification mh) { - if (mh.modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) { - view.llc.Invalidate(LineLayout::llCheckTextAndStyle); -- int lineDoc = pdoc->LineFromPosition(mh.position); -- int lines = Platform::Maximum(0, mh.linesAdded); -+ Sci::Line lineDoc = pdoc->LineFromPosition(mh.position); -+ Sci::Line lines = std::max(static_cast<Sci::Line>(0), mh.linesAdded); - if (Wrapping()) { - NeedWrapping(lineDoc, lineDoc + lines + 1); - } -@@ -2527,7 +2527,7 @@ - } - - // Move a position so it is still after the same character as before the insertion. --static inline int MovePositionForInsertion(int position, int startInsertion, int length) { -+static inline Sci::Position MovePositionForInsertion(Sci::Position position, Sci::Position startInsertion, Sci::Position length) { - if (position > startInsertion) { - return position + length; - } -@@ -2536,9 +2536,9 @@ - - // Move a position so it is still after the same character as before the deletion if that - // character is still present else after the previous surviving character. --static inline int MovePositionForDeletion(int position, int startDeletion, int length) { -+static inline Sci::Position MovePositionForDeletion(Sci::Position position, Sci::Position startDeletion, Sci::Position length) { - if (position > startDeletion) { -- int endDeletion = startDeletion + length; -+ Sci::Position endDeletion = startDeletion + length; - if (position > endDeletion) { - return position - length; - } else { -@@ -2602,17 +2602,17 @@ - } - if ((mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) && cs.HiddenLines()) { - // Some lines are hidden so may need shown. -- const int lineOfPos = pdoc->LineFromPosition(mh.position); -- int endNeedShown = mh.position; -+ const Sci::Line lineOfPos = pdoc->LineFromPosition(mh.position); -+ Sci::Position endNeedShown = mh.position; - if (mh.modificationType & SC_MOD_BEFOREINSERT) { - if (pdoc->ContainsLineEnd(mh.text, mh.length) && (mh.position != pdoc->LineStart(lineOfPos))) - endNeedShown = pdoc->LineStart(lineOfPos+1); - } else if (mh.modificationType & SC_MOD_BEFOREDELETE) { - // If the deletion includes any EOL then we extend the need shown area. - endNeedShown = mh.position + mh.length; -- int lineLast = pdoc->LineFromPosition(mh.position+mh.length); -- for (int line = lineOfPos + 1; line <= lineLast; line++) { -- const int lineMaxSubord = pdoc->GetLastChild(line, -1, -1); -+ Sci::Line lineLast = pdoc->LineFromPosition(mh.position+mh.length); -+ for (Sci::Line line = lineOfPos + 1; line <= lineLast; line++) { -+ const Sci::Line lineMaxSubord = pdoc->GetLastChild(line, -1, -1); - if (lineLast < lineMaxSubord) { - lineLast = lineMaxSubord; - endNeedShown = pdoc->LineEnd(lineLast); -@@ -2624,7 +2624,7 @@ - if (mh.linesAdded != 0) { - // Update contraction state for inserted and removed lines - // lineOfPos should be calculated in context of state before modification, shouldn't it -- int lineOfPos = pdoc->LineFromPosition(mh.position); -+ Sci::Line lineOfPos = pdoc->LineFromPosition(mh.position); - if (mh.position > pdoc->LineStart(lineOfPos)) - lineOfPos++; // Affecting subsequent lines - if (mh.linesAdded > 0) { -@@ -2635,7 +2635,7 @@ - view.LinesAddedOrRemoved(lineOfPos, mh.linesAdded); - } - if (mh.modificationType & SC_MOD_CHANGEANNOTATION) { -- int lineDoc = pdoc->LineFromPosition(mh.position); -+ Sci::Line lineDoc = pdoc->LineFromPosition(mh.position); - if (vs.annotationVisible) { - cs.SetHeight(lineDoc, cs.GetHeight(lineDoc) + mh.annotationLinesAdded); - Redraw(); -@@ -2645,7 +2645,7 @@ - if (mh.linesAdded != 0) { - // Avoid scrolling of display if change before current display - if (mh.position < posTopLine && !CanDeferToLastStep(mh)) { -- int newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos()); -+ Sci::Line newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos()); - if (newTop != topLine) { - SetTopLine(newTop); - SetVerticalScrollPos(); -@@ -2857,12 +2857,12 @@ - * If stuttered = true and already at first/last row, scroll as normal. - */ - void Editor::PageMove(int direction, Selection::selTypes selt, bool stuttered) { -- int topLineNew; -+ Sci::Line topLineNew; - SelectionPosition newPos; - -- int currentLine = pdoc->LineFromPosition(sel.MainCaret()); -- int topStutterLine = topLine + caretYSlop; -- int bottomStutterLine = -+ Sci::Line currentLine = pdoc->LineFromPosition(sel.MainCaret()); -+ Sci::Line topStutterLine = topLine + caretYSlop; -+ Sci::Line bottomStutterLine = - pdoc->LineFromPosition(PositionFromLocation( - Point::FromInts(lastXChosen - xOffset, direction * vs.lineHeight * LinesToScroll()))) - - caretYSlop - 1; -@@ -2921,15 +2921,15 @@ - } - size_t endDifferenceText = sText.size() - 1 - lastDifferenceText; - pdoc->DeleteChars( -- static_cast<int>(currentNoVS.Start().Position() + firstDifference), -- static_cast<int>(rangeBytes - firstDifference - endDifferenceText)); -- const int lengthChange = static_cast<int>(lastDifferenceMapped - firstDifference + 1); -- const int lengthInserted = pdoc->InsertString( -+ static_cast<Sci::Position>(currentNoVS.Start().Position() + firstDifference), -+ static_cast<Sci::Position>(rangeBytes - firstDifference - endDifferenceText)); -+ const Sci::Position lengthChange = static_cast<Sci::Position>(lastDifferenceMapped - firstDifference + 1); -+ const Sci::Position lengthInserted = pdoc->InsertString( - static_cast<int>(currentNoVS.Start().Position() + firstDifference), - sMapped.c_str() + firstDifference, - lengthChange); - // Automatic movement changes selection so reset to exactly the same as it was. -- int diffSizes = static_cast<int>(sMapped.size() - sText.size()) + lengthInserted - lengthChange; -+ Sci::Position diffSizes = static_cast<Sci::Position>(sMapped.size() - sText.size()) + lengthInserted - lengthChange; - if (diffSizes != 0) { - if (current.anchor > current.caret) - current.anchor.Add(diffSizes); -@@ -2943,24 +2943,24 @@ - } - - void Editor::LineTranspose() { -- int line = pdoc->LineFromPosition(sel.MainCaret()); -+ Sci::Line line = pdoc->LineFromPosition(sel.MainCaret()); - if (line > 0) { - UndoGroup ug(pdoc); - -- const int startPrevious = pdoc->LineStart(line - 1); -+ const Sci::Position startPrevious = pdoc->LineStart(line - 1); - const std::string linePrevious = RangeText(startPrevious, pdoc->LineEnd(line - 1)); - -- int startCurrent = pdoc->LineStart(line); -+ Sci::Position startCurrent = pdoc->LineStart(line); - const std::string lineCurrent = RangeText(startCurrent, pdoc->LineEnd(line)); - -- pdoc->DeleteChars(startCurrent, static_cast<int>(lineCurrent.length())); -- pdoc->DeleteChars(startPrevious, static_cast<int>(linePrevious.length())); -- startCurrent -= static_cast<int>(linePrevious.length()); -+ pdoc->DeleteChars(startCurrent, static_cast<Sci::Position>(lineCurrent.length())); -+ pdoc->DeleteChars(startPrevious, static_cast<Sci::Position>(linePrevious.length())); -+ startCurrent -= static_cast<Sci::Position>(linePrevious.length()); - - startCurrent += pdoc->InsertString(startPrevious, lineCurrent.c_str(), -- static_cast<int>(lineCurrent.length())); -+ static_cast<Sci::Position>(lineCurrent.length())); - pdoc->InsertString(startCurrent, linePrevious.c_str(), -- static_cast<int>(linePrevious.length())); -+ static_cast<Sci::Position>(linePrevious.length())); - // Move caret to start of current line - MovePositionTo(SelectionPosition(startCurrent)); - } -@@ -2981,20 +2981,20 @@ - SelectionPosition start = sel.Range(r).Start(); - SelectionPosition end = sel.Range(r).End(); - if (forLine) { -- int line = pdoc->LineFromPosition(sel.Range(r).caret.Position()); -+ Sci::Line line = pdoc->LineFromPosition(sel.Range(r).caret.Position()); - start = SelectionPosition(pdoc->LineStart(line)); - end = SelectionPosition(pdoc->LineEnd(line)); - } - std::string text = RangeText(start.Position(), end.Position()); -- int lengthInserted = eolLen; -+ Sci::Position lengthInserted = eolLen; - if (forLine) - lengthInserted = pdoc->InsertString(end.Position(), eol, eolLen); -- pdoc->InsertString(end.Position() + lengthInserted, text.c_str(), static_cast<int>(text.length())); -+ pdoc->InsertString(end.Position() + lengthInserted, text.c_str(), static_cast<Sci::Position>(text.length())); - } - if (sel.Count() && sel.IsRectangular()) { - SelectionPosition last = sel.Last(); - if (forLine) { -- int line = pdoc->LineFromPosition(last.Position()); -+ Sci::Line line = pdoc->LineFromPosition(last.Position()); - last = SelectionPosition(last.Position() + pdoc->LineStart(line+1) - pdoc->LineStart(line)); - } - if (sel.Rectangular().anchor > sel.Rectangular().caret) -@@ -3028,8 +3028,8 @@ - for (size_t r = 0; r < sel.Count(); r++) { - sel.Range(r).ClearVirtualSpace(); - const char *eol = StringFromEOLMode(pdoc->eolMode); -- const int positionInsert = sel.Range(r).caret.Position(); -- const int insertLength = pdoc->InsertString(positionInsert, eol, istrlen(eol)); -+ const Sci::Position positionInsert = sel.Range(r).caret.Position(); -+ const Sci::Position insertLength = pdoc->InsertString(positionInsert, eol, istrlen(eol)); - if (insertLength > 0) { - sel.Range(r) = SelectionRange(positionInsert + insertLength); - countInsertions++; -@@ -3064,12 +3064,12 @@ - int skipLines = 0; - - if (vs.annotationVisible) { -- const int lineDoc = pdoc->LineFromPosition(spStart.Position()); -+ const Sci::Line lineDoc = pdoc->LineFromPosition(spStart.Position()); - const Point ptStartLine = LocationFromPosition(pdoc->LineStart(lineDoc)); - const int subLine = static_cast<int>(pt.y - ptStartLine.y) / vs.lineHeight; - - if (direction < 0 && subLine == 0) { -- const int lineDisplay = cs.DisplayFromDoc(lineDoc); -+ const Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); - if (lineDisplay > 0) { - skipLines = pdoc->AnnotationLines(cs.DocFromDisplay(lineDisplay - 1)); - } -@@ -3078,9 +3078,9 @@ - } - } - -- const int newY = static_cast<int>(pt.y) + (1 + skipLines) * direction * vs.lineHeight; -+ const Sci::Line newY = static_cast<Sci::Line>(pt.y) + (1 + skipLines) * direction * vs.lineHeight; - if (lastX < 0) { -- lastX = static_cast<int>(pt.x) + xOffset; -+ lastX = static_cast<Sci::Position>(pt.x) + xOffset; - } - SelectionPosition posNew = SPositionFromLocation( - Point::FromInts(lastX - xOffset, newY), false, false, UserVirtualSpace()); -@@ -3151,7 +3151,8 @@ - } - - void Editor::ParaUpOrDown(int direction, Selection::selTypes selt) { -- int lineDoc, savedPos = sel.MainCaret(); -+ Sci::Line lineDoc; -+ Sci::Position savedPos = sel.MainCaret(); - do { - MovePositionTo(SelectionPosition(direction > 0 ? pdoc->ParaDown(sel.MainCaret()) : pdoc->ParaUp(sel.MainCaret())), selt); - lineDoc = pdoc->LineFromPosition(sel.MainCaret()); -@@ -3166,16 +3167,16 @@ - } while (!cs.GetVisible(lineDoc)); - } - --Range Editor::RangeDisplayLine(int lineVisible) { -+Range Editor::RangeDisplayLine(Sci::Line lineVisible) { - RefreshStyleData(); - AutoSurface surface(this); - return view.RangeDisplayLine(surface, *this, lineVisible, vs); - } - --int Editor::StartEndDisplayLine(int pos, bool start) { -+Sci::Position Editor::StartEndDisplayLine(Sci::Position pos, bool start) { - RefreshStyleData(); - AutoSurface surface(this); -- int posRet = view.StartEndDisplayLine(surface, *this, pos, start, vs); -+ Sci::Position posRet = view.StartEndDisplayLine(surface, *this, pos, start, vs); - if (posRet == INVALID_POSITION) { - return pos; - } else { -@@ -3258,27 +3259,27 @@ - - } - --int Editor::VCHomeDisplayPosition(int position) { -- const int homePos = pdoc->VCHomePosition(position); -- const int viewLineStart = StartEndDisplayLine(position, true); -+Sci::Position Editor::VCHomeDisplayPosition(Sci::Position position) { -+ const Sci::Position homePos = pdoc->VCHomePosition(position); -+ const Sci::Position viewLineStart = StartEndDisplayLine(position, true); - if (viewLineStart > homePos) - return viewLineStart; - else - return homePos; - } - --int Editor::VCHomeWrapPosition(int position) { -- const int homePos = pdoc->VCHomePosition(position); -- const int viewLineStart = StartEndDisplayLine(position, true); -+Sci::Position Editor::VCHomeWrapPosition(Sci::Position position) { -+ const Sci::Position homePos = pdoc->VCHomePosition(position); -+ const Sci::Position viewLineStart = StartEndDisplayLine(position, true); - if ((viewLineStart < position) && (viewLineStart > homePos)) - return viewLineStart; - else - return homePos; - } - --int Editor::LineEndWrapPosition(int position) { -- const int endPos = StartEndDisplayLine(position, false); -- const int realEndPos = pdoc->LineEndPosition(position); -+Sci::Position Editor::LineEndWrapPosition(Sci::Position position) { -+ const Sci::Position endPos = StartEndDisplayLine(position, false); -+ const Sci::Position realEndPos = pdoc->LineEndPosition(position); - if (endPos > realEndPos // if moved past visible EOLs - || position >= endPos) // if at end of display line already - return realEndPos; -@@ -3781,26 +3782,26 @@ - return DelWordOrLine(iMessage); - - case SCI_LINECOPY: { -- int lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -- int lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); -+ Sci::Line lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -+ Sci::Line lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); - CopyRangeToClipboard(pdoc->LineStart(lineStart), - pdoc->LineStart(lineEnd + 1)); - } - break; - case SCI_LINECUT: { -- int lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -- int lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); -- int start = pdoc->LineStart(lineStart); -- int end = pdoc->LineStart(lineEnd + 1); -+ Sci::Line lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -+ Sci::Line lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); -+ Sci::Position start = pdoc->LineStart(lineStart); -+ Sci::Position end = pdoc->LineStart(lineEnd + 1); - SetSelection(start, end); - Cut(); - SetLastXChosen(); - } - break; - case SCI_LINEDELETE: { -- int line = pdoc->LineFromPosition(sel.MainCaret()); -- int start = pdoc->LineStart(line); -- int end = pdoc->LineStart(line + 1); -+ Sci::Line line = pdoc->LineFromPosition(sel.MainCaret()); -+ Sci::Position start = pdoc->LineStart(line); -+ Sci::Position end = pdoc->LineStart(line + 1); - pdoc->DeleteChars(start, end - start); - } - break; -@@ -3854,9 +3855,9 @@ - void Editor::Indent(bool forwards) { - UndoGroup ug(pdoc); - for (size_t r=0; r<sel.Count(); r++) { -- int lineOfAnchor = pdoc->LineFromPosition(sel.Range(r).anchor.Position()); -- int caretPosition = sel.Range(r).caret.Position(); -- int lineCurrentPos = pdoc->LineFromPosition(caretPosition); -+ Sci::Line lineOfAnchor = pdoc->LineFromPosition(sel.Range(r).anchor.Position()); -+ Sci::Position caretPosition = sel.Range(r).caret.Position(); -+ Sci::Line lineCurrentPos = pdoc->LineFromPosition(caretPosition); - if (lineOfAnchor == lineCurrentPos) { - if (forwards) { - pdoc->DeleteChars(sel.Range(r).Start().Position(), sel.Range(r).Length()); -@@ -3865,12 +3866,12 @@ - pdoc->tabIndents) { - int indentation = pdoc->GetLineIndentation(lineCurrentPos); - int indentationStep = pdoc->IndentSize(); -- const int posSelect = pdoc->SetLineIndentation( -+ const Sci::Position posSelect = pdoc->SetLineIndentation( - lineCurrentPos, indentation + indentationStep - indentation % indentationStep); - sel.Range(r) = SelectionRange(posSelect); - } else { - if (pdoc->useTabs) { -- const int lengthInserted = pdoc->InsertString(caretPosition, "\t", 1); -+ const Sci::Position lengthInserted = pdoc->InsertString(caretPosition, "\t", 1); - sel.Range(r) = SelectionRange(caretPosition + lengthInserted); - } else { - int numSpaces = (pdoc->tabInChars) - -@@ -3878,8 +3879,8 @@ - if (numSpaces < 1) - numSpaces = pdoc->tabInChars; - const std::string spaceText(numSpaces, ' '); -- const int lengthInserted = pdoc->InsertString(caretPosition, spaceText.c_str(), -- static_cast<int>(spaceText.length())); -+ const Sci::Position lengthInserted = pdoc->InsertString(caretPosition, spaceText.c_str(), -+ static_cast<Sci::Position>(spaceText.length())); - sel.Range(r) = SelectionRange(caretPosition + lengthInserted); - } - } -@@ -3888,25 +3889,25 @@ - pdoc->tabIndents) { - int indentation = pdoc->GetLineIndentation(lineCurrentPos); - int indentationStep = pdoc->IndentSize(); -- const int posSelect = pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep); -+ const Sci::Position posSelect = pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep); - sel.Range(r) = SelectionRange(posSelect); - } else { -- int newColumn = ((pdoc->GetColumn(caretPosition) - 1) / pdoc->tabInChars) * -+ Sci::Position newColumn = ((pdoc->GetColumn(caretPosition) - 1) / pdoc->tabInChars) * - pdoc->tabInChars; - if (newColumn < 0) - newColumn = 0; -- int newPos = caretPosition; -+ Sci::Position newPos = caretPosition; - while (pdoc->GetColumn(newPos) > newColumn) - newPos--; - sel.Range(r) = SelectionRange(newPos); - } - } - } else { // Multiline -- int anchorPosOnLine = sel.Range(r).anchor.Position() - pdoc->LineStart(lineOfAnchor); -- int currentPosPosOnLine = caretPosition - pdoc->LineStart(lineCurrentPos); -+ Sci::Position anchorPosOnLine = sel.Range(r).anchor.Position() - pdoc->LineStart(lineOfAnchor); -+ Sci::Position currentPosPosOnLine = caretPosition - pdoc->LineStart(lineCurrentPos); - // Multiple lines selected so indent / dedent -- int lineTopSel = Platform::Minimum(lineOfAnchor, lineCurrentPos); -- int lineBottomSel = Platform::Maximum(lineOfAnchor, lineCurrentPos); -+ Sci::Line lineTopSel = Platform::Minimum(lineOfAnchor, lineCurrentPos); -+ Sci::Line lineBottomSel = Platform::Maximum(lineOfAnchor, lineCurrentPos); - if (pdoc->LineStart(lineBottomSel) == sel.Range(r).anchor.Position() || pdoc->LineStart(lineBottomSel) == caretPosition) - lineBottomSel--; // If not selecting any characters on a line, do not indent - pdoc->Indent(forwards, lineBottomSel, lineTopSel); -@@ -3951,13 +3952,13 @@ - sptr_t lParam) { ///< @c Sci_TextToFind structure: The text to search for in the given range. - - Sci_TextToFind *ft = reinterpret_cast<Sci_TextToFind *>(lParam); -- int lengthFound = istrlen(ft->lpstrText); -+ Sci::Position lengthFound = istrlen(ft->lpstrText); - if (!pdoc->HasCaseFolder()) - pdoc->SetCaseFolder(CaseFolderForEncoding()); - try { - long pos = pdoc->FindText( -- static_cast<int>(ft->chrg.cpMin), -- static_cast<int>(ft->chrg.cpMax), -+ static_cast<Sci::Position>(ft->chrg.cpMin), -+ static_cast<Sci::Position>(ft->chrg.cpMax), - ft->lpstrText, - static_cast<int>(wParam), - &lengthFound); -@@ -4000,7 +4001,7 @@ - - const char *txt = reinterpret_cast<char *>(lParam); - long pos; -- int lengthFound = istrlen(txt); -+ Sci::Position lengthFound = istrlen(txt); - if (!pdoc->HasCaseFolder()) - pdoc->SetCaseFolder(CaseFolderForEncoding()); - try { -@@ -4045,8 +4046,8 @@ - * Search for text in the target range of the document. - * @return The position of the found text, -1 if not found. - */ --long Editor::SearchInTarget(const char *text, int length) { -- int lengthFound = length; -+long Editor::SearchInTarget(const char *text, Sci::Position length) { -+ Sci::Position lengthFound = length; - - if (!pdoc->HasCaseFolder()) - pdoc->SetCaseFolder(CaseFolderForEncoding()); -@@ -4065,7 +4066,7 @@ - } - } - --void Editor::GoToLine(int lineNo) { -+void Editor::GoToLine(Sci::Line lineNo) { - if (lineNo > pdoc->LinesTotal()) - lineNo = pdoc->LinesTotal(); - if (lineNo < 0) -@@ -4083,9 +4084,9 @@ - return true; - } - --std::string Editor::RangeText(int start, int end) const { -+std::string Editor::RangeText(Sci::Position start, Sci::Position end) const { - if (start < end) { -- int len = end - start; -+ Sci::Position len = end - start; - std::string ret(len, '\0'); - for (int i = 0; i < len; i++) { - ret[i] = pdoc->CharAt(start + i); -@@ -4098,9 +4099,9 @@ - void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) { - if (sel.Empty()) { - if (allowLineCopy) { -- int currentLine = pdoc->LineFromPosition(sel.MainCaret()); -- int start = pdoc->LineStart(currentLine); -- int end = pdoc->LineEnd(currentLine); -+ Sci::Line currentLine = pdoc->LineFromPosition(sel.MainCaret()); -+ Sci::Position start = pdoc->LineStart(currentLine); -+ Sci::Position end = pdoc->LineEnd(currentLine); - - std::string text = RangeText(start, end); - if (pdoc->eolMode != SC_EOL_LF) -@@ -4130,7 +4131,7 @@ - } - } - --void Editor::CopyRangeToClipboard(int start, int end) { -+void Editor::CopyRangeToClipboard(Sci::Position start, Sci::Position end) { - start = pdoc->ClampPositionIntoDocument(start); - end = pdoc->ClampPositionIntoDocument(end); - SelectionText selectedText; -@@ -4230,13 +4231,13 @@ - std::string convertedText = Document::TransformLineEnds(value, lengthValue, pdoc->eolMode); - - if (rectangular) { -- PasteRectangular(position, convertedText.c_str(), static_cast<int>(convertedText.length())); -+ PasteRectangular(position, convertedText.c_str(), static_cast<Sci::Position>(convertedText.length())); - // Should try to select new rectangle but it may not be a rectangle now so just select the drop position - SetEmptySelection(position); - } else { - position = MovePositionOutsideChar(position, sel.MainCaret() - position.Position()); - position = RealizeVirtualSpace(position); -- const int lengthInserted = pdoc->InsertString( -+ const Sci::Position lengthInserted = pdoc->InsertString( - position.Position(), convertedText.c_str(), static_cast<int>(convertedText.length())); - if (lengthInserted > 0) { - SelectionPosition posAfterInsertion = position; -@@ -4256,7 +4257,7 @@ - /** - * @return true if given position is inside the selection, - */ --bool Editor::PositionInSelection(int pos) { -+bool Editor::PositionInSelection(Sci::Position pos) { - pos = MovePositionOutsideChar(pos, sel.MainCaret() - pos); - for (size_t r=0; r<sel.Count(); r++) { - if (sel.Range(r).Contains(pos)) -@@ -4313,16 +4314,16 @@ - return Window::cursorReverseArrow; - } - --void Editor::TrimAndSetSelection(int currentPos_, int anchor_) { -+void Editor::TrimAndSetSelection(Sci::Position currentPos_, Sci::Position anchor_) { - sel.TrimSelection(SelectionRange(currentPos_, anchor_)); - SetSelection(currentPos_, anchor_); - } - --void Editor::LineSelection(int lineCurrentPos_, int lineAnchorPos_, bool wholeLine) { -- int selCurrentPos, selAnchorPos; -+void Editor::LineSelection(Sci::Position lineCurrentPos_, Sci::Position lineAnchorPos_, bool wholeLine) { -+ Sci::Position selCurrentPos, selAnchorPos; - if (wholeLine) { -- int lineCurrent_ = pdoc->LineFromPosition(lineCurrentPos_); -- int lineAnchor_ = pdoc->LineFromPosition(lineAnchorPos_); -+ Sci::Line lineCurrent_ = pdoc->LineFromPosition(lineCurrentPos_); -+ Sci::Line lineAnchor_ = pdoc->LineFromPosition(lineAnchorPos_); - if (lineAnchorPos_ < lineCurrentPos_) { - selCurrentPos = pdoc->LineStart(lineCurrent_ + 1); - selAnchorPos = pdoc->LineStart(lineAnchor_); -@@ -4351,7 +4352,7 @@ - TrimAndSetSelection(selCurrentPos, selAnchorPos); - } - --void Editor::WordSelection(int pos) { -+void Editor::WordSelection(Sci::Position pos) { - if (pos < wordSelectAnchorStartPos) { - // Extend backward to the word containing pos. - // Skip ExtendWordSelect if the line is empty or if pos is after the last character. -@@ -4472,13 +4473,13 @@ - } - - if (selectionType == selWord) { -- int charPos = originalAnchorPos; -+ Sci::Position charPos = originalAnchorPos; - if (sel.MainCaret() == originalAnchorPos) { - charPos = PositionFromLocation(pt, false, true); - charPos = MovePositionOutsideChar(charPos, -1); - } - -- int startWord, endWord; -+ Sci::Position startWord, endWord; - if ((sel.MainCaret() >= originalAnchorPos) && !pdoc->IsLineEndPosition(charPos)) { - startWord = pdoc->ExtendWordSelect(pdoc->MovePositionOutsideChar(charPos + 1, 1), -1); - endWord = pdoc->ExtendWordSelect(charPos, 1); -@@ -4539,7 +4540,7 @@ - LineSelection(newPos.Position(), lineAnchorPos, selectionType == selWholeLine); - } - -- SetDragPosition(SelectionPosition(invalidPosition)); -+ SetDragPosition(SelectionPosition(Sci::invalidPosition)); - SetMouseCapture(true); - if (FineTickerAvailable()) { - FineTickerStart(tickScroll, 100, 10); -@@ -4560,7 +4561,7 @@ - FineTickerStart(tickScroll, 100, 10); - } - if (inDragDrop != ddInitial) { -- SetDragPosition(SelectionPosition(invalidPosition)); -+ SetDragPosition(SelectionPosition(Sci::invalidPosition)); - if (!shift) { - if (ctrl && multipleSelection) { - SelectionRange range(newPos); -@@ -4603,19 +4604,19 @@ - return ButtonDownWithModifiers(pt, curTime, ModifierFlags(shift, ctrl, alt)); - } - --bool Editor::PositionIsHotspot(int position) const { -+bool Editor::PositionIsHotspot(Sci::Position position) const { - return vs.styles[pdoc->StyleIndexAt(position)].hotspot; - } - - bool Editor::PointIsHotspot(Point pt) { -- int pos = PositionFromLocation(pt, true, true); -+ Sci::Position pos = PositionFromLocation(pt, true, true); - if (pos == INVALID_POSITION) - return false; - return PositionIsHotspot(pos); - } - --void Editor::SetHoverIndicatorPosition(int position) { -- int hoverIndicatorPosPrev = hoverIndicatorPos; -+void Editor::SetHoverIndicatorPosition(Sci::Position position) { -+ Sci::Position hoverIndicatorPosPrev = hoverIndicatorPos; - hoverIndicatorPos = INVALID_POSITION; - if (vs.indicatorsDynamic == 0) - return; -@@ -4643,7 +4644,7 @@ - - void Editor::SetHotSpotRange(Point *pt) { - if (pt) { -- int pos = PositionFromLocation(*pt, false, true); -+ Sci::Position pos = PositionFromLocation(*pt, false, true); - - // If we don't limit this to word characters then the - // range can encompass more than the run range and then -@@ -4664,7 +4665,7 @@ - if (hotspot.Valid()) { - InvalidateRange(hotspot.start, hotspot.end); - } -- hotspot = Range(invalidPosition); -+ hotspot = Range(Sci::invalidPosition); - } - } - -@@ -4752,7 +4753,7 @@ - } - - // Autoscroll -- int lineMove = DisplayFromPosition(movePos.Position()); -+ Sci::Line lineMove = DisplayFromPosition(movePos.Position()); - if (pt.y > rcClient.bottom) { - ScrollTo(lineMove - LinesOnScreen() + 1); - Redraw(); -@@ -4789,7 +4790,7 @@ - DisplayCursor(Window::cursorHand); - SetHotSpotRange(&pt); - } else { -- if (hoverIndicatorPos != invalidPosition) -+ if (hoverIndicatorPos != Sci::invalidPosition) - DisplayCursor(Window::cursorHand); - else - DisplayCursor(Window::cursorText); -@@ -4842,14 +4843,14 @@ - if (drag.Length()) { - const int length = static_cast<int>(drag.Length()); - if (ctrl) { -- const int lengthInserted = pdoc->InsertString( -+ const Sci::Position lengthInserted = pdoc->InsertString( - newPos.Position(), drag.Data(), length); - if (lengthInserted > 0) { - SetSelection(newPos.Position(), newPos.Position() + lengthInserted); - } - } else if (newPos < selStart) { - pdoc->DeleteChars(selStart.Position(), static_cast<int>(drag.Length())); -- const int lengthInserted = pdoc->InsertString( -+ const Sci::Position lengthInserted = pdoc->InsertString( - newPos.Position(), drag.Data(), length); - if (lengthInserted > 0) { - SetSelection(newPos.Position(), newPos.Position() + lengthInserted); -@@ -4857,7 +4858,7 @@ - } else if (newPos > selEnd) { - pdoc->DeleteChars(selStart.Position(), static_cast<int>(drag.Length())); - newPos.Add(-static_cast<int>(drag.Length())); -- const int lengthInserted = pdoc->InsertString( -+ const Sci::Position lengthInserted = pdoc->InsertString( - newPos.Position(), drag.Data(), length); - if (lengthInserted > 0) { - SetSelection(newPos.Position(), newPos.Position() + lengthInserted); -@@ -5017,11 +5018,11 @@ - ShowCaretAtCurrentPosition(); - } - --int Editor::PositionAfterArea(PRectangle rcArea) const { -+Sci::Position Editor::PositionAfterArea(PRectangle rcArea) const { - // The start of the document line after the display line after the area - // This often means that the line after a modification is restyled which helps - // detect multiline comment additions and heals single line comments -- int lineAfter = TopLineOfMain() + static_cast<int>(rcArea.bottom - 1) / vs.lineHeight + 1; -+ Sci::Line lineAfter = TopLineOfMain() + static_cast<Sci::Line>(rcArea.bottom - 1) / vs.lineHeight + 1; - if (lineAfter < cs.LinesDisplayed()) - return pdoc->LineStart(cs.DocFromDisplay(lineAfter) + 1); - else -@@ -5030,8 +5031,8 @@ - - // Style to a position within the view. If this causes a change at end of last line then - // affects later lines so style all the viewed text. --void Editor::StyleToPositionInView(Position pos) { -- int endWindow = PositionAfterArea(GetClientDrawingRectangle()); -+void Editor::StyleToPositionInView(Sci::Position pos) { -+ Sci::Position endWindow = PositionAfterArea(GetClientDrawingRectangle()); - if (pos > endWindow) - pos = endWindow; - const int styleAtEnd = pdoc->StyleIndexAt(pos-1); -@@ -5046,7 +5047,7 @@ - } - } - --int Editor::PositionAfterMaxStyling(int posMax, bool scrolling) const { -+Sci::Position Editor::PositionAfterMaxStyling(Sci::Position posMax, bool scrolling) const { - if ((idleStyling == SC_IDLESTYLING_NONE) || (idleStyling == SC_IDLESTYLING_AFTERVISIBLE)) { - // Both states do not limit styling - return posMax; -@@ -5056,12 +5057,12 @@ - // When scrolling, allow less time to ensure responsive - const double secondsAllowed = scrolling ? 0.005 : 0.02; - -- const int linesToStyle = Platform::Clamp(static_cast<int>(secondsAllowed / pdoc->durationStyleOneLine), -+ const Sci::Line linesToStyle = Platform::Clamp(static_cast<int>(secondsAllowed / pdoc->durationStyleOneLine), - 10, 0x10000); -- const int stylingMaxLine = std::min( -- static_cast<int>(pdoc->LineFromPosition(pdoc->GetEndStyled()) + linesToStyle), -+ const Sci::Line stylingMaxLine = std::min( -+ static_cast<Sci::Line>(pdoc->LineFromPosition(pdoc->GetEndStyled()) + linesToStyle), - pdoc->LinesTotal()); -- return std::min(static_cast<int>(pdoc->LineStart(stylingMaxLine)), posMax); -+ return std::min(static_cast<Sci::Position>(pdoc->LineStart(stylingMaxLine)), posMax); - } - - void Editor::StartIdleStyling(bool truncatedLastStyling) { -@@ -5081,8 +5082,8 @@ - - // Style for an area but bound the amount of styling to remain responsive - void Editor::StyleAreaBounded(PRectangle rcArea, bool scrolling) { -- const int posAfterArea = PositionAfterArea(rcArea); -- const int posAfterMax = PositionAfterMaxStyling(posAfterArea, scrolling); -+ const Sci::Position posAfterArea = PositionAfterArea(rcArea); -+ const Sci::Position posAfterMax = PositionAfterMaxStyling(posAfterArea, scrolling); - if (posAfterMax < posAfterArea) { - // Idle styling may be performed before current visible area - // Style a bit now then style further in idle time -@@ -5095,10 +5096,10 @@ - } - - void Editor::IdleStyling() { -- const int posAfterArea = PositionAfterArea(GetClientRectangle()); -- const int endGoal = (idleStyling >= SC_IDLESTYLING_AFTERVISIBLE) ? -+ const Sci::Position posAfterArea = PositionAfterArea(GetClientRectangle()); -+ const Sci::Position endGoal = (idleStyling >= SC_IDLESTYLING_AFTERVISIBLE) ? - pdoc->Length() : posAfterArea; -- const int posAfterMax = PositionAfterMaxStyling(endGoal, false); -+ const Sci::Position posAfterMax = PositionAfterMaxStyling(endGoal, false); - pdoc->StyleToAdjustingLineDuration(posAfterMax); - if (pdoc->GetEndStyled() >= endGoal) { - needIdleStyling = false; -@@ -5115,7 +5116,7 @@ - workNeeded.Reset(); - } - --void Editor::QueueIdleWork(WorkNeeded::workItems items, int upTo) { -+void Editor::QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo) { - workNeeded.Need(items, upTo); - } - -@@ -5160,7 +5161,7 @@ - } - } - --void Editor::SetBraceHighlight(Position pos0, Position pos1, int matchStyle) { -+void Editor::SetBraceHighlight(Sci::Position pos0, Sci::Position pos1, int matchStyle) { - if ((pos0 != braces[0]) || (pos1 != braces[1]) || (matchStyle != bracesMatchStyle)) { - if ((braces[0] != pos0) || (matchStyle != bracesMatchStyle)) { - CheckForChangeOutsidePaint(Range(braces[0])); -@@ -5179,11 +5180,11 @@ - } - } - --void Editor::SetAnnotationHeights(int start, int end) { -+void Editor::SetAnnotationHeights(Sci::Line start, Sci::Line end) { - if (vs.annotationVisible) { - RefreshStyleData(); - bool changedHeight = false; -- for (int line=start; line<end && line<pdoc->LinesTotal(); line++) { -+ for (Sci::Line line=start; line<end && line<pdoc->LinesTotal(); line++) { - int linesWrapped = 1; - if (Wrapping()) { - AutoSurface surface(this); -@@ -5218,8 +5219,8 @@ - targetStart = 0; - targetEnd = 0; - -- braces[0] = invalidPosition; -- braces[1] = invalidPosition; -+ braces[0] = Sci::invalidPosition; -+ braces[1] = Sci::invalidPosition; - - vs.ReleaseAllExtendedStyles(); - -@@ -5232,8 +5233,8 @@ - view.llc.Deallocate(); - NeedWrapping(); - -- hotspot = Range(invalidPosition); -- hoverIndicatorPos = invalidPosition; -+ hotspot = Range(Sci::invalidPosition); -+ hoverIndicatorPos = Sci::invalidPosition; - - view.ClearAllTabstops(); - -@@ -5248,7 +5249,7 @@ - vs.annotationVisible = visible; - if (changedFromOrToHidden) { - int dir = vs.annotationVisible ? 1 : -1; -- for (int line=0; line<pdoc->LinesTotal(); line++) { -+ for (Sci::Line line=0; line<pdoc->LinesTotal(); line++) { - int annotationLines = pdoc->AnnotationLines(line); - if (annotationLines > 0) { - cs.SetHeight(line, cs.GetHeight(line) + annotationLines * dir); -@@ -5262,8 +5263,8 @@ - /** - * Recursively expand a fold, making lines visible except where they have an unexpanded parent. - */ --int Editor::ExpandLine(int line) { -- int lineMaxSubord = pdoc->GetLastChild(line); -+Sci::Line Editor::ExpandLine(Sci::Line line) { -+ Sci::Line lineMaxSubord = pdoc->GetLastChild(line); - line++; - while (line <= lineMaxSubord) { - cs.SetVisible(line, line, true); -@@ -5280,13 +5281,13 @@ - return lineMaxSubord; - } - --void Editor::SetFoldExpanded(int lineDoc, bool expanded) { -+void Editor::SetFoldExpanded(Sci::Line lineDoc, bool expanded) { - if (cs.SetExpanded(lineDoc, expanded)) { - RedrawSelMargin(); - } - } - --void Editor::FoldLine(int line, int action) { -+void Editor::FoldLine(Sci::Line line, int action) { - if (line >= 0) { - if (action == SC_FOLDACTION_TOGGLE) { - if ((pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG) == 0) { -@@ -5298,12 +5299,12 @@ - } - - if (action == SC_FOLDACTION_CONTRACT) { -- int lineMaxSubord = pdoc->GetLastChild(line); -+ Sci::Line lineMaxSubord = pdoc->GetLastChild(line); - if (lineMaxSubord > line) { - cs.SetExpanded(line, 0); - cs.SetVisible(line + 1, lineMaxSubord, false); - -- int lineCurrent = pdoc->LineFromPosition(sel.MainCaret()); -+ Sci::Line lineCurrent = pdoc->LineFromPosition(sel.MainCaret()); - if (lineCurrent > line && lineCurrent <= lineMaxSubord) { - // This does not re-expand the fold - EnsureCaretVisible(); -@@ -5324,7 +5325,7 @@ - } - } - --void Editor::FoldExpand(int line, int action, int level) { -+void Editor::FoldExpand(Sci::Line line, int action, int level) { - bool expanding = action == SC_FOLDACTION_EXPAND; - if (action == SC_FOLDACTION_TOGGLE) { - expanding = !cs.GetExpanded(line); -@@ -5336,7 +5337,7 @@ - if (expanding && (cs.HiddenLines() == 0)) - // Nothing to do - return; -- int lineMaxSubord = pdoc->GetLastChild(line, LevelNumber(level)); -+ Sci::Line lineMaxSubord = pdoc->GetLastChild(line, LevelNumber(level)); - line++; - cs.SetVisible(line, lineMaxSubord, expanding); - while (line <= lineMaxSubord) { -@@ -5350,8 +5351,8 @@ - Redraw(); - } - --int Editor::ContractedFoldNext(int lineStart) const { -- for (int line = lineStart; line<pdoc->LinesTotal();) { -+Sci::Line Editor::ContractedFoldNext(Sci::Line lineStart) const { -+ for (Sci::Line line = lineStart; line<pdoc->LinesTotal();) { - if (!cs.GetExpanded(line) && (pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG)) - return line; - line = cs.ContractedNext(line+1); -@@ -5366,7 +5367,7 @@ - * Recurse up from this line to find any folds that prevent this line from being visible - * and unfold them all. - */ --void Editor::EnsureLineVisible(int lineDoc, bool enforcePolicy) { -+void Editor::EnsureLineVisible(Sci::Line lineDoc, bool enforcePolicy) { - - // In case in need of wrapping to ensure DisplayFromDoc works. - if (lineDoc >= wrapPending.start) -@@ -5374,12 +5375,12 @@ - - if (!cs.GetVisible(lineDoc)) { - // Back up to find a non-blank line -- int lookLine = lineDoc; -+ Sci::Line lookLine = lineDoc; - int lookLineLevel = pdoc->GetLevel(lookLine); - while ((lookLine > 0) && (lookLineLevel & SC_FOLDLEVELWHITEFLAG)) { - lookLineLevel = pdoc->GetLevel(--lookLine); - } -- int lineParent = pdoc->GetFoldParent(lookLine); -+ Sci::Line lineParent = pdoc->GetFoldParent(lookLine); - if (lineParent < 0) { - // Backed up to a top level line, so try to find parent of initial line - lineParent = pdoc->GetFoldParent(lineDoc); -@@ -5396,7 +5397,7 @@ - Redraw(); - } - if (enforcePolicy) { -- int lineDisplay = cs.DisplayFromDoc(lineDoc); -+ Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); - if (visiblePolicy & VISIBLE_SLOP) { - if ((topLine > lineDisplay) || ((visiblePolicy & VISIBLE_STRICT) && (topLine + visibleSlop > lineDisplay))) { - SetTopLine(Platform::Clamp(lineDisplay - visibleSlop, 0, MaxScrollPos())); -@@ -5420,7 +5421,7 @@ - - void Editor::FoldAll(int action) { - pdoc->EnsureStyledTo(pdoc->Length()); -- int maxLine = pdoc->LinesTotal(); -+ Sci::Line maxLine = pdoc->LinesTotal(); - bool expanding = action == SC_FOLDACTION_EXPAND; - if (action == SC_FOLDACTION_TOGGLE) { - // Discover current state -@@ -5445,7 +5446,7 @@ - if ((level & SC_FOLDLEVELHEADERFLAG) && - (SC_FOLDLEVELBASE == LevelNumber(level))) { - SetFoldExpanded(line, false); -- int lineMaxSubord = pdoc->GetLastChild(line, -1); -+ Sci::Line lineMaxSubord = pdoc->GetLastChild(line, -1); - if (lineMaxSubord > line) { - cs.SetVisible(line + 1, lineMaxSubord, false); - } -@@ -5456,7 +5457,7 @@ - Redraw(); - } - --void Editor::FoldChanged(int line, int levelNow, int levelPrev) { -+void Editor::FoldChanged(Sci::Line line, int levelNow, int levelPrev) { - if (levelNow & SC_FOLDLEVELHEADERFLAG) { - if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) { - // Adding a fold point. -@@ -5466,7 +5467,7 @@ - FoldExpand(line, SC_FOLDACTION_EXPAND, levelPrev); - } - } else if (levelPrev & SC_FOLDLEVELHEADERFLAG) { -- const int prevLine = line - 1; -+ const Sci::Line prevLine = line - 1; - const int prevLineLevel = pdoc->GetLevel(prevLine); - - // Combining two blocks where the first block is collapsed (e.g. by deleting the line(s) which separate(s) the two blocks) -@@ -5487,7 +5488,7 @@ - (LevelNumber(levelPrev) > LevelNumber(levelNow))) { - if (cs.HiddenLines()) { - // See if should still be hidden -- int parentLine = pdoc->GetFoldParent(line); -+ Sci::Line parentLine = pdoc->GetFoldParent(line); - if ((parentLine < 0) || (cs.GetExpanded(parentLine) && cs.GetVisible(parentLine))) { - cs.SetVisible(line, line, true); - SetScrollBars(); -@@ -5499,18 +5500,18 @@ - // Combining two blocks where the first one is collapsed (e.g. by adding characters in the line which separates the two blocks) - if (!(levelNow & SC_FOLDLEVELWHITEFLAG) && (LevelNumber(levelPrev) < LevelNumber(levelNow))) { - if (cs.HiddenLines()) { -- const int parentLine = pdoc->GetFoldParent(line); -+ const Sci::Line parentLine = pdoc->GetFoldParent(line); - if (!cs.GetExpanded(parentLine) && cs.GetVisible(line)) - FoldLine(parentLine, SC_FOLDACTION_EXPAND); - } - } - } - --void Editor::NeedShown(int pos, int len) { -+void Editor::NeedShown(Sci::Position pos, Sci::Position len) { - if (foldAutomatic & SC_AUTOMATICFOLD_SHOW) { -- int lineStart = pdoc->LineFromPosition(pos); -- int lineEnd = pdoc->LineFromPosition(pos+len); -- for (int line = lineStart; line <= lineEnd; line++) { -+ Sci::Line lineStart = pdoc->LineFromPosition(pos); -+ Sci::Line lineEnd = pdoc->LineFromPosition(pos+len); -+ for (Sci::Line line = lineStart; line <= lineEnd; line++) { - EnsureLineVisible(line, false); - } - } else { -@@ -5518,9 +5519,9 @@ - } - } - --int Editor::GetTag(char *tagValue, int tagNumber) { -+Sci::Position Editor::GetTag(char *tagValue, int tagNumber) { - const char *text = 0; -- int length = 0; -+ Sci::Position length = 0; - if ((tagNumber >= 1) && (tagNumber <= 9)) { - char name[3] = "\\?"; - name[1] = static_cast<char>(tagNumber + '0'); -@@ -5536,7 +5537,7 @@ - return length; - } - --int Editor::ReplaceTarget(bool replacePatterns, const char *text, int length) { -+Sci::Position Editor::ReplaceTarget(bool replacePatterns, const char *text, Sci::Position length) { - UndoGroup ug(pdoc); - if (length == -1) - length = istrlen(text); -@@ -5549,7 +5550,7 @@ - if (targetStart != targetEnd) - pdoc->DeleteChars(targetStart, targetEnd - targetStart); - targetEnd = targetStart; -- const int lengthInserted = pdoc->InsertString(targetStart, text, length); -+ const Sci::Position lengthInserted = pdoc->InsertString(targetStart, text, length); - targetEnd = targetStart + lengthInserted; - return length; - } -@@ -5577,15 +5578,15 @@ - } - } - --void Editor::AddStyledText(char *buffer, int appendLength) { -+void Editor::AddStyledText(char *buffer, Sci::Position appendLength) { - // The buffer consists of alternating character bytes and style bytes -- int textLength = appendLength / 2; -+ Sci::Position textLength = appendLength / 2; - std::string text(textLength, '\0'); -- int i; -+ Sci::Position i; - for (i = 0; i < textLength; i++) { - text[i] = buffer[i*2]; - } -- const int lengthInserted = pdoc->InsertString(CurrentPosition(), text.c_str(), textLength); -+ const Sci::Position lengthInserted = pdoc->InsertString(CurrentPosition(), text.c_str(), textLength); - for (i = 0; i < textLength; i++) { - text[i] = buffer[i*2+1]; - } -@@ -5854,14 +5855,14 @@ - break; - - case SCI_GETLINE: { // Risk of overwriting the end of the buffer -- int lineStart = pdoc->LineStart(static_cast<int>(wParam)); -- int lineEnd = pdoc->LineStart(static_cast<int>(wParam + 1)); -+ Sci::Position lineStart = pdoc->LineStart(static_cast<Sci::Line>(wParam)); -+ Sci::Position lineEnd = pdoc->LineStart(static_cast<Sci::Line>(wParam + 1)); - if (lParam == 0) { - return lineEnd - lineStart; - } - char *ptr = CharPtrFromSPtr(lParam); -- int iPlace = 0; -- for (int iChar = lineStart; iChar < lineEnd; iChar++) { -+ Sci::Position iPlace = 0; -+ for (Sci::Position iChar = lineStart; iChar < lineEnd; iChar++) { - ptr[iPlace++] = pdoc->CharAt(iChar); - } - return iPlace; -@@ -5877,8 +5878,8 @@ - return !pdoc->IsSavePoint(); - - case SCI_SETSEL: { -- int nStart = static_cast<int>(wParam); -- int nEnd = static_cast<int>(lParam); -+ Sci::Position nStart = static_cast<Sci::Position>(wParam); -+ Sci::Position nEnd = static_cast<Sci::Position>(lParam); - if (nEnd < 0) - nEnd = pdoc->Length(); - if (nStart < 0) -@@ -5919,7 +5920,7 @@ - wParam = pdoc->LineFromPosition(SelectionStart().Position()); - if (wParam == 0) - return 0; // Even if there is no text, there is a first line that starts at 0 -- if (static_cast<int>(wParam) > pdoc->LinesTotal()) -+ if (static_cast<Sci::Line>(wParam) > pdoc->LinesTotal()) - return -1; - //if (wParam > pdoc->LineFromPosition(pdoc->Length())) // Useful test, anyway... - // return -1; -@@ -5938,7 +5939,7 @@ - UndoGroup ug(pdoc); - ClearSelection(); - char *replacement = CharPtrFromSPtr(lParam); -- const int lengthInserted = pdoc->InsertString( -+ const Sci::Position lengthInserted = pdoc->InsertString( - sel.MainCaret(), replacement, istrlen(replacement)); - SetEmptySelection(sel.MainCaret() + lengthInserted); - EnsureCaretVisible(); -@@ -5986,15 +5987,15 @@ - - case SCI_REPLACETARGET: - PLATFORM_ASSERT(lParam); -- return ReplaceTarget(false, CharPtrFromSPtr(lParam), static_cast<int>(wParam)); -+ return ReplaceTarget(false, CharPtrFromSPtr(lParam), static_cast<Sci::Position>(wParam)); - - case SCI_REPLACETARGETRE: - PLATFORM_ASSERT(lParam); -- return ReplaceTarget(true, CharPtrFromSPtr(lParam), static_cast<int>(wParam)); -+ return ReplaceTarget(true, CharPtrFromSPtr(lParam), static_cast<Sci::Position>(wParam)); - - case SCI_SEARCHINTARGET: - PLATFORM_ASSERT(lParam); -- return SearchInTarget(CharPtrFromSPtr(lParam), static_cast<int>(wParam)); -+ return SearchInTarget(CharPtrFromSPtr(lParam), static_cast<Sci::Position>(wParam)); - - case SCI_SETSEARCHFLAGS: - searchFlags = static_cast<int>(wParam); -@@ -6016,8 +6017,8 @@ - return Platform::Clamp(pdoc->GetRelativePosition(static_cast<int>(wParam), static_cast<int>(lParam)), 0, pdoc->Length()); - - case SCI_LINESCROLL: -- ScrollTo(topLine + static_cast<int>(lParam)); -- HorizontalScrollTo(xOffset + static_cast<int>(wParam)* static_cast<int>(vs.spaceWidth)); -+ ScrollTo(topLine + static_cast<Sci::Line>(lParam)); -+ HorizontalScrollTo(xOffset + static_cast<int>(wParam) * static_cast<int>(vs.spaceWidth)); - return 1; - - case SCI_SETXOFFSET: -@@ -6072,7 +6073,7 @@ - if (lParam == 0) - return 0; - Sci_TextRange *tr = reinterpret_cast<Sci_TextRange *>(lParam); -- int cpMax = static_cast<int>(tr->chrg.cpMax); -+ Sci::Position cpMax = static_cast<Sci::Position>(tr->chrg.cpMax); - if (cpMax == -1) - cpMax = pdoc->Length(); - PLATFORM_ASSERT(cpMax <= pdoc->Length()); -@@ -6113,26 +6114,26 @@ - case SCI_ADDTEXT: { - if (lParam == 0) - return 0; -- const int lengthInserted = pdoc->InsertString( -- CurrentPosition(), CharPtrFromSPtr(lParam), static_cast<int>(wParam)); -+ const Sci::Position lengthInserted = pdoc->InsertString( -+ CurrentPosition(), CharPtrFromSPtr(lParam), static_cast<Sci::Position>(wParam)); - SetEmptySelection(sel.MainCaret() + lengthInserted); - return 0; - } - - case SCI_ADDSTYLEDTEXT: - if (lParam) -- AddStyledText(CharPtrFromSPtr(lParam), static_cast<int>(wParam)); -+ AddStyledText(CharPtrFromSPtr(lParam), static_cast<Sci::Position>(wParam)); - return 0; - - case SCI_INSERTTEXT: { - if (lParam == 0) - return 0; -- int insertPos = static_cast<int>(wParam); -+ Sci::Position insertPos = static_cast<Sci::Position>(wParam); - if (static_cast<int>(wParam) == -1) - insertPos = CurrentPosition(); -- int newCurrent = CurrentPosition(); -+ Sci::Position newCurrent = CurrentPosition(); - char *sz = CharPtrFromSPtr(lParam); -- const int lengthInserted = pdoc->InsertString(insertPos, sz, istrlen(sz)); -+ const Sci::Position lengthInserted = pdoc->InsertString(insertPos, sz, istrlen(sz)); - if (newCurrent > insertPos) - newCurrent += lengthInserted; - SetEmptySelection(newCurrent); -@@ -6221,11 +6222,11 @@ - return pdoc->Length(); - - case SCI_ALLOCATE: -- pdoc->Allocate(static_cast<int>(wParam)); -+ pdoc->Allocate(static_cast<Sci::Position>(wParam)); - break; - - case SCI_GETCHARAT: -- return pdoc->CharAt(static_cast<int>(wParam)); -+ return pdoc->CharAt(static_cast<Sci::Position>(wParam)); - - case SCI_SETCURRENTPOS: - if (sel.IsRectangular()) { -@@ -6233,7 +6234,7 @@ - SetRectangularRange(); - Redraw(); - } else { -- SetSelection(static_cast<int>(wParam), sel.MainAnchor()); -+ SetSelection(static_cast<Sci::Position>(wParam), sel.MainAnchor()); - } - break; - -@@ -6242,11 +6243,11 @@ - - case SCI_SETANCHOR: - if (sel.IsRectangular()) { -- sel.Rectangular().anchor.SetPosition(static_cast<int>(wParam)); -+ sel.Rectangular().anchor.SetPosition(static_cast<Sci::Position>(wParam)); - SetRectangularRange(); - Redraw(); - } else { -- SetSelection(sel.MainCaret(), static_cast<int>(wParam)); -+ SetSelection(sel.MainCaret(), static_cast<Sci::Position>(wParam)); - } - break; - -@@ -6254,14 +6255,14 @@ - return sel.IsRectangular() ? sel.Rectangular().anchor.Position() : sel.MainAnchor(); - - case SCI_SETSELECTIONSTART: -- SetSelection(Platform::Maximum(sel.MainCaret(), static_cast<int>(wParam)), static_cast<int>(wParam)); -+ SetSelection(std::max(sel.MainCaret(), static_cast<Sci::Position>(wParam)), static_cast<Sci::Position>(wParam)); - break; - - case SCI_GETSELECTIONSTART: - return sel.LimitsForRectangularElseMain().start.Position(); - - case SCI_SETSELECTIONEND: -- SetSelection(static_cast<int>(wParam), Platform::Minimum(sel.MainAnchor(), static_cast<int>(wParam))); -+ SetSelection(static_cast<Sci::Position>(wParam), Platform::Minimum(sel.MainAnchor(), static_cast<Sci::Position>(wParam))); - break; - - case SCI_GETSELECTIONEND: -@@ -6384,16 +6385,16 @@ - break; - - case SCI_GETCURLINE: { -- int lineCurrentPos = pdoc->LineFromPosition(sel.MainCaret()); -- int lineStart = pdoc->LineStart(lineCurrentPos); -- unsigned int lineEnd = pdoc->LineStart(lineCurrentPos + 1); -+ const Sci::Line lineCurrentPos = pdoc->LineFromPosition(sel.MainCaret()); -+ const Sci::Position lineStart = pdoc->LineStart(lineCurrentPos); -+ const Sci::Position lineEnd = pdoc->LineStart(lineCurrentPos + 1); - 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++) { -+ for (Sci::Position iChar = lineStart; iChar < lineEnd && iPlace < wParam - 1; iChar++) { - ptr[iPlace++] = pdoc->CharAt(iChar); - } - ptr[iPlace] = '\0'; -diff -r 1788f6795302 -r a0f26eaf474d src/Editor.h ---- a/src/Editor.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/Editor.h Fri Mar 31 18:19:38 2017 +1100 -@@ -47,14 +47,14 @@ - workUpdateUI=2 - }; - enum workItems items; -- Position upTo; -+ Sci::Position upTo; - - WorkNeeded() : items(workNone), upTo(0) {} - void Reset() { - items = workNone; - upTo = 0; - } -- void Need(workItems items_, Position pos) { -+ void Need(workItems items_, Sci::Position pos) { - if ((items_ & workStyle) && (upTo < pos)) - upTo = pos; - items = static_cast<workItems>(items | items_); -@@ -115,8 +115,8 @@ - struct WrapPending { - // The range of lines that need to be wrapped - enum { lineLarge = 0x7ffffff }; -- int start; // When there are wraps pending, will be in document range -- int end; // May be lineLarge to indicate all of document after start -+ Sci::Line start; // When there are wraps pending, will be in document range -+ Sci::Line end; // May be lineLarge to indicate all of document after start - WrapPending() { - start = lineLarge; - end = lineLarge; -@@ -125,14 +125,14 @@ - start = lineLarge; - end = lineLarge; - } -- void Wrapped(int line) { -+ void Wrapped(Sci::Line line) { - if (start == line) - start++; - } - bool NeedsWrap() const { - return start < end; - } -- bool AddRange(int lineStart, int lineEnd) { -+ bool AddRange(Sci::Line lineStart, Sci::Line lineEnd) { - const bool neededWrap = NeedsWrap(); - bool changed = false; - if (start > lineStart) { -@@ -211,19 +211,19 @@ - enum { ddNone, ddInitial, ddDragging } inDragDrop; - bool dropWentOutside; - SelectionPosition posDrop; -- int hotSpotClickPos; -+ Sci::Position hotSpotClickPos; - int lastXChosen; -- int lineAnchorPos; -- int originalAnchorPos; -- int wordSelectAnchorStartPos; -- int wordSelectAnchorEndPos; -- int wordSelectInitialCaretPos; -- int targetStart; -- int targetEnd; -+ Sci::Position lineAnchorPos; -+ Sci::Position originalAnchorPos; -+ Sci::Position wordSelectAnchorStartPos; -+ Sci::Position wordSelectAnchorEndPos; -+ Sci::Position wordSelectInitialCaretPos; -+ Sci::Position targetStart; -+ Sci::Position targetEnd; - int searchFlags; -- int topLine; -- int posTopLine; -- int lengthForEncode; -+ Sci::Line topLine; -+ Sci::Position posTopLine; -+ Sci::Position lengthForEncode; - - int needUpdateUI; - -@@ -249,7 +249,7 @@ - int visiblePolicy; - int visibleSlop; - -- int searchAnchor; -+ Sci::Position searchAnchor; - - bool recordingMacro; - -@@ -276,38 +276,38 @@ - // scroll views where it will be equivalent to the current scroll position. - virtual Point GetVisibleOriginInMain() const; - PointDocument DocumentPointFromView(Point ptView) const; // Convert a point from view space to document -- int TopLineOfMain() const; // Return the line at Main's y coordinate 0 -+ Sci::Line TopLineOfMain() const; // Return the line at Main's y coordinate 0 - virtual PRectangle GetClientRectangle() const; - virtual PRectangle GetClientDrawingRectangle(); - PRectangle GetTextRectangle() const; - -- virtual int LinesOnScreen() const; -- int LinesToScroll() const; -- int MaxScrollPos() const; -+ virtual Sci::Line LinesOnScreen() const; -+ Sci::Line LinesToScroll() const; -+ Sci::Line MaxScrollPos() const; - SelectionPosition ClampPositionIntoDocument(SelectionPosition sp) const; - Point LocationFromPosition(SelectionPosition pos, PointEnd pe=peDefault); -- Point LocationFromPosition(int pos, PointEnd pe=peDefault); -- int XFromPosition(int pos); -+ Point LocationFromPosition(Sci::Position pos, PointEnd pe=peDefault); -+ int XFromPosition(Sci::Position pos); - int XFromPosition(SelectionPosition sp); - SelectionPosition SPositionFromLocation(Point pt, bool canReturnInvalid=false, bool charPosition=false, bool virtualSpace=true); -- int PositionFromLocation(Point pt, bool canReturnInvalid = false, bool charPosition = false); -- SelectionPosition SPositionFromLineX(int lineDoc, int x); -- int PositionFromLineX(int line, int x); -- int LineFromLocation(Point pt) const; -- void SetTopLine(int topLineNew); -+ Sci::Position PositionFromLocation(Point pt, bool canReturnInvalid = false, bool charPosition = false); -+ SelectionPosition SPositionFromLineX(Sci::Line lineDoc, int x); -+ Sci::Position PositionFromLineX(Sci::Line line, int x); -+ Sci::Line LineFromLocation(Point pt) const; -+ void SetTopLine(Sci::Line topLineNew); - - virtual bool AbandonPaint(); - virtual void RedrawRect(PRectangle rc); - virtual void DiscardOverdraw(); - virtual void Redraw(); -- void RedrawSelMargin(int line=-1, bool allAfter=false); -+ void RedrawSelMargin(Sci::Line line=-1, bool allAfter=false); - PRectangle RectangleFromRange(Range r, int overlap); -- void InvalidateRange(int start, int end); -+ void InvalidateRange(Sci::Position start, Sci::Position end); - - bool UserVirtualSpace() const { - return ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0); - } -- int CurrentPosition() const; -+ Sci::Position CurrentPosition() const; - bool SelectionEmpty() const; - SelectionPosition SelectionStart(); - SelectionPosition SelectionEnd(); -@@ -316,39 +316,39 @@ - void InvalidateSelection(SelectionRange newMain, bool invalidateWholeSelection=false); - void InvalidateWholeSelection(); - void SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_); -- void SetSelection(int currentPos_, int anchor_); -+ void SetSelection(Sci::Position currentPos_, Sci::Position anchor_); - void SetSelection(SelectionPosition currentPos_); - void SetSelection(int currentPos_); - void SetEmptySelection(SelectionPosition currentPos_); -- void SetEmptySelection(int currentPos_); -+ void SetEmptySelection(Sci::Position currentPos_); - enum AddNumber { addOne, addEach }; - void MultipleSelectAdd(AddNumber addNumber); -- bool RangeContainsProtected(int start, int end) const; -+ bool RangeContainsProtected(Sci::Position start, Sci::Position end) const; - bool SelectionContainsProtected(); -- int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true) const; -- SelectionPosition MovePositionOutsideChar(SelectionPosition pos, int moveDir, bool checkLineEnd=true) const; -+ Sci::Position MovePositionOutsideChar(Sci::Position pos, Sci::Position moveDir, bool checkLineEnd=true) const; -+ SelectionPosition MovePositionOutsideChar(SelectionPosition pos, Sci::Position moveDir, bool checkLineEnd=true) const; - void MovedCaret(SelectionPosition newPos, SelectionPosition previousPos, bool ensureVisible); - void MovePositionTo(SelectionPosition newPos, Selection::selTypes selt=Selection::noSel, bool ensureVisible=true); -- void MovePositionTo(int newPos, Selection::selTypes selt=Selection::noSel, bool ensureVisible=true); -+ void MovePositionTo(Sci::Position newPos, Selection::selTypes selt=Selection::noSel, bool ensureVisible=true); - SelectionPosition MovePositionSoVisible(SelectionPosition pos, int moveDir); -- SelectionPosition MovePositionSoVisible(int pos, int moveDir); -+ SelectionPosition MovePositionSoVisible(Sci::Position pos, int moveDir); - Point PointMainCaret(); - void SetLastXChosen(); - -- void ScrollTo(int line, bool moveThumb=true); -- virtual void ScrollText(int linesToMove); -+ void ScrollTo(Sci::Line line, bool moveThumb=true); -+ virtual void ScrollText(Sci::Line linesToMove); - void HorizontalScrollTo(int xPos); - void VerticalCentreCaret(); - void MoveSelectedLines(int lineDelta); - void MoveSelectedLinesUp(); - void MoveSelectedLinesDown(); - void MoveCaretInsideView(bool ensureVisible=true); -- int DisplayFromPosition(int pos); -+ Sci::Line DisplayFromPosition(Sci::Position pos); - - struct XYScrollPosition { - int xOffset; -- int topLine; -- XYScrollPosition(int xOffset_, int topLine_) : xOffset(xOffset_), topLine(topLine_) {} -+ Sci::Line topLine; -+ XYScrollPosition(int xOffset_, Sci::Line topLine_) : xOffset(xOffset_), topLine(topLine_) {} - bool operator==(const XYScrollPosition &other) const { - return (xOffset == other.xOffset) && (topLine == other.topLine); - } -@@ -370,8 +370,8 @@ - virtual void UpdateSystemCaret(); - - bool Wrapping() const; -- void NeedWrapping(int docLineStart=0, int docLineEnd=WrapPending::lineLarge); -- bool WrapOneLine(Surface *surface, int lineToWrap); -+ void NeedWrapping(Sci::Line docLineStart=0, Sci::Line docLineEnd=WrapPending::lineLarge); -+ bool WrapOneLine(Surface *surface, Sci::Line lineToWrap); - enum wrapScope {wsAll, wsVisible, wsIdle}; - bool WrapLines(enum wrapScope ws); - void LinesJoin(); -@@ -385,13 +385,13 @@ - - virtual void SetVerticalScrollPos() = 0; - virtual void SetHorizontalScrollPos() = 0; -- virtual bool ModifyScrollBars(int nMax, int nPage) = 0; -+ virtual bool ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) = 0; - virtual void ReconfigureScrollBars(); - void SetScrollBars(); - void ChangeSize(); - - void FilterSelections(); -- int RealizeVirtualSpace(int position, unsigned int virtualSpace); -+ Sci::Position RealizeVirtualSpace(Sci::Position position, Sci::Position virtualSpace); - SelectionPosition RealizeVirtualSpace(const SelectionPosition &position); - void AddChar(char ch); - virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false); -@@ -403,7 +403,7 @@ - void ClearAll(); - void ClearDocumentStyle(); - void Cut(); -- void PasteRectangular(SelectionPosition pos, const char *ptr, int len); -+ void PasteRectangular(SelectionPosition pos, const char *ptr, Sci::Position len); - virtual void Copy() = 0; - virtual void CopyAllowLine(); - virtual bool CanPaste(); -@@ -421,26 +421,26 @@ - virtual void SetCtrlID(int identifier); - virtual int GetCtrlID() { return ctrlID; } - virtual void NotifyParent(SCNotification scn) = 0; -- virtual void NotifyStyleToNeeded(int endStyleNeeded); -+ virtual void NotifyStyleToNeeded(Sci::Position endStyleNeeded); - void NotifyChar(int ch); - void NotifySavePoint(bool isSavePoint); - void NotifyModifyAttempt(); - virtual void NotifyDoubleClick(Point pt, int modifiers); - virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt); -- void NotifyHotSpotClicked(int position, int modifiers); -- void NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt); -- void NotifyHotSpotDoubleClicked(int position, int modifiers); -- void NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt); -- void NotifyHotSpotReleaseClick(int position, int modifiers); -- void NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool alt); -+ void NotifyHotSpotClicked(Sci::Position position, int modifiers); -+ void NotifyHotSpotClicked(Sci::Position position, bool shift, bool ctrl, bool alt); -+ void NotifyHotSpotDoubleClicked(Sci::Position position, int modifiers); -+ void NotifyHotSpotDoubleClicked(Sci::Position position, bool shift, bool ctrl, bool alt); -+ void NotifyHotSpotReleaseClick(Sci::Position position, int modifiers); -+ void NotifyHotSpotReleaseClick(Sci::Position position, bool shift, bool ctrl, bool alt); - bool NotifyUpdateUI(); - void NotifyPainted(); -- void NotifyIndicatorClick(bool click, int position, int modifiers); -- void NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt); -+ void NotifyIndicatorClick(bool click, Sci::Position position, int modifiers); -+ void NotifyIndicatorClick(bool click, Sci::Position position, bool shift, bool ctrl, bool alt); - bool NotifyMarginClick(Point pt, int modifiers); - bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt); - bool NotifyMarginRightClick(Point pt, int modifiers); -- void NotifyNeedShown(int pos, int len); -+ void NotifyNeedShown(Sci::Position pos, Sci::Position len); - void NotifyDwelling(Point pt, bool state); - void NotifyZoom(); - -@@ -449,7 +449,7 @@ - void CheckModificationForWrap(DocModification mh); - void NotifyModified(Document *document, DocModification mh, void *userData); - void NotifyDeleted(Document *document, void *userData); -- void NotifyStyleNeeded(Document *doc, void *userData, int endPos); -+ void NotifyStyleNeeded(Document *doc, void *userData, Sci::Position endPos); - void NotifyLexerChanged(Document *doc, void *userData); - void NotifyErrorOccurred(Document *doc, void *userData, int status); - void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam); -@@ -466,11 +466,11 @@ - SelectionPosition PositionUpOrDown(SelectionPosition spStart, int direction, int lastX); - void CursorUpOrDown(int direction, Selection::selTypes selt); - void ParaUpOrDown(int direction, Selection::selTypes selt); -- Range RangeDisplayLine(int lineVisible); -- int StartEndDisplayLine(int pos, bool start); -- int VCHomeDisplayPosition(int position); -- int VCHomeWrapPosition(int position); -- int LineEndWrapPosition(int position); -+ Range RangeDisplayLine(Sci::Line lineVisible); -+ Sci::Position StartEndDisplayLine(Sci::Position pos, bool start); -+ Sci::Position VCHomeDisplayPosition(Sci::Position position); -+ Sci::Position VCHomeWrapPosition(Sci::Position position); -+ Sci::Position LineEndWrapPosition(Sci::Position position); - int HorizontalMove(unsigned int iMessage); - int DelWordOrLine(unsigned int iMessage); - virtual int KeyCommand(unsigned int iMessage); -@@ -484,13 +484,13 @@ - long FindText(uptr_t wParam, sptr_t lParam); - void SearchAnchor(); - long SearchText(unsigned int iMessage, uptr_t wParam, sptr_t lParam); -- long SearchInTarget(const char *text, int length); -- void GoToLine(int lineNo); -+ long SearchInTarget(const char *text, Sci::Position length); -+ void GoToLine(Sci::Line lineNo); - - virtual void CopyToClipboard(const SelectionText &selectedText) = 0; -- std::string RangeText(int start, int end) const; -+ std::string RangeText(Sci::Position start, Sci::Position end) const; - void CopySelectionRange(SelectionText *ss, bool allowLineCopy=false); -- void CopyRangeToClipboard(int start, int end); -+ void CopyRangeToClipboard(Sci::Position start, Sci::Position end); - void CopyText(int length, const char *text); - void SetDragPosition(SelectionPosition newPos); - virtual void DisplayCursor(Window::Cursor c); -@@ -499,13 +499,13 @@ - void DropAt(SelectionPosition position, const char *value, size_t lengthValue, bool moving, bool rectangular); - void DropAt(SelectionPosition position, const char *value, bool moving, bool rectangular); - /** PositionInSelection returns true if position in selection. */ -- bool PositionInSelection(int pos); -+ bool PositionInSelection(Sci::Position pos); - bool PointInSelection(Point pt); - bool PointInSelMargin(Point pt) const; - Window::Cursor GetMarginCursor(Point pt) const; -- void TrimAndSetSelection(int currentPos_, int anchor_); -- void LineSelection(int lineCurrentPos_, int lineAnchorPos_, bool wholeLine); -- void WordSelection(int pos); -+ void TrimAndSetSelection(Sci::Position currentPos_, Sci::Position anchor_); -+ void LineSelection(Sci::Position lineCurrentPos_, Sci::Position lineAnchorPos_, bool wholeLine); -+ void WordSelection(Sci::Position pos); - void DwellEnd(bool mouseMoved); - void MouseLeave(); - virtual void ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); -@@ -529,49 +529,49 @@ - virtual bool HaveMouseCapture() = 0; - void SetFocusState(bool focusState); - -- int PositionAfterArea(PRectangle rcArea) const; -- void StyleToPositionInView(Position pos); -- int PositionAfterMaxStyling(int posMax, bool scrolling) const; -+ Sci::Position PositionAfterArea(PRectangle rcArea) const; -+ void StyleToPositionInView(Sci::Position pos); -+ Sci::Position PositionAfterMaxStyling(Sci::Position posMax, bool scrolling) const; - void StartIdleStyling(bool truncatedLastStyling); - void StyleAreaBounded(PRectangle rcArea, bool scrolling); - void IdleStyling(); - virtual void IdleWork(); -- virtual void QueueIdleWork(WorkNeeded::workItems items, int upTo=0); -+ virtual void QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo=0); - - virtual bool PaintContains(PRectangle rc); - bool PaintContainsMargin(); - void CheckForChangeOutsidePaint(Range r); -- void SetBraceHighlight(Position pos0, Position pos1, int matchStyle); -+ void SetBraceHighlight(Sci::Position pos0, Sci::Position pos1, int matchStyle); - -- void SetAnnotationHeights(int start, int end); -+ void SetAnnotationHeights(Sci::Line start, Sci::Line end); - virtual void SetDocPointer(Document *document); - - void SetAnnotationVisible(int visible); - -- int ExpandLine(int line); -- void SetFoldExpanded(int lineDoc, bool expanded); -- void FoldLine(int line, int action); -- void FoldExpand(int line, int action, int level); -- int ContractedFoldNext(int lineStart) const; -- void EnsureLineVisible(int lineDoc, bool enforcePolicy); -- void FoldChanged(int line, int levelNow, int levelPrev); -- void NeedShown(int pos, int len); -+ Sci::Line ExpandLine(Sci::Line line); -+ void SetFoldExpanded(Sci::Line lineDoc, bool expanded); -+ void FoldLine(Sci::Line line, int action); -+ void FoldExpand(Sci::Line line, int action, int level); -+ Sci::Line ContractedFoldNext(Sci::Line lineStart) const; -+ void EnsureLineVisible(Sci::Line lineDoc, bool enforcePolicy); -+ void FoldChanged(Sci::Line line, int levelNow, int levelPrev); -+ void NeedShown(Sci::Position pos, Sci::Position len); - void FoldAll(int action); - -- int GetTag(char *tagValue, int tagNumber); -- int ReplaceTarget(bool replacePatterns, const char *text, int length=-1); -+ Sci::Position GetTag(char *tagValue, int tagNumber); -+ Sci::Position ReplaceTarget(bool replacePatterns, const char *text, Sci::Position length=-1); - -- bool PositionIsHotspot(int position) const; -+ bool PositionIsHotspot(Sci::Position position) const; - bool PointIsHotspot(Point pt); - void SetHotSpotRange(Point *pt); - Range GetHotSpotRange() const; -- void SetHoverIndicatorPosition(int position); -+ void SetHoverIndicatorPosition(Sci::Position position); - void SetHoverIndicatorPoint(Point pt); - - int CodePage() const; - virtual bool ValidCodePage(int /* codePage */) const { return true; } - int WrapCount(int line); -- void AddStyledText(char *buffer, int appendLength); -+ void AddStyledText(char *buffer, Sci::Position appendLength); - - virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; - bool ValidMargin(uptr_t wParam) const; -diff -r 1788f6795302 -r a0f26eaf474d src/MarginView.cxx ---- a/src/MarginView.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/MarginView.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -183,7 +183,7 @@ - return markerCheck; - } - --void MarginView::PaintMargin(Surface *surface, int topLine, PRectangle rc, PRectangle rcMargin, -+void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, PRectangle rcMargin, - const EditModel &model, const ViewStyle &vs) { - - PRectangle rcSelMargin = rcMargin; -@@ -230,8 +230,8 @@ - } - - const int lineStartPaint = static_cast<int>(rcMargin.top + ptOrigin.y) / vs.lineHeight; -- int visibleLine = model.TopLineOfMain() + lineStartPaint; -- int yposScreen = lineStartPaint * vs.lineHeight - static_cast<int>(ptOrigin.y); -+ Sci::Line visibleLine = model.TopLineOfMain() + lineStartPaint; -+ Sci::Position yposScreen = lineStartPaint * vs.lineHeight - static_cast<Sci::Position>(ptOrigin.y); - // Work out whether the top line is whitespace located after a - // lessening of fold level which implies a 'fold tail' but which should not - // be displayed until the last of a sequence of whitespace. -@@ -239,7 +239,7 @@ - if (vs.ms[margin].mask & SC_MASK_FOLDERS) { - int level = model.pdoc->GetLevel(model.cs.DocFromDisplay(visibleLine)); - if (level & SC_FOLDLEVELWHITEFLAG) { -- int lineBack = model.cs.DocFromDisplay(visibleLine); -+ Sci::Line lineBack = model.cs.DocFromDisplay(visibleLine); - int levelPrev = level; - while ((lineBack > 0) && (levelPrev & SC_FOLDLEVELWHITEFLAG)) { - lineBack--; -@@ -251,7 +251,7 @@ - } - } - if (highlightDelimiter.isEnabled) { -- int lastLine = model.cs.DocFromDisplay(topLine + model.LinesOnScreen()) + 1; -+ Sci::Line lastLine = model.cs.DocFromDisplay(topLine + model.LinesOnScreen()) + 1; - model.pdoc->GetHighlightDelimiters(highlightDelimiter, model.pdoc->LineFromPosition(model.sel.MainCaret()), lastLine); - } - } -@@ -265,10 +265,10 @@ - while ((visibleLine < model.cs.LinesDisplayed()) && yposScreen < rc.bottom) { - - PLATFORM_ASSERT(visibleLine < model.cs.LinesDisplayed()); -- const int lineDoc = model.cs.DocFromDisplay(visibleLine); -+ const Sci::Line lineDoc = model.cs.DocFromDisplay(visibleLine); - PLATFORM_ASSERT(model.cs.GetVisible(lineDoc)); -- const int firstVisibleLine = model.cs.DisplayFromDoc(lineDoc); -- const int lastVisibleLine = model.cs.DisplayLastFromDoc(lineDoc); -+ const Sci::Line firstVisibleLine = model.cs.DisplayFromDoc(lineDoc); -+ const Sci::Line lastVisibleLine = model.cs.DisplayLastFromDoc(lineDoc); - const bool firstSubLine = visibleLine == firstVisibleLine; - const bool lastSubLine = visibleLine == lastVisibleLine; - -@@ -313,7 +313,7 @@ - } - } - needWhiteClosure = false; -- const int firstFollowupLine = model.cs.DocFromDisplay(model.cs.DisplayFromDoc(lineDoc + 1)); -+ const Sci::Line firstFollowupLine = model.cs.DocFromDisplay(model.cs.DisplayFromDoc(lineDoc + 1)); - const int firstFollowupLineLevel = model.pdoc->GetLevel(firstFollowupLine); - const int secondFollowupLineLevelNum = LevelNumber(model.pdoc->GetLevel(firstFollowupLine + 1)); - if (!model.cs.GetExpanded(lineDoc)) { -diff -r 1788f6795302 -r a0f26eaf474d src/MarginView.h ---- a/src/MarginView.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/MarginView.h Fri Mar 31 18:19:38 2017 +1100 -@@ -39,7 +39,7 @@ - void DropGraphics(bool freeObjects); - void AllocateGraphics(const ViewStyle &vsDraw); - void RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw); -- void PaintMargin(Surface *surface, int topLine, PRectangle rc, PRectangle rcMargin, -+ void PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, PRectangle rcMargin, - const EditModel &model, const ViewStyle &vs); - }; - -diff -r 1788f6795302 -r a0f26eaf474d src/PerLine.cxx ---- a/src/PerLine.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/PerLine.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -131,13 +131,13 @@ - markers.DeleteAll(); - } - --void LineMarkers::InsertLine(int line) { -+void LineMarkers::InsertLine(Sci::Line line) { - if (markers.Length()) { - markers.Insert(line, 0); - } - } - --void LineMarkers::RemoveLine(int line) { -+void LineMarkers::RemoveLine(Sci::Line line) { - // Retain the markers from the deleted line by oring them into the previous line - if (markers.Length()) { - if (line > 0) { -@@ -147,9 +147,9 @@ - } - } - --int LineMarkers::LineFromHandle(int markerHandle) { -+Sci::Line LineMarkers::LineFromHandle(int markerHandle) { - if (markers.Length()) { -- for (int line = 0; line < markers.Length(); line++) { -+ for (Sci::Line line = 0; line < markers.Length(); line++) { - if (markers[line]) { - if (markers[line]->Contains(markerHandle)) { - return line; -@@ -160,28 +160,28 @@ - return -1; - } - --void LineMarkers::MergeMarkers(int pos) { -- if (markers[pos + 1] != NULL) { -- if (markers[pos] == NULL) -- markers[pos] = new MarkerHandleSet; -- markers[pos]->CombineWith(markers[pos + 1]); -- delete markers[pos + 1]; -- markers[pos + 1] = NULL; -+void LineMarkers::MergeMarkers(Sci::Line line) { -+ if (markers[line + 1] != NULL) { -+ if (markers[line] == NULL) -+ markers[line] = new MarkerHandleSet; -+ markers[line]->CombineWith(markers[line + 1]); -+ delete markers[line + 1]; -+ markers[line + 1] = NULL; - } - } - --int LineMarkers::MarkValue(int line) { -+int LineMarkers::MarkValue(Sci::Line line) { - if (markers.Length() && (line >= 0) && (line < markers.Length()) && markers[line]) - return markers[line]->MarkValue(); - else - return 0; - } - --int LineMarkers::MarkerNext(int lineStart, int mask) const { -+Sci::Line LineMarkers::MarkerNext(Sci::Line lineStart, int mask) const { - if (lineStart < 0) - lineStart = 0; -- int length = markers.Length(); -- for (int iLine = lineStart; iLine < length; iLine++) { -+ Sci::Line length = markers.Length(); -+ for (Sci::Line iLine = lineStart; iLine < length; iLine++) { - MarkerHandleSet *onLine = markers[iLine]; - if (onLine && ((onLine->MarkValue() & mask) != 0)) - //if ((pdoc->GetMark(iLine) & lParam) != 0) -@@ -190,7 +190,7 @@ - return -1; - } - --int LineMarkers::AddMark(int line, int markerNum, int lines) { -+int LineMarkers::AddMark(Sci::Line line, int markerNum, Sci::Line lines) { - handleCurrent++; - if (!markers.Length()) { - // No existing markers so allocate one element per line -@@ -208,7 +208,7 @@ - return handleCurrent; - } - --bool LineMarkers::DeleteMark(int line, int markerNum, bool all) { -+bool LineMarkers::DeleteMark(Sci::Line line, int markerNum, bool all) { - bool someChanges = false; - if (markers.Length() && (line >= 0) && (line < markers.Length()) && markers[line]) { - if (markerNum == -1) { -@@ -227,7 +227,7 @@ - } - - void LineMarkers::DeleteMarkFromHandle(int markerHandle) { -- int line = LineFromHandle(markerHandle); -+ Sci::Line line = LineFromHandle(markerHandle); - if (line >= 0) { - markers[line]->RemoveHandle(markerHandle); - if (markers[line]->Length() == 0) { -@@ -244,14 +244,14 @@ - levels.DeleteAll(); - } - --void LineLevels::InsertLine(int line) { -+void LineLevels::InsertLine(Sci::Line line) { - if (levels.Length()) { - int level = (line < levels.Length()) ? levels[line] : SC_FOLDLEVELBASE; - levels.InsertValue(line, 1, level); - } - } - --void LineLevels::RemoveLine(int line) { -+void LineLevels::RemoveLine(Sci::Line line) { - if (levels.Length()) { - // Move up following lines but merge header flag from this line - // to line before to avoid a temporary disappearence causing expansion. -@@ -264,7 +264,7 @@ - } - } - --void LineLevels::ExpandLevels(int sizeNew) { -+void LineLevels::ExpandLevels(Sci::Line sizeNew) { - levels.InsertValue(levels.Length(), sizeNew - levels.Length(), SC_FOLDLEVELBASE); - } - -@@ -272,7 +272,7 @@ - levels.DeleteAll(); - } - --int LineLevels::SetLevel(int line, int level, int lines) { -+int LineLevels::SetLevel(Sci::Line line, int level, Sci::Line lines) { - int prev = 0; - if ((line >= 0) && (line < lines)) { - if (!levels.Length()) { -@@ -286,7 +286,7 @@ - return prev; - } - --int LineLevels::GetLevel(int line) const { -+int LineLevels::GetLevel(Sci::Line line) const { - if (levels.Length() && (line >= 0) && (line < levels.Length())) { - return levels[line]; - } else { -@@ -301,7 +301,7 @@ - lineStates.DeleteAll(); - } - --void LineState::InsertLine(int line) { -+void LineState::InsertLine(Sci::Line line) { - if (lineStates.Length()) { - lineStates.EnsureLength(line); - int val = (line < lineStates.Length()) ? lineStates[line] : 0; -@@ -309,27 +309,27 @@ - } - } - --void LineState::RemoveLine(int line) { -+void LineState::RemoveLine(Sci::Line line) { - if (lineStates.Length() > line) { - lineStates.Delete(line); - } - } - --int LineState::SetLineState(int line, int state) { -+int LineState::SetLineState(Sci::Line line, int state) { - lineStates.EnsureLength(line + 1); - int stateOld = lineStates[line]; - lineStates[line] = state; - return stateOld; - } - --int LineState::GetLineState(int line) { -+int LineState::GetLineState(Sci::Line line) { - if (line < 0) - return 0; - lineStates.EnsureLength(line + 1); - return lineStates[line]; - } - --int LineState::GetMaxLineState() const { -+Sci::Line LineState::GetMaxLineState() const { - return lineStates.Length(); - } - -@@ -366,42 +366,42 @@ - ClearAll(); - } - --void LineAnnotation::InsertLine(int line) { -+void LineAnnotation::InsertLine(Sci::Line line) { - if (annotations.Length()) { - annotations.EnsureLength(line); - annotations.Insert(line, 0); - } - } - --void LineAnnotation::RemoveLine(int line) { -+void LineAnnotation::RemoveLine(Sci::Line line) { - if (annotations.Length() && (line > 0) && (line <= annotations.Length())) { - delete []annotations[line-1]; - annotations.Delete(line-1); - } - } - --bool LineAnnotation::MultipleStyles(int line) const { -+bool LineAnnotation::MultipleStyles(Sci::Line line) const { - if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line]) - return reinterpret_cast<AnnotationHeader *>(annotations[line])->style == IndividualStyles; - else - return 0; - } - --int LineAnnotation::Style(int line) const { -+int LineAnnotation::Style(Sci::Line line) const { - if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line]) - return reinterpret_cast<AnnotationHeader *>(annotations[line])->style; - else - return 0; - } - --const char *LineAnnotation::Text(int line) const { -+const char *LineAnnotation::Text(Sci::Line line) const { - if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line]) - return annotations[line]+sizeof(AnnotationHeader); - else - return 0; - } - --const unsigned char *LineAnnotation::Styles(int line) const { -+const unsigned char *LineAnnotation::Styles(Sci::Line line) const { - if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line] && MultipleStyles(line)) - return reinterpret_cast<unsigned char *>(annotations[line] + sizeof(AnnotationHeader) + Length(line)); - else -@@ -414,7 +414,7 @@ - return ret; - } - --void LineAnnotation::SetText(int line, const char *text) { -+void LineAnnotation::SetText(Sci::Line line, const char *text) { - if (text && (line >= 0)) { - annotations.EnsureLength(line+1); - int style = Style(line); -@@ -443,7 +443,7 @@ - annotations.DeleteAll(); - } - --void LineAnnotation::SetStyle(int line, int style) { -+void LineAnnotation::SetStyle(Sci::Line line, int style) { - annotations.EnsureLength(line+1); - if (!annotations[line]) { - annotations[line] = AllocateAnnotation(0, style); -@@ -451,7 +451,7 @@ - reinterpret_cast<AnnotationHeader *>(annotations[line])->style = static_cast<short>(style); - } - --void LineAnnotation::SetStyles(int line, const unsigned char *styles) { -+void LineAnnotation::SetStyles(Sci::Line line, const unsigned char *styles) { - if (line >= 0) { - annotations.EnsureLength(line+1); - if (!annotations[line]) { -@@ -474,14 +474,14 @@ - } - } - --int LineAnnotation::Length(int line) const { -+int LineAnnotation::Length(Sci::Line line) const { - if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line]) - return reinterpret_cast<AnnotationHeader *>(annotations[line])->length; - else - return 0; - } - --int LineAnnotation::Lines(int line) const { -+int LineAnnotation::Lines(Sci::Line line) const { - if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line]) - return reinterpret_cast<AnnotationHeader *>(annotations[line])->lines; - else -@@ -499,21 +499,21 @@ - tabstops.DeleteAll(); - } - --void LineTabstops::InsertLine(int line) { -+void LineTabstops::InsertLine(Sci::Line line) { - if (tabstops.Length()) { - tabstops.EnsureLength(line); - tabstops.Insert(line, 0); - } - } - --void LineTabstops::RemoveLine(int line) { -+void LineTabstops::RemoveLine(Sci::Line line) { - if (tabstops.Length() > line) { - delete tabstops[line]; - tabstops.Delete(line); - } - } - --bool LineTabstops::ClearTabstops(int line) { -+bool LineTabstops::ClearTabstops(Sci::Line line) { - if (line < tabstops.Length()) { - TabstopList *tl = tabstops[line]; - if (tl) { -@@ -524,7 +524,7 @@ - return false; - } - --bool LineTabstops::AddTabstop(int line, int x) { -+bool LineTabstops::AddTabstop(Sci::Line line, int x) { - tabstops.EnsureLength(line + 1); - if (!tabstops[line]) { - tabstops[line] = new TabstopList(); -@@ -543,7 +543,7 @@ - return false; - } - --int LineTabstops::GetNextTabstop(int line, int x) const { -+int LineTabstops::GetNextTabstop(Sci::Line line, int x) const { - if (line < tabstops.Length()) { - TabstopList *tl = tabstops[line]; - if (tl) { -diff -r 1788f6795302 -r a0f26eaf474d src/PerLine.h ---- a/src/PerLine.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/PerLine.h Fri Mar 31 18:19:38 2017 +1100 -@@ -49,16 +49,16 @@ - } - virtual ~LineMarkers(); - virtual void Init(); -- virtual void InsertLine(int line); -- virtual void RemoveLine(int line); -+ virtual void InsertLine(Sci::Line line); -+ virtual void RemoveLine(Sci::Line line); - -- int MarkValue(int line); -- int MarkerNext(int lineStart, int mask) const; -- int AddMark(int line, int marker, int lines); -- void MergeMarkers(int pos); -- bool DeleteMark(int line, int markerNum, bool all); -+ int MarkValue(Sci::Line line); -+ Sci::Line MarkerNext(Sci::Line lineStart, int mask) const; -+ int AddMark(Sci::Line line, int marker, Sci::Line lines); -+ void MergeMarkers(Sci::Line line); -+ bool DeleteMark(Sci::Line line, int markerNum, bool all); - void DeleteMarkFromHandle(int markerHandle); -- int LineFromHandle(int markerHandle); -+ Sci::Line LineFromHandle(int markerHandle); - }; - - class LineLevels : public PerLine { -@@ -66,13 +66,13 @@ - public: - virtual ~LineLevels(); - virtual void Init(); -- virtual void InsertLine(int line); -- virtual void RemoveLine(int line); -+ virtual void InsertLine(Sci::Line line); -+ virtual void RemoveLine(Sci::Line line); - -- void ExpandLevels(int sizeNew=-1); -+ void ExpandLevels(Sci::Line sizeNew=-1); - void ClearLevels(); -- int SetLevel(int line, int level, int lines); -- int GetLevel(int line) const; -+ int SetLevel(Sci::Line line, int level, Sci::Line lines); -+ int GetLevel(Sci::Line line) const; - }; - - class LineState : public PerLine { -@@ -82,12 +82,12 @@ - } - virtual ~LineState(); - virtual void Init(); -- virtual void InsertLine(int line); -- virtual void RemoveLine(int line); -+ virtual void InsertLine(Sci::Line line); -+ virtual void RemoveLine(Sci::Line line); - -- int SetLineState(int line, int state); -- int GetLineState(int line); -- int GetMaxLineState() const; -+ int SetLineState(Sci::Line line, int state); -+ int GetLineState(Sci::Line line); -+ Sci::Line GetMaxLineState() const; - }; - - class LineAnnotation : public PerLine { -@@ -97,19 +97,19 @@ - } - virtual ~LineAnnotation(); - virtual void Init(); -- virtual void InsertLine(int line); -- virtual void RemoveLine(int line); -+ virtual void InsertLine(Sci::Line line); -+ virtual void RemoveLine(Sci::Line line); - -- bool MultipleStyles(int line) const; -- int Style(int line) const; -- const char *Text(int line) const; -- const unsigned char *Styles(int line) const; -- void SetText(int line, const char *text); -+ bool MultipleStyles(Sci::Line line) const; -+ int Style(Sci::Line line) const; -+ const char *Text(Sci::Line line) const; -+ const unsigned char *Styles(Sci::Line line) const; -+ void SetText(Sci::Line line, const char *text); - void ClearAll(); -- void SetStyle(int line, int style); -- void SetStyles(int line, const unsigned char *styles); -- int Length(int line) const; -- int Lines(int line) const; -+ void SetStyle(Sci::Line line, int style); -+ void SetStyles(Sci::Line line, const unsigned char *styles); -+ int Length(Sci::Line line) const; -+ int Lines(Sci::Line line) const; - }; - - typedef std::vector<int> TabstopList; -@@ -121,12 +121,12 @@ - } - virtual ~LineTabstops(); - virtual void Init(); -- virtual void InsertLine(int line); -- virtual void RemoveLine(int line); -+ virtual void InsertLine(Sci::Line line); -+ virtual void RemoveLine(Sci::Line line); - -- bool ClearTabstops(int line); -- bool AddTabstop(int line, int x); -- int GetNextTabstop(int line, int x) const; -+ bool ClearTabstops(Sci::Line line); -+ bool AddTabstop(Sci::Line line, int x); -+ int GetNextTabstop(Sci::Line line, int x) const; - }; - - #ifdef SCI_NAMESPACE -diff -r 1788f6795302 -r a0f26eaf474d src/Position.h ---- a/src/Position.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/Position.h Fri Mar 31 18:19:38 2017 +1100 -@@ -16,6 +16,7 @@ - namespace Sci { - - typedef int Position; -+typedef int Line; - - // A later version (4.x) of this file may: - //#if defined(SCI_LARGE_FILE_SUPPORT) -diff -r 1788f6795302 -r a0f26eaf474d src/PositionCache.cxx ---- a/src/PositionCache.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/PositionCache.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -149,7 +149,7 @@ - lineStarts[line] = start; - } - --void LineLayout::SetBracesHighlight(Range rangeLine, const Position braces[], -+void LineLayout::SetBracesHighlight(Range rangeLine, const Sci::Position braces[], - char bracesMatchStyle, int xHighlight, bool ignoreStyle) { - if (!ignoreStyle && rangeLine.ContainsCharacter(braces[0])) { - int braceOffset = braces[0] - rangeLine.start; -@@ -171,7 +171,7 @@ - } - } - --void LineLayout::RestoreBracesHighlight(Range rangeLine, const Position braces[], bool ignoreStyle) { -+void LineLayout::RestoreBracesHighlight(Range rangeLine, const Sci::Position braces[], bool ignoreStyle) { - if (!ignoreStyle && rangeLine.ContainsCharacter(braces[0])) { - int braceOffset = braces[0] - rangeLine.start; - if (braceOffset < numCharsInLine) { -@@ -267,7 +267,7 @@ - cache.resize(length_); - } - --void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) { -+void LineLayoutCache::AllocateForLevel(Sci::Line linesOnScreen, Sci::Line linesInDoc) { - PLATFORM_ASSERT(useCount == 0); - size_t lengthForLevel = 0; - if (level == llcCaret) { -@@ -320,15 +320,15 @@ - } - } - --LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_, -- int linesOnScreen, int linesInDoc) { -+LineLayout *LineLayoutCache::Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, int maxChars, int styleClock_, -+ Sci::Line linesOnScreen, Sci::Line linesInDoc) { - AllocateForLevel(linesOnScreen, linesInDoc); - if (styleClock != styleClock_) { - Invalidate(LineLayout::llCheckTextAndStyle); - styleClock = styleClock_; - } - allInvalidated = false; -- int pos = -1; -+ Sci::Position pos = -1; - LineLayout *ret = 0; - if (level == llcCaret) { - pos = 0; -@@ -447,7 +447,7 @@ - } - } - --BreakFinder::BreakFinder(const LineLayout *ll_, const Selection *psel, Range lineRange_, int posLineStart_, -+BreakFinder::BreakFinder(const LineLayout *ll_, const Selection *psel, Range lineRange_, Sci::Position posLineStart_, - int xStart, bool breakForSelection, const Document *pdoc_, const SpecialRepresentations *preprs_, const ViewStyle *pvsDraw) : - ll(ll_), - lineRange(lineRange_), -@@ -486,7 +486,7 @@ - if (pvsDraw && pvsDraw->indicatorsSetFore > 0) { - for (Decoration *deco = pdoc->decorations.root; deco; deco = deco->next) { - if (pvsDraw->indicators[deco->indicator].OverridesTextFore()) { -- int startPos = deco->rs.EndRun(posLineStart); -+ Sci::Position startPos = deco->rs.EndRun(posLineStart); - while (startPos < (posLineStart + lineRange.end)) { - Insert(startPos - posLineStart); - startPos = deco->rs.EndRun(startPos); -diff -r 1788f6795302 -r a0f26eaf474d src/PositionCache.h ---- a/src/PositionCache.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/PositionCache.h Fri Mar 31 18:19:38 2017 +1100 -@@ -50,7 +50,7 @@ - int *lineStarts; - int lenLineStarts; - /// Drawing is only performed for @a maxLineLength characters on each line. -- int lineNumber; -+ Sci::Line lineNumber; - bool inCache; - public: - enum { wrapWidthInfinite = 0x7ffffff }; -@@ -86,9 +86,9 @@ - Range SubLineRange(int line) const; - bool InLine(int offset, int line) const; - void SetLineStart(int line, int start); -- void SetBracesHighlight(Range rangeLine, const Position braces[], -+ void SetBracesHighlight(Range rangeLine, const Sci::Position braces[], - char bracesMatchStyle, int xHighlight, bool ignoreStyle); -- void RestoreBracesHighlight(Range rangeLine, const Position braces[], bool ignoreStyle); -+ void RestoreBracesHighlight(Range rangeLine, const Sci::Position braces[], bool ignoreStyle); - int FindBefore(XYPOSITION x, int lower, int upper) const; - int FindPositionFromX(XYPOSITION x, Range range, bool charPosition) const; - Point PointFromPosition(int posInLine, int lineHeight, PointEnd pe) const; -@@ -104,7 +104,7 @@ - int styleClock; - int useCount; - void Allocate(size_t length_); -- void AllocateForLevel(int linesOnScreen, int linesInDoc); -+ void AllocateForLevel(Sci::Line linesOnScreen, Sci::Line linesInDoc); - public: - LineLayoutCache(); - virtual ~LineLayoutCache(); -@@ -118,8 +118,8 @@ - void Invalidate(LineLayout::validLevel validity_); - void SetLevel(int level_); - int GetLevel() const { return level; } -- LineLayout *Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_, -- int linesOnScreen, int linesInDoc); -+ LineLayout *Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, int maxChars, int styleClock_, -+ Sci::Line linesOnScreen, Sci::Line linesInDoc); - void Dispose(LineLayout *ll); - }; - -@@ -176,7 +176,7 @@ - class BreakFinder { - const LineLayout *ll; - Range lineRange; -- int posLineStart; -+ Sci::Position posLineStart; - int nextBreak; - std::vector<int> selAndEdge; - unsigned int saeCurrentPos; -@@ -194,7 +194,7 @@ - enum { lengthStartSubdivision = 300 }; - // Try to make each subdivided run lengthEachSubdivision or shorter. - enum { lengthEachSubdivision = 100 }; -- BreakFinder(const LineLayout *ll_, const Selection *psel, Range rangeLine_, int posLineStart_, -+ BreakFinder(const LineLayout *ll_, const Selection *psel, Range rangeLine_, Sci::Position posLineStart_, - int xStart, bool breakForSelection, const Document *pdoc_, const SpecialRepresentations *preprs_, const ViewStyle *pvsDraw); - ~BreakFinder(); - TextSegment Next(); -diff -r 1788f6795302 -r a0f26eaf474d src/RESearch.cxx ---- a/src/RESearch.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/RESearch.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -277,9 +277,9 @@ - void RESearch::GrabMatches(CharacterIndexer &ci) { - for (unsigned int i = 0; i < MAXTAG; i++) { - if ((bopat[i] != NOTFOUND) && (eopat[i] != NOTFOUND)) { -- unsigned int len = eopat[i] - bopat[i]; -+ Sci::Position len = eopat[i] - bopat[i]; - pat[i].resize(len); -- for (unsigned int j = 0; j < len; j++) -+ for (Sci::Position j = 0; j < len; j++) - pat[i][j] = ci.CharAt(bopat[i] + j); - } - } -@@ -434,7 +434,7 @@ - return result; - } - --const char *RESearch::Compile(const char *pattern, int length, bool caseSensitive, bool posix) { -+const char *RESearch::Compile(const char *pattern, Sci::Position length, bool caseSensitive, bool posix) { - char *mp=nfa; /* nfa pointer */ - char *lp; /* saved pointer */ - char *sp=nfa; /* another one */ -@@ -755,9 +755,9 @@ - * respectively. - * - */ --int RESearch::Execute(CharacterIndexer &ci, int lp, int endp) { -+int RESearch::Execute(CharacterIndexer &ci, Sci::Position lp, Sci::Position endp) { - unsigned char c; -- int ep = NOTFOUND; -+ Sci::Position ep = NOTFOUND; - char *ap = nfa; - - bol = lp; -@@ -844,13 +844,13 @@ - #define CHRSKIP 3 /* [CLO] CHR chr END */ - #define CCLSKIP 34 /* [CLO] CCL 32 bytes END */ - --int RESearch::PMatch(CharacterIndexer &ci, int lp, int endp, char *ap) { -+Sci::Position RESearch::PMatch(CharacterIndexer &ci, Sci::Position lp, Sci::Position endp, char *ap) { - int op, c, n; -- int e; /* extra pointer for CLO */ -- int bp; /* beginning of subpat... */ -- int ep; /* ending of subpat... */ -- int are; /* to save the line ptr. */ -- int llp; /* lazy lp for LCLO */ -+ Sci::Position e; /* extra pointer for CLO */ -+ Sci::Position bp; /* beginning of subpat... */ -+ Sci::Position ep; /* ending of subpat... */ -+ Sci::Position are; /* to save the line ptr. */ -+ Sci::Position llp; /* lazy lp for LCLO */ - - while ((op = *ap++) != END) - switch (op) { -@@ -940,7 +940,7 @@ - llp = lp; - e = NOTFOUND; - while (llp >= are) { -- int q; -+ Sci::Position q; - if ((q = PMatch(ci, llp, endp, ap)) != NOTFOUND) { - e = q; - lp = llp; -diff -r 1788f6795302 -r a0f26eaf474d src/RESearch.h ---- a/src/RESearch.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/RESearch.h Fri Mar 31 18:19:38 2017 +1100 -@@ -23,7 +23,7 @@ - - class CharacterIndexer { - public: -- virtual char CharAt(int index)=0; -+ virtual char CharAt(Sci::Position index)=0; - virtual ~CharacterIndexer() { - } - }; -@@ -35,15 +35,15 @@ - ~RESearch(); - void Clear(); - void GrabMatches(CharacterIndexer &ci); -- const char *Compile(const char *pattern, int length, bool caseSensitive, bool posix); -- int Execute(CharacterIndexer &ci, int lp, int endp); -+ const char *Compile(const char *pattern, Sci::Position length, bool caseSensitive, bool posix); -+ int Execute(CharacterIndexer &ci, Sci::Position lp, Sci::Position endp); - - enum { MAXTAG=10 }; - enum { MAXNFA=4096 }; - enum { NOTFOUND=-1 }; - -- int bopat[MAXTAG]; -- int eopat[MAXTAG]; -+ Sci::Position bopat[MAXTAG]; -+ Sci::Position eopat[MAXTAG]; - std::string pat[MAXTAG]; - - private: -@@ -51,10 +51,10 @@ - void ChSetWithCase(unsigned char c, bool caseSensitive); - int GetBackslashExpression(const char *pattern, int &incr); - -- int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap); -+ Sci::Position PMatch(CharacterIndexer &ci, Sci::Position lp, Sci::Position endp, char *ap); - -- int bol; -- int tagstk[MAXTAG]; /* subpat tag stack */ -+ Sci::Position bol; -+ Sci::Position tagstk[MAXTAG]; /* subpat tag stack */ - char nfa[MAXNFA]; /* automaton */ - int sta; - unsigned char bittab[BITBLK]; /* bit table for CCL pre-set bits */ -diff -r 1788f6795302 -r a0f26eaf474d src/ScintillaBase.cxx ---- a/src/ScintillaBase.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/ScintillaBase.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -207,24 +207,24 @@ - sci->AutoCompleteCompleted(0, SC_AC_DOUBLECLICK); - } - --void ScintillaBase::AutoCompleteInsert(Position startPos, int removeLen, const char *text, int textLen) { -+void ScintillaBase::AutoCompleteInsert(Sci::Position startPos, int removeLen, const char *text, int textLen) { - UndoGroup ug(pdoc); - if (multiAutoCMode == SC_MULTIAUTOC_ONCE) { - pdoc->DeleteChars(startPos, removeLen); -- const int lengthInserted = pdoc->InsertString(startPos, text, textLen); -+ const Sci::Position lengthInserted = pdoc->InsertString(startPos, text, textLen); - SetEmptySelection(startPos + lengthInserted); - } else { - // SC_MULTIAUTOC_EACH - for (size_t r=0; r<sel.Count(); r++) { - if (!RangeContainsProtected(sel.Range(r).Start().Position(), - sel.Range(r).End().Position())) { -- int positionInsert = sel.Range(r).Start().Position(); -+ Sci::Position positionInsert = sel.Range(r).Start().Position(); - positionInsert = RealizeVirtualSpace(positionInsert, sel.Range(r).caret.VirtualSpace()); - if (positionInsert - removeLen >= 0) { - positionInsert -= removeLen; - pdoc->DeleteChars(positionInsert, removeLen); - } -- const int lengthInserted = pdoc->InsertString(positionInsert, text, textLen); -+ const Sci::Position lengthInserted = pdoc->InsertString(positionInsert, text, textLen); - if (lengthInserted > 0) { - sel.Range(r).caret.SetPosition(positionInsert + lengthInserted); - sel.Range(r).anchor.SetPosition(positionInsert + lengthInserted); -@@ -382,7 +382,7 @@ - scn.listCompletionMethod = completionMethod; - scn.wParam = listType; - scn.listType = listType; -- Position firstPos = ac.posStart - ac.startLen; -+ Sci::Position firstPos = ac.posStart - ac.startLen; - scn.position = firstPos; - scn.lParam = firstPos; - scn.text = selected.c_str(); -@@ -395,7 +395,7 @@ - if (listType > 0) - return; - -- Position endPos = sel.MainCaret(); -+ Sci::Position endPos = sel.MainCaret(); - if (ac.dropRestOfWord) - endPos = pdoc->ExtendWordSelect(endPos, 1, true); - if (endPos < firstPos) -@@ -771,11 +771,11 @@ - - #endif - --void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded) { -+void ScintillaBase::NotifyStyleToNeeded(Sci::Position endStyleNeeded) { - #ifdef SCI_LEXER - if (DocumentLexState()->lexLanguage != SCLEX_CONTAINER) { -- int lineEndStyled = pdoc->LineFromPosition(pdoc->GetEndStyled()); -- int endStyled = pdoc->LineStart(lineEndStyled); -+ Sci::Line lineEndStyled = pdoc->LineFromPosition(pdoc->GetEndStyled()); -+ Sci::Position endStyled = pdoc->LineStart(lineEndStyled); - DocumentLexState()->Colourise(endStyled, endStyleNeeded); - return; - } -@@ -994,10 +994,10 @@ - - case SCI_COLOURISE: - if (DocumentLexState()->lexLanguage == SCLEX_CONTAINER) { -- pdoc->ModifiedAt(static_cast<int>(wParam)); -- NotifyStyleToNeeded((lParam == -1) ? pdoc->Length() : static_cast<int>(lParam)); -+ pdoc->ModifiedAt(static_cast<Sci::Position>(wParam)); -+ NotifyStyleToNeeded((lParam == -1) ? pdoc->Length() : static_cast<Sci::Position>(lParam)); - } else { -- DocumentLexState()->Colourise(static_cast<int>(wParam), static_cast<int>(lParam)); -+ DocumentLexState()->Colourise(static_cast<Sci::Position>(wParam), static_cast<Sci::Position>(lParam)); - } - Redraw(); - break; -diff -r 1788f6795302 -r a0f26eaf474d src/ScintillaBase.h ---- a/src/ScintillaBase.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/ScintillaBase.h Fri Mar 31 18:19:38 2017 +1100 -@@ -67,7 +67,7 @@ - virtual void CancelModes(); - virtual int KeyCommand(unsigned int iMessage); - -- void AutoCompleteInsert(Position startPos, int removeLen, const char *text, int textLen); -+ void AutoCompleteInsert(Sci::Position startPos, int removeLen, const char *text, int textLen); - void AutoCompleteStart(int lenEntered, const char *list); - void AutoCompleteCancel(); - void AutoCompleteMove(int delta); -@@ -91,7 +91,7 @@ - virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); - virtual void RightButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); - -- void NotifyStyleToNeeded(int endStyleNeeded); -+ void NotifyStyleToNeeded(Sci::Position endStyleNeeded); - void NotifyLexerChanged(Document *doc, void *userData); - - public: -diff -r 1788f6795302 -r a0f26eaf474d src/Selection.cxx ---- a/src/Selection.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/Selection.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -22,10 +22,10 @@ - using namespace Scintilla; - #endif - --void SelectionPosition::MoveForInsertDelete(bool insertion, int startChange, int length) { -+void SelectionPosition::MoveForInsertDelete(bool insertion, Sci::Position startChange, Sci::Position length) { - if (insertion) { - if (position == startChange) { -- int virtualLengthRemove = std::min(length, virtualSpace); -+ Sci::Position virtualLengthRemove = std::min(length, virtualSpace); - virtualSpace -= virtualLengthRemove; - position += virtualLengthRemove; - } else if (position > startChange) { -@@ -36,7 +36,7 @@ - virtualSpace = 0; - } - if (position > startChange) { -- int endDeletion = startChange + length; -+ Sci::Position endDeletion = startChange + length; - if (position > endDeletion) { - position -= length; - } else { -@@ -75,7 +75,7 @@ - return *this > other; - } - --int SelectionRange::Length() const { -+Sci::Position SelectionRange::Length() const { - if (anchor > caret) { - return anchor.Position() - caret.Position(); - } else { -@@ -83,12 +83,12 @@ - } - } - --void SelectionRange::MoveForInsertDelete(bool insertion, int startChange, int length) { -+void SelectionRange::MoveForInsertDelete(bool insertion, Sci::Position startChange, Sci::Position length) { - caret.MoveForInsertDelete(insertion, startChange, length); - anchor.MoveForInsertDelete(insertion, startChange, length); - } - --bool SelectionRange::Contains(int pos) const { -+bool SelectionRange::Contains(Sci::Position pos) const { - if (anchor > caret) - return (pos >= caret.Position()) && (pos <= anchor.Position()); - else -@@ -102,7 +102,7 @@ - return (sp >= anchor) && (sp <= caret); - } - --bool SelectionRange::ContainsCharacter(int posCharacter) const { -+bool SelectionRange::ContainsCharacter(Sci::Position posCharacter) const { - if (anchor > caret) - return (posCharacter >= caret.Position()) && (posCharacter < anchor.Position()); - else -@@ -168,7 +168,7 @@ - // If range is all virtual collapse to start of virtual space - void SelectionRange::MinimizeVirtualSpace() { - if (caret.Position() == anchor.Position()) { -- int virtualSpace = caret.VirtualSpace(); -+ Sci::Position virtualSpace = caret.VirtualSpace(); - if (virtualSpace > anchor.VirtualSpace()) - virtualSpace = anchor.VirtualSpace(); - caret.SetVirtualSpace(virtualSpace); -@@ -187,11 +187,11 @@ - return (selType == selRectangle) || (selType == selThin); - } - --int Selection::MainCaret() const { -+Sci::Position Selection::MainCaret() const { - return ranges[mainRange].caret.Position(); - } - --int Selection::MainAnchor() const { -+Sci::Position Selection::MainAnchor() const { - return ranges[mainRange].anchor.Position(); - } - -@@ -284,15 +284,15 @@ - return lastPosition; - } - --int Selection::Length() const { -- int len = 0; -+Sci::Position Selection::Length() const { -+ Sci::Position len = 0; - for (size_t i=0; i<ranges.size(); i++) { - len += ranges[i].Length(); - } - return len; - } - --void Selection::MovePositions(bool insertion, int startChange, int length) { -+void Selection::MovePositions(bool insertion, Sci::Position startChange, Sci::Position length) { - for (size_t i=0; i<ranges.size(); i++) { - ranges[i].MoveForInsertDelete(insertion, startChange, length); - } -@@ -376,7 +376,7 @@ - tentativeMain = false; - } - --int Selection::CharacterInSelection(int posCharacter) const { -+int Selection::CharacterInSelection(Sci::Position posCharacter) const { - for (size_t i=0; i<ranges.size(); i++) { - if (ranges[i].ContainsCharacter(posCharacter)) - return i == mainRange ? 1 : 2; -@@ -384,7 +384,7 @@ - return 0; - } - --int Selection::InSelectionForEOL(int pos) const { -+int Selection::InSelectionForEOL(Sci::Position pos) const { - for (size_t i=0; i<ranges.size(); i++) { - if (!ranges[i].Empty() && (pos > ranges[i].Start().Position()) && (pos <= ranges[i].End().Position())) - return i == mainRange ? 1 : 2; -@@ -392,8 +392,8 @@ - return 0; - } - --int Selection::VirtualSpaceFor(int pos) const { -- int virtualSpace = 0; -+Sci::Position Selection::VirtualSpaceFor(Sci::Position pos) const { -+ Sci::Position virtualSpace = 0; - for (size_t i=0; i<ranges.size(); i++) { - if ((ranges[i].caret.Position() == pos) && (virtualSpace < ranges[i].caret.VirtualSpace())) - virtualSpace = ranges[i].caret.VirtualSpace(); -diff -r 1788f6795302 -r a0f26eaf474d src/Selection.h ---- a/src/Selection.h Thu Mar 30 09:11:48 2017 +1100 -+++ b/src/Selection.h Fri Mar 31 18:19:38 2017 +1100 -@@ -13,10 +13,10 @@ - #endif - - class SelectionPosition { -- int position; -- int virtualSpace; -+ Sci::Position position; -+ Sci::Position virtualSpace; - public: -- explicit SelectionPosition(int position_=INVALID_POSITION, int virtualSpace_=0) : position(position_), virtualSpace(virtualSpace_) { -+ explicit SelectionPosition(Sci::Position position_=INVALID_POSITION, Sci::Position virtualSpace_=0) : position(position_), virtualSpace(virtualSpace_) { - PLATFORM_ASSERT(virtualSpace < 800000); - if (virtualSpace < 0) - virtualSpace = 0; -@@ -25,7 +25,7 @@ - position = 0; - virtualSpace = 0; - } -- void MoveForInsertDelete(bool insertion, int startChange, int length); -+ void MoveForInsertDelete(bool insertion, Sci::Position startChange, Sci::Position length); - bool operator ==(const SelectionPosition &other) const { - return position == other.position && virtualSpace == other.virtualSpace; - } -@@ -33,22 +33,22 @@ - bool operator >(const SelectionPosition &other) const; - bool operator <=(const SelectionPosition &other) const; - bool operator >=(const SelectionPosition &other) const; -- int Position() const { -+ Sci::Position Position() const { - return position; - } -- void SetPosition(int position_) { -+ void SetPosition(Sci::Position position_) { - position = position_; - virtualSpace = 0; - } -- int VirtualSpace() const { -+ Sci::Position VirtualSpace() const { - return virtualSpace; - } -- void SetVirtualSpace(int virtualSpace_) { -+ void SetVirtualSpace(Sci::Position virtualSpace_) { - PLATFORM_ASSERT(virtualSpace_ < 800000); - if (virtualSpace_ >= 0) - virtualSpace = virtualSpace_; - } -- void Add(int increment) { -+ void Add(Sci::Position increment) { - position = position + increment; - } - bool IsValid() const { -@@ -90,17 +90,17 @@ - } - explicit SelectionRange(SelectionPosition single) : caret(single), anchor(single) { - } -- explicit SelectionRange(int single) : caret(single), anchor(single) { -+ explicit SelectionRange(Sci::Position single) : caret(single), anchor(single) { - } - SelectionRange(SelectionPosition caret_, SelectionPosition anchor_) : caret(caret_), anchor(anchor_) { - } -- SelectionRange(int caret_, int anchor_) : caret(caret_), anchor(anchor_) { -+ SelectionRange(Sci::Position caret_, Sci::Position anchor_) : caret(caret_), anchor(anchor_) { - } - bool Empty() const { - return anchor == caret; - } -- int Length() const; -- // int Width() const; // Like Length but takes virtual space into account -+ Sci::Position Length() const; -+ // Sci::Position Width() const; // Like Length but takes virtual space into account - bool operator ==(const SelectionRange &other) const { - return caret == other.caret && anchor == other.anchor; - } -@@ -115,10 +115,10 @@ - anchor.SetVirtualSpace(0); - caret.SetVirtualSpace(0); - } -- void MoveForInsertDelete(bool insertion, int startChange, int length); -- bool Contains(int pos) const; -+ void MoveForInsertDelete(bool insertion, Sci::Position startChange, Sci::Position length); -+ bool Contains(Sci::Position pos) const; - bool Contains(SelectionPosition sp) const; -- bool ContainsCharacter(int posCharacter) const; -+ bool ContainsCharacter(Sci::Position posCharacter) const; - SelectionSegment Intersect(SelectionSegment check) const; - SelectionPosition Start() const { - return (anchor < caret) ? anchor : caret; -@@ -146,8 +146,8 @@ - Selection(); - ~Selection(); - bool IsRectangular() const; -- int MainCaret() const; -- int MainAnchor() const; -+ Sci::Position MainCaret() const; -+ Sci::Position MainAnchor() const; - SelectionRange &Rectangular(); - SelectionSegment Limits() const; - // This is for when you want to move the caret in response to a -@@ -166,8 +166,8 @@ - void SetMoveExtends(bool moveExtends_); - bool Empty() const; - SelectionPosition Last() const; -- int Length() const; -- void MovePositions(bool insertion, int startChange, int length); -+ Sci::Position Length() const; -+ void MovePositions(bool insertion, Sci::Position startChange, Sci::Position length); - void TrimSelection(SelectionRange range); - void TrimOtherSelections(size_t r, SelectionRange range); - void SetSelection(SelectionRange range); -@@ -177,9 +177,9 @@ - void DropAdditionalRanges(); - void TentativeSelection(SelectionRange range); - void CommitTentative(); -- int CharacterInSelection(int posCharacter) const; -- int InSelectionForEOL(int pos) const; -- int VirtualSpaceFor(int pos) const; -+ int CharacterInSelection(Sci::Position posCharacter) const; -+ int InSelectionForEOL(Sci::Position pos) const; -+ Sci::Position VirtualSpaceFor(Sci::Position pos) const; - void Clear(); - void RemoveDuplicates(); - void RotateMain(); -diff -r 1788f6795302 -r a0f26eaf474d win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Thu Mar 30 09:11:48 2017 +1100 -+++ b/win32/ScintillaWin.cxx Fri Mar 31 18:19:38 2017 +1100 -@@ -294,15 +294,15 @@ - - bool DragThreshold(Point ptStart, Point ptNow) override; - void StartDrag() override; -- int TargetAsUTF8(char *text); -+ Sci::Position TargetAsUTF8(char *text); - void AddCharUTF16(wchar_t const *wcs, unsigned int wclen); -- int EncodedFromUTF8(char *utf8, char *encoded) const; -+ Sci::Position EncodedFromUTF8(char *utf8, char *encoded) const; - sptr_t WndPaint(uptr_t wParam); - - sptr_t HandleCompositionWindowed(uptr_t wParam, sptr_t lParam); - sptr_t HandleCompositionInline(uptr_t wParam, sptr_t lParam); - static bool KoreanIME(); -- void MoveImeCarets(int offset); -+ void MoveImeCarets(Sci::Position offset); - void DrawImeIndicator(int indicator, int len); - void SetCandidateWindowPos(); - void SelectionToHangul(); -@@ -323,12 +323,12 @@ - bool HaveMouseCapture() override; - void SetTrackMouseLeaveEvent(bool on); - bool PaintContains(PRectangle rc) override; -- void ScrollText(int linesToMove) override; -+ void ScrollText(Sci::Line linesToMove) override; - void NotifyCaretMove() override; - void UpdateSystemCaret() override; - void SetVerticalScrollPos() override; - void SetHorizontalScrollPos() override; -- bool ModifyScrollBars(int nMax, int nPage) override; -+ bool ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) override; - void NotifyChange() override; - void NotifyFocus(bool focus) override; - void SetCtrlID(int identifier) override; -@@ -361,7 +361,7 @@ - - int SetScrollInfo(int nBar, LPCSCROLLINFO lpsi, BOOL bRedraw); - bool GetScrollInfo(int nBar, LPSCROLLINFO lpsi); -- void ChangeScrollPos(int barType, int pos); -+ void ChangeScrollPos(int barType, Sci::Position pos); - sptr_t GetTextLength(); - sptr_t GetText(uptr_t wParam, sptr_t lParam); - -@@ -618,7 +618,7 @@ - } - } - inDragDrop = ddNone; -- SetDragPosition(SelectionPosition(invalidPosition)); -+ SetDragPosition(SelectionPosition(Sci::invalidPosition)); - } - - // Avoid warnings everywhere for old style casts by concentrating them here -@@ -730,8 +730,8 @@ - - // Returns the target converted to UTF8. - // Return the length in bytes. --int ScintillaWin::TargetAsUTF8(char *text) { -- int targetLength = targetEnd - targetStart; -+Sci::Position ScintillaWin::TargetAsUTF8(char *text) { -+ Sci::Position targetLength = targetEnd - targetStart; - if (IsUnicodeMode()) { - if (text) { - pdoc->GetCharRange(text, targetStart, targetLength); -@@ -752,8 +752,8 @@ - - // Translates a nul terminated UTF8 string into the document encoding. - // Return the length of the result in bytes. --int ScintillaWin::EncodedFromUTF8(char *utf8, char *encoded) const { -- int inputLength = (lengthForEncode >= 0) ? lengthForEncode : static_cast<int>(strlen(utf8)); -+Sci::Position ScintillaWin::EncodedFromUTF8(char *utf8, char *encoded) const { -+ Sci::Position inputLength = (lengthForEncode >= 0) ? lengthForEncode : static_cast<Sci::Position>(strlen(utf8)); - if (IsUnicodeMode()) { - if (encoded) { - memcpy(encoded, utf8, inputLength); -@@ -889,10 +889,10 @@ - return codePage == 949 || codePage == 1361; - } - --void ScintillaWin::MoveImeCarets(int offset) { -+void ScintillaWin::MoveImeCarets(Sci::Position offset) { - // Move carets relatively by bytes. - for (size_t r=0; r<sel.Count(); r++) { -- int positionInsert = sel.Range(r).Start().Position(); -+ Sci::Position positionInsert = sel.Range(r).Start().Position(); - sel.Range(r).caret.SetPosition(positionInsert + offset); - sel.Range(r).anchor.SetPosition(positionInsert + offset); - } -@@ -908,7 +908,7 @@ - } - pdoc->decorations.SetCurrentIndicator(indicator); - for (size_t r=0; r<sel.Count(); r++) { -- int positionInsert = sel.Range(r).Start().Position(); -+ Sci::Position positionInsert = sel.Range(r).Start().Position(); - pdoc->DecorationFillRange(positionInsert - len, 1, len); - } - } -@@ -928,10 +928,10 @@ - - void ScintillaWin::SelectionToHangul() { - // Convert every hanja to hangul within the main range. -- const int selStart = sel.RangeMain().Start().Position(); -- const int documentStrLen = sel.RangeMain().Length(); -- const int selEnd = selStart + documentStrLen; -- const int utf16Len = pdoc->CountUTF16(selStart, selEnd); -+ const Sci::Position selStart = sel.RangeMain().Start().Position(); -+ const Sci::Position documentStrLen = sel.RangeMain().Length(); -+ const Sci::Position selEnd = selStart + documentStrLen; -+ const Sci::Position utf16Len = pdoc->CountUTF16(selStart, selEnd); - - if (utf16Len > 0) { - std::string documentStr(documentStrLen, '\0'); -@@ -957,7 +957,7 @@ - if (sel.Count() > 1) { - return; // Do not allow multi carets. - } -- int currentPos = CurrentPosition(); -+ Sci::Position currentPos = CurrentPosition(); - int oneCharLen = pdoc->LenChar(currentPos); - - if (oneCharLen < 2) { -@@ -1091,7 +1091,7 @@ - - // Move IME caret from current last position to imeCaretPos. - int imeEndToImeCaretU16 = imc.GetImeCaretPos() - static_cast<unsigned int>(wcs.size()); -- int imeCaretPosDoc = pdoc->GetRelativePositionUTF16(CurrentPosition(), imeEndToImeCaretU16); -+ Sci::Position imeCaretPosDoc = pdoc->GetRelativePositionUTF16(CurrentPosition(), imeEndToImeCaretU16); - - MoveImeCarets(- CurrentPosition() + imeCaretPosDoc); - -@@ -1298,7 +1298,7 @@ - // Either SCROLL or ZOOM. We handle the wheel steppings calculation - wheelDelta -= static_cast<short>(HiWord(wParam)); - if (abs(wheelDelta) >= WHEEL_DELTA && linesPerScroll > 0) { -- int linesToScroll = linesPerScroll; -+ Sci::Line linesToScroll = linesPerScroll; - if (linesPerScroll == WHEEL_PAGESCROLL) - linesToScroll = LinesOnScreen() - 1; - if (linesToScroll == 0) { -@@ -1663,8 +1663,8 @@ - break; - - case EM_SETSEL: { -- int nStart = static_cast<int>(wParam); -- int nEnd = static_cast<int>(lParam); -+ Sci::Position nStart = static_cast<Sci::Position>(wParam); -+ Sci::Position nEnd = static_cast<Sci::Position>(lParam); - if (nStart == 0 && nEnd == -1) { - nEnd = pdoc->Length(); - } -@@ -1850,7 +1850,7 @@ - return true; - } - --void ScintillaWin::ScrollText(int /* linesToMove */) { -+void ScintillaWin::ScrollText(Sci::Line /* linesToMove */) { - //Platform::DebugPrintf("ScintillaWin::ScrollText %d\n", linesToMove); - //::ScrollWindow(MainHWND(), 0, - // vs.lineHeight * linesToMove, 0, 0); -@@ -1883,7 +1883,7 @@ - } - - // Change the scroll position but avoid repaint if changing to same value --void ScintillaWin::ChangeScrollPos(int barType, int pos) { -+void ScintillaWin::ChangeScrollPos(int barType, Sci::Position pos) { - SCROLLINFO sci = { - sizeof(sci), 0, 0, 0, 0, 0, 0 - }; -@@ -1904,14 +1904,14 @@ - ChangeScrollPos(SB_HORZ, xOffset); - } - --bool ScintillaWin::ModifyScrollBars(int nMax, int nPage) { -+bool ScintillaWin::ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) { - bool modified = false; - SCROLLINFO sci = { - sizeof(sci), 0, 0, 0, 0, 0, 0 - }; - sci.fMask = SIF_PAGE | SIF_RANGE; - GetScrollInfo(SB_VERT, &sci); -- int vertEndPreferred = nMax; -+ Sci::Line vertEndPreferred = nMax; - if (!verticalScrollBarVisible) - nPage = vertEndPreferred + 1; - if ((sci.nMin != 0) || -@@ -1932,14 +1932,14 @@ - int horizEndPreferred = scrollWidth; - if (horizEndPreferred < 0) - horizEndPreferred = 0; -- unsigned int pageWidth = static_cast<unsigned int>(rcText.Width()); -+ int pageWidth = static_cast<int>(rcText.Width()); - if (!horizontalScrollBarVisible || Wrapping()) - pageWidth = horizEndPreferred + 1; - sci.fMask = SIF_PAGE | SIF_RANGE; - GetScrollInfo(SB_HORZ, &sci); - if ((sci.nMin != 0) || - (sci.nMax != horizEndPreferred) || -- (sci.nPage != pageWidth) || -+ (sci.nPage != static_cast<unsigned int>(pageWidth)) || - (sci.nPos != 0)) { - sci.fMask = SIF_PAGE | SIF_RANGE; - sci.nMin = 0; -@@ -1949,7 +1949,7 @@ - sci.nTrackPos = 1; - SetScrollInfo(SB_HORZ, &sci, TRUE); - modified = true; -- if (scrollWidth < static_cast<int>(pageWidth)) { -+ if (scrollWidth < pageWidth) { - HorizontalScrollTo(0); - } - } -@@ -2673,13 +2673,13 @@ - LRESULT ScintillaWin::ImeOnReconvert(LPARAM lParam) { - // Reconversion on windows limits within one line without eol. - // Look around: baseStart <-- (|mainStart| -- mainEnd) --> baseEnd. -- const int mainStart = sel.RangeMain().Start().Position(); -- const int mainEnd = sel.RangeMain().End().Position(); -- const int curLine = pdoc->LineFromPosition(mainStart); -+ const Sci::Position mainStart = sel.RangeMain().Start().Position(); -+ const Sci::Position mainEnd = sel.RangeMain().End().Position(); -+ const Sci::Line curLine = pdoc->LineFromPosition(mainStart); - if (curLine != pdoc->LineFromPosition(mainEnd)) - return 0; -- const int baseStart = pdoc->LineStart(curLine); -- const int baseEnd = pdoc->LineEnd(curLine); -+ const Sci::Position baseStart = pdoc->LineStart(curLine); -+ const Sci::Position baseEnd = pdoc->LineEnd(curLine); - if ((baseStart == baseEnd) || (mainEnd > baseEnd)) - return 0; - -@@ -2730,8 +2730,8 @@ - - // Make place for next composition string to sit in. - for (size_t r=0; r<sel.Count(); r++) { -- int rBase = sel.Range(r).Start().Position(); -- int docCompStart = rBase + adjust; -+ Sci::Position rBase = sel.Range(r).Start().Position(); -+ Sci::Position docCompStart = rBase + adjust; - - if (inOverstrike) { // the docCompLen of bytes will be overstriked. - sel.Range(r).caret.SetPosition(docCompStart); -@@ -2739,8 +2739,8 @@ - } else { - // Ensure docCompStart+docCompLen be not beyond lineEnd. - // since docCompLen by byte might break eol. -- int lineEnd = pdoc->LineEnd(pdoc->LineFromPosition(rBase)); -- int overflow = (docCompStart + docCompLen) - lineEnd; -+ Sci::Position lineEnd = pdoc->LineEnd(pdoc->LineFromPosition(rBase)); -+ Sci::Position overflow = (docCompStart + docCompLen) - lineEnd; - if (overflow > 0) { - pdoc->DeleteChars(docCompStart, docCompLen - overflow); - } else { -@@ -2833,7 +2833,7 @@ - //Platform::DebugPrintf("ScrollInfo %d mask=%x min=%d max=%d page=%d pos=%d track=%d\n", b,sci.fMask, - //sci.nMin, sci.nMax, sci.nPage, sci.nPos, sci.nTrackPos); - -- int topLineNew = topLine; -+ Sci::Line topLineNew = topLine; - switch (LoWord(wParam)) { - case SB_LINEUP: - topLineNew -= 1; -@@ -3038,7 +3038,7 @@ - - STDMETHODIMP ScintillaWin::DragLeave() { - try { -- SetDragPosition(SelectionPosition(invalidPosition)); -+ SetDragPosition(SelectionPosition(Sci::invalidPosition)); - return S_OK; - } catch (...) { - errorStatus = SC_STATUS_FAILURE; -@@ -3054,7 +3054,7 @@ - if (pIDataSource == NULL) - return E_POINTER; - -- SetDragPosition(SelectionPosition(invalidPosition)); -+ SetDragPosition(SelectionPosition(Sci::invalidPosition)); - - STGMEDIUM medium = {0, {0}, 0}; - diff --git a/src/scintilla_backports/6154_284cc3b0e754.patch b/src/scintilla_backports/6154_284cc3b0e754.patch deleted file mode 100644 index 09267db3..00000000 --- a/src/scintilla_backports/6154_284cc3b0e754.patch +++ /dev/null @@ -1,18 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1490950601 -39600 -# Node ID 284cc3b0e7544e9894323fd07e038fdec383b836 -# Parent a0f26eaf474d98cb999629f79a3d082c0028925b -Delete declaration of unimplemented method. - -diff -r a0f26eaf474d -r 284cc3b0e754 src/Document.h ---- a/src/Document.h Fri Mar 31 18:19:38 2017 +1100 -+++ b/src/Document.h Fri Mar 31 19:56:41 2017 +1100 -@@ -379,7 +379,6 @@ - Sci::Line GetFoldParent(Sci::Line line) const; - void GetHighlightDelimiters(HighlightDelimiter &hDelimiter, Sci::Line line, Sci::Line lastLine); - -- void Indent(bool forwards); - Sci::Position ExtendWordSelect(Sci::Position pos, int delta, bool onlyWordCharacters=false) const; - Sci::Position NextWordStart(Sci::Position pos, int delta) const; - Sci::Position NextWordEnd(Sci::Position pos, int delta) const; diff --git a/src/scintilla_backports/6155_c105254dae66.patch b/src/scintilla_backports/6155_c105254dae66.patch deleted file mode 100644 index 8eddcd9b..00000000 --- a/src/scintilla_backports/6155_c105254dae66.patch +++ /dev/null @@ -1,95 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1490962049 -39600 -# Node ID c105254dae66064fe4898cc13f409c7abfc1edab -# Parent 284cc3b0e7544e9894323fd07e038fdec383b836 -Hide decorations details a little. - -diff -r 284cc3b0e754 -r c105254dae66 cocoa/ScintillaCocoa.mm ---- a/cocoa/ScintillaCocoa.mm Fri Mar 31 19:56:41 2017 +1100 -+++ b/cocoa/ScintillaCocoa.mm Fri Mar 31 23:07:29 2017 +1100 -@@ -2394,7 +2394,7 @@ - void ScintillaCocoa::CompositionCommit() - { - pdoc->TentativeCommit(); -- pdoc->decorations.SetCurrentIndicator(INDIC_IME); -+ pdoc->DecorationSetCurrentIndicator(INDIC_IME); - pdoc->DecorationFillRange(0, 0, pdoc->Length()); - } - -diff -r 284cc3b0e754 -r c105254dae66 gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Fri Mar 31 19:56:41 2017 +1100 -+++ b/gtk/ScintillaGTK.cxx Fri Mar 31 23:07:29 2017 +1100 -@@ -2227,7 +2227,7 @@ - if (indicator < 8 || indicator > INDIC_MAX) { - return; - } -- pdoc->decorations.SetCurrentIndicator(indicator); -+ pdoc->DecorationSetCurrentIndicator(indicator); - for (size_t r=0; r<sel.Count(); r++) { - int positionInsert = sel.Range(r).Start().Position(); - pdoc->DecorationFillRange(positionInsert - len, 1, len); -diff -r 284cc3b0e754 -r c105254dae66 qt/ScintillaEditBase/ScintillaEditBase.cpp ---- a/qt/ScintillaEditBase/ScintillaEditBase.cpp Fri Mar 31 19:56:41 2017 +1100 -+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp Fri Mar 31 23:07:29 2017 +1100 -@@ -451,7 +451,7 @@ - if (indicator < 8 || indicator > INDIC_MAX) { - return; - } -- sqt->pdoc->decorations.SetCurrentIndicator(indicator); -+ sqt->pdoc->DecorationSetCurrentIndicator(indicator); - for (size_t r=0; r< sqt-> sel.Count(); r++) { - int positionInsert = sqt->sel.Range(r).Start().Position(); - sqt->pdoc->DecorationFillRange(positionInsert - len, 1, len); -diff -r 284cc3b0e754 -r c105254dae66 src/Document.cxx ---- a/src/Document.cxx Fri Mar 31 19:56:41 2017 +1100 -+++ b/src/Document.cxx Fri Mar 31 23:07:29 2017 +1100 -@@ -2221,6 +2221,10 @@ - styleClock = (styleClock + 1) % 0x100000; - } - -+void SCI_METHOD Document::DecorationSetCurrentIndicator(int indicator) { -+ decorations.SetCurrentIndicator(indicator); -+} -+ - void SCI_METHOD Document::DecorationFillRange(Sci_Position position, int value, Sci_Position fillLength) { - if (decorations.FillRange(position, value, fillLength)) { - DocModification mh(SC_MOD_CHANGEINDICATOR | SC_PERFORMED_USER, -diff -r 284cc3b0e754 -r c105254dae66 src/Document.h ---- a/src/Document.h Fri Mar 31 19:56:41 2017 +1100 -+++ b/src/Document.h Fri Mar 31 23:07:29 2017 +1100 -@@ -410,9 +410,7 @@ - void LexerChanged(); - int GetStyleClock() const { return styleClock; } - void IncrementStyleClock(); -- void SCI_METHOD DecorationSetCurrentIndicator(int indicator) { -- decorations.SetCurrentIndicator(indicator); -- } -+ void SCI_METHOD DecorationSetCurrentIndicator(int indicator); - void SCI_METHOD DecorationFillRange(Sci_Position position, int value, Sci_Position fillLength); - - int SCI_METHOD SetLineState(Sci_Position line, int state); -diff -r 284cc3b0e754 -r c105254dae66 src/Editor.cxx ---- a/src/Editor.cxx Fri Mar 31 19:56:41 2017 +1100 -+++ b/src/Editor.cxx Fri Mar 31 23:07:29 2017 +1100 -@@ -7354,7 +7354,7 @@ - return (wParam <= INDIC_MAX) ? vs.indicators[wParam].outlineAlpha : 0; - - case SCI_SETINDICATORCURRENT: -- pdoc->decorations.SetCurrentIndicator(static_cast<int>(wParam)); -+ pdoc->DecorationSetCurrentIndicator(static_cast<int>(wParam)); - break; - case SCI_GETINDICATORCURRENT: - return pdoc->decorations.GetCurrentIndicator(); -diff -r 284cc3b0e754 -r c105254dae66 win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Fri Mar 31 19:56:41 2017 +1100 -+++ b/win32/ScintillaWin.cxx Fri Mar 31 23:07:29 2017 +1100 -@@ -906,7 +906,7 @@ - if (indicator < 8 || indicator > INDIC_MAX) { - return; - } -- pdoc->decorations.SetCurrentIndicator(indicator); -+ pdoc->DecorationSetCurrentIndicator(indicator); - for (size_t r=0; r<sel.Count(); r++) { - Sci::Position positionInsert = sel.Range(r).Start().Position(); - pdoc->DecorationFillRange(positionInsert - len, 1, len); diff --git a/src/scintilla_backports/6156_152e56f0b392.patch b/src/scintilla_backports/6156_152e56f0b392.patch deleted file mode 100644 index a1d7a4e8..00000000 --- a/src/scintilla_backports/6156_152e56f0b392.patch +++ /dev/null @@ -1,239 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1490962865 -39600 -# Node ID 152e56f0b392ab3143b697c8a057ac1d79533366 -# Parent c105254dae66064fe4898cc13f409c7abfc1edab -Prefer standard min/max over Platform's as adapts to changed types. - -diff -r c105254dae66 -r 152e56f0b392 cocoa/ScintillaCocoa.mm ---- a/cocoa/ScintillaCocoa.mm Fri Mar 31 23:07:29 2017 +1100 -+++ b/cocoa/ScintillaCocoa.mm Fri Mar 31 23:21:05 2017 +1100 -@@ -1263,7 +1263,7 @@ - // TODO: does not work for wrapped lines, fix it. - Sci::Line line = pdoc->LineFromPosition(posDrag.Position()); - Sci::Line currentVisibleLine = cs.DisplayFromDoc(line); -- Sci::Line lastVisibleLine = Platform::Minimum(topLine + LinesOnScreen(), cs.LinesDisplayed()) - 2; -+ Sci::Line lastVisibleLine = std::min(topLine + LinesOnScreen(), cs.LinesDisplayed()) - 2; - - if (currentVisibleLine <= topLine && topLine > 0) - ScrollTo(topLine - scrollSpeed); -diff -r c105254dae66 -r 152e56f0b392 src/CallTip.cxx ---- a/src/CallTip.cxx Fri Mar 31 23:07:29 2017 +1100 -+++ b/src/CallTip.cxx Fri Mar 31 23:21:05 2017 +1100 -@@ -11,6 +11,7 @@ - - #include <stdexcept> - #include <string> -+#include <algorithm> - - #include "Platform.h" - -@@ -191,11 +192,11 @@ - int chunkOffset = static_cast<int>(chunkVal - val.c_str()); - int chunkLength = static_cast<int>(chunkEnd - chunkVal); - int chunkEndOffset = chunkOffset + chunkLength; -- int thisStartHighlight = Platform::Maximum(startHighlight, chunkOffset); -- thisStartHighlight = Platform::Minimum(thisStartHighlight, chunkEndOffset); -+ int thisStartHighlight = std::max(startHighlight, chunkOffset); -+ thisStartHighlight = std::min(thisStartHighlight, chunkEndOffset); - thisStartHighlight -= chunkOffset; -- int thisEndHighlight = Platform::Maximum(endHighlight, chunkOffset); -- thisEndHighlight = Platform::Minimum(thisEndHighlight, chunkEndOffset); -+ int thisEndHighlight = std::max(endHighlight, chunkOffset); -+ thisEndHighlight = std::min(thisEndHighlight, chunkEndOffset); - thisEndHighlight -= chunkOffset; - rcClient.top = static_cast<XYPOSITION>(ytext - ascent - 1); - -@@ -211,7 +212,7 @@ - chunkVal = chunkEnd + 1; - ytext += lineHeight; - rcClient.bottom += lineHeight; -- maxWidth = Platform::Maximum(maxWidth, x); -+ maxWidth = std::max(maxWidth, x); - } - return maxWidth; - } -diff -r c105254dae66 -r 152e56f0b392 src/Document.cxx ---- a/src/Document.cxx Fri Mar 31 23:07:29 2017 +1100 -+++ b/src/Document.cxx Fri Mar 31 23:21:05 2017 +1100 -@@ -448,7 +448,7 @@ - if (level == -1) - level = LevelNumber(GetLevel(lineParent)); - Sci::Line maxLine = LinesTotal(); -- Sci::Line lookLastLine = (lastLine != -1) ? Platform::Minimum(LinesTotal() - 1, lastLine) : -1; -+ Sci::Line lookLastLine = (lastLine != -1) ? std::min(LinesTotal() - 1, lastLine) : -1; - Sci::Line lineMaxSubord = lineParent; - while (lineMaxSubord < maxLine - 1) { - EnsureStyledTo(LineStart(lineMaxSubord + 2)); -@@ -488,7 +488,7 @@ - - void Document::GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, Sci::Line line, Sci::Line lastLine) { - int level = GetLevel(line); -- Sci::Line lookLastLine = Platform::Maximum(line, lastLine) + 1; -+ Sci::Line lookLastLine = std::max(line, lastLine) + 1; - - Sci::Line lookLine = line; - int lookLineLevel = level; -@@ -1863,7 +1863,7 @@ - const Sci::Position lengthFind = *length; - - //Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind); -- const Sci::Position limitPos = Platform::Maximum(startPos, endPos); -+ const Sci::Position limitPos = std::max(startPos, endPos); - Sci::Position pos = startPos; - if (!forward) { - // Back all of a character -diff -r c105254dae66 -r 152e56f0b392 src/EditView.cxx ---- a/src/EditView.cxx Fri Mar 31 23:07:29 2017 +1100 -+++ b/src/EditView.cxx Fri Mar 31 23:21:05 2017 +1100 -@@ -1780,7 +1780,7 @@ - // Find the most recent line with some text - - Sci::Line lineLastWithText = line; -- while (lineLastWithText > Platform::Maximum(line - 20, 0) && model.pdoc->IsWhiteLine(lineLastWithText)) { -+ while (lineLastWithText > std::max(line - 20, 0) && model.pdoc->IsWhiteLine(lineLastWithText)) { - lineLastWithText--; - } - if (lineLastWithText < line) { -@@ -1795,21 +1795,21 @@ - if (vsDraw.viewIndentationGuides == ivLookForward) { - // In viLookForward mode, previous line only used if it is a fold header - if (isFoldHeader) { -- indentSpace = Platform::Maximum(indentSpace, indentLastWithText); -+ indentSpace = std::max(indentSpace, indentLastWithText); - } - } else { // viLookBoth -- indentSpace = Platform::Maximum(indentSpace, indentLastWithText); -+ indentSpace = std::max(indentSpace, indentLastWithText); - } - } - - Sci::Line lineNextWithText = line; -- while (lineNextWithText < Platform::Minimum(line + 20, model.pdoc->LinesTotal()) && model.pdoc->IsWhiteLine(lineNextWithText)) { -+ while (lineNextWithText < std::min(line + 20, model.pdoc->LinesTotal()) && model.pdoc->IsWhiteLine(lineNextWithText)) { - lineNextWithText++; - } - if (lineNextWithText > line) { - xStartText = 100000; // Don't limit to visible indentation on empty line - // This line is empty, so use indentation of first next line with text -- indentSpace = Platform::Maximum(indentSpace, -+ indentSpace = std::max(indentSpace, - model.pdoc->GetLineIndentation(lineNextWithText)); - } - -@@ -2050,7 +2050,7 @@ - surfaceWindow->Copy(rcCopyArea, from, *pixmapLine); - } - -- lineWidthMaxSeen = Platform::Maximum( -+ lineWidthMaxSeen = std::max( - lineWidthMaxSeen, static_cast<int>(ll->positions[ll->numCharsInLine])); - //durCopy += et.Duration(true); - } -@@ -2140,7 +2140,7 @@ - r = r * il / l; - g = g * il / l; - b = b * il / l; -- return ColourDesired(Platform::Minimum(r, 0xff), Platform::Minimum(g, 0xff), Platform::Minimum(b, 0xff)); -+ return ColourDesired(std::min(r, 0xffu), std::min(g, 0xffu), std::min(b, 0xffu)); - } - - long EditView::FormatRange(bool draw, Sci_RangeToFormat *pfr, Surface *surface, Surface *surfaceMeasure, -diff -r c105254dae66 -r 152e56f0b392 src/Editor.cxx ---- a/src/Editor.cxx Fri Mar 31 23:07:29 2017 +1100 -+++ b/src/Editor.cxx Fri Mar 31 23:21:05 2017 +1100 -@@ -600,16 +600,16 @@ - if (sel.Count() > 1 || !(sel.RangeMain().anchor == newMain.anchor) || sel.IsRectangular()) { - invalidateWholeSelection = true; - } -- Sci::Position firstAffected = Platform::Minimum(sel.RangeMain().Start().Position(), newMain.Start().Position()); -+ Sci::Position firstAffected = std::min(sel.RangeMain().Start().Position(), newMain.Start().Position()); - // +1 for lastAffected ensures caret repainted -- Sci::Position lastAffected = Platform::Maximum(newMain.caret.Position()+1, newMain.anchor.Position()); -- lastAffected = Platform::Maximum(lastAffected, sel.RangeMain().End().Position()); -+ Sci::Position lastAffected = std::max(newMain.caret.Position()+1, newMain.anchor.Position()); -+ lastAffected = std::max(lastAffected, sel.RangeMain().End().Position()); - if (invalidateWholeSelection) { - for (size_t r=0; r<sel.Count(); r++) { -- firstAffected = Platform::Minimum(firstAffected, sel.Range(r).caret.Position()); -- firstAffected = Platform::Minimum(firstAffected, sel.Range(r).anchor.Position()); -- lastAffected = Platform::Maximum(lastAffected, sel.Range(r).caret.Position()+1); -- lastAffected = Platform::Maximum(lastAffected, sel.Range(r).anchor.Position()); -+ firstAffected = std::min(firstAffected, sel.Range(r).caret.Position()); -+ firstAffected = std::min(firstAffected, sel.Range(r).anchor.Position()); -+ lastAffected = std::max(lastAffected, sel.Range(r).caret.Position()+1); -+ lastAffected = std::max(lastAffected, sel.Range(r).anchor.Position()); - } - } - ContainerNeedsUpdate(SC_UPDATE_SELECTION); -@@ -1132,7 +1132,7 @@ - if ((options & xysVertical) && (pt.y < rcClient.top || ptBottomCaret.y >= rcClient.bottom || (caretYPolicy & CARET_STRICT) != 0)) { - const Sci::Line lineCaret = DisplayFromPosition(range.caret.Position()); - const Sci::Line linesOnScreen = LinesOnScreen(); -- const Sci::Line halfScreen = Platform::Maximum(linesOnScreen - 1, 2) / 2; -+ const Sci::Line halfScreen = std::max(linesOnScreen - 1, 2) / 2; - const bool bSlop = (caretYPolicy & CARET_SLOP) != 0; - const bool bStrict = (caretYPolicy & CARET_STRICT) != 0; - const bool bJump = (caretYPolicy & CARET_JUMPS) != 0; -@@ -1231,7 +1231,7 @@ - - // Horizontal positioning - if ((options & xysHorizontal) && !Wrapping()) { -- const int halfScreen = Platform::Maximum(static_cast<int>(rcClient.Width()) - 4, 4) / 2; -+ const int halfScreen = std::max(static_cast<int>(rcClient.Width()) - 4, 4) / 2; - const bool bSlop = (caretXPolicy & CARET_SLOP) != 0; - const bool bStrict = (caretXPolicy & CARET_STRICT) != 0; - const bool bJump = (caretXPolicy & CARET_JUMPS) != 0; -@@ -2101,7 +2101,7 @@ - // Save next in case deco deleted - Decoration *decoNext = deco->next; - if (deco->indicator < INDIC_CONTAINER) { -- pdoc->decorations.SetCurrentIndicator(deco->indicator); -+ pdoc->DecorationSetCurrentIndicator(deco->indicator); - pdoc->DecorationFillRange(0, 0, pdoc->Length()); - } - deco = decoNext; -@@ -3906,8 +3906,8 @@ - Sci::Position anchorPosOnLine = sel.Range(r).anchor.Position() - pdoc->LineStart(lineOfAnchor); - Sci::Position currentPosPosOnLine = caretPosition - pdoc->LineStart(lineCurrentPos); - // Multiple lines selected so indent / dedent -- Sci::Line lineTopSel = Platform::Minimum(lineOfAnchor, lineCurrentPos); -- Sci::Line lineBottomSel = Platform::Maximum(lineOfAnchor, lineCurrentPos); -+ Sci::Line lineTopSel = std::min(lineOfAnchor, lineCurrentPos); -+ Sci::Line lineBottomSel = std::max(lineOfAnchor, lineCurrentPos); - if (pdoc->LineStart(lineBottomSel) == sel.Range(r).anchor.Position() || pdoc->LineStart(lineBottomSel) == caretPosition) - lineBottomSel--; // If not selecting any characters on a line, do not indent - pdoc->Indent(forwards, lineBottomSel, lineTopSel); -@@ -6262,7 +6262,7 @@ - return sel.LimitsForRectangularElseMain().start.Position(); - - case SCI_SETSELECTIONEND: -- SetSelection(static_cast<Sci::Position>(wParam), Platform::Minimum(sel.MainAnchor(), static_cast<Sci::Position>(wParam))); -+ SetSelection(static_cast<Sci::Position>(wParam), std::min(sel.MainAnchor(), static_cast<Sci::Position>(wParam))); - break; - - case SCI_GETSELECTIONEND: -diff -r c105254dae66 -r 152e56f0b392 src/ScintillaBase.cxx ---- a/src/ScintillaBase.cxx Fri Mar 31 23:07:29 2017 +1100 -+++ b/src/ScintillaBase.cxx Fri Mar 31 23:21:05 2017 +1100 -@@ -288,7 +288,7 @@ - rcac.top = pt.y + vs.lineHeight; - } - rcac.right = rcac.left + widthLB; -- rcac.bottom = static_cast<XYPOSITION>(Platform::Minimum(static_cast<int>(rcac.top) + heightLB, static_cast<int>(rcPopupBounds.bottom))); -+ rcac.bottom = static_cast<XYPOSITION>(std::min(static_cast<int>(rcac.top) + heightLB, static_cast<int>(rcPopupBounds.bottom))); - ac.lb->SetPositionRelative(rcac, wMain); - ac.lb->SetFont(vs.styles[STYLE_DEFAULT].font); - unsigned int aveCharWidth = static_cast<unsigned int>(vs.styles[STYLE_DEFAULT].aveCharWidth); -@@ -300,9 +300,9 @@ - // Fiddle the position of the list so it is right next to the target and wide enough for all its strings - PRectangle rcList = ac.lb->GetDesiredRect(); - int heightAlloced = static_cast<int>(rcList.bottom - rcList.top); -- widthLB = Platform::Maximum(widthLB, static_cast<int>(rcList.right - rcList.left)); -+ widthLB = std::max(widthLB, static_cast<int>(rcList.right - rcList.left)); - if (maxListWidth != 0) -- widthLB = Platform::Minimum(widthLB, aveCharWidth*maxListWidth); -+ widthLB = std::min(widthLB, static_cast<int>(aveCharWidth)*maxListWidth); - // Make an allowance for large strings in list - rcList.left = pt.x - ac.lb->CaretFromEdge(); - rcList.right = rcList.left + widthLB; diff --git a/src/scintilla_backports/6157_35d652a3344b.patch b/src/scintilla_backports/6157_35d652a3344b.patch deleted file mode 100644 index d6cebe9c..00000000 --- a/src/scintilla_backports/6157_35d652a3344b.patch +++ /dev/null @@ -1,881 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491003839 -39600 -# Node ID 35d652a3344bede120f1c59d9dc0b453a11c736b -# Parent 152e56f0b392ab3143b697c8a057ac1d79533366 -Standardize on C++ headers, remove headers that aren't needed and add <cstddef> -where it may be needed in the future. - -diff -r 152e56f0b392 -r 35d652a3344b cocoa/PlatCocoa.h ---- a/cocoa/PlatCocoa.h Fri Mar 31 23:21:05 2017 +1100 -+++ b/cocoa/PlatCocoa.h Sat Apr 01 10:43:59 2017 +1100 -@@ -7,11 +7,10 @@ - #ifndef PLATCOCOA_H - #define PLATCOCOA_H - --#include <assert.h> -- - #include <sys/time.h> - - #include <cstdlib> -+#include <cassert> - #include <cstring> - #include <cstdio> - -diff -r 152e56f0b392 -r 35d652a3344b cocoa/PlatCocoa.mm ---- a/cocoa/PlatCocoa.mm Fri Mar 31 23:21:05 2017 +1100 -+++ b/cocoa/PlatCocoa.mm Sat Apr 01 10:43:59 2017 +1100 -@@ -12,10 +12,11 @@ - * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). - */ - --#include <assert.h> - #include <sys/time.h> - -+#include <cstddef> - #include <cstdlib> -+#include <cassert> - #include <cstring> - #include <cstdio> - -diff -r 152e56f0b392 -r 35d652a3344b cocoa/ScintillaCocoa.h ---- a/cocoa/ScintillaCocoa.h Fri Mar 31 23:21:05 2017 +1100 -+++ b/cocoa/ScintillaCocoa.h Sat Apr 01 10:43:59 2017 +1100 -@@ -13,10 +13,11 @@ - * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). - */ - --#include <stdlib.h> --#include <stdio.h> --#include <time.h> --#include <ctype.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cctype> -+#include <cstdio> -+#include <ctime> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b gtk/PlatGTK.cxx ---- a/gtk/PlatGTK.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/gtk/PlatGTK.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -3,11 +3,11 @@ - // Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stddef.h> --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <math.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cstring> -+#include <cstdio> -+#include <cmath> - - #include <string> - #include <vector> -diff -r 152e56f0b392 -r 35d652a3344b gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/gtk/ScintillaGTK.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -3,13 +3,14 @@ - // Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <time.h> --#include <math.h> --#include <assert.h> --#include <ctype.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> -+#include <cctype> -+#include <cstdio> -+#include <ctime> -+#include <cmath> - - #include <stdexcept> - #include <new> -diff -r 152e56f0b392 -r 35d652a3344b gtk/ScintillaGTKAccessible.cxx ---- a/gtk/ScintillaGTKAccessible.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/gtk/ScintillaGTKAccessible.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -51,8 +51,9 @@ - - // FIXME: optimize character/byte offset conversion (with a cache?) - --#include <stdlib.h> --#include <string.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cstring> - - #include <stdexcept> - #include <new> -diff -r 152e56f0b392 -r 35d652a3344b lexlib/Accessor.cxx ---- a/lexlib/Accessor.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/lexlib/Accessor.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,12 +5,8 @@ - // Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> --#include <assert.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cassert> - - #include "ILexer.h" - #include "Scintilla.h" -diff -r 152e56f0b392 -r 35d652a3344b lexlib/CharacterSet.cxx ---- a/lexlib/CharacterSet.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/lexlib/CharacterSet.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -6,11 +6,8 @@ - // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <assert.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cassert> - - #include "CharacterSet.h" - -diff -r 152e56f0b392 -r 35d652a3344b lexlib/LexerBase.cxx ---- a/lexlib/LexerBase.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/lexlib/LexerBase.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,12 +5,9 @@ - // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> --#include <assert.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> - - #include "ILexer.h" - #include "Scintilla.h" -diff -r 152e56f0b392 -r 35d652a3344b lexlib/LexerModule.cxx ---- a/lexlib/LexerModule.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/lexlib/LexerModule.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,12 +5,8 @@ - // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> --#include <assert.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cassert> - - #include <string> - -diff -r 152e56f0b392 -r 35d652a3344b lexlib/LexerNoExceptions.cxx ---- a/lexlib/LexerNoExceptions.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/lexlib/LexerNoExceptions.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,12 +5,8 @@ - // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> --#include <assert.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cassert> - - #include "ILexer.h" - #include "Scintilla.h" -diff -r 152e56f0b392 -r 35d652a3344b lexlib/LexerSimple.cxx ---- a/lexlib/LexerSimple.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/lexlib/LexerSimple.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,12 +5,8 @@ - // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> --#include <assert.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cassert> - - #include <string> - -diff -r 152e56f0b392 -r 35d652a3344b lexlib/PropSetSimple.cxx ---- a/lexlib/PropSetSimple.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/lexlib/PropSetSimple.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -7,9 +7,8 @@ - - // Maintain a dictionary of properties - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> -+#include <cstdlib> -+#include <cstring> - - #include <string> - #include <map> -diff -r 152e56f0b392 -r 35d652a3344b lexlib/StyleContext.cxx ---- a/lexlib/StyleContext.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/lexlib/StyleContext.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,11 +5,9 @@ - // Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org> - // This file is in the public domain. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <assert.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cassert> -+#include <cctype> - - #include "ILexer.h" - -diff -r 152e56f0b392 -r 35d652a3344b lexlib/WordList.cxx ---- a/lexlib/WordList.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/lexlib/WordList.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,11 +5,8 @@ - // Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cstring> - - #include <algorithm> - -diff -r 152e56f0b392 -r 35d652a3344b qt/ScintillaEditBase/ScintillaQt.h ---- a/qt/ScintillaEditBase/ScintillaQt.h Fri Mar 31 23:21:05 2017 +1100 -+++ b/qt/ScintillaEditBase/ScintillaQt.h Sat Apr 01 10:43:59 2017 +1100 -@@ -11,12 +11,13 @@ - #ifndef SCINTILLAQT_H - #define SCINTILLAQT_H - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <assert.h> --#include <ctype.h> --#include <time.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> -+#include <cctype> -+#include <cstdio> -+#include <ctime> - #include <cmath> - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b scripts/HeaderOrder.txt ---- a/scripts/HeaderOrder.txt Fri Mar 31 23:21:05 2017 +1100 -+++ b/scripts/HeaderOrder.txt Sat Apr 01 10:43:59 2017 +1100 -@@ -17,13 +17,17 @@ - #include <sys/time.h> - - // C++ wrappers of C standard library -+#include <cstddef> - #include <cstdlib> -+#include <cstdint> - #include <cassert> - #include <cstring> - #include <cctype> - #include <cstdio> - #include <cstdarg> -+#include <ctime> - #include <cmath> -+#include <climits> - - // C++ standard library - #include <stdexcept> -diff -r 152e56f0b392 -r 35d652a3344b src/AutoComplete.cxx ---- a/src/AutoComplete.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/AutoComplete.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,10 +5,10 @@ - // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <assert.h> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> -+#include <cstdio> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/CallTip.cxx ---- a/src/CallTip.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/CallTip.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,9 +5,9 @@ - // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> -+#include <cstdlib> -+#include <cstring> -+#include <cstdio> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/Catalogue.cxx ---- a/src/Catalogue.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/Catalogue.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,12 +5,9 @@ - // Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> --#include <assert.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> - - #include <stdexcept> - #include <vector> -diff -r 152e56f0b392 -r 35d652a3344b src/CellBuffer.cxx ---- a/src/CellBuffer.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/CellBuffer.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,10 +5,11 @@ - // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cstring> -+#include <cstdio> -+#include <cstdarg> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b src/CharClassify.cxx ---- a/src/CharClassify.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/CharClassify.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,8 +5,8 @@ - // Copyright 2006 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cctype> - - #include <stdexcept> - -diff -r 152e56f0b392 -r 35d652a3344b src/ContractionState.cxx ---- a/src/ContractionState.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/ContractionState.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,8 +5,9 @@ - // Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <string.h> --#include <assert.h> -+#include <cstddef> -+#include <cassert> -+#include <cstring> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b src/Decoration.cxx ---- a/src/Decoration.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/Decoration.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -4,10 +4,11 @@ - // Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cstring> -+#include <cstdio> -+#include <cstdarg> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b src/Document.cxx ---- a/src/Document.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/Document.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,11 +5,11 @@ - // Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <assert.h> --#include <ctype.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> -+#include <cstdio> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/EditModel.cxx ---- a/src/EditModel.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/EditModel.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,12 +5,10 @@ - // Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <math.h> --#include <assert.h> --#include <ctype.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cassert> -+#include <cmath> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/EditView.cxx ---- a/src/EditView.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/EditView.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,12 +5,13 @@ - // Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <math.h> --#include <assert.h> --#include <ctype.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> -+#include <cctype> -+#include <cstdio> -+#include <cmath> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/Editor.cxx ---- a/src/Editor.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/Editor.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,11 +5,12 @@ - // Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <assert.h> --#include <ctype.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> -+#include <cctype> -+#include <cstdio> - - #include <cmath> - #include <stdexcept> -diff -r 152e56f0b392 -r 35d652a3344b src/ExternalLexer.cxx ---- a/src/ExternalLexer.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/ExternalLexer.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,11 +5,9 @@ - // Copyright 2001 Simon Steele <ss@pnotepad.org>, portions copyright Neil Hodgson. - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <assert.h> --#include <ctype.h> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/KeyMap.cxx ---- a/src/KeyMap.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/KeyMap.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,7 +5,7 @@ - // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> -+#include <cstdlib> - - #include <stdexcept> - #include <vector> -diff -r 152e56f0b392 -r 35d652a3344b src/LineMarker.cxx ---- a/src/LineMarker.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/LineMarker.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,8 +5,8 @@ - // Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <string.h> --#include <math.h> -+#include <cstring> -+#include <cmath> - - #include <stdexcept> - #include <vector> -diff -r 152e56f0b392 -r 35d652a3344b src/MarginView.cxx ---- a/src/MarginView.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/MarginView.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,12 +5,13 @@ - // Copyright 1998-2014 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <math.h> --#include <assert.h> --#include <ctype.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> -+#include <cctype> -+#include <cstdio> -+#include <cmath> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/PerLine.cxx ---- a/src/PerLine.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/PerLine.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,7 +5,8 @@ - // Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <string.h> -+#include <cstddef> -+#include <cstring> - - #include <stdexcept> - #include <vector> -diff -r 152e56f0b392 -r 35d652a3344b src/PositionCache.cxx ---- a/src/PositionCache.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/PositionCache.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,10 +5,9 @@ - // Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <ctype.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cstring> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/RESearch.cxx ---- a/src/RESearch.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/RESearch.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -200,7 +200,7 @@ - * matches: foo-foo fo-fo fob-fob foobar-foobar ... - */ - --#include <stdlib.h> -+#include <cstdlib> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/RunStyles.cxx ---- a/src/RunStyles.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/RunStyles.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -4,10 +4,11 @@ - // Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cstring> -+#include <cstdio> -+#include <cstdarg> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b src/ScintillaBase.cxx ---- a/src/ScintillaBase.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/ScintillaBase.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,11 +5,10 @@ - // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <assert.h> --#include <ctype.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/Selection.cxx ---- a/src/Selection.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/Selection.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,7 +5,7 @@ - // Copyright 2009 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> -+#include <cstdlib> - - #include <stdexcept> - #include <vector> -diff -r 152e56f0b392 -r 35d652a3344b src/Style.cxx ---- a/src/Style.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/Style.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,8 +5,6 @@ - // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <string.h> -- - #include <stdexcept> - - #include "Platform.h" -diff -r 152e56f0b392 -r 35d652a3344b src/UniConversion.cxx ---- a/src/UniConversion.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/UniConversion.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,7 +5,7 @@ - // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> -+#include <cstdlib> - - #include <stdexcept> - #include <string> -diff -r 152e56f0b392 -r 35d652a3344b src/ViewStyle.cxx ---- a/src/ViewStyle.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/ViewStyle.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,8 +5,9 @@ - // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <string.h> --#include <assert.h> -+#include <cstddef> -+#include <cassert> -+#include <cstring> - - #include <stdexcept> - #include <vector> -diff -r 152e56f0b392 -r 35d652a3344b src/XPM.cxx ---- a/src/XPM.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/src/XPM.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,8 +5,8 @@ - // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> -+#include <cstdlib> -+#include <cstring> - - #include <stdexcept> - #include <vector> -diff -r 152e56f0b392 -r 35d652a3344b test/unit/testCharClassify.cxx ---- a/test/unit/testCharClassify.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/test/unit/testCharClassify.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -1,6 +1,6 @@ - // Unit Tests for Scintilla internal data structures - --#include <string.h> -+#include <cstring> - - #include <algorithm> - #include <iostream> -diff -r 152e56f0b392 -r 35d652a3344b test/unit/testContractionState.cxx ---- a/test/unit/testContractionState.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/test/unit/testContractionState.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -1,6 +1,6 @@ - // Unit Tests for Scintilla internal data structures - --#include <string.h> -+#include <cstring> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b test/unit/testDecoration.cxx ---- a/test/unit/testDecoration.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/test/unit/testDecoration.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -1,6 +1,6 @@ - // Unit Tests for Scintilla internal data structures - --#include <string.h> -+#include <cstring> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b test/unit/testPartitioning.cxx ---- a/test/unit/testPartitioning.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/test/unit/testPartitioning.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -1,6 +1,6 @@ - // Unit Tests for Scintilla internal data structures - --#include <string.h> -+#include <cstring> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b test/unit/testRunStyles.cxx ---- a/test/unit/testRunStyles.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/test/unit/testRunStyles.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -1,6 +1,6 @@ - // Unit Tests for Scintilla internal data structures - --#include <string.h> -+#include <cstring> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b test/unit/testSparseVector.cxx ---- a/test/unit/testSparseVector.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/test/unit/testSparseVector.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -1,8 +1,7 @@ - // Unit Tests for Scintilla internal data structures - --#include <string.h> -- - #include <cassert> -+#include <cstring> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b test/unit/testSplitVector.cxx ---- a/test/unit/testSplitVector.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/test/unit/testSplitVector.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -1,6 +1,6 @@ - // Unit Tests for Scintilla internal data structures - --#include <string.h> -+#include <cstring> - - #include <stdexcept> - #include <algorithm> -diff -r 152e56f0b392 -r 35d652a3344b test/unit/testUnicodeFromUTF8.cxx ---- a/test/unit/testUnicodeFromUTF8.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/test/unit/testUnicodeFromUTF8.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -1,6 +1,6 @@ - // Unit Tests for Scintilla internal data structures - --#include <string.h> -+#include <cstring> - - #include <algorithm> - -diff -r 152e56f0b392 -r 35d652a3344b win32/PlatWin.cxx ---- a/win32/PlatWin.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/win32/PlatWin.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,15 +5,15 @@ - // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stddef.h> --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <stdarg.h> --#include <time.h> --#include <math.h> --#include <ctype.h> --#include <limits.h> -+#include <cstddef> -+#include <cstdlib> -+#include <cstring> -+#include <cctype> -+#include <cstdio> -+#include <cstdarg> -+#include <ctime> -+#include <cmath> -+#include <climits> - - #include <vector> - #include <map> -diff -r 152e56f0b392 -r 35d652a3344b win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Fri Mar 31 23:21:05 2017 +1100 -+++ b/win32/ScintillaWin.cxx Sat Apr 01 10:43:59 2017 +1100 -@@ -5,14 +5,15 @@ - // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> - // The License.txt file describes the conditions under which this software may be distributed. - --#include <stdlib.h> --#include <string.h> --#include <stdio.h> --#include <assert.h> --#include <ctype.h> --#include <limits.h> -- -+#include <cstddef> -+#include <cstdlib> -+#include <cassert> -+#include <cstring> -+#include <cctype> -+#include <cstdio> - #include <cmath> -+#include <climits> -+ - #include <stdexcept> - #include <new> - #include <string> diff --git a/src/scintilla_backports/6158_47fa874827a5.patch b/src/scintilla_backports/6158_47fa874827a5.patch deleted file mode 100644 index 6a88ed94..00000000 --- a/src/scintilla_backports/6158_47fa874827a5.patch +++ /dev/null @@ -1,280 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491012984 -39600 -# Node ID 47fa874827a53ca2595aab2df1efa17834f24e06 -# Parent 35d652a3344bede120f1c59d9dc0b453a11c736b -More encapsulation for Decoration and DecorationList. - -diff -r 35d652a3344b -r 47fa874827a5 src/Decoration.cxx ---- a/src/Decoration.cxx Sat Apr 01 10:43:59 2017 +1100 -+++ b/src/Decoration.cxx Sat Apr 01 13:16:24 2017 +1100 -@@ -26,7 +26,7 @@ - using namespace Scintilla; - #endif - --Decoration::Decoration(int indicator_) : next(0), indicator(indicator_) { -+Decoration::Decoration(int indicator_) : indicator(indicator_), next(0) { - } - - Decoration::~Decoration() { -@@ -43,7 +43,7 @@ - DecorationList::~DecorationList() { - Decoration *deco = root; - while (deco) { -- Decoration *decoNext = deco->next; -+ Decoration *decoNext = deco->Next(); - delete deco; - deco = decoNext; - } -@@ -52,8 +52,8 @@ - } - - Decoration *DecorationList::DecorationFromIndicator(int indicator) { -- for (Decoration *deco=root; deco; deco = deco->next) { -- if (deco->indicator == indicator) { -+ for (Decoration *deco=root; deco; deco = deco->Next()) { -+ if (deco->Indicator() == indicator) { - return deco; - } - } -@@ -68,9 +68,9 @@ - Decoration *decoPrev = 0; - Decoration *deco = root; - -- while (deco && (deco->indicator < indicator)) { -+ while (deco && (deco->Indicator() < indicator)) { - decoPrev = deco; -- deco = deco->next; -+ deco = deco->Next(); - } - if (decoPrev == 0) { - decoNew->next = root; -@@ -85,17 +85,17 @@ - void DecorationList::Delete(int indicator) { - Decoration *decoToDelete = 0; - if (root) { -- if (root->indicator == indicator) { -+ if (root->Indicator() == indicator) { - decoToDelete = root; -- root = root->next; -+ root = root->Next(); - } else { - Decoration *deco=root; -- while (deco->next && !decoToDelete) { -- if (deco->next && deco->next->indicator == indicator) { -- decoToDelete = deco->next; -- deco->next = decoToDelete->next; -+ while (deco->Next() && !decoToDelete) { -+ if (deco->Next() && deco->Next()->Indicator() == indicator) { -+ decoToDelete = deco->Next(); -+ deco->next = decoToDelete->Next(); - } else { -- deco = deco->next; -+ deco = deco->Next(); - } - } - } -@@ -133,7 +133,7 @@ - void DecorationList::InsertSpace(int position, int insertLength) { - const bool atEnd = position == lengthDocument; - lengthDocument += insertLength; -- for (Decoration *deco=root; deco; deco = deco->next) { -+ for (Decoration *deco=root; deco; deco = deco->Next()) { - deco->rs.InsertSpace(position, insertLength); - if (atEnd) { - deco->rs.FillRange(position, 0, insertLength); -@@ -144,7 +144,7 @@ - void DecorationList::DeleteRange(int position, int deleteLength) { - lengthDocument -= deleteLength; - Decoration *deco; -- for (deco=root; deco; deco = deco->next) { -+ for (deco=root; deco; deco = deco->Next()) { - deco->rs.DeleteRange(position, deleteLength); - } - DeleteAnyEmpty(); -@@ -154,20 +154,20 @@ - Decoration *deco = root; - while (deco) { - if ((lengthDocument == 0) || deco->Empty()) { -- Delete(deco->indicator); -+ Delete(deco->Indicator()); - deco = root; - } else { -- deco = deco->next; -+ deco = deco->Next(); - } - } - } - - int DecorationList::AllOnFor(int position) const { - int mask = 0; -- for (Decoration *deco=root; deco; deco = deco->next) { -+ for (Decoration *deco=root; deco; deco = deco->Next()) { - if (deco->rs.ValueAt(position)) { -- if (deco->indicator < INDIC_IME) { -- mask |= 1 << deco->indicator; -+ if (deco->Indicator() < INDIC_IME) { -+ mask |= 1 << deco->Indicator(); - } - } - } -diff -r 35d652a3344b -r 47fa874827a5 src/Decoration.h ---- a/src/Decoration.h Sat Apr 01 10:43:59 2017 +1100 -+++ b/src/Decoration.h Sat Apr 01 13:16:24 2017 +1100 -@@ -12,15 +12,21 @@ - #endif - - class Decoration { -+ int indicator; - public: - Decoration *next; - RunStyles rs; -- int indicator; - - explicit Decoration(int indicator_); - ~Decoration(); - - bool Empty() const; -+ Decoration *Next() const { -+ return next; -+ } -+ int Indicator() const { -+ return indicator; -+ } - }; - - class DecorationList { -@@ -32,13 +38,17 @@ - Decoration *Create(int indicator, int length); - void Delete(int indicator); - void DeleteAnyEmpty(); --public: - Decoration *root; - bool clickNotified; -+public: - - DecorationList(); - ~DecorationList(); - -+ Decoration *Root() const { -+ return root; -+ } -+ - void SetCurrentIndicator(int indicator); - int GetCurrentIndicator() const { return currentIndicator; } - -@@ -55,6 +65,13 @@ - int ValueAt(int indicator, int position); - int Start(int indicator, int position); - int End(int indicator, int position); -+ -+ virtual bool ClickNotified() const { -+ return clickNotified; -+ } -+ virtual void SetClickNotified(bool notified) { -+ clickNotified = notified; -+ } - }; - - #ifdef SCI_NAMESPACE -diff -r 35d652a3344b -r 47fa874827a5 src/EditView.cxx ---- a/src/EditView.cxx Sat Apr 01 10:43:59 2017 +1100 -+++ b/src/EditView.cxx Sat Apr 01 13:16:24 2017 +1100 -@@ -1015,8 +1015,8 @@ - const Sci::Position lineStart = ll->LineStart(subLine); - const Sci::Position posLineEnd = posLineStart + lineEnd; - -- for (Decoration *deco = model.pdoc->decorations.root; deco; deco = deco->next) { -- if (under == vsDraw.indicators[deco->indicator].under) { -+ for (Decoration *deco = model.pdoc->decorations.Root(); deco; deco = deco->Next()) { -+ if (under == vsDraw.indicators[deco->Indicator()].under) { - Sci::Position startPos = posLineStart + lineStart; - if (!deco->rs.ValueAt(startPos)) { - startPos = deco->rs.EndRun(startPos); -@@ -1024,12 +1024,12 @@ - while ((startPos < posLineEnd) && (deco->rs.ValueAt(startPos))) { - const Range rangeRun(deco->rs.StartRun(startPos), deco->rs.EndRun(startPos)); - const Sci::Position endPos = std::min(rangeRun.end, posLineEnd); -- const bool hover = vsDraw.indicators[deco->indicator].IsDynamic() && -+ const bool hover = vsDraw.indicators[deco->Indicator()].IsDynamic() && - rangeRun.ContainsCharacter(hoverIndicatorPos); - const int value = deco->rs.ValueAt(startPos); - Indicator::DrawState drawState = hover ? Indicator::drawHover : Indicator::drawNormal; - const Sci::Position posSecond = model.pdoc->MovePositionOutsideChar(rangeRun.First() + 1, 1); -- DrawIndicator(deco->indicator, startPos - posLineStart, endPos - posLineStart, -+ DrawIndicator(deco->Indicator(), startPos - posLineStart, endPos - posLineStart, - surface, vsDraw, ll, xStart, rcLine, posSecond - posLineStart, subLine, drawState, value); - startPos = endPos; - if (!deco->rs.ValueAt(startPos)) { -@@ -1619,10 +1619,10 @@ - } - if (vsDraw.indicatorsSetFore > 0) { - // At least one indicator sets the text colour so see if it applies to this segment -- for (Decoration *deco = model.pdoc->decorations.root; deco; deco = deco->next) { -+ for (Decoration *deco = model.pdoc->decorations.Root(); deco; deco = deco->Next()) { - const int indicatorValue = deco->rs.ValueAt(ts.start + posLineStart); - if (indicatorValue) { -- const Indicator &indicator = vsDraw.indicators[deco->indicator]; -+ const Indicator &indicator = vsDraw.indicators[deco->Indicator()]; - const bool hover = indicator.IsDynamic() && - ((model.hoverIndicatorPos >= ts.start + posLineStart) && - (model.hoverIndicatorPos <= ts.end() + posLineStart)); -diff -r 35d652a3344b -r 47fa874827a5 src/Editor.cxx ---- a/src/Editor.cxx Sat Apr 01 10:43:59 2017 +1100 -+++ b/src/Editor.cxx Sat Apr 01 13:16:24 2017 +1100 -@@ -2097,12 +2097,12 @@ - } - - void Editor::ClearDocumentStyle() { -- Decoration *deco = pdoc->decorations.root; -+ Decoration *deco = pdoc->decorations.Root(); - while (deco) { - // Save next in case deco deleted -- Decoration *decoNext = deco->next; -- if (deco->indicator < INDIC_CONTAINER) { -- pdoc->DecorationSetCurrentIndicator(deco->indicator); -+ Decoration *decoNext = deco->Next(); -+ if (deco->Indicator() < INDIC_CONTAINER) { -+ pdoc->DecorationSetCurrentIndicator(deco->Indicator()); - pdoc->DecorationFillRange(0, 0, pdoc->Length()); - } - deco = decoNext; -@@ -2407,9 +2407,9 @@ - - void Editor::NotifyIndicatorClick(bool click, Sci::Position position, int modifiers) { - int mask = pdoc->decorations.AllOnFor(position); -- if ((click && mask) || pdoc->decorations.clickNotified) { -+ if ((click && mask) || pdoc->decorations.ClickNotified()) { - SCNotification scn = {}; -- pdoc->decorations.clickNotified = click; -+ pdoc->decorations.SetClickNotified(click); - scn.nmhdr.code = click ? SCN_INDICATORCLICK : SCN_INDICATORRELEASE; - scn.modifiers = modifiers; - scn.position = position; -@@ -4622,9 +4622,9 @@ - if (vs.indicatorsDynamic == 0) - return; - if (position != INVALID_POSITION) { -- for (Decoration *deco = pdoc->decorations.root; deco; deco = deco->next) { -- if (vs.indicators[deco->indicator].IsDynamic()) { -- if (pdoc->decorations.ValueAt(deco->indicator, position)) { -+ for (Decoration *deco = pdoc->decorations.Root(); deco; deco = deco->Next()) { -+ if (vs.indicators[deco->Indicator()].IsDynamic()) { -+ if (pdoc->decorations.ValueAt(deco->Indicator(), position)) { - hoverIndicatorPos = position; - } - } -diff -r 35d652a3344b -r 47fa874827a5 src/PositionCache.cxx ---- a/src/PositionCache.cxx Sat Apr 01 10:43:59 2017 +1100 -+++ b/src/PositionCache.cxx Sat Apr 01 13:16:24 2017 +1100 -@@ -483,8 +483,8 @@ - } - } - if (pvsDraw && pvsDraw->indicatorsSetFore > 0) { -- for (Decoration *deco = pdoc->decorations.root; deco; deco = deco->next) { -- if (pvsDraw->indicators[deco->indicator].OverridesTextFore()) { -+ for (Decoration *deco = pdoc->decorations.Root(); deco; deco = deco->Next()) { -+ if (pvsDraw->indicators[deco->Indicator()].OverridesTextFore()) { - Sci::Position startPos = deco->rs.EndRun(posLineStart); - while (startPos < (posLineStart + lineRange.end)) { - Insert(startPos - posLineStart); diff --git a/src/scintilla_backports/6159_67865d8e5a37.patch b/src/scintilla_backports/6159_67865d8e5a37.patch deleted file mode 100644 index 66cee150..00000000 --- a/src/scintilla_backports/6159_67865d8e5a37.patch +++ /dev/null @@ -1,31 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491013858 -39600 -# Node ID 67865d8e5a374e2cf9468e9b2638901342b1dca0 -# Parent 47fa874827a53ca2595aab2df1efa17834f24e06 -Fix DisplayFromPosition pos argument to be correct type. - -diff -r 47fa874827a5 -r 67865d8e5a37 src/EditView.cxx ---- a/src/EditView.cxx Sat Apr 01 13:16:24 2017 +1100 -+++ b/src/EditView.cxx Sat Apr 01 13:30:58 2017 +1100 -@@ -720,7 +720,7 @@ - return SelectionPosition(0); - } - --Sci::Line EditView::DisplayFromPosition(Surface *surface, const EditModel &model, int pos, const ViewStyle &vs) { -+Sci::Line EditView::DisplayFromPosition(Surface *surface, const EditModel &model, Sci::Position pos, const ViewStyle &vs) { - Sci::Line lineDoc = model.pdoc->LineFromPosition(pos); - Sci::Line lineDisplay = model.cs.DisplayFromDoc(lineDoc); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); -diff -r 47fa874827a5 -r 67865d8e5a37 src/EditView.h ---- a/src/EditView.h Sat Apr 01 13:16:24 2017 +1100 -+++ b/src/EditView.h Sat Apr 01 13:30:58 2017 +1100 -@@ -117,7 +117,7 @@ - SelectionPosition SPositionFromLocation(Surface *surface, const EditModel &model, PointDocument pt, bool canReturnInvalid, - bool charPosition, bool virtualSpace, const ViewStyle &vs); - SelectionPosition SPositionFromLineX(Surface *surface, const EditModel &model, Sci::Line lineDoc, int x, const ViewStyle &vs); -- Sci::Line DisplayFromPosition(Surface *surface, const EditModel &model, int pos, const ViewStyle &vs); -+ Sci::Line DisplayFromPosition(Surface *surface, const EditModel &model, Sci::Position pos, const ViewStyle &vs); - Sci::Position StartEndDisplayLine(Surface *surface, const EditModel &model, Sci::Position pos, bool start, const ViewStyle &vs); - - void DrawIndentGuide(Surface *surface, Sci::Line lineVisible, int lineHeight, Sci::Position start, PRectangle rcSegment, bool highlight); diff --git a/src/scintilla_backports/6160_a1a9cde51997.patch b/src/scintilla_backports/6160_a1a9cde51997.patch deleted file mode 100644 index 093ba79a..00000000 --- a/src/scintilla_backports/6160_a1a9cde51997.patch +++ /dev/null @@ -1,142 +0,0 @@ -# HG changeset patch -# User Vicente -# Date 1491085058 -36000 -# Node ID a1a9cde519976fa12e46224d6cd57483bc4633ae -# Parent 67865d8e5a374e2cf9468e9b2638901342b1dca0 -Added "Reverse Selected Lines" as SCI_LINEREVERSE. - -diff -r 67865d8e5a37 -r a1a9cde51997 doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Sat Apr 01 13:30:58 2017 +1100 -+++ b/doc/ScintillaDoc.html Sun Apr 02 08:17:38 2017 +1000 -@@ -5199,15 +5199,18 @@ - <td><code>SCI_DELLINERIGHT</code></td> - - <td><code>SCI_LINEDELETE</code></td> -- </tr> -- -- <tr> -+ - <td><code>SCI_LINECUT</code></td> -+ </tr> -+ -+ <tr> - - <td><code>SCI_LINECOPY</code></td> - - <td><code>SCI_LINETRANSPOSE</code></td> - -+ <td><code>SCI_LINEREVERSE</code></td> -+ - <td><code>SCI_LINEDUPLICATE</code></td> - </tr> - -diff -r 67865d8e5a37 -r a1a9cde51997 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sat Apr 01 13:30:58 2017 +1100 -+++ b/doc/ScintillaHistory.html Sun Apr 02 08:17:38 2017 +1000 -@@ -527,6 +527,9 @@ - Released 21 March 2017. - </li> - <li> -+ Added "Reverse Selected Lines" feature. -+ </li> -+ <li> - Updated case conversion and character categories to Unicode 9. - </li> - <li> -diff -r 67865d8e5a37 -r a1a9cde51997 include/Scintilla.h ---- a/include/Scintilla.h Sat Apr 01 13:30:58 2017 +1100 -+++ b/include/Scintilla.h Sun Apr 02 08:17:38 2017 +1000 -@@ -638,6 +638,7 @@ - #define SCI_LINECUT 2337 - #define SCI_LINEDELETE 2338 - #define SCI_LINETRANSPOSE 2339 -+#define SCI_LINEREVERSE 2354 - #define SCI_LINEDUPLICATE 2404 - #define SCI_LOWERCASE 2340 - #define SCI_UPPERCASE 2341 -diff -r 67865d8e5a37 -r a1a9cde51997 include/Scintilla.iface ---- a/include/Scintilla.iface Sat Apr 01 13:30:58 2017 +1100 -+++ b/include/Scintilla.iface Sun Apr 02 08:17:38 2017 +1000 -@@ -1614,6 +1614,9 @@ - # Switch the current line with the previous. - fun void LineTranspose=2339(,) - -+# Reverse order of selected lines. -+fun void LineReverse=2354(,) -+ - # Duplicate the current line. - fun void LineDuplicate=2404(,) - -diff -r 67865d8e5a37 -r a1a9cde51997 src/Editor.cxx ---- a/src/Editor.cxx Sat Apr 01 13:30:58 2017 +1100 -+++ b/src/Editor.cxx Sun Apr 02 08:17:38 2017 +1000 -@@ -2800,6 +2800,7 @@ - case SCI_LINECUT: - case SCI_LINEDELETE: - case SCI_LINETRANSPOSE: -+ case SCI_LINEREVERSE: - case SCI_LINEDUPLICATE: - case SCI_LOWERCASE: - case SCI_UPPERCASE: -@@ -2967,6 +2968,32 @@ - } - } - -+void Editor::LineReverse() { -+ const Sci::Line lineStart = pdoc->LineFromPosition(sel.RangeMain().Start().Position()); -+ const Sci::Line lineEnd = pdoc->LineFromPosition(sel.RangeMain().End().Position()-1); -+ const Sci::Line lineDiff = lineEnd - lineStart; -+ if (lineDiff <= 0) -+ return; -+ UndoGroup ug(pdoc); -+ for (Sci::Line i=(lineDiff+1)/2-1; i>=0; --i) { -+ const Sci::Line lineNum2 = lineEnd - i; -+ const Sci::Line lineNum1 = lineStart + i; -+ Sci::Position lineStart2 = pdoc->LineStart(lineNum2); -+ const Sci::Position lineStart1 = pdoc->LineStart(lineNum1); -+ const std::string line2 = RangeText(lineStart2, pdoc->LineEnd(lineNum2)); -+ const std::string line1 = RangeText(lineStart1, pdoc->LineEnd(lineNum1)); -+ const Sci::Position lineLen2 = static_cast<Sci::Position>(line2.length()); -+ const Sci::Position lineLen1 = static_cast<Sci::Position>(line1.length()); -+ pdoc->DeleteChars(lineStart2, lineLen2); -+ pdoc->DeleteChars(lineStart1, lineLen1); -+ lineStart2 -= lineLen1; -+ pdoc->InsertString(lineStart2, line1.c_str(), lineLen1); -+ pdoc->InsertString(lineStart1, line2.c_str(), lineLen2); -+ } -+ // Wholly select all affected lines -+ sel.RangeMain() = SelectionRange(pdoc->LineStart(lineStart), pdoc->LineStart(lineEnd+1)); -+} -+ - void Editor::Duplicate(bool forLine) { - if (sel.Empty()) { - forLine = true; -@@ -3809,6 +3836,9 @@ - case SCI_LINETRANSPOSE: - LineTranspose(); - break; -+ case SCI_LINEREVERSE: -+ LineReverse(); -+ break; - case SCI_LINEDUPLICATE: - Duplicate(true); - break; -@@ -7453,6 +7483,7 @@ - case SCI_LINECUT: - case SCI_LINEDELETE: - case SCI_LINETRANSPOSE: -+ case SCI_LINEREVERSE: - case SCI_LINEDUPLICATE: - case SCI_LOWERCASE: - case SCI_UPPERCASE: -diff -r 67865d8e5a37 -r a1a9cde51997 src/Editor.h ---- a/src/Editor.h Sat Apr 01 13:30:58 2017 +1100 -+++ b/src/Editor.h Sun Apr 02 08:17:38 2017 +1000 -@@ -460,6 +460,7 @@ - virtual std::string CaseMapString(const std::string &s, int caseMapping); - void ChangeCaseOfSelection(int caseMapping); - void LineTranspose(); -+ void LineReverse(); - void Duplicate(bool forLine); - virtual void CancelModes(); - void NewLine(); diff --git a/src/scintilla_backports/6161_e7ca78c6f29c.patch b/src/scintilla_backports/6161_e7ca78c6f29c.patch deleted file mode 100644 index cd8e88d4..00000000 --- a/src/scintilla_backports/6161_e7ca78c6f29c.patch +++ /dev/null @@ -1,27 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491209937 -36000 -# Node ID e7ca78c6f29cf64c8c26e3e6ee2d63f4dbd48909 -# Parent a1a9cde519976fa12e46224d6cd57483bc4633ae -Prevent warning from MSVC Code Analysis. - -diff -r a1a9cde51997 -r e7ca78c6f29c src/Decoration.cxx ---- a/src/Decoration.cxx Sun Apr 02 08:17:38 2017 +1000 -+++ b/src/Decoration.cxx Mon Apr 03 18:58:57 2017 +1000 -@@ -89,10 +89,12 @@ - decoToDelete = root; - root = root->Next(); - } else { -- Decoration *deco=root; -- while (deco->Next() && !decoToDelete) { -- if (deco->Next() && deco->Next()->Indicator() == indicator) { -- decoToDelete = deco->Next(); -+ Decoration *deco = root; -+ while (deco && deco->Next() && !decoToDelete) { -+ // decoNext ensures no warning from MSVC Code Analysis -+ Decoration *decoNext = deco->Next(); -+ if (decoNext && deco->Next()->Indicator() == indicator) { -+ decoToDelete = decoNext; - deco->next = decoToDelete->Next(); - } else { - deco = deco->Next(); diff --git a/src/scintilla_backports/6167_797ed6c538fd.patch b/src/scintilla_backports/6167_797ed6c538fd.patch deleted file mode 100644 index 9231e7ca..00000000 --- a/src/scintilla_backports/6167_797ed6c538fd.patch +++ /dev/null @@ -1,296 +0,0 @@ -# HG changeset patch -# User A-R-C-A -# Date 1491473963 -36000 -# Node ID 797ed6c538fdb3de395888cf46e847a617c48f60 -# Parent 4e0ed8a19851652ab7210bdc797d974447d82554 -Added a caret line frame as an alternative visual for highlighting the caret line. - -diff -r 4e0ed8a19851 -r 797ed6c538fd doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Thu Apr 06 09:23:14 2017 +1000 -+++ b/doc/ScintillaDoc.html Thu Apr 06 20:19:23 2017 +1000 -@@ -3069,6 +3069,8 @@ - <a class="message" href="#SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK → colour</a><br /> - <a class="message" href="#SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(alpha alpha)</a><br /> - <a class="message" href="#SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA → int</a><br /> -+ <a class="message" href="#SCI_SETCARETLINEFRAME">SCI_SETCARETLINEFRAME(int width)</a><br /> -+ <a class="message" href="#SCI_GETCARETLINEFRAME">SCI_GETCARETLINEFRAME → int</a><br /> - <a class="message" href="#SCI_SETCARETLINEVISIBLEALWAYS">SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)</a><br /> - <a class="message" href="#SCI_GETCARETLINEVISIBLEALWAYS">SCI_GETCARETLINEVISIBLEALWAYS → bool</a><br /> - <a class="message" href="#SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int periodMilliseconds)</a><br /> -@@ -3117,6 +3119,8 @@ - <b id="SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK → colour</b><br /> - <b id="SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(<a class="jump" href="#alpha">alpha</a> alpha)</b><br /> - <b id="SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA → int</b><br /> -+ <b id="SCI_SETCARETLINEFRAME">SCI_SETCARETLINEFRAME(int width)</b><br /> -+ <b id="SCI_GETCARETLINEFRAME">SCI_GETCARETLINEFRAME → int</b><br /> - You can choose to make the background colour of the line containing the caret different with - these messages. To do this, set the desired background colour with - <code>SCI_SETCARETLINEBACK</code>, then use <code>SCI_SETCARETLINEVISIBLE(true)</code> to -@@ -3128,6 +3132,8 @@ - through. This is done by setting the alpha (translucency) value by calling - SCI_SETCARETLINEBACKALPHA. When the alpha is not SC_ALPHA_NOALPHA, - the caret line is drawn after all other features so will affect the colour of all other features. -+ Alternatively <code>SCI_SETCARETLINEFRAME</code> can be used to display the caret line framed -+ instead of filling the whole background. Set width != 0 to enable this option and width = 0 to disable it. - </p> - - <p><b id="SCI_SETCARETLINEVISIBLEALWAYS">SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)</b><br /> -diff -r 4e0ed8a19851 -r 797ed6c538fd doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Thu Apr 06 09:23:14 2017 +1000 -+++ b/doc/ScintillaHistory.html Thu Apr 06 20:19:23 2017 +1000 -@@ -527,6 +527,9 @@ - Released 21 March 2017. - </li> - <li> -+ Added a caret line frame as an alternative visual for highlighting the caret line. -+ </li> -+ <li> - Added "Reverse Selected Lines" feature. - </li> - <li> -diff -r 4e0ed8a19851 -r 797ed6c538fd include/Scintilla.h ---- a/include/Scintilla.h Thu Apr 06 09:23:14 2017 +1000 -+++ b/include/Scintilla.h Thu Apr 06 20:19:23 2017 +1000 -@@ -329,6 +329,8 @@ - #define SCI_SETCARETLINEVISIBLE 2096 - #define SCI_GETCARETLINEBACK 2097 - #define SCI_SETCARETLINEBACK 2098 -+#define SCI_GETCARETLINEFRAME 2704 -+#define SCI_SETCARETLINEFRAME 2705 - #define SCI_STYLESETCHANGEABLE 2099 - #define SCI_AUTOCSHOW 2100 - #define SCI_AUTOCCANCEL 2101 -diff -r 4e0ed8a19851 -r 797ed6c538fd include/Scintilla.iface ---- a/include/Scintilla.iface Thu Apr 06 09:23:14 2017 +1000 -+++ b/include/Scintilla.iface Thu Apr 06 20:19:23 2017 +1000 -@@ -731,6 +731,14 @@ - # Set the colour of the background of the line containing the caret. - set void SetCaretLineBack=2098(colour back,) - -+# Retrieve the caret line frame width. -+# Width = 0 means this option is disabled. -+get int GetCaretLineFrame=2704(,) -+ -+# Display the caret line framed. -+# Set width != 0 to enable this option and width = 0 to disable it. -+set void SetCaretLineFrame=2705(int width,) -+ - # Set a style to be changeable or not (read only). - # Experimental feature, currently buggy. - set void StyleSetChangeable=2099(int style, bool changeable) -diff -r 4e0ed8a19851 -r 797ed6c538fd src/EditView.cxx ---- a/src/EditView.cxx Thu Apr 06 09:23:14 2017 +1000 -+++ b/src/EditView.cxx Thu Apr 06 20:19:23 2017 +1000 -@@ -836,6 +836,37 @@ - textBack, textFore); - } - -+static void DrawFrame(Surface *surface, ColourDesired colour, int alpha, PRectangle rcFrame) { -+ if (alpha != SC_ALPHA_NOALPHA) -+ surface->AlphaRectangle(rcFrame, 0, colour, alpha, colour, alpha, 0); -+ else -+ surface->FillRectangle(rcFrame, colour); -+} -+ -+static void DrawCaretLineFramed(Surface *surface, const ViewStyle &vsDraw, const LineLayout *ll, PRectangle rcLine, int subLine) { -+ const int width = vsDraw.GetFrameWidth(); -+ if (subLine == 0 || ll->wrapIndent == 0 || vsDraw.caretLineAlpha != SC_ALPHA_NOALPHA) { -+ // Left -+ DrawFrame(surface, vsDraw.caretLineBackground, vsDraw.caretLineAlpha, -+ PRectangle(rcLine.left, rcLine.top, rcLine.left + width, rcLine.bottom)); -+ } -+ if (subLine == 0) { -+ // Top -+ DrawFrame(surface, vsDraw.caretLineBackground, vsDraw.caretLineAlpha, -+ PRectangle(rcLine.left + width, rcLine.top, rcLine.right - width, rcLine.top + width)); -+ } -+ if (subLine == ll->lines - 1 || vsDraw.caretLineAlpha != SC_ALPHA_NOALPHA) { -+ // Right -+ DrawFrame(surface, vsDraw.caretLineBackground, vsDraw.caretLineAlpha, -+ PRectangle(rcLine.right - width, rcLine.top, rcLine.right, rcLine.bottom)); -+ } -+ if (subLine == ll->lines - 1) { -+ // Bottom -+ DrawFrame(surface, vsDraw.caretLineBackground, vsDraw.caretLineAlpha, -+ PRectangle(rcLine.left + width, rcLine.bottom - width, rcLine.right - width, rcLine.bottom)); -+ } -+} -+ - void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, - PRectangle rcLine, Sci::Line line, Sci::Position lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart, - ColourOptional background) { -@@ -963,10 +994,16 @@ - - bool drawWrapMarkEnd = false; - -- if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_END) { -- if (subLine + 1 < ll->lines) { -+ if (subLine + 1 < ll->lines) { -+ if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_END) { - drawWrapMarkEnd = ll->LineStart(subLine + 1) != 0; - } -+ if (vsDraw.IsLineFrameOpaque(model.caret.active, ll->containsCaret)) { -+ const int width = vsDraw.GetFrameWidth(); -+ // Draw right of frame under marker -+ DrawFrame(surface, vsDraw.caretLineBackground, vsDraw.caretLineAlpha, -+ PRectangle(rcLine.right - width, rcLine.top, rcLine.right, rcLine.bottom)); -+ } - } - - if (drawWrapMarkEnd) { -@@ -1373,11 +1410,19 @@ - } - - static void DrawWrapIndentAndMarker(Surface *surface, const ViewStyle &vsDraw, const LineLayout *ll, -- int xStart, PRectangle rcLine, ColourOptional background, DrawWrapMarkerFn customDrawWrapMarker) { -+ int xStart, PRectangle rcLine, ColourOptional background, DrawWrapMarkerFn customDrawWrapMarker, -+ bool caretActive) { - // default bgnd here.. - surface->FillRectangle(rcLine, background.isSet ? background : - vsDraw.styles[STYLE_DEFAULT].back); - -+ if (vsDraw.IsLineFrameOpaque(caretActive, ll->containsCaret)) { -+ const int width = vsDraw.GetFrameWidth(); -+ // Draw left of frame under marker -+ DrawFrame(surface, vsDraw.caretLineBackground, vsDraw.caretLineAlpha, -+ PRectangle(rcLine.left, rcLine.top, rcLine.left + width, rcLine.bottom)); -+ } -+ - if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_START) { - - // draw continuation rect -@@ -1551,9 +1596,14 @@ - - // Draw any translucent whole line states - static void DrawTranslucentLineState(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, -- Sci::Line line, PRectangle rcLine) { -- if ((model.caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && ll->containsCaret) { -- SimpleAlphaRectangle(surface, rcLine, vsDraw.caretLineBackground, vsDraw.caretLineAlpha); -+ Sci::Line line, PRectangle rcLine, int subLine) { -+ if ((model.caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && ll->containsCaret && -+ vsDraw.caretLineAlpha != SC_ALPHA_NOALPHA) { -+ if (vsDraw.caretLineFrame) { -+ DrawCaretLineFramed(surface, vsDraw, ll, rcLine, subLine); -+ } else { -+ SimpleAlphaRectangle(surface, rcLine, vsDraw.caretLineBackground, vsDraw.caretLineAlpha); -+ } - } - const int marksOfLine = model.pdoc->GetMark(line); - int marksDrawnInText = marksOfLine & vsDraw.maskDrawInText; -@@ -1842,7 +1892,7 @@ - - if ((ll->wrapIndent != 0) && (subLine > 0)) { - if (phase & drawBack) { -- DrawWrapIndentAndMarker(surface, vsDraw, ll, xStart, rcLine, background, customDrawWrapMarker); -+ DrawWrapIndentAndMarker(surface, vsDraw, ll, xStart, rcLine, background, customDrawWrapMarker, model.caret.active); - } - xStart += static_cast<int>(ll->wrapIndent); - } -@@ -1855,6 +1905,8 @@ - phase = static_cast<DrawPhase>(phase & ~drawBack); // Remove drawBack to not draw again in DrawFoldDisplayText - DrawEOL(surface, model, vsDraw, ll, rcLine, line, lineRange.end, - xStart, subLine, subLineStart, background); -+ if (vsDraw.IsLineFrameOpaque(model.caret.active, ll->containsCaret)) -+ DrawCaretLineFramed(surface, vsDraw, ll, rcLine, subLine); - } - - if (phase & drawIndicatorsBack) { -@@ -1882,6 +1934,8 @@ - if (phasesDraw == phasesOne) { - DrawEOL(surface, model, vsDraw, ll, rcLine, line, lineRange.end, - xStart, subLine, subLineStart, background); -+ if (vsDraw.IsLineFrameOpaque(model.caret.active, ll->containsCaret)) -+ DrawCaretLineFramed(surface, vsDraw, ll, rcLine, subLine); - DrawEdgeLine(surface, vsDraw, ll, rcLine, lineRange, xStart); - DrawMarkUnderline(surface, model, vsDraw, line, rcLine); - } -@@ -1891,7 +1945,7 @@ - } - - if (phase & drawLineTranslucent) { -- DrawTranslucentLineState(surface, model, vsDraw, ll, line, rcLine); -+ DrawTranslucentLineState(surface, model, vsDraw, ll, line, rcLine, subLine); - } - } - -diff -r 4e0ed8a19851 -r 797ed6c538fd src/Editor.cxx ---- a/src/Editor.cxx Thu Apr 06 09:23:14 2017 +1000 -+++ b/src/Editor.cxx Thu Apr 06 20:19:23 2017 +1000 -@@ -7067,6 +7067,12 @@ - InvalidateStyleRedraw(); - break; - -+ case SCI_GETCARETLINEFRAME: -+ return vs.caretLineFrame; -+ case SCI_SETCARETLINEFRAME: -+ vs.caretLineFrame = static_cast<int>(wParam); -+ InvalidateStyleRedraw(); -+ break; - case SCI_GETCARETLINEBACK: - return vs.caretLineBackground.AsLong(); - case SCI_SETCARETLINEBACK: -diff -r 4e0ed8a19851 -r 797ed6c538fd src/ViewStyle.cxx ---- a/src/ViewStyle.cxx Thu Apr 06 09:23:14 2017 +1000 -+++ b/src/ViewStyle.cxx Thu Apr 06 20:19:23 2017 +1000 -@@ -136,6 +136,7 @@ - selbarlight = source.selbarlight; - caretcolour = source.caretcolour; - additionalCaretColour = source.additionalCaretColour; -+ caretLineFrame = source.caretLineFrame; - showCaretLineBackground = source.showCaretLineBackground; - alwaysShowCaretLineBackground = source.alwaysShowCaretLineBackground; - caretLineBackground = source.caretLineBackground; -@@ -264,6 +265,7 @@ - styles[STYLE_LINENUMBER].back = Platform::Chrome(); - caretcolour = ColourDesired(0, 0, 0); - additionalCaretColour = ColourDesired(0x7f, 0x7f, 0x7f); -+ caretLineFrame = 0; - showCaretLineBackground = false; - alwaysShowCaretLineBackground = false; - caretLineBackground = ColourDesired(0xff, 0xff, 0); -@@ -479,6 +481,15 @@ - } - } - -+int ViewStyle::GetFrameWidth() const { -+ return Platform::Clamp(caretLineFrame, 1, lineHeight / 3); -+} -+ -+bool ViewStyle::IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const { -+ return caretLineFrame && (caretActive || alwaysShowCaretLineBackground) && showCaretLineBackground && -+ (caretLineAlpha == SC_ALPHA_NOALPHA) && lineContainsCaret; -+} -+ - // See if something overrides the line background color: Either if caret is on the line - // and background color is set for that, or if a marker is defined that forces its background - // color onto the line, or if a marker is defined but has no selection margin in which to -@@ -487,7 +498,8 @@ - // the color for the highest numbered one is used. - ColourOptional ViewStyle::Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const { - ColourOptional background; -- if ((caretActive || alwaysShowCaretLineBackground) && showCaretLineBackground && (caretLineAlpha == SC_ALPHA_NOALPHA) && lineContainsCaret) { -+ if (!caretLineFrame && (caretActive || alwaysShowCaretLineBackground) && showCaretLineBackground && -+ (caretLineAlpha == SC_ALPHA_NOALPHA) && lineContainsCaret) { - background = ColourOptional(caretLineBackground, true); - } - if (!background.isSet && marksOfLine) { -diff -r 4e0ed8a19851 -r 797ed6c538fd src/ViewStyle.h ---- a/src/ViewStyle.h Thu Apr 06 09:23:14 2017 +1000 -+++ b/src/ViewStyle.h Thu Apr 06 20:19:23 2017 +1000 -@@ -141,6 +141,7 @@ - bool viewEOL; - ColourDesired caretcolour; - ColourDesired additionalCaretColour; -+ int caretLineFrame; - bool showCaretLineBackground; - bool alwaysShowCaretLineBackground; - ColourDesired caretLineBackground; -@@ -190,6 +191,8 @@ - int MarginFromLocation(Point pt) const; - bool ValidStyle(size_t styleIndex) const; - void CalcLargestMarkerHeight(); -+ int GetFrameWidth() const; -+ bool IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const; - ColourOptional Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const; - bool SelectionBackgroundDrawn() const; - bool WhitespaceBackgroundDrawn() const; diff --git a/src/scintilla_backports/6168_d046ce80d590.patch b/src/scintilla_backports/6168_d046ce80d590.patch deleted file mode 100644 index 52d5e93f..00000000 --- a/src/scintilla_backports/6168_d046ce80d590.patch +++ /dev/null @@ -1,2631 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491476677 -36000 -# Node ID d046ce80d590607515c1ab59513101818e3da415 -# Parent 797ed6c538fdb3de395888cf46e847a617c48f60 -Added const where possible. - -diff -r 797ed6c538fd -r d046ce80d590 include/Platform.h ---- a/include/Platform.h Thu Apr 06 20:19:23 2017 +1000 -+++ b/include/Platform.h Thu Apr 06 21:04:37 2017 +1000 -@@ -136,7 +136,7 @@ - - // Other automatically defined methods (assignment, copy constructor, destructor) are fine - -- bool operator==(PRectangle &rc) const { -+ bool operator==(const PRectangle &rc) const { - return (rc.left == left) && (rc.right == right) && - (rc.top == top) && (rc.bottom == bottom); - } -diff -r 797ed6c538fd -r d046ce80d590 lexlib/Accessor.cxx ---- a/lexlib/Accessor.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/lexlib/Accessor.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -29,7 +29,7 @@ - } - - int Accessor::IndentAmount(Sci_Position line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) { -- Sci_Position end = Length(); -+ const Sci_Position end = Length(); - int spaceFlags = 0; - - // Determines the indentation level of the current line and also checks for consistent -@@ -44,7 +44,7 @@ - Sci_Position posPrev = inPrevPrefix ? LineStart(line-1) : 0; - while ((ch == ' ' || ch == '\t') && (pos < end)) { - if (inPrevPrefix) { -- char chPrev = (*this)[posPrev++]; -+ const char chPrev = (*this)[posPrev++]; - if (chPrev == ' ' || chPrev == '\t') { - if (chPrev != ch) - spaceFlags |= wsInconsistent; -diff -r 797ed6c538fd -r d046ce80d590 lexlib/CharacterCategory.cxx ---- a/lexlib/CharacterCategory.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/lexlib/CharacterCategory.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -3808,11 +3808,11 @@ - if (IsIdPattern(character)) { - return false; - } -- OtherID oid = OtherIDOfCharacter(character); -+ const OtherID oid = OtherIDOfCharacter(character); - if (oid == OtherID::oidStart) { - return true; - } -- CharacterCategory c = CategoriseCharacter(character); -+ const CharacterCategory c = CategoriseCharacter(character); - return (c == ccLl || c == ccLu || c == ccLt || c == ccLm || c == ccLo - || c == ccNl); - } -@@ -3823,11 +3823,11 @@ - if (IsIdPattern(character)) { - return false; - } -- OtherID oid = OtherIDOfCharacter(character); -+ const OtherID oid = OtherIDOfCharacter(character); - if (oid != OtherID::oidNone) { - return true; - } -- CharacterCategory c = CategoriseCharacter(character); -+ const CharacterCategory c = CategoriseCharacter(character); - return (c == ccLl || c == ccLu || c == ccLt || c == ccLm || c == ccLo - || c == ccNl || c == ccMn || c == ccMc || c == ccNd || c == ccPc); - } -diff -r 797ed6c538fd -r d046ce80d590 lexlib/CharacterSet.cxx ---- a/lexlib/CharacterSet.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/lexlib/CharacterSet.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -22,8 +22,8 @@ - int CompareCaseInsensitive(const char *a, const char *b) { - while (*a && *b) { - if (*a != *b) { -- char upperA = static_cast<char>(MakeUpperCase(*a)); -- char upperB = static_cast<char>(MakeUpperCase(*b)); -+ const char upperA = static_cast<char>(MakeUpperCase(*a)); -+ const char upperB = static_cast<char>(MakeUpperCase(*b)); - if (upperA != upperB) - return upperA - upperB; - } -@@ -37,8 +37,8 @@ - int CompareNCaseInsensitive(const char *a, const char *b, size_t len) { - while (*a && *b && len) { - if (*a != *b) { -- char upperA = static_cast<char>(MakeUpperCase(*a)); -- char upperB = static_cast<char>(MakeUpperCase(*b)); -+ const char upperA = static_cast<char>(MakeUpperCase(*a)); -+ const char upperB = static_cast<char>(MakeUpperCase(*b)); - if (upperA != upperB) - return upperA - upperB; - } -diff -r 797ed6c538fd -r d046ce80d590 lexlib/LexAccessor.h ---- a/lexlib/LexAccessor.h Thu Apr 06 20:19:23 2017 +1000 -+++ b/lexlib/LexAccessor.h Thu Apr 06 21:04:37 2017 +1000 -@@ -125,7 +125,7 @@ - } else { - // Old interface means only '\r', '\n' and '\r\n' line ends. - Sci_Position startNext = pAccess->LineStart(line+1); -- char chLineEnd = SafeGetCharAt(startNext-1); -+ const char chLineEnd = SafeGetCharAt(startNext-1); - if (chLineEnd == '\n' && (SafeGetCharAt(startNext-2) == '\r')) - return startNext - 2; - else -diff -r 797ed6c538fd -r d046ce80d590 lexlib/StyleContext.h ---- a/lexlib/StyleContext.h Thu Apr 06 20:19:23 2017 +1000 -+++ b/lexlib/StyleContext.h Thu Apr 06 21:04:37 2017 +1000 -@@ -130,7 +130,7 @@ - } - } - void ForwardBytes(Sci_Position nb) { -- Sci_PositionU forwardPos = currentPos + nb; -+ const Sci_PositionU forwardPos = currentPos + nb; - while (forwardPos > currentPos) { - Forward(); - } -@@ -165,7 +165,7 @@ - } - Sci_Position diffRelative = n - offsetRelative; - Sci_Position posNew = multiByteAccess->GetRelativePosition(posRelative, diffRelative); -- int chReturn = multiByteAccess->GetCharacterAndWidth(posNew, 0); -+ const int chReturn = multiByteAccess->GetCharacterAndWidth(posNew, 0); - posRelative = posNew; - currentPosLastRelative = currentPos; - offsetRelative = n; -diff -r 797ed6c538fd -r d046ce80d590 lexlib/WordList.cxx ---- a/lexlib/WordList.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/lexlib/WordList.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -34,7 +34,7 @@ - wordSeparator[static_cast<unsigned int>('\t')] = true; - } - for (int j = 0; wordlist[j]; j++) { -- int curr = static_cast<unsigned char>(wordlist[j]); -+ const int curr = static_cast<unsigned char>(wordlist[j]); - if (!wordSeparator[curr] && wordSeparator[prev]) - words++; - prev = curr; -@@ -143,7 +143,7 @@ - bool WordList::InList(const char *s) const { - if (0 == words) - return false; -- unsigned char firstChar = s[0]; -+ const unsigned char firstChar = s[0]; - int j = starts[firstChar]; - if (j >= 0) { - while (static_cast<unsigned char>(words[j][0]) == firstChar) { -@@ -185,7 +185,7 @@ - bool WordList::InListAbbreviated(const char *s, const char marker) const { - if (0 == words) - return false; -- unsigned char firstChar = s[0]; -+ const unsigned char firstChar = s[0]; - int j = starts[firstChar]; - if (j >= 0) { - while (static_cast<unsigned char>(words[j][0]) == firstChar) { -@@ -239,7 +239,7 @@ - bool WordList::InListAbridged(const char *s, const char marker) const { - if (0 == words) - return false; -- unsigned char firstChar = s[0]; -+ const unsigned char firstChar = s[0]; - int j = starts[firstChar]; - if (j >= 0) { - while (static_cast<unsigned char>(words[j][0]) == firstChar) { -diff -r 797ed6c538fd -r d046ce80d590 src/AutoComplete.cxx ---- a/src/AutoComplete.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/AutoComplete.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -131,9 +131,9 @@ - } - - bool operator()(int a, int b) { -- int lenA = indices[a * 2 + 1] - indices[a * 2]; -- int lenB = indices[b * 2 + 1] - indices[b * 2]; -- int len = std::min(lenA, lenB); -+ const int lenA = indices[a * 2 + 1] - indices[a * 2]; -+ const int lenB = indices[b * 2 + 1] - indices[b * 2]; -+ const int len = std::min(lenA, lenB); - int cmp; - if (ac->ignoreCase) - cmp = CompareNCaseInsensitive(list + indices[a * 2], list + indices[b * 2], len); -@@ -217,7 +217,7 @@ - - - void AutoComplete::Move(int delta) { -- int count = lb->Length(); -+ const int count = lb->Length(); - int current = lb->GetSelection(); - current += delta; - if (current >= count) -diff -r 797ed6c538fd -r d046ce80d590 src/CallTip.cxx ---- a/src/CallTip.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/CallTip.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -90,7 +90,7 @@ - int posStart, int posEnd, int ytext, PRectangle rcClient, - bool highlight, bool draw) { - s += posStart; -- int len = posEnd - posStart; -+ const int len = posEnd - posStart; - - // Divide the text into sections that are all text, or that are - // single arrows or single tab characters (if tabSize > 0). -@@ -113,7 +113,7 @@ - if (endSeg > startSeg) { - if (IsArrowCharacter(s[startSeg])) { - xEnd = x + widthArrow; -- bool upArrow = s[startSeg] == '\001'; -+ const bool upArrow = s[startSeg] == '\001'; - rcClient.left = static_cast<XYPOSITION>(x); - rcClient.right = static_cast<XYPOSITION>(xEnd); - if (draw) { -@@ -189,9 +189,9 @@ - chunkEnd = chunkVal + strlen(chunkVal); - moreChunks = false; - } -- int chunkOffset = static_cast<int>(chunkVal - val.c_str()); -- int chunkLength = static_cast<int>(chunkEnd - chunkVal); -- int chunkEndOffset = chunkOffset + chunkLength; -+ const int chunkOffset = static_cast<int>(chunkVal - val.c_str()); -+ const int chunkLength = static_cast<int>(chunkEnd - chunkVal); -+ const int chunkEndOffset = chunkOffset + chunkLength; - int thisStartHighlight = std::max(startHighlight, chunkOffset); - thisStartHighlight = std::min(thisStartHighlight, chunkEndOffset); - thisStartHighlight -= chunkOffset; -diff -r 797ed6c538fd -r d046ce80d590 src/CaseConvert.cxx ---- a/src/CaseConvert.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/CaseConvert.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -708,18 +708,18 @@ - void SetupConversions(enum CaseConversion conversion) { - // First initialize for the symmetric ranges - for (size_t i=0; i<ELEMENTS(symmetricCaseConversionRanges);) { -- int lower = symmetricCaseConversionRanges[i++]; -- int upper = symmetricCaseConversionRanges[i++]; -- int length = symmetricCaseConversionRanges[i++]; -- int pitch = symmetricCaseConversionRanges[i++]; -+ const int lower = symmetricCaseConversionRanges[i++]; -+ const int upper = symmetricCaseConversionRanges[i++]; -+ const int length = symmetricCaseConversionRanges[i++]; -+ const int pitch = symmetricCaseConversionRanges[i++]; - for (int j=0; j<length*pitch; j+=pitch) { - AddSymmetric(conversion, lower+j, upper+j); - } - } - // Add the symmetric singletons - for (size_t i=0; i<ELEMENTS(symmetricCaseConversions);) { -- int lower = symmetricCaseConversions[i++]; -- int upper = symmetricCaseConversions[i++]; -+ const int lower = symmetricCaseConversions[i++]; -+ const int upper = symmetricCaseConversions[i++]; - AddSymmetric(conversion, lower, upper); - } - // Add the complex cases -diff -r 797ed6c538fd -r d046ce80d590 src/CellBuffer.cxx ---- a/src/CellBuffer.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/CellBuffer.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -162,7 +162,7 @@ - // as two actions may be created by the calling function - if (currentAction >= (lenActions - 2)) { - // Run out of undo nodes so extend the array -- int lenActionsNew = lenActions * 2; -+ const int lenActionsNew = lenActions * 2; - Action *actionsNew = new Action[lenActionsNew]; - for (int act = 0; act <= currentAction; act++) - actionsNew[act].Grab(&actions[act]); -@@ -240,7 +240,7 @@ - currentAction++; - } - startSequence = oldCurrentAction != currentAction; -- int actionWithData = currentAction; -+ const int actionWithData = currentAction; - actions[currentAction].Create(at, position, data, lengthData, mayCoalesce); - currentAction++; - actions[currentAction].Create(startAction); -@@ -439,7 +439,7 @@ - } - - bool CellBuffer::SetStyleAt(Sci::Position position, char styleValue) { -- char curVal = style.ValueAt(position); -+ const char curVal = style.ValueAt(position); - if (curVal != styleValue) { - style.SetValueAt(position, styleValue); - return true; -@@ -453,7 +453,7 @@ - PLATFORM_ASSERT(lengthStyle == 0 || - (lengthStyle > 0 && lengthStyle + position <= style.Length())); - while (lengthStyle--) { -- char curVal = style.ValueAt(position); -+ const char curVal = style.ValueAt(position); - if (curVal != styleValue) { - style.SetValueAt(position, styleValue); - changed = true; -@@ -505,7 +505,7 @@ - if ((ch == '\r') || (ch == '\n')) { - return true; - } else if (utf8LineEnds) { -- unsigned char back3[3] = { chBeforePrev, chPrev, ch }; -+ const unsigned char back3[3] = { chBeforePrev, chPrev, ch }; - if (UTF8IsSeparator(back3) || UTF8IsNEL(back3 + 1)) { - return true; - } -@@ -576,7 +576,7 @@ - } - - bool CellBuffer::UTF8LineEndOverlaps(Sci::Position position) const { -- unsigned char bytes[] = { -+ const unsigned char bytes[] = { - static_cast<unsigned char>(substance.ValueAt(position-2)), - static_cast<unsigned char>(substance.ValueAt(position-1)), - static_cast<unsigned char>(substance.ValueAt(position)), -@@ -597,7 +597,7 @@ - unsigned char chBeforePrev = 0; - unsigned char chPrev = 0; - for (Sci::Position i = 0; i < length; i++) { -- unsigned char ch = substance.ValueAt(position + i); -+ const unsigned char ch = substance.ValueAt(position + i); - if (ch == '\r') { - InsertLine(lineInsert, (position + i) + 1, atLineStart); - lineInsert++; -@@ -610,7 +610,7 @@ - lineInsert++; - } - } else if (utf8LineEnds) { -- unsigned char back3[3] = {chBeforePrev, chPrev, ch}; -+ const unsigned char back3[3] = {chBeforePrev, chPrev, ch}; - if (UTF8IsSeparator(back3) || UTF8IsNEL(back3+1)) { - InsertLine(lineInsert, (position + i) + 1, atLineStart); - lineInsert++; -@@ -626,7 +626,7 @@ - return; - PLATFORM_ASSERT(insertLength > 0); - -- unsigned char chAfter = substance.ValueAt(position); -+ const unsigned char chAfter = substance.ValueAt(position); - bool breakingUTF8LineEnd = false; - if (utf8LineEnds && UTF8IsTrailByte(chAfter)) { - breakingUTF8LineEnd = UTF8LineEndOverlaps(position); -@@ -664,7 +664,7 @@ - lineInsert++; - } - } else if (utf8LineEnds) { -- unsigned char back3[3] = {chBeforePrev, chPrev, ch}; -+ const unsigned char back3[3] = {chBeforePrev, chPrev, ch}; - if (UTF8IsSeparator(back3) || UTF8IsNEL(back3+1)) { - InsertLine(lineInsert, (position + i) + 1, atLineStart); - lineInsert++; -@@ -682,8 +682,8 @@ - } else if (utf8LineEnds && !UTF8IsAscii(chAfter)) { - // May have end of UTF-8 line end in buffer and start in insertion - for (int j = 0; j < UTF8SeparatorLength-1; j++) { -- unsigned char chAt = substance.ValueAt(position + insertLength + j); -- unsigned char back3[3] = {chBeforePrev, chPrev, chAt}; -+ const unsigned char chAt = substance.ValueAt(position + insertLength + j); -+ const unsigned char back3[3] = {chBeforePrev, chPrev, chAt}; - if (UTF8IsSeparator(back3)) { - InsertLine(lineInsert, (position + insertLength + j) + 1, atLineStart); - lineInsert++; -@@ -712,8 +712,8 @@ - - Sci::Line lineRemove = lv.LineFromPosition(position) + 1; - lv.InsertText(lineRemove-1, - (deleteLength)); -- unsigned char chPrev = substance.ValueAt(position - 1); -- unsigned char chBefore = chPrev; -+ const unsigned char chPrev = substance.ValueAt(position - 1); -+ const unsigned char chBefore = chPrev; - unsigned char chNext = substance.ValueAt(position); - bool ignoreNL = false; - if (chPrev == '\r' && chNext == '\n') { -@@ -743,7 +743,7 @@ - } - } else if (utf8LineEnds) { - if (!UTF8IsAscii(ch)) { -- unsigned char next3[3] = {ch, chNext, -+ const unsigned char next3[3] = {ch, chNext, - static_cast<unsigned char>(substance.ValueAt(position + i + 2))}; - if (UTF8IsSeparator(next3) || UTF8IsNEL(next3)) { - RemoveLine(lineRemove); -@@ -755,7 +755,7 @@ - } - // May have to fix up end if last deletion causes cr to be next to lf - // or removes one of a crlf pair -- char chAfter = substance.ValueAt(position + deleteLength); -+ const char chAfter = substance.ValueAt(position + deleteLength); - if (chBefore == '\r' && chAfter == '\n') { - // Using lineRemove-1 as cr ended line before start of deletion - RemoveLine(lineRemove - 1); -diff -r 797ed6c538fd -r d046ce80d590 src/Decoration.cxx ---- a/src/Decoration.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/Decoration.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -125,7 +125,7 @@ - current = Create(currentIndicator, lengthDocument); - } - } -- bool changed = current->rs.FillRange(position, value, fillLength); -+ const bool changed = current->rs.FillRange(position, value, fillLength); - if (current->Empty()) { - Delete(currentIndicator); - } -@@ -177,7 +177,7 @@ - } - - int DecorationList::ValueAt(int indicator, int position) { -- Decoration *deco = DecorationFromIndicator(indicator); -+ const Decoration *deco = DecorationFromIndicator(indicator); - if (deco) { - return deco->rs.ValueAt(position); - } -@@ -185,7 +185,7 @@ - } - - int DecorationList::Start(int indicator, int position) { -- Decoration *deco = DecorationFromIndicator(indicator); -+ const Decoration *deco = DecorationFromIndicator(indicator); - if (deco) { - return deco->rs.StartRun(position); - } -@@ -193,7 +193,7 @@ - } - - int DecorationList::End(int indicator, int position) { -- Decoration *deco = DecorationFromIndicator(indicator); -+ const Decoration *deco = DecorationFromIndicator(indicator); - if (deco) { - return deco->rs.EndRun(position); - } -diff -r 797ed6c538fd -r d046ce80d590 src/Document.cxx ---- a/src/Document.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/Document.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -84,7 +84,7 @@ - - int LexInterface::LineEndTypesSupported() { - if (instance) { -- int interfaceVersion = instance->Version(); -+ const int interfaceVersion = instance->Version(); - if (interfaceVersion >= lvSubStyles) { - ILexerWithSubStyles *ssinstance = static_cast<ILexerWithSubStyles *>(instance); - return ssinstance->LineEndTypesSupported(); -@@ -211,7 +211,7 @@ - // Decrease reference count and return its previous value. - // Delete the document if reference count reaches zero. - int SCI_METHOD Document::Release() { -- int curRefCount = --refCount; -+ const int curRefCount = --refCount; - if (curRefCount == 0) - delete this; - return curRefCount; -@@ -229,9 +229,9 @@ - if (enteredModification == 0) { - enteredModification++; - if (!cb.IsReadOnly()) { -- bool startSavePoint = cb.IsSavePoint(); -+ const bool startSavePoint = cb.IsSavePoint(); - bool multiLine = false; -- int steps = cb.TentativeSteps(); -+ const int steps = cb.TentativeSteps(); - //Platform::DebugPrintf("Steps=%d\n", steps); - for (int step = 0; step < steps; step++) { - const Sci::Line prevLinesTotal = LinesTotal(); -@@ -293,7 +293,7 @@ - - int Document::AddMark(Sci::Line line, int markerNum) { - if (line >= 0 && line <= LinesTotal()) { -- int prev = static_cast<LineMarkers *>(perLineData[ldMarkers])-> -+ const int prev = static_cast<LineMarkers *>(perLineData[ldMarkers])-> - AddMark(line, markerNum, LinesTotal()); - DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); - NotifyModified(mh); -@@ -360,7 +360,7 @@ - } else { - Sci::Position position = LineStart(line + 1); - if (SC_CP_UTF8 == dbcsCodePage) { -- unsigned char bytes[] = { -+ const unsigned char bytes[] = { - static_cast<unsigned char>(cb.CharAt(position-3)), - static_cast<unsigned char>(cb.CharAt(position-2)), - static_cast<unsigned char>(cb.CharAt(position-1)), -@@ -407,7 +407,7 @@ - Sci::Position Document::VCHomePosition(Sci::Position position) const { - Sci::Line line = LineFromPosition(position); - Sci::Position startPosition = LineStart(line); -- Sci::Position endLine = LineEnd(line); -+ const Sci::Position endLine = LineEnd(line); - Sci::Position startText = startPosition; - while (startText < endLine && (cb.CharAt(startText) == ' ' || cb.CharAt(startText) == '\t')) - startText++; -@@ -418,7 +418,7 @@ - } - - int SCI_METHOD Document::SetLevel(Sci_Position line, int level) { -- int prev = static_cast<LineLevels *>(perLineData[ldLevels])->SetLevel(line, level, LinesTotal()); -+ const int prev = static_cast<LineLevels *>(perLineData[ldLevels])->SetLevel(line, level, LinesTotal()); - if (prev != level) { - DocModification mh(SC_MOD_CHANGEFOLD | SC_MOD_CHANGEMARKER, - LineStart(line), 0, 0, 0, line); -@@ -447,8 +447,8 @@ - Sci::Line Document::GetLastChild(Sci::Line lineParent, int level, Sci::Line lastLine) { - if (level == -1) - level = LevelNumber(GetLevel(lineParent)); -- Sci::Line maxLine = LinesTotal(); -- Sci::Line lookLastLine = (lastLine != -1) ? std::min(LinesTotal() - 1, lastLine) : -1; -+ const Sci::Line maxLine = LinesTotal(); -+ const Sci::Line lookLastLine = (lastLine != -1) ? std::min(LinesTotal() - 1, lastLine) : -1; - Sci::Line lineMaxSubord = lineParent; - while (lineMaxSubord < maxLine - 1) { - EnsureStyledTo(LineStart(lineMaxSubord + 2)); -@@ -470,7 +470,7 @@ - } - - Sci::Line Document::GetFoldParent(Sci::Line line) const { -- int level = LevelNumber(GetLevel(line)); -+ const int level = LevelNumber(GetLevel(line)); - Sci::Line lineLook = line - 1; - while ((lineLook > 0) && ( - (!(GetLevel(lineLook) & SC_FOLDLEVELHEADERFLAG)) || -@@ -487,7 +487,7 @@ - } - - void Document::GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, Sci::Line line, Sci::Line lastLine) { -- int level = GetLevel(line); -+ const int level = GetLevel(line); - Sci::Line lookLastLine = std::max(line, lastLine) + 1; - - Sci::Line lookLine = line; -@@ -599,15 +599,15 @@ - if (widthCharBytes == 1) { - return false; - } else { -- int trailBytes = widthCharBytes - 1; -- Sci::Position len = pos - start; -+ const int trailBytes = widthCharBytes - 1; -+ const Sci::Position len = pos - start; - if (len > trailBytes) - // pos too far from lead - return false; - char charBytes[UTF8MaxBytes] = {static_cast<char>(leadByte),0,0,0}; - for (int b=1; b<widthCharBytes && ((start+b) < Length()); b++) - charBytes[b] = cb.CharAt(static_cast<Sci::Position>(start+b)); -- int utf8status = UTF8Classify(reinterpret_cast<const unsigned char *>(charBytes), widthCharBytes); -+ const int utf8status = UTF8Classify(reinterpret_cast<const unsigned char *>(charBytes), widthCharBytes); - if (utf8status & UTF8MaskInvalid) - return false; - end = start + widthCharBytes; -@@ -638,7 +638,7 @@ - - if (dbcsCodePage) { - if (SC_CP_UTF8 == dbcsCodePage) { -- unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos)); -+ const unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos)); - // If ch is not a trail byte then pos is valid intercharacter position - if (UTF8IsTrailByte(ch)) { - Sci::Position startUTF = pos; -@@ -655,7 +655,7 @@ - } else { - // Anchor DBCS calculations at start of line because start of line can - // not be a DBCS trail byte. -- Sci::Position posStartLine = LineStart(LineFromPosition(pos)); -+ const Sci::Position posStartLine = LineStart(LineFromPosition(pos)); - if (pos == posStartLine) - return pos; - -@@ -717,7 +717,7 @@ - } else { - // Examine byte before position - pos--; -- unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos)); -+ const unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos)); - // If ch is not a trail byte then pos is valid intercharacter position - if (UTF8IsTrailByte(ch)) { - // If ch is a trail byte in a valid UTF-8 character then return start of character -@@ -738,7 +738,7 @@ - } else { - // Anchor DBCS calculations at start of line because start of line can - // not be a DBCS trail byte. -- Sci::Position posStartLine = LineStart(LineFromPosition(pos)); -+ const Sci::Position posStartLine = LineStart(LineFromPosition(pos)); - // See http://msdn.microsoft.com/en-us/library/cc194792%28v=MSDN.10%29.aspx - // http://msdn.microsoft.com/en-us/library/cc194790.aspx - if ((pos - 1) <= posStartLine) { -@@ -902,7 +902,7 @@ - unsigned char charBytes[UTF8MaxBytes] = {leadByte,0,0,0}; - for (int b=1; b<widthCharBytes; b++) - charBytes[b] = static_cast<unsigned char>(cb.CharAt(position+b)); -- int utf8status = UTF8Classify(charBytes, widthCharBytes); -+ const int utf8status = UTF8Classify(charBytes, widthCharBytes); - if (utf8status & UTF8MaskInvalid) { - // Report as singleton surrogate values which are invalid Unicode - character = 0xDC80 + leadByte; -@@ -934,7 +934,7 @@ - - bool SCI_METHOD Document::IsDBCSLeadByte(char ch) const { - // Byte ranges found in Wikipedia articles with relevant search strings in each case -- unsigned char uch = static_cast<unsigned char>(ch); -+ const unsigned char uch = static_cast<unsigned char>(ch); - switch (dbcsCodePage) { - case 932: - // Shift_jis -@@ -982,7 +982,7 @@ - int lastPunctuationBreak = -1; - int lastEncodingAllowedBreak = 0; - for (int j=0; j < lengthSegment;) { -- unsigned char ch = static_cast<unsigned char>(text[j]); -+ const unsigned char ch = static_cast<unsigned char>(text[j]); - if (j > 0) { - if (IsSpaceOrTab(text[j - 1]) && !IsSpaceOrTab(text[j])) { - lastSpaceBreak = j; -@@ -1150,9 +1150,9 @@ - if ((enteredModification == 0) && (cb.IsCollectingUndo())) { - enteredModification++; - if (!cb.IsReadOnly()) { -- bool startSavePoint = cb.IsSavePoint(); -+ const bool startSavePoint = cb.IsSavePoint(); - bool multiLine = false; -- int steps = cb.StartUndo(); -+ const int steps = cb.StartUndo(); - //Platform::DebugPrintf("Steps=%d\n", steps); - Sci::Position coalescedRemovePos = -1; - Sci::Position coalescedRemoveLen = 0; -@@ -1235,9 +1235,9 @@ - if ((enteredModification == 0) && (cb.IsCollectingUndo())) { - enteredModification++; - if (!cb.IsReadOnly()) { -- bool startSavePoint = cb.IsSavePoint(); -+ const bool startSavePoint = cb.IsSavePoint(); - bool multiLine = false; -- int steps = cb.StartRedo(); -+ const int steps = cb.StartRedo(); - for (int step = 0; step < steps; step++) { - const Sci::Line prevLinesTotal = LinesTotal(); - const Action &action = cb.GetRedoStep(); -@@ -1328,10 +1328,10 @@ - int SCI_METHOD Document::GetLineIndentation(Sci_Position line) { - int indent = 0; - if ((line >= 0) && (line < LinesTotal())) { -- Sci::Position lineStart = LineStart(line); -- Sci::Position length = Length(); -+ const Sci::Position lineStart = LineStart(line); -+ const Sci::Position length = Length(); - for (Sci::Position i = lineStart; i < length; i++) { -- char ch = cb.CharAt(i); -+ const char ch = cb.CharAt(i); - if (ch == ' ') - indent++; - else if (ch == '\t') -@@ -1344,7 +1344,7 @@ - } - - Sci::Position Document::SetLineIndentation(Sci::Line line, Sci::Position indent) { -- int indentOfLine = GetLineIndentation(line); -+ const int indentOfLine = GetLineIndentation(line); - if (indent < 0) - indent = 0; - if (indent != indentOfLine) { -@@ -1364,7 +1364,7 @@ - if (line < 0) - return 0; - Sci::Position pos = LineStart(line); -- Sci::Position length = Length(); -+ const Sci::Position length = Length(); - while ((pos < length) && IsSpaceOrTab(cb.CharAt(pos))) { - pos++; - } -@@ -1376,7 +1376,7 @@ - Sci::Line line = LineFromPosition(pos); - if ((line >= 0) && (line < LinesTotal())) { - for (Sci::Position i = LineStart(line); i < pos;) { -- char ch = cb.CharAt(i); -+ const char ch = cb.CharAt(i); - if (ch == '\t') { - column = NextTab(column, tabInChars); - i++; -@@ -1427,7 +1427,7 @@ - if ((line >= 0) && (line < LinesTotal())) { - Sci::Position columnCurrent = 0; - while ((columnCurrent < column) && (position < Length())) { -- char ch = cb.CharAt(position); -+ const char ch = cb.CharAt(position); - if (ch == '\t') { - columnCurrent = NextTab(columnCurrent, tabInChars); - if (columnCurrent > column) -@@ -1524,7 +1524,7 @@ - - bool Document::IsWhiteLine(Sci::Line line) const { - Sci::Position currentChar = LineStart(line); -- Sci::Position endLine = LineEnd(line); -+ const Sci::Position endLine = LineEnd(line); - while (currentChar < endLine) { - if (cb.CharAt(currentChar) != ' ' && cb.CharAt(currentChar) != '\t') { - return false; -@@ -1718,7 +1718,7 @@ - if (delta < 0) { - if (pos > 0) { - CharacterExtracted ce = CharacterBefore(pos); -- CharClassify::cc ccStart = WordCharacterClass(ce.character); -+ const CharClassify::cc ccStart = WordCharacterClass(ce.character); - if (ccStart != CharClassify::ccSpace) { - while (pos > 0) { - ce = CharacterBefore(pos); -@@ -1743,7 +1743,7 @@ - } - if (pos < Length()) { - CharacterExtracted ce = CharacterAfter(pos); -- CharClassify::cc ccStart = WordCharacterClass(ce.character); -+ const CharClassify::cc ccStart = WordCharacterClass(ce.character); - while (pos < Length()) { - ce = CharacterAfter(pos); - if (WordCharacterClass(ce.character) != ccStart) -@@ -2125,7 +2125,7 @@ - } - - int SCI_METHOD Document::SetLineState(Sci_Position line, int state) { -- int statePrevious = static_cast<LineState *>(perLineData[ldState])->SetLineState(line, state); -+ const int statePrevious = static_cast<LineState *>(perLineData[ldState])->SetLineState(line, state); - if (state != statePrevious) { - DocModification mh(SC_MOD_CHANGELINESTATE, LineStart(line), 0, 0, 0, line); - NotifyModified(mh); -@@ -2147,7 +2147,7 @@ - } - - StyledText Document::MarginStyledText(Sci::Line line) const { -- LineAnnotation *pla = static_cast<LineAnnotation *>(perLineData[ldMargin]); -+ const LineAnnotation *pla = static_cast<LineAnnotation *>(perLineData[ldMargin]); - return StyledText(pla->Length(line), pla->Text(line), - pla->MultipleStyles(line), pla->Style(line), pla->Styles(line)); - } -@@ -2169,7 +2169,7 @@ - } - - void Document::MarginClearAll() { -- Sci::Line maxEditorLine = LinesTotal(); -+ const Sci::Line maxEditorLine = LinesTotal(); - for (Sci::Line l=0; l<maxEditorLine; l++) - MarginSetText(l, 0); - // Free remaining data -@@ -2177,7 +2177,7 @@ - } - - StyledText Document::AnnotationStyledText(Sci::Line line) const { -- LineAnnotation *pla = static_cast<LineAnnotation *>(perLineData[ldAnnotation]); -+ const LineAnnotation *pla = static_cast<LineAnnotation *>(perLineData[ldAnnotation]); - return StyledText(pla->Length(line), pla->Text(line), - pla->MultipleStyles(line), pla->Style(line), pla->Styles(line)); - } -@@ -2210,7 +2210,7 @@ - } - - void Document::AnnotationClearAll() { -- Sci::Line maxEditorLine = LinesTotal(); -+ const Sci::Line maxEditorLine = LinesTotal(); - for (Sci::Line l=0; l<maxEditorLine; l++) - AnnotationSetText(l, 0); - // Free remaining data -@@ -2416,7 +2416,7 @@ - } - - Sci::Position Document::ExtendStyleRange(Sci::Position pos, int delta, bool singleLine) { -- int sStart = cb.StyleAt(pos); -+ const int sStart = cb.StyleAt(pos); - if (delta < 0) { - while (pos > 0 && (cb.StyleAt(pos) == sStart) && (!singleLine || !IsLineEndChar(cb.CharAt(pos)))) - pos--; -@@ -2453,8 +2453,8 @@ - - // TODO: should be able to extend styled region to find matching brace - Sci::Position Document::BraceMatch(Sci::Position position, Sci::Position /*maxReStyle*/) { -- char chBrace = CharAt(position); -- char chSeek = BraceOpposite(chBrace); -+ const char chBrace = CharAt(position); -+ const char chSeek = BraceOpposite(chBrace); - if (chSeek == '\0') - return - 1; - const int styBrace = StyleIndexAt(position); -@@ -2464,7 +2464,7 @@ - int depth = 1; - position = NextPosition(position, direction); - while ((position >= 0) && (position < Length())) { -- char chAtPos = CharAt(position); -+ const char chAtPos = CharAt(position); - const int styAtPos = StyleIndexAt(position); - if ((position > GetEndStyled()) || (styAtPos == styBrace)) { - if (chAtPos == chBrace) -@@ -2474,7 +2474,7 @@ - if (depth == 0) - return position; - } -- Sci::Position positionBeforeMove = position; -+ const Sci::Position positionBeforeMove = position; - position = NextPosition(position, direction); - if (position == positionBeforeMove) - break; -@@ -2740,7 +2740,7 @@ - } - private: - void ReadCharacter() { -- Document::CharacterExtracted charExtracted = doc->ExtractCharacter(position); -+ const Document::CharacterExtracted charExtracted = doc->ExtractCharacter(position); - lenBytes = charExtracted.widthBytes; - if (charExtracted.character == unicodeReplacementChar) { - lenCharacters = 1; -diff -r 797ed6c538fd -r d046ce80d590 src/EditView.cxx ---- a/src/EditView.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/EditView.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -244,7 +244,7 @@ - } - - int EditView::GetNextTabstop(Sci::Line line, int x) const { -- LineTabstops *lt = static_cast<LineTabstops *>(ldTabstops); -+ const LineTabstops *lt = static_cast<LineTabstops *>(ldTabstops); - if (lt) { - return lt->GetNextTabstop(line, x); - } else { -@@ -386,7 +386,7 @@ - int numCharsInLine = 0; - while (numCharsInLine < lineLength) { - Sci::Position charInDoc = numCharsInLine + posLineStart; -- char chDoc = model.pdoc->CharAt(charInDoc); -+ const char chDoc = model.pdoc->CharAt(charInDoc); - styleByte = model.pdoc->StyleIndexAt(charInDoc); - allSame = allSame && - (ll->styles[numCharsInLine] == styleByte); -@@ -435,7 +435,7 @@ - const int lineLength = posLineEnd - posLineStart; - model.pdoc->GetCharRange(ll->chars, posLineStart, lineLength); - model.pdoc->GetStyleRange(ll->styles, posLineStart, lineLength); -- int numCharsBeforeEOL = model.pdoc->LineEnd(line) - posLineStart; -+ const int numCharsBeforeEOL = model.pdoc->LineEnd(line) - posLineStart; - const int numCharsInLine = (vstyle.viewEOL) ? lineLength : numCharsBeforeEOL; - for (Sci::Position styleInLine = 0; styleInLine < numCharsInLine; styleInLine++) { - const unsigned char styleByte = ll->styles[styleInLine]; -@@ -444,7 +444,7 @@ - const unsigned char styleByteLast = (lineLength > 0) ? ll->styles[lineLength - 1] : 0; - if (vstyle.someStylesForceCase) { - for (int charInLine = 0; charInLine<lineLength; charInLine++) { -- char chDoc = ll->chars[charInLine]; -+ const char chDoc = ll->chars[charInLine]; - if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseUpper) - ll->chars[charInLine] = static_cast<char>(MakeUpperCase(chDoc)); - else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseLower) -@@ -721,13 +721,13 @@ - } - - Sci::Line EditView::DisplayFromPosition(Surface *surface, const EditModel &model, Sci::Position pos, const ViewStyle &vs) { -- Sci::Line lineDoc = model.pdoc->LineFromPosition(pos); -+ const Sci::Line lineDoc = model.pdoc->LineFromPosition(pos); - Sci::Line lineDisplay = model.cs.DisplayFromDoc(lineDoc); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); -- Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); -- Sci::Position posInLine = pos - posLineStart; -+ const Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); -+ const Sci::Position posInLine = pos - posLineStart; - lineDisplay--; // To make up for first increment ahead. - for (int subLine = 0; subLine < ll->lines; subLine++) { - if (posInLine >= ll->LineStart(subLine)) { -@@ -739,13 +739,13 @@ - } - - Sci::Position EditView::StartEndDisplayLine(Surface *surface, const EditModel &model, Sci::Position pos, bool start, const ViewStyle &vs) { -- Sci::Line line = model.pdoc->LineFromPosition(pos); -+ const Sci::Line line = model.pdoc->LineFromPosition(pos); - AutoLineLayout ll(llc, RetrieveLineLayout(line, model)); - Sci::Position posRet = INVALID_POSITION; - if (surface && ll) { -- Sci::Position posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = model.pdoc->LineStart(line); - LayoutLine(model, line, surface, vs, ll, model.wrapWidth); -- Sci::Position posInLine = pos - posLineStart; -+ const Sci::Position posInLine = pos - posLineStart; - if (posInLine <= ll->maxLineLength) { - for (int subLine = 0; subLine < ll->lines; subLine++) { - if ((posInLine >= ll->LineStart(subLine)) && -@@ -880,7 +880,7 @@ - const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; - virtualSpace = model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)) * spaceWidth; - } -- XYPOSITION xEol = static_cast<XYPOSITION>(ll->positions[lineEnd] - subLineStart); -+ const XYPOSITION xEol = static_cast<XYPOSITION>(ll->positions[lineEnd] - subLineStart); - - // Fill the virtual space and show selections within it - if (virtualSpace > 0.0f) { -@@ -890,9 +890,9 @@ - if (!hideSelection && ((vsDraw.selAlpha == SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA))) { - SelectionSegment virtualSpaceRange(SelectionPosition(model.pdoc->LineEnd(line)), SelectionPosition(model.pdoc->LineEnd(line), model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)))); - for (size_t r = 0; r<model.sel.Count(); r++) { -- int alpha = (r == model.sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; -+ const int alpha = (r == model.sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - if (alpha == SC_ALPHA_NOALPHA) { -- SelectionSegment portion = model.sel.Range(r).Intersect(virtualSpaceRange); -+ const SelectionSegment portion = model.sel.Range(r).Intersect(virtualSpaceRange); - if (!portion.Empty()) { - const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; - rcSegment.left = xStart + ll->positions[portion.start.Position() - posLineStart] - -@@ -925,7 +925,7 @@ - blobsWidth += rcSegment.Width(); - char hexits[4]; - const char *ctrlChar; -- unsigned char chEOL = ll->chars[eolPos]; -+ const unsigned char chEOL = ll->chars[eolPos]; - int styleMain = ll->styles[eolPos]; - ColourDesired textBack = TextBackground(model, vsDraw, ll, background, eolInSelection, false, styleMain, eolPos); - if (UTF8IsAscii(chEOL)) { -@@ -986,7 +986,7 @@ - rcSegment.left = rcLine.left; - rcSegment.right = rcLine.right; - -- bool fillRemainder = !lastSubLine || model.foldDisplayTextStyle == SC_FOLDDISPLAYTEXT_HIDDEN || !model.cs.GetFoldDisplayTextShown(line); -+ const bool fillRemainder = !lastSubLine || model.foldDisplayTextStyle == SC_FOLDDISPLAYTEXT_HIDDEN || !model.cs.GetFoldDisplayTextShown(line); - if (fillRemainder) { - // Fill the remainder of the line - FillLineRemainder(surface, model, vsDraw, ll, line, rcSegment, subLine); -@@ -1064,7 +1064,7 @@ - const bool hover = vsDraw.indicators[deco->Indicator()].IsDynamic() && - rangeRun.ContainsCharacter(hoverIndicatorPos); - const int value = deco->rs.ValueAt(startPos); -- Indicator::DrawState drawState = hover ? Indicator::drawHover : Indicator::drawNormal; -+ const Indicator::DrawState drawState = hover ? Indicator::drawHover : Indicator::drawNormal; - const Sci::Position posSecond = model.pdoc->MovePositionOutsideChar(rangeRun.First() + 1, 1); - DrawIndicator(deco->Indicator(), startPos - posLineStart, endPos - posLineStart, - surface, vsDraw, ll, xStart, rcLine, posSecond - posLineStart, subLine, drawState, value); -@@ -1079,7 +1079,7 @@ - // Use indicators to highlight matching braces - if ((vsDraw.braceHighlightIndicatorSet && (model.bracesMatchStyle == STYLE_BRACELIGHT)) || - (vsDraw.braceBadLightIndicatorSet && (model.bracesMatchStyle == STYLE_BRACEBAD))) { -- int braceIndicator = (model.bracesMatchStyle == STYLE_BRACELIGHT) ? vsDraw.braceHighlightIndicator : vsDraw.braceBadLightIndicator; -+ const int braceIndicator = (model.bracesMatchStyle == STYLE_BRACELIGHT) ? vsDraw.braceHighlightIndicator : vsDraw.braceBadLightIndicator; - if (under == vsDraw.indicators[braceIndicator].under) { - Range rangeLine(posLineStart + lineStart, posLineEnd); - if (rangeLine.ContainsCharacter(model.braces[0])) { -@@ -1128,13 +1128,13 @@ - rcSegment.left = xStart + static_cast<XYPOSITION>(ll->positions[ll->numCharsInLine] - subLineStart) + virtualSpace + vsDraw.aveCharWidth; - rcSegment.right = rcSegment.left + static_cast<XYPOSITION>(widthFoldDisplayText); - -- ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret); -+ const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret); - FontAlias textFont = vsDraw.styles[STYLE_FOLDDISPLAYTEXT].font; - ColourDesired textFore = vsDraw.styles[STYLE_FOLDDISPLAYTEXT].fore; - if (eolInSelection && (vsDraw.selColours.fore.isSet)) { - textFore = (eolInSelection == 1) ? vsDraw.selColours.fore : vsDraw.selAdditionalForeground; - } -- ColourDesired textBack = TextBackground(model, vsDraw, ll, background, eolInSelection, -+ const ColourDesired textBack = TextBackground(model, vsDraw, ll, background, eolInSelection, - false, STYLE_FOLDDISPLAYTEXT, -1); - - if (model.trackLineWidth) { -@@ -1198,9 +1198,9 @@ - - void EditView::DrawAnnotation(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, - Sci::Line line, int xStart, PRectangle rcLine, int subLine, DrawPhase phase) { -- int indent = static_cast<int>(model.pdoc->GetLineIndentation(line) * vsDraw.spaceWidth); -+ const int indent = static_cast<int>(model.pdoc->GetLineIndentation(line) * vsDraw.spaceWidth); - PRectangle rcSegment = rcLine; -- int annotationLine = subLine - ll->lines; -+ const int annotationLine = subLine - ll->lines; - const StyledText stAnnotation = model.pdoc->AnnotationStyledText(line); - if (stAnnotation.text && ValidStyledText(vsDraw, vsDraw.annotationStyleOffset, stAnnotation)) { - if (phase & drawBack) { -@@ -1322,7 +1322,7 @@ - void EditView::DrawCarets(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, - Sci::Line lineDoc, int xStart, PRectangle rcLine, int subLine) const { - // When drag is active it is the only caret drawn -- bool drawDrag = model.posDrag.IsValid(); -+ const bool drawDrag = model.posDrag.IsValid(); - if (hideSelection && !drawDrag) - return; - const Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); -@@ -1342,12 +1342,12 @@ - if (ll->InLine(offset, subLine) && offset <= ll->numCharsBeforeEOL) { - XYPOSITION xposCaret = ll->positions[offset] + virtualOffset - ll->positions[ll->LineStart(subLine)]; - if (ll->wrapIndent != 0) { -- Sci::Position lineStart = ll->LineStart(subLine); -+ const Sci::Position lineStart = ll->LineStart(subLine); - if (lineStart != 0) // Wrapped - xposCaret += ll->wrapIndent; - } -- bool caretBlinkState = (model.caret.active && model.caret.on) || (!additionalCaretsBlink && !mainCaret); -- bool caretVisibleState = additionalCaretsVisible || mainCaret; -+ const bool caretBlinkState = (model.caret.active && model.caret.on) || (!additionalCaretsBlink && !mainCaret); -+ const bool caretVisibleState = additionalCaretsVisible || mainCaret; - if ((xposCaret >= 0) && (vsDraw.caretWidth > 0) && (vsDraw.caretStyle != CARETSTYLE_INVISIBLE) && - ((model.posDrag.IsValid()) || (caretBlinkState && caretVisibleState))) { - bool caretAtEOF = false; -@@ -1566,13 +1566,13 @@ - if (subLine == (ll->lines - 1)) { - virtualSpaces = model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)); - } -- SelectionPosition posStart(posLineStart + lineRange.start); -- SelectionPosition posEnd(posLineStart + lineRange.end, virtualSpaces); -- SelectionSegment virtualSpaceRange(posStart, posEnd); -+ const SelectionPosition posStart(posLineStart + lineRange.start); -+ const SelectionPosition posEnd(posLineStart + lineRange.end, virtualSpaces); -+ const SelectionSegment virtualSpaceRange(posStart, posEnd); - for (size_t r = 0; r < model.sel.Count(); r++) { -- int alpha = (r == model.sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; -+ const int alpha = (r == model.sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - if (alpha != SC_ALPHA_NOALPHA) { -- SelectionSegment portion = model.sel.Range(r).Intersect(virtualSpaceRange); -+ const SelectionSegment portion = model.sel.Range(r).Intersect(virtualSpaceRange); - if (!portion.Empty()) { - const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; - PRectangle rcSegment = rcLine; -@@ -1838,7 +1838,7 @@ - xStartText = 100000; // Don't limit to visible indentation on empty line - // This line is empty, so use indentation of last line with text - int indentLastWithText = model.pdoc->GetLineIndentation(lineLastWithText); -- int isFoldHeader = model.pdoc->GetLevel(lineLastWithText) & SC_FOLDLEVELHEADERFLAG; -+ const int isFoldHeader = model.pdoc->GetLevel(lineLastWithText) & SC_FOLDLEVELHEADERFLAG; - if (isFoldHeader) { - // Level is one more level than parent - indentLastWithText += model.pdoc->IndentSize(); -@@ -1950,7 +1950,7 @@ - } - - static void DrawFoldLines(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, Sci::Line line, PRectangle rcLine) { -- bool expanded = model.cs.GetExpanded(line); -+ const bool expanded = model.cs.GetExpanded(line); - const int level = model.pdoc->GetLevel(line); - const int levelNext = model.pdoc->GetLevel(line + 1); - if ((level & SC_FOLDLEVELHEADERFLAG) && -@@ -2163,7 +2163,7 @@ - alpha = (eolInSelection == 1) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - } - -- ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret); -+ const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret); - - if (eolInSelection && vsDraw.selEOLFilled && vsDraw.selColours.back.isSet && (line < model.pdoc->LinesTotal() - 1) && (alpha == SC_ALPHA_NOALPHA)) { - surface->FillRectangle(rcArea, SelectionBackground(vsDraw, eolInSelection == 1, model.primarySelection)); -@@ -2188,8 +2188,8 @@ - unsigned int r = orig.GetRed(); - unsigned int g = orig.GetGreen(); - unsigned int b = orig.GetBlue(); -- unsigned int l = (r + g + b) / 3; // There is a better calculation for this that matches human eye -- unsigned int il = 0xff - l; -+ const unsigned int l = (r + g + b) / 3; // There is a better calculation for this that matches human eye -+ const unsigned int il = 0xff - l; - if (l == 0) - return ColourDesired(0xff, 0xff, 0xff); - r = r * il / l; -@@ -2320,7 +2320,7 @@ - // to start printing from to ensure a particular position is on the first - // line of the page. - if (visibleLine == 0) { -- Sci::Position startWithinLine = nPrintPos - model.pdoc->LineStart(lineDoc); -+ const Sci::Position startWithinLine = nPrintPos - model.pdoc->LineStart(lineDoc); - for (int iwl = 0; iwl < ll.lines - 1; iwl++) { - if (ll.LineStart(iwl) <= startWithinLine && ll.LineStart(iwl + 1) >= startWithinLine) { - visibleLine = -iwl; -diff -r 797ed6c538fd -r d046ce80d590 src/Editor.cxx ---- a/src/Editor.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/Editor.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -287,7 +287,7 @@ - PointDocument Editor::DocumentPointFromView(Point ptView) const { - PointDocument ptDocument(ptView); - if (wMargin.GetID()) { -- Point ptOrigin = GetVisibleOriginInMain(); -+ const Point ptOrigin = GetVisibleOriginInMain(); - ptDocument.x += ptOrigin.x; - ptDocument.y += ptOrigin.y; - } else { -@@ -321,8 +321,8 @@ - } - - Sci::Line Editor::LinesOnScreen() const { -- PRectangle rcClient = GetClientRectangle(); -- int htClient = static_cast<int>(rcClient.bottom - rcClient.top); -+ const PRectangle rcClient = GetClientRectangle(); -+ const int htClient = static_cast<int>(rcClient.bottom - rcClient.top); - //Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1); - return htClient / vs.lineHeight; - } -@@ -565,14 +565,14 @@ - - void Editor::SetRectangularRange() { - if (sel.IsRectangular()) { -- int xAnchor = XFromPosition(sel.Rectangular().anchor); -+ const int xAnchor = XFromPosition(sel.Rectangular().anchor); - int xCaret = XFromPosition(sel.Rectangular().caret); - if (sel.selType == Selection::selThin) { - xCaret = xAnchor; - } -- Sci::Line lineAnchorRect = pdoc->LineFromPosition(sel.Rectangular().anchor.Position()); -- Sci::Line lineCaret = pdoc->LineFromPosition(sel.Rectangular().caret.Position()); -- int increment = (lineCaret > lineAnchorRect) ? 1 : -1; -+ const Sci::Line lineAnchorRect = pdoc->LineFromPosition(sel.Rectangular().anchor.Position()); -+ const Sci::Line lineCaret = pdoc->LineFromPosition(sel.Rectangular().caret.Position()); -+ const int increment = (lineCaret > lineAnchorRect) ? 1 : -1; - for (Sci::Line line=lineAnchorRect; line != lineCaret+increment; line += increment) { - SelectionRange range(SPositionFromLineX(line, xCaret), SPositionFromLineX(line, xAnchor)); - if ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) == 0) -@@ -913,12 +913,12 @@ - } - - void Editor::ScrollTo(Sci::Line line, bool moveThumb) { -- Sci::Line topLineNew = Platform::Clamp(line, 0, MaxScrollPos()); -+ const Sci::Line topLineNew = Platform::Clamp(line, 0, MaxScrollPos()); - if (topLineNew != topLine) { - // Try to optimise small scrolls - #ifndef UNDER_CE -- Sci::Line linesToMove = topLine - topLineNew; -- bool performBlit = (abs(linesToMove) <= 10) && (paintState == notPainting); -+ const Sci::Line linesToMove = topLine - topLineNew; -+ const bool performBlit = (abs(linesToMove) <= 10) && (paintState == notPainting); - willRedrawAll = !performBlit; - #endif - SetTopLine(topLineNew); -@@ -960,9 +960,9 @@ - } - - void Editor::VerticalCentreCaret() { -- Sci::Line lineDoc = pdoc->LineFromPosition(sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret()); -- Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); -- Sci::Line newTop = lineDisplay - (LinesOnScreen() / 2); -+ const Sci::Line lineDoc = pdoc->LineFromPosition(sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret()); -+ const Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); -+ const Sci::Line newTop = lineDisplay - (LinesOnScreen() / 2); - if (topLine != newTop) { - SetTopLine(newTop > 0 ? newTop : 0); - RedrawRect(GetClientRectangle()); -@@ -979,15 +979,15 @@ - - // if selection doesn't start at the beginning of the line, set the new start - Sci::Position selectionStart = SelectionStart().Position(); -- Sci::Line startLine = pdoc->LineFromPosition(selectionStart); -- Sci::Position beginningOfStartLine = pdoc->LineStart(startLine); -+ const Sci::Line startLine = pdoc->LineFromPosition(selectionStart); -+ const Sci::Position beginningOfStartLine = pdoc->LineStart(startLine); - selectionStart = beginningOfStartLine; - - // if selection doesn't end at the beginning of a line greater than that of the start, - // then set it at the beginning of the next one - Sci::Position selectionEnd = SelectionEnd().Position(); -- Sci::Line endLine = pdoc->LineFromPosition(selectionEnd); -- Sci::Position beginningOfEndLine = pdoc->LineStart(endLine); -+ const Sci::Line endLine = pdoc->LineFromPosition(selectionEnd); -+ const Sci::Position beginningOfEndLine = pdoc->LineStart(endLine); - bool appendEol = false; - if (selectionEnd > beginningOfEndLine - || selectionStart == selectionEnd) { -@@ -1114,7 +1114,7 @@ - */ - - Editor::XYScrollPosition Editor::XYScrollToMakeVisible(const SelectionRange &range, const XYScrollOptions options) { -- PRectangle rcClient = GetTextRectangle(); -+ const PRectangle rcClient = GetTextRectangle(); - Point pt = LocationFromPosition(range.caret); - Point ptAnchor = LocationFromPosition(range.anchor); - const Point ptOrigin = GetVisibleOriginInMain(); -@@ -1334,14 +1334,14 @@ - if (!(range.caret == range.anchor)) { - if (ptAnchor.x < pt.x) { - // Shift to left to show anchor or as much of range as possible -- int maxOffset = static_cast<int>(ptAnchor.x + xOffset - rcClient.left) - 1; -- int minOffset = static_cast<int>(pt.x + xOffset - rcClient.right) + 1; -+ const int maxOffset = static_cast<int>(ptAnchor.x + xOffset - rcClient.left) - 1; -+ const int minOffset = static_cast<int>(pt.x + xOffset - rcClient.right) + 1; - newXY.xOffset = std::min(newXY.xOffset, maxOffset); - newXY.xOffset = std::max(newXY.xOffset, minOffset); - } else { - // Shift to right to show anchor or as much of range as possible -- int minOffset = static_cast<Sci::Position>(ptAnchor.x + xOffset - rcClient.right) + 1; -- int maxOffset = static_cast<Sci::Position>(pt.x + xOffset - rcClient.left) - 1; -+ const int minOffset = static_cast<Sci::Position>(ptAnchor.x + xOffset - rcClient.right) + 1; -+ const int maxOffset = static_cast<Sci::Position>(pt.x + xOffset - rcClient.left) - 1; - newXY.xOffset = std::max(newXY.xOffset, minOffset); - newXY.xOffset = std::min(newXY.xOffset, maxOffset); - } -@@ -1364,7 +1364,7 @@ - xOffset = newXY.xOffset; - ContainerNeedsUpdate(SC_UPDATE_H_SCROLL); - if (newXY.xOffset > 0) { -- PRectangle rcText = GetTextRectangle(); -+ const PRectangle rcText = GetTextRectangle(); - if (horizontalScrollBarVisible && - rcText.Width() + xOffset > scrollWidth) { - scrollWidth = xOffset + static_cast<Sci::Position>(rcText.Width()); -@@ -1599,7 +1599,7 @@ - void Editor::LinesSplit(int pixelWidth) { - if (!RangeContainsProtected(targetStart, targetEnd)) { - if (pixelWidth == 0) { -- PRectangle rcText = GetTextRectangle(); -+ const PRectangle rcText = GetTextRectangle(); - pixelWidth = static_cast<int>(rcText.Width()); - } - Sci::Line lineStart = pdoc->LineFromPosition(targetStart); -@@ -1675,7 +1675,7 @@ - view.RefreshPixMaps(surfaceWindow, wMain.GetID(), vs); - marginView.RefreshPixMaps(surfaceWindow, wMain.GetID(), vs); - if (view.bufferedDraw) { -- PRectangle rcClient = GetClientRectangle(); -+ const PRectangle rcClient = GetClientRectangle(); - if (!view.pixmapLine->Initialised()) { - - view.pixmapLine->InitPixMap(static_cast<int>(rcClient.Width()), vs.lineHeight, -@@ -1804,9 +1804,9 @@ - void Editor::SetScrollBars() { - RefreshStyleData(); - -- Sci::Line nMax = MaxScrollPos(); -- Sci::Line nPage = LinesOnScreen(); -- bool modified = ModifyScrollBars(nMax + nPage - 1, nPage); -+ const Sci::Line nMax = MaxScrollPos(); -+ const Sci::Line nPage = LinesOnScreen(); -+ const bool modified = ModifyScrollBars(nMax + nPage - 1, nPage); - if (modified) { - DwellEnd(true); - } -@@ -2251,8 +2251,8 @@ - if (pdoc->GetColumn(sel.Range(r).caret.Position()) <= pdoc->GetLineIndentation(lineCurrentPos) && - pdoc->GetColumn(sel.Range(r).caret.Position()) > 0 && pdoc->backspaceUnindents) { - UndoGroup ugInner(pdoc, !ug.Needed()); -- int indentation = pdoc->GetLineIndentation(lineCurrentPos); -- int indentationStep = pdoc->IndentSize(); -+ const int indentation = pdoc->GetLineIndentation(lineCurrentPos); -+ const int indentationStep = pdoc->IndentSize(); - int indentationChange = indentation % indentationStep; - if (indentationChange == 0) - indentationChange = indentationStep; -@@ -2406,7 +2406,7 @@ - } - - void Editor::NotifyIndicatorClick(bool click, Sci::Position position, int modifiers) { -- int mask = pdoc->decorations.AllOnFor(position); -+ const int mask = pdoc->decorations.AllOnFor(position); - if ((click && mask) || pdoc->decorations.ClickNotified()) { - SCNotification scn = {}; - pdoc->decorations.SetClickNotified(click); -@@ -2539,7 +2539,7 @@ - // character is still present else after the previous surviving character. - static inline Sci::Position MovePositionForDeletion(Sci::Position position, Sci::Position startDeletion, Sci::Position length) { - if (position > startDeletion) { -- Sci::Position endDeletion = startDeletion + length; -+ const Sci::Position endDeletion = startDeletion + length; - if (position > endDeletion) { - return position - length; - } else { -@@ -2862,9 +2862,9 @@ - Sci::Line topLineNew; - SelectionPosition newPos; - -- Sci::Line currentLine = pdoc->LineFromPosition(sel.MainCaret()); -- Sci::Line topStutterLine = topLine + caretYSlop; -- Sci::Line bottomStutterLine = -+ const Sci::Line currentLine = pdoc->LineFromPosition(sel.MainCaret()); -+ const Sci::Line topStutterLine = topLine + caretYSlop; -+ const Sci::Line bottomStutterLine = - pdoc->LineFromPosition(PositionFromLocation( - Point::FromInts(lastXChosen - xOffset, direction * vs.lineHeight * LinesToScroll()))) - - caretYSlop - 1; -@@ -3810,26 +3810,26 @@ - return DelWordOrLine(iMessage); - - case SCI_LINECOPY: { -- Sci::Line lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -- Sci::Line lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); -+ const Sci::Line lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -+ const Sci::Line lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); - CopyRangeToClipboard(pdoc->LineStart(lineStart), - pdoc->LineStart(lineEnd + 1)); - } - break; - case SCI_LINECUT: { -- Sci::Line lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -- Sci::Line lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); -- Sci::Position start = pdoc->LineStart(lineStart); -- Sci::Position end = pdoc->LineStart(lineEnd + 1); -+ const Sci::Line lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -+ const Sci::Line lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); -+ const Sci::Position start = pdoc->LineStart(lineStart); -+ const Sci::Position end = pdoc->LineStart(lineEnd + 1); - SetSelection(start, end); - Cut(); - SetLastXChosen(); - } - break; - case SCI_LINEDELETE: { -- Sci::Line line = pdoc->LineFromPosition(sel.MainCaret()); -- Sci::Position start = pdoc->LineStart(line); -- Sci::Position end = pdoc->LineStart(line + 1); -+ const Sci::Line line = pdoc->LineFromPosition(sel.MainCaret()); -+ const Sci::Position start = pdoc->LineStart(line); -+ const Sci::Position end = pdoc->LineStart(line + 1); - pdoc->DeleteChars(start, end - start); - } - break; -@@ -3918,8 +3918,8 @@ - } else { - if (pdoc->GetColumn(caretPosition) <= pdoc->GetLineIndentation(lineCurrentPos) && - pdoc->tabIndents) { -- int indentation = pdoc->GetLineIndentation(lineCurrentPos); -- int indentationStep = pdoc->IndentSize(); -+ const int indentation = pdoc->GetLineIndentation(lineCurrentPos); -+ const int indentationStep = pdoc->IndentSize(); - const Sci::Position posSelect = pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep); - sel.Range(r) = SelectionRange(posSelect); - } else { -@@ -3934,10 +3934,10 @@ - } - } - } else { // Multiline -- Sci::Position anchorPosOnLine = sel.Range(r).anchor.Position() - pdoc->LineStart(lineOfAnchor); -- Sci::Position currentPosPosOnLine = caretPosition - pdoc->LineStart(lineCurrentPos); -+ const Sci::Position anchorPosOnLine = sel.Range(r).anchor.Position() - pdoc->LineStart(lineOfAnchor); -+ const Sci::Position currentPosPosOnLine = caretPosition - pdoc->LineStart(lineCurrentPos); - // Multiple lines selected so indent / dedent -- Sci::Line lineTopSel = std::min(lineOfAnchor, lineCurrentPos); -+ const Sci::Line lineTopSel = std::min(lineOfAnchor, lineCurrentPos); - Sci::Line lineBottomSel = std::max(lineOfAnchor, lineCurrentPos); - if (pdoc->LineStart(lineBottomSel) == sel.Range(r).anchor.Position() || pdoc->LineStart(lineBottomSel) == caretPosition) - lineBottomSel--; // If not selecting any characters on a line, do not indent -@@ -4148,7 +4148,7 @@ - if (sel.selType == Selection::selRectangle) - std::sort(rangesInOrder.begin(), rangesInOrder.end()); - for (size_t r=0; r<rangesInOrder.size(); r++) { -- SelectionRange current = rangesInOrder[r]; -+ const SelectionRange current = rangesInOrder[r]; - text.append(RangeText(current.Start().Position(), current.End().Position())); - if (sel.selType == Selection::selRectangle) { - if (pdoc->eolMode != SC_EOL_LF) -@@ -4207,9 +4207,9 @@ - } - - bool Editor::DragThreshold(Point ptStart, Point ptNow) { -- int xMove = static_cast<int>(ptStart.x - ptNow.x); -- int yMove = static_cast<int>(ptStart.y - ptNow.y); -- int distanceSquared = xMove * xMove + yMove * yMove; -+ const int xMove = static_cast<int>(ptStart.x - ptNow.x); -+ const int yMove = static_cast<int>(ptStart.y - ptNow.y); -+ const int distanceSquared = xMove * xMove + yMove * yMove; - return distanceSquared > 16; - } - -@@ -4224,9 +4224,9 @@ - if (inDragDrop == ddDragging) - dropWentOutside = false; - -- bool positionWasInSelection = PositionInSelection(position.Position()); -- -- bool positionOnEdgeOfSelection = -+ const bool positionWasInSelection = PositionInSelection(position.Position()); -+ -+ const bool positionOnEdgeOfSelection = - (position == SelectionStart()) || (position == SelectionEnd()); - - if ((inDragDrop != ddDragging) || !(positionWasInSelection) || -@@ -4298,10 +4298,10 @@ - } - - bool Editor::PointInSelection(Point pt) { -- SelectionPosition pos = SPositionFromLocation(pt, false, true); -- Point ptPos = LocationFromPosition(pos); -+ const SelectionPosition pos = SPositionFromLocation(pt, false, true); -+ const Point ptPos = LocationFromPosition(pos); - for (size_t r=0; r<sel.Count(); r++) { -- SelectionRange range = sel.Range(r); -+ const SelectionRange range = sel.Range(r); - if (range.Contains(pos)) { - bool hit = true; - if (pos == range.Start()) { -@@ -4456,7 +4456,7 @@ - - NotifyIndicatorClick(true, newPos.Position(), modifiers); - -- bool inSelMargin = PointInSelMargin(pt); -+ const bool inSelMargin = PointInSelMargin(pt); - // In margin ctrl+(double)click should always select everything - if (ctrl && inSelMargin) { - SelectAll(); -@@ -4647,7 +4647,7 @@ - } - - void Editor::SetHoverIndicatorPosition(Sci::Position position) { -- Sci::Position hoverIndicatorPosPrev = hoverIndicatorPos; -+ const Sci::Position hoverIndicatorPosPrev = hoverIndicatorPos; - hoverIndicatorPos = INVALID_POSITION; - if (vs.indicatorsDynamic == 0) - return; -@@ -5276,7 +5276,7 @@ - - void Editor::SetAnnotationVisible(int visible) { - if (vs.annotationVisible != visible) { -- bool changedFromOrToHidden = ((vs.annotationVisible != 0) != (visible != 0)); -+ const bool changedFromOrToHidden = ((vs.annotationVisible != 0) != (visible != 0)); - vs.annotationVisible = visible; - if (changedFromOrToHidden) { - int dir = vs.annotationVisible ? 1 : -1; -@@ -5299,7 +5299,7 @@ - line++; - while (line <= lineMaxSubord) { - cs.SetVisible(line, line, true); -- int level = pdoc->GetLevel(line); -+ const int level = pdoc->GetLevel(line); - if (level & SC_FOLDLEVELHEADERFLAG) { - if (cs.GetExpanded(line)) { - line = ExpandLine(line); -@@ -5330,12 +5330,12 @@ - } - - if (action == SC_FOLDACTION_CONTRACT) { -- Sci::Line lineMaxSubord = pdoc->GetLastChild(line); -+ const Sci::Line lineMaxSubord = pdoc->GetLastChild(line); - if (lineMaxSubord > line) { - cs.SetExpanded(line, 0); - cs.SetVisible(line + 1, lineMaxSubord, false); - -- Sci::Line lineCurrent = pdoc->LineFromPosition(sel.MainCaret()); -+ const Sci::Line lineCurrent = pdoc->LineFromPosition(sel.MainCaret()); - if (lineCurrent > line && lineCurrent <= lineMaxSubord) { - // This does not re-expand the fold - EnsureCaretVisible(); -@@ -5372,7 +5372,7 @@ - line++; - cs.SetVisible(line, lineMaxSubord, expanding); - while (line <= lineMaxSubord) { -- int levelLine = pdoc->GetLevel(line); -+ const int levelLine = pdoc->GetLevel(line); - if (levelLine & SC_FOLDLEVELHEADERFLAG) { - SetFoldExpanded(line, expanding); - } -@@ -5428,7 +5428,7 @@ - Redraw(); - } - if (enforcePolicy) { -- Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); -+ const Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); - if (visiblePolicy & VISIBLE_SLOP) { - if ((topLine > lineDisplay) || ((visiblePolicy & VISIBLE_STRICT) && (topLine + visibleSlop > lineDisplay))) { - SetTopLine(Platform::Clamp(lineDisplay - visibleSlop, 0, MaxScrollPos())); -@@ -5466,14 +5466,14 @@ - if (expanding) { - cs.SetVisible(0, maxLine-1, true); - for (int line = 0; line < maxLine; line++) { -- int levelLine = pdoc->GetLevel(line); -+ const int levelLine = pdoc->GetLevel(line); - if (levelLine & SC_FOLDLEVELHEADERFLAG) { - SetFoldExpanded(line, true); - } - } - } else { - for (int line = 0; line < maxLine; line++) { -- int level = pdoc->GetLevel(line); -+ const int level = pdoc->GetLevel(line); - if ((level & SC_FOLDLEVELHEADERFLAG) && - (SC_FOLDLEVELBASE == LevelNumber(level))) { - SetFoldExpanded(line, false); -@@ -5540,8 +5540,8 @@ - - void Editor::NeedShown(Sci::Position pos, Sci::Position len) { - if (foldAutomatic & SC_AUTOMATICFOLD_SHOW) { -- Sci::Line lineStart = pdoc->LineFromPosition(pos); -- Sci::Line lineEnd = pdoc->LineFromPosition(pos+len); -+ const Sci::Line lineStart = pdoc->LineFromPosition(pos); -+ const Sci::Line lineEnd = pdoc->LineFromPosition(pos+len); - for (Sci::Line line = lineStart; line <= lineEnd; line++) { - EnsureLineVisible(line, false); - } -@@ -7693,7 +7693,7 @@ - SelectionSegment segmentLine(SelectionPosition(pdoc->LineStart(static_cast<int>(wParam))), - SelectionPosition(pdoc->LineEnd(static_cast<int>(wParam)))); - for (size_t r=0; r<sel.Count(); r++) { -- SelectionSegment portion = sel.Range(r).Intersect(segmentLine); -+ const SelectionSegment portion = sel.Range(r).Intersect(segmentLine); - if (portion.start.IsValid()) { - return (iMessage == SCI_GETLINESELSTARTPOSITION) ? portion.start.Position() : portion.end.Position(); - } -diff -r 797ed6c538fd -r d046ce80d590 src/ExternalLexer.cxx ---- a/src/ExternalLexer.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/ExternalLexer.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -65,7 +65,7 @@ - GetLexerNameFn GetLexerName = (GetLexerNameFn)(sptr_t)lib->FindFunction("GetLexerName"); - GetLexerFactoryFunction fnFactory = (GetLexerFactoryFunction)(sptr_t)lib->FindFunction("GetLexerFactory"); - -- int nl = GetLexerCount(); -+ const int nl = GetLexerCount(); - - for (int i = 0; i < nl; i++) { - // Assign a buffer for the lexer name. -diff -r 797ed6c538fd -r d046ce80d590 src/Indicator.cxx ---- a/src/Indicator.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/Indicator.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -36,7 +36,7 @@ - int ymid = static_cast<int>(rc.bottom + rc.top) / 2; - if (sacDraw.style == INDIC_SQUIGGLE) { - int x = int(rc.left+0.5); -- int xLast = int(rc.right+0.5); -+ const int xLast = int(rc.right+0.5); - int y = 0; - surface->MoveTo(x, static_cast<int>(rc.top) + y); - while (x < xLast) { -diff -r 797ed6c538fd -r d046ce80d590 src/LineMarker.cxx ---- a/src/LineMarker.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/LineMarker.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -122,11 +122,11 @@ - int minDim = Platform::Minimum(static_cast<int>(rc.Width()), static_cast<int>(rc.Height())); - minDim--; // Ensure does not go beyond edge - int centreX = static_cast<int>(floor((rc.right + rc.left) / 2.0)); -- int centreY = static_cast<int>(floor((rc.bottom + rc.top) / 2.0)); -- int dimOn2 = minDim / 2; -- int dimOn4 = minDim / 4; -+ const int centreY = static_cast<int>(floor((rc.bottom + rc.top) / 2.0)); -+ const int dimOn2 = minDim / 2; -+ const int dimOn4 = minDim / 4; - int blobSize = dimOn2-1; -- int armSize = dimOn2-2; -+ const int armSize = dimOn2-2; - if (marginStyle == SC_MARGIN_NUMBER || marginStyle == SC_MARGIN_TEXT || marginStyle == SC_MARGIN_RTEXT) { - // On textual margins move marker to the left to try to avoid overlapping the text - centreX = static_cast<int>(rc.left) + dimOn2 + 1; -@@ -384,7 +384,7 @@ - rcLeft.right = rcLeft.left + 4; - surface->FillRectangle(rcLeft, back); - } else if (markType == SC_MARK_BOOKMARK) { -- int halfHeight = minDim / 3; -+ const int halfHeight = minDim / 3; - Point pts[] = { - Point::FromInts(static_cast<int>(rc.left), centreY-halfHeight), - Point::FromInts(static_cast<int>(rc.right) - 3, centreY - halfHeight), -diff -r 797ed6c538fd -r d046ce80d590 src/MarginView.cxx ---- a/src/MarginView.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/MarginView.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -64,10 +64,10 @@ - enum { xa = 1 }; // gap before start - int w = static_cast<int>(rcPlace.right - rcPlace.left) - xa - 1; - -- bool xStraight = isEndMarker; // x-mirrored symbol for start marker -+ const bool xStraight = isEndMarker; // x-mirrored symbol for start marker - -- int x0 = static_cast<int>(xStraight ? rcPlace.left : rcPlace.right - 1); -- int y0 = static_cast<int>(rcPlace.top); -+ const int x0 = static_cast<int>(xStraight ? rcPlace.left : rcPlace.right - 1); -+ const int y0 = static_cast<int>(rcPlace.top); - - int dy = static_cast<int>(rcPlace.bottom - rcPlace.top) / 5; - int y = static_cast<int>(rcPlace.bottom - rcPlace.top) / 2 + dy; -@@ -205,7 +205,7 @@ - // Required because of special way brush is created for selection margin - // Ensure patterns line up when scrolling with separate margin view - // by choosing correctly aligned variant. -- bool invertPhase = static_cast<int>(ptOrigin.y) & 1; -+ const bool invertPhase = static_cast<int>(ptOrigin.y) & 1; - surface->FillRectangle(rcSelMargin, - invertPhase ? *pixmapSelPattern : *pixmapSelPatternOffset1); - } else { -@@ -238,7 +238,7 @@ - // be displayed until the last of a sequence of whitespace. - bool needWhiteClosure = false; - if (vs.ms[margin].mask & SC_MASK_FOLDERS) { -- int level = model.pdoc->GetLevel(model.cs.DocFromDisplay(visibleLine)); -+ const int level = model.pdoc->GetLevel(model.cs.DocFromDisplay(visibleLine)); - if (level & SC_FOLDLEVELWHITEFLAG) { - Sci::Line lineBack = model.cs.DocFromDisplay(visibleLine); - int levelPrev = level; -@@ -380,7 +380,7 @@ - sprintf(number, "%d", lineDoc + 1); - if (model.foldFlags & (SC_FOLDFLAG_LEVELNUMBERS | SC_FOLDFLAG_LINESTATE)) { - if (model.foldFlags & SC_FOLDFLAG_LEVELNUMBERS) { -- int lev = model.pdoc->GetLevel(lineDoc); -+ const int lev = model.pdoc->GetLevel(lineDoc); - sprintf(number, "%c%c %03X %03X", - (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_', - (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_', -@@ -388,7 +388,7 @@ - lev >> 16 - ); - } else { -- int state = model.pdoc->GetLineState(lineDoc); -+ const int state = model.pdoc->GetLineState(lineDoc); - sprintf(number, "%0X", state); - } - } -diff -r 797ed6c538fd -r d046ce80d590 src/Partitioning.h ---- a/src/Partitioning.h Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/Partitioning.h Thu Apr 06 21:04:37 2017 +1000 -@@ -27,9 +27,9 @@ - void RangeAddDelta(int start, int end, int delta) { - // end is 1 past end, so end-start is number of elements to change - int i = 0; -- int rangeLength = end - start; -+ const int rangeLength = end - start; - int range1Length = rangeLength; -- int part1Left = part1Length - start; -+ const int part1Left = part1Length - start; - if (range1Length > part1Left) - range1Length = part1Left; - while (i < range1Length) { -@@ -170,7 +170,7 @@ - int lower = 0; - int upper = body->Length()-1; - do { -- int middle = (upper + lower + 1) / 2; // Round high -+ const int middle = (upper + lower + 1) / 2; // Round high - int posMiddle = body->ValueAt(middle); - if (middle > stepPartition) - posMiddle += stepLength; -diff -r 797ed6c538fd -r d046ce80d590 src/PerLine.cxx ---- a/src/PerLine.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/PerLine.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -181,9 +181,9 @@ - Sci::Line LineMarkers::MarkerNext(Sci::Line lineStart, int mask) const { - if (lineStart < 0) - lineStart = 0; -- Sci::Line length = markers.Length(); -+ const Sci::Line length = markers.Length(); - for (Sci::Line iLine = lineStart; iLine < length; iLine++) { -- MarkerHandleSet *onLine = markers[iLine]; -+ const MarkerHandleSet *onLine = markers[iLine]; - if (onLine && ((onLine->MarkValue() & mask) != 0)) - //if ((pdoc->GetMark(iLine) & lParam) != 0) - return iLine; -@@ -318,7 +318,7 @@ - - int LineState::SetLineState(Sci::Line line, int state) { - lineStates.EnsureLength(line + 1); -- int stateOld = lineStates[line]; -+ const int stateOld = lineStates[line]; - lineStates[line] = state; - return stateOld; - } -@@ -410,7 +410,7 @@ - } - - static char *AllocateAnnotation(int length, int style) { -- size_t len = sizeof(AnnotationHeader) + length + ((style == IndividualStyles) ? length : 0); -+ const size_t len = sizeof(AnnotationHeader) + length + ((style == IndividualStyles) ? length : 0); - char *ret = new char[len](); - return ret; - } -@@ -418,7 +418,7 @@ - void LineAnnotation::SetText(Sci::Line line, const char *text) { - if (text && (line >= 0)) { - annotations.EnsureLength(line+1); -- int style = Style(line); -+ const int style = Style(line); - if (annotations[line]) { - delete []annotations[line]; - } -diff -r 797ed6c538fd -r d046ce80d590 src/PositionCache.cxx ---- a/src/PositionCache.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/PositionCache.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -189,7 +189,7 @@ - int LineLayout::FindBefore(XYPOSITION x, int lower, int upper) const { - do { - int middle = (upper + lower + 1) / 2; // Round high -- XYPOSITION posMiddle = positions[middle]; -+ const XYPOSITION posMiddle = positions[middle]; - if (x < posMiddle) { - upper = middle - 1; - } else { -@@ -469,11 +469,11 @@ - } - - if (breakForSelection) { -- SelectionPosition posStart(posLineStart); -- SelectionPosition posEnd(posLineStart + lineRange.end); -- SelectionSegment segmentLine(posStart, posEnd); -+ const SelectionPosition posStart(posLineStart); -+ const SelectionPosition posEnd(posLineStart + lineRange.end); -+ const SelectionSegment segmentLine(posStart, posEnd); - for (size_t r=0; r<psel->Count(); r++) { -- SelectionSegment portion = psel->Range(r).Intersect(segmentLine); -+ const SelectionSegment portion = psel->Range(r).Intersect(segmentLine); - if (!(portion.start == portion.end)) { - if (portion.start.IsValid()) - Insert(portion.start.Position() - posLineStart); -@@ -653,7 +653,7 @@ - } - - void PositionCache::MeasureWidths(Surface *surface, const ViewStyle &vstyle, unsigned int styleNumber, -- const char *s, unsigned int len, XYPOSITION *positions, Document *pdoc) { -+ const char *s, unsigned int len, XYPOSITION *positions, const Document *pdoc) { - - allClear = false; - size_t probe = pces.size(); // Out of bounds -diff -r 797ed6c538fd -r d046ce80d590 src/PositionCache.h ---- a/src/PositionCache.h Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/PositionCache.h Thu Apr 06 21:04:37 2017 +1000 -@@ -214,7 +214,7 @@ - void SetSize(size_t size_); - size_t GetSize() const { return pces.size(); } - void MeasureWidths(Surface *surface, const ViewStyle &vstyle, unsigned int styleNumber, -- const char *s, unsigned int len, XYPOSITION *positions, Document *pdoc); -+ const char *s, unsigned int len, XYPOSITION *positions, const Document *pdoc); - }; - - inline bool IsSpaceOrTab(int ch) { -diff -r 797ed6c538fd -r d046ce80d590 src/RESearch.cxx ---- a/src/RESearch.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/RESearch.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -358,7 +358,7 @@ - incr = 0; // Most of the time, will skip the char "naturally". - int c; - int result = -1; -- unsigned char bsc = *pattern; -+ const unsigned char bsc = *pattern; - if (!bsc) { - // Avoid overrun - result = '\\'; // \ at end of pattern, take it literally -@@ -376,9 +376,9 @@ - result = escapeValue(bsc); - break; - case 'x': { -- unsigned char hd1 = *(pattern + 1); -- unsigned char hd2 = *(pattern + 2); -- int hexValue = GetHexaChar(hd1, hd2); -+ const unsigned char hd1 = *(pattern + 1); -+ const unsigned char hd2 = *(pattern + 2); -+ const int hexValue = GetHexaChar(hd1, hd2); - if (hexValue >= 0) { - result = hexValue; - incr = 2; // Must skip the digits -diff -r 797ed6c538fd -r d046ce80d590 src/RunStyles.cxx ---- a/src/RunStyles.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/RunStyles.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -38,7 +38,7 @@ - // If there is no run boundary at position, insert one continuing style. - int RunStyles::SplitRun(int position) { - int run = RunFromPosition(position); -- int posRun = starts->PositionFromPartition(run); -+ const int posRun = starts->PositionFromPartition(run); - if (posRun < position) { - int runStyle = ValueAt(position); - run++; -@@ -91,12 +91,12 @@ - } - - int RunStyles::FindNextChange(int position, int end) const { -- int run = starts->PartitionFromPosition(position); -+ const int run = starts->PartitionFromPosition(position); - if (run < starts->Partitions()) { -- int runChange = starts->PositionFromPartition(run); -+ const int runChange = starts->PositionFromPartition(run); - if (runChange > position) - return runChange; -- int nextChange = starts->PositionFromPartition(run + 1); -+ const int nextChange = starts->PositionFromPartition(run + 1); - if (nextChange > position) { - return nextChange; - } else if (position < end) { -@@ -273,7 +273,7 @@ - } - int start=0; - while (start < Length()) { -- int end = EndRun(start); -+ const int end = EndRun(start); - if (start >= end) { - throw std::runtime_error("RunStyles: Partition is 0 length."); - } -diff -r 797ed6c538fd -r d046ce80d590 src/ScintillaBase.cxx ---- a/src/ScintillaBase.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/ScintillaBase.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -79,7 +79,7 @@ - } - - void ScintillaBase::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) { -- bool isFillUp = ac.Active() && ac.IsFillUpChar(*s); -+ const bool isFillUp = ac.Active() && ac.IsFillUpChar(*s); - if (!isFillUp) { - Editor::AddCharUTF(s, len, treatAsDBCS); - } -@@ -365,7 +365,7 @@ - } - - void ScintillaBase::AutoCompleteCompleted(char ch, unsigned int completionMethod) { -- int item = ac.GetSelection(); -+ const int item = ac.GetSelection(); - if (item == -1) { - AutoCompleteCancel(); - return; -@@ -415,7 +415,7 @@ - - int ScintillaBase::AutoCompleteGetCurrentText(char *buffer) const { - if (ac.Active()) { -- int item = ac.GetSelection(); -+ const int item = ac.GetSelection(); - if (item != -1) { - const std::string selected = ac.GetValue(item); - if (buffer != NULL) -@@ -453,7 +453,7 @@ - wMain); - // If the call-tip window would be out of the client - // space -- PRectangle rcClient = GetClientRectangle(); -+ const PRectangle rcClient = GetClientRectangle(); - int offset = vs.lineHeight + static_cast<int>(rc.Height()); - // adjust so it displays above the text. - if (rc.bottom > rcClient.bottom && rc.Height() < rcClient.Height()) { -@@ -485,7 +485,7 @@ - - void ScintillaBase::ContextMenu(Point pt) { - if (displayPopupMenu) { -- bool writable = !WndProc(SCI_GETREADONLY, 0, 0); -+ const bool writable = !WndProc(SCI_GETREADONLY, 0, 0); - popup.CreatePopUp(); - AddToPopUp("Undo", idcmdUndo, writable && pdoc->CanUndo()); - AddToPopUp("Redo", idcmdRedo, writable && pdoc->CanRedo()); -diff -r 797ed6c538fd -r d046ce80d590 src/Selection.cxx ---- a/src/Selection.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/Selection.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -36,7 +36,7 @@ - virtualSpace = 0; - } - if (position > startChange) { -- Sci::Position endDeletion = startChange + length; -+ const Sci::Position endDeletion = startChange + length; - if (position > endDeletion) { - position -= length; - } else { -@@ -131,8 +131,8 @@ - } - - bool SelectionRange::Trim(SelectionRange range) { -- SelectionPosition startRange = range.Start(); -- SelectionPosition endRange = range.End(); -+ const SelectionPosition startRange = range.Start(); -+ const SelectionPosition endRange = range.End(); - SelectionPosition start = Start(); - SelectionPosition end = End(); - PLATFORM_ASSERT(start <= end); -diff -r 797ed6c538fd -r d046ce80d590 src/SplitVector.h ---- a/src/SplitVector.h Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/SplitVector.h Thu Apr 06 21:04:37 2017 +1000 -@@ -251,7 +251,7 @@ - // Split into up to 2 ranges, before and after the split then use memcpy on each. - int range1Length = 0; - if (position < part1Length) { -- int part1AfterPosition = part1Length - position; -+ const int part1AfterPosition = part1Length - position; - range1Length = retrieveLength; - if (range1Length > part1AfterPosition) - range1Length = part1AfterPosition; -diff -r 797ed6c538fd -r d046ce80d590 src/UniConversion.cxx ---- a/src/UniConversion.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/UniConversion.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -23,7 +23,7 @@ - unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) { - unsigned int len = 0; - for (unsigned int i = 0; i < tlen && uptr[i];) { -- unsigned int uch = uptr[i]; -+ const unsigned int uch = uptr[i]; - if (uch < 0x80) { - len++; - } else if (uch < 0x800) { -@@ -43,7 +43,7 @@ - void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len) { - unsigned int k = 0; - for (unsigned int i = 0; i < tlen && uptr[i];) { -- unsigned int uch = uptr[i]; -+ const unsigned int uch = uptr[i]; - if (uch < 0x80) { - putf[k++] = static_cast<char>(uch); - } else if (uch < 0x800) { -@@ -53,7 +53,7 @@ - (uch <= SURROGATE_TRAIL_LAST)) { - // Half a surrogate pair - i++; -- unsigned int xch = 0x10000 + ((uch & 0x3ff) << 10) + (uptr[i] & 0x3ff); -+ const unsigned int xch = 0x10000 + ((uch & 0x3ff) << 10) + (uptr[i] & 0x3ff); - putf[k++] = static_cast<char>(0xF0 | (xch >> 18)); - putf[k++] = static_cast<char>(0x80 | ((xch >> 12) & 0x3f)); - putf[k++] = static_cast<char>(0x80 | ((xch >> 6) & 0x3f)); -@@ -85,7 +85,7 @@ - size_t ulen = 0; - size_t charLen; - for (size_t i = 0; i<len;) { -- unsigned char ch = static_cast<unsigned char>(s[i]); -+ const unsigned char ch = static_cast<unsigned char>(s[i]); - if (ch < 0x80) { - charLen = 1; - } else if (ch < 0x80 + 0x40 + 0x20) { -@@ -301,7 +301,7 @@ - } - - int UTF8DrawBytes(const unsigned char *us, int len) { -- int utf8StatusNext = UTF8Classify(us, len); -+ const int utf8StatusNext = UTF8Classify(us, len); - return (utf8StatusNext & UTF8MaskInvalid) ? 1 : (utf8StatusNext & UTF8MaskWidth); - } - -diff -r 797ed6c538fd -r d046ce80d590 src/ViewStyle.cxx ---- a/src/ViewStyle.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/ViewStyle.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -565,31 +565,31 @@ - wrapStateWanted = eWrapNone; - break; - } -- bool changed = wrapState != wrapStateWanted; -+ const bool changed = wrapState != wrapStateWanted; - wrapState = wrapStateWanted; - return changed; - } - - bool ViewStyle::SetWrapVisualFlags(int wrapVisualFlags_) { -- bool changed = wrapVisualFlags != wrapVisualFlags_; -+ const bool changed = wrapVisualFlags != wrapVisualFlags_; - wrapVisualFlags = wrapVisualFlags_; - return changed; - } - - bool ViewStyle::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_) { -- bool changed = wrapVisualFlagsLocation != wrapVisualFlagsLocation_; -+ const bool changed = wrapVisualFlagsLocation != wrapVisualFlagsLocation_; - wrapVisualFlagsLocation = wrapVisualFlagsLocation_; - return changed; - } - - bool ViewStyle::SetWrapVisualStartIndent(int wrapVisualStartIndent_) { -- bool changed = wrapVisualStartIndent != wrapVisualStartIndent_; -+ const bool changed = wrapVisualStartIndent != wrapVisualStartIndent_; - wrapVisualStartIndent = wrapVisualStartIndent_; - return changed; - } - - bool ViewStyle::SetWrapIndentMode(int wrapIndentMode_) { -- bool changed = wrapIndentMode != wrapIndentMode_; -+ const bool changed = wrapIndentMode != wrapIndentMode_; - wrapIndentMode = wrapIndentMode_; - return changed; - } -diff -r 797ed6c538fd -r d046ce80d590 src/XPM.cxx ---- a/src/XPM.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/XPM.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -117,24 +117,24 @@ - - for (int y=0; y<height; y++) { - const char *lform = linesForm[y+nColours+1]; -- size_t len = MeasureLength(lform); -+ const size_t len = MeasureLength(lform); - for (size_t x = 0; x<len; x++) - pixels[y * width + x] = static_cast<unsigned char>(lform[x]); - } - } - --void XPM::Draw(Surface *surface, PRectangle &rc) { -+void XPM::Draw(Surface *surface, const PRectangle &rc) { - if (pixels.empty()) { - return; - } - // Centre the pixmap -- int startY = static_cast<int>(rc.top + (rc.Height() - height) / 2); -- int startX = static_cast<int>(rc.left + (rc.Width() - width) / 2); -+ const int startY = static_cast<int>(rc.top + (rc.Height() - height) / 2); -+ const int startX = static_cast<int>(rc.left + (rc.Width() - width) / 2); - for (int y=0; y<height; y++) { - int prevCode = 0; - int xStartRun = 0; - for (int x=0; x<width; x++) { -- int code = pixels[y * width + x]; -+ const int code = pixels[y * width + x]; - if (code != prevCode) { - FillRun(surface, prevCode, startX + xStartRun, startY + y, startX + x); - xStartRun = x; -diff -r 797ed6c538fd -r d046ce80d590 src/XPM.h ---- a/src/XPM.h Thu Apr 06 20:19:23 2017 +1000 -+++ b/src/XPM.h Thu Apr 06 21:04:37 2017 +1000 -@@ -31,7 +31,7 @@ - void Init(const char *textForm); - void Init(const char *const *linesForm); - /// Decompose image into runs and use FillRectangle for each run -- void Draw(Surface *surface, PRectangle &rc); -+ void Draw(Surface *surface, const PRectangle &rc); - int GetHeight() const { return height; } - int GetWidth() const { return width; } - void PixelAt(int x, int y, ColourDesired &colour, bool &transparent) const; -diff -r 797ed6c538fd -r d046ce80d590 win32/HanjaDic.cxx ---- a/win32/HanjaDic.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/win32/HanjaDic.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -112,7 +112,7 @@ - if (dict.IsHanja(static_cast<int>(inout[i]))) { // Pass hanja only! - conv[0] = inout[i]; - BSTR bstrHanja = SysAllocString(conv); -- HRESULT hr = dict.HJinterface->HanjaToHangul(bstrHanja, &bstrHangul); -+ const HRESULT hr = dict.HJinterface->HanjaToHangul(bstrHanja, &bstrHangul); - if (SUCCEEDED(hr)) { - inout[i] = static_cast<wchar_t>(bstrHangul[0]); - changed += 1; -diff -r 797ed6c538fd -r d046ce80d590 win32/PlatWin.cxx ---- a/win32/PlatWin.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/win32/PlatWin.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -129,7 +129,7 @@ - } - - if (pIDWriteFactory) { -- HRESULT hr = pIDWriteFactory->CreateRenderingParams(&defaultRenderingParams); -+ const HRESULT hr = pIDWriteFactory->CreateRenderingParams(&defaultRenderingParams); - if (SUCCEEDED(hr)) { - unsigned int clearTypeContrast; - if (::SystemParametersInfo(SPI_GETFONTSMOOTHINGCONTRAST, 0, &clearTypeContrast, 0)) { -@@ -212,7 +212,7 @@ - return 0; - } - } else { -- HRESULT hr = pTextFormat->GetFontFamilyName(lf.lfFaceName, LF_FACESIZE); -+ const HRESULT hr = pTextFormat->GetFontFamilyName(lf.lfFaceName, LF_FACESIZE); - if (!SUCCEEDED(hr)) { - return 0; - } -@@ -393,7 +393,7 @@ - FontID FontCached::FindOrCreate(const FontParameters &fp) { - FontID ret = 0; - ::EnterCriticalSection(&crPlatformLock); -- int hashFind = HashFont(fp); -+ const int hashFind = HashFont(fp); - for (FontCached *cur=first; cur; cur=cur->next) { - if ((cur->hash == hashFind) && - cur->SameAs(fp)) { -@@ -843,7 +843,7 @@ - for (int y=height-1; y>=0; y--) { - for (int x=0; x<width; x++) { - unsigned char *pixel = image + (y*width+x) * 4; -- unsigned char alpha = pixelsImage[3]; -+ const unsigned char alpha = pixelsImage[3]; - // Input is RGBA, output is BGRA with premultiplied alpha - pixel[2] = static_cast<unsigned char>((*pixelsImage++) * alpha / 255); - pixel[1] = static_cast<unsigned char>((*pixelsImage++) * alpha / 255); -@@ -952,7 +952,7 @@ - } - // Map the widths given for UTF-16 characters back onto the UTF-8 input string - for (int ui = 0; ui < fit; ui++) { -- unsigned int lenChar = UTF8BytesOfLead[static_cast<unsigned char>(s[i])]; -+ const unsigned int lenChar = UTF8BytesOfLead[static_cast<unsigned char>(s[i])]; - if (lenChar == 4) { // Non-BMP - ui++; - } -@@ -1211,7 +1211,7 @@ - desiredFormat = psurfOther->pRenderTarget->GetPixelFormat(); - #endif - desiredFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE; -- HRESULT hr = psurfOther->pRenderTarget->CreateCompatibleRenderTarget( -+ const HRESULT hr = psurfOther->pRenderTarget->CreateCompatibleRenderTarget( - &desiredSize, NULL, &desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &pCompatibleRenderTarget); - if (SUCCEEDED(hr)) { - pRenderTarget = pCompatibleRenderTarget; -@@ -1236,7 +1236,7 @@ - if (pBrush) { - pBrush->SetColor(col); - } else { -- HRESULT hr = pRenderTarget->CreateSolidColorBrush(col, &pBrush); -+ const HRESULT hr = pRenderTarget->CreateSolidColorBrush(col, &pBrush); - if (!SUCCEEDED(hr) && pBrush) { - pBrush->Release(); - pBrush = 0; -@@ -1297,18 +1297,18 @@ - - void SurfaceD2D::LineTo(int x_, int y_) { - if (pRenderTarget) { -- int xDiff = x_ - x; -- int xDelta = Delta(xDiff); -- int yDiff = y_ - y; -- int yDelta = Delta(yDiff); -+ const int xDiff = x_ - x; -+ const int xDelta = Delta(xDiff); -+ const int yDiff = y_ - y; -+ const int yDelta = Delta(yDiff); - if ((xDiff == 0) || (yDiff == 0)) { - // Horizontal or vertical lines can be more precisely drawn as a filled rectangle -- int xEnd = x_ - xDelta; -- int left = Platform::Minimum(x, xEnd); -- int width = abs(x - xEnd) + 1; -- int yEnd = y_ - yDelta; -- int top = Platform::Minimum(y, yEnd); -- int height = abs(y - yEnd) + 1; -+ const int xEnd = x_ - xDelta; -+ const int left = Platform::Minimum(x, xEnd); -+ const int width = abs(x - xEnd) + 1; -+ const int yEnd = y_ - yDelta; -+ const int top = Platform::Minimum(y, yEnd); -+ const int height = abs(y - yEnd) + 1; - D2D1_RECT_F rectangle1 = D2D1::RectF(static_cast<float>(left), static_cast<float>(top), - static_cast<float>(left+width), static_cast<float>(top+height)); - pRenderTarget->FillRectangle(&rectangle1, pBrush); -@@ -1455,7 +1455,7 @@ - for (int yPixel=0; yPixel<height; yPixel++) { - for (int xPixel = 0; xPixel<width; xPixel++) { - unsigned char *pixel = &image[0] + (yPixel*width + xPixel) * 4; -- unsigned char alpha = pixelsImage[3]; -+ const unsigned char alpha = pixelsImage[3]; - // Input is RGBA, output is BGRA with premultiplied alpha - pixel[2] = (*pixelsImage++) * alpha / 255; - pixel[1] = (*pixelsImage++) * alpha / 255; -@@ -1468,7 +1468,7 @@ - D2D1_SIZE_U size = D2D1::SizeU(width, height); - D2D1_BITMAP_PROPERTIES props = {{DXGI_FORMAT_B8G8R8A8_UNORM, - D2D1_ALPHA_MODE_PREMULTIPLIED}, 72.0, 72.0}; -- HRESULT hr = pRenderTarget->CreateBitmap(size, &image[0], -+ const HRESULT hr = pRenderTarget->CreateBitmap(size, &image[0], - width * 4, &props, &bitmap); - if (SUCCEEDED(hr)) { - D2D1_RECT_F rcDestination = {rc.left, rc.top, rc.right, rc.bottom}; -@@ -1525,7 +1525,7 @@ - - // Explicitly creating a text layout appears a little faster - IDWriteTextLayout *pTextLayout; -- HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, -+ const HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, - rc.Width(), rc.Height(), &pTextLayout); - if (SUCCEEDED(hr)) { - D2D1_POINT_2F origin = {rc.left, ybase-yAscent}; -@@ -1578,7 +1578,7 @@ - if (pIDWriteFactory && pTextFormat) { - // Create a layout - IDWriteTextLayout *pTextLayout = 0; -- HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, 1000.0, 1000.0, &pTextLayout); -+ const HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, 1000.0, 1000.0, &pTextLayout); - if (SUCCEEDED(hr)) { - DWRITE_TEXT_METRICS textMetrics; - if (SUCCEEDED(pTextLayout->GetMetrics(&textMetrics))) -@@ -1602,7 +1602,7 @@ - SetFont(font_); - // Create a layout - IDWriteTextLayout *pTextLayout = 0; -- HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, 10000.0, 1000.0, &pTextLayout); -+ const HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, 10000.0, 1000.0, &pTextLayout); - if (!SUCCEEDED(hr)) - return; - if (!SUCCEEDED(pTextLayout->GetClusterMetrics(clusterMetrics, clusters, &count))) -@@ -1625,7 +1625,7 @@ - const unsigned char *us = reinterpret_cast<const unsigned char *>(s); - int i=0; - while (ui<fit) { -- unsigned char uch = us[i]; -+ const unsigned char uch = us[i]; - unsigned int lenChar = 1; - if (uch >= (0x80 + 0x40 + 0x20 + 0x10)) { - lenChar = 4; -@@ -1683,7 +1683,7 @@ - // Create a layout - IDWriteTextLayout *pTextLayout = 0; - const WCHAR wch = ch; -- HRESULT hr = pIDWriteFactory->CreateTextLayout(&wch, 1, pTextFormat, 1000.0, 1000.0, &pTextLayout); -+ const HRESULT hr = pIDWriteFactory->CreateTextLayout(&wch, 1, pTextFormat, 1000.0, 1000.0, &pTextLayout); - if (SUCCEEDED(hr)) { - DWRITE_TEXT_METRICS textMetrics; - if (SUCCEEDED(pTextLayout->GetMetrics(&textMetrics))) -@@ -1726,7 +1726,7 @@ - IDWriteTextLayout *pTextLayout = 0; - const WCHAR wszAllAlpha[] = L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - const size_t lenAllAlpha = wcslen(wszAllAlpha); -- HRESULT hr = pIDWriteFactory->CreateTextLayout(wszAllAlpha, static_cast<UINT32>(lenAllAlpha), -+ const HRESULT hr = pIDWriteFactory->CreateTextLayout(wszAllAlpha, static_cast<UINT32>(lenAllAlpha), - pTextFormat, 1000.0, 1000.0, &pTextLayout); - if (SUCCEEDED(hr)) { - DWRITE_TEXT_METRICS textMetrics; -@@ -1812,7 +1812,7 @@ - } - - void Window::SetPositionRelative(PRectangle rc, Window w) { -- LONG style = ::GetWindowLong(static_cast<HWND>(wid), GWL_STYLE); -+ const LONG style = ::GetWindowLong(static_cast<HWND>(wid), GWL_STYLE); - if (style & WS_POPUP) { - POINT ptOther = {0, 0}; - ::ClientToScreen(static_cast<HWND>(w.GetID()), &ptOther); -@@ -2194,7 +2194,7 @@ - SelectFont(hdc, oldFont); - ::ReleaseDC(lb, hdc); - -- int widthDesired = Platform::Maximum(textSize.cx, (len + 1) * tm.tmAveCharWidth); -+ const int widthDesired = Platform::Maximum(textSize.cx, (len + 1) * tm.tmAveCharWidth); - if (width < widthDesired) - width = widthDesired; - -@@ -2253,7 +2253,7 @@ - } - - void ListBoxX::GetValue(int n, char *value, int len) { -- ListItemData item = lti.Get(n); -+ const ListItemData item = lti.Get(n); - strncpy(value, item.text, len); - value[len-1] = '\0'; - } -@@ -2289,7 +2289,7 @@ - ::SetTextColor(pDrawItem->hDC, ::GetSysColor(COLOR_WINDOWTEXT)); - } - -- ListItemData item = lti.Get(pDrawItem->itemID); -+ const ListItemData item = lti.Get(pDrawItem->itemID); - int pixId = item.pixId; - const char *text = item.text; - int len = static_cast<int>(strlen(text)); -@@ -2305,13 +2305,13 @@ - } - - // Draw the image, if any -- RGBAImage *pimage = images.Get(pixId); -+ const RGBAImage *pimage = images.Get(pixId); - if (pimage) { - Surface *surfaceItem = Surface::Allocate(technology); - if (surfaceItem) { - if (technology == SCWIN_TECH_GDI) { - surfaceItem->Init(pDrawItem->hDC, pDrawItem->hwndItem); -- long left = pDrawItem->rcItem.left + static_cast<int>(ItemInset.x + ImageInset.x); -+ const long left = pDrawItem->rcItem.left + static_cast<int>(ItemInset.x + ImageInset.x); - PRectangle rcImage = PRectangle::FromInts(left, pDrawItem->rcItem.top, - left + images.GetWidth(), pDrawItem->rcItem.bottom); - surfaceItem->DrawRGBAImage(rcImage, -@@ -2339,7 +2339,7 @@ - if (SUCCEEDED(hr)) { - surfaceItem->Init(pDCRT, pDrawItem->hwndItem); - pDCRT->BeginDraw(); -- long left = pDrawItem->rcItem.left + static_cast<long>(ItemInset.x + ImageInset.x); -+ const long left = pDrawItem->rcItem.left + static_cast<long>(ItemInset.x + ImageInset.x); - PRectangle rcImage = PRectangle::FromInts(left, pDrawItem->rcItem.top, - left + images.GetWidth(), pDrawItem->rcItem.bottom); - surfaceItem->DrawRGBAImage(rcImage, -@@ -2371,7 +2371,7 @@ - } - - lti.AllocItem(text, pixId); -- unsigned int len = static_cast<unsigned int>(strlen(text)); -+ const unsigned int len = static_cast<unsigned int>(strlen(text)); - if (maxItemCharacters < len) { - maxItemCharacters = len; - widestItem = text; -@@ -2383,7 +2383,7 @@ - // the listbox is not visible. - SetRedraw(false); - Clear(); -- size_t size = strlen(list); -+ const size_t size = strlen(list); - char *words = lti.SetWords(list); - char *startword = words; - char *numword = NULL; -@@ -2422,7 +2422,7 @@ - - int ListBoxX::ItemHeight() const { - int itemHeight = lineHeight + (static_cast<int>(TextInset.y) * 2); -- int pixHeight = images.GetHeight() + (static_cast<int>(ImageInset.y) * 2); -+ const int pixHeight = images.GetHeight() + (static_cast<int>(ImageInset.y) * 2); - if (itemHeight < pixHeight) { - itemHeight = pixHeight; - } -@@ -2570,8 +2570,8 @@ - // window caption height + frame, even if one is hovering over the bottom edge of - // the frame, so workaround that here - if (hit >= HTTOP && hit <= HTTOPRIGHT) { -- int minHeight = GetSystemMetrics(SM_CYMINTRACK); -- int yPos = GET_Y_LPARAM(lParam); -+ const int minHeight = GetSystemMetrics(SM_CYMINTRACK); -+ const int yPos = GET_Y_LPARAM(lParam); - if ((rc.Height() < minHeight) && (yPos > ((rc.top + rc.bottom)/2))) { - hit += HTBOTTOM - HTTOP; - } -@@ -2625,10 +2625,10 @@ - void ListBoxX::CentreItem(int n) { - // If below mid point, scroll up to centre, but with more items below if uneven - if (n >= 0) { -- POINT extent = GetClientExtent(); -- int visible = extent.y/ItemHeight(); -+ const POINT extent = GetClientExtent(); -+ const int visible = extent.y/ItemHeight(); - if (visible < Length()) { -- LRESULT top = ::SendMessage(lb, LB_GETTOPINDEX, 0, 0); -+ const LRESULT top = ::SendMessage(lb, LB_GETTOPINDEX, 0, 0); - int half = (visible - 1) / 2; - if (n > (top + half)) - ::SendMessage(lb, LB_SETTOPINDEX, n - half , 0); -@@ -2680,7 +2680,7 @@ - case WM_LBUTTONDOWN: { - // We must take control of selection to prevent the ListBox activating - // the popup -- LRESULT lResult = ::SendMessage(hWnd, LB_ITEMFROMPOINT, 0, lParam); -+ const LRESULT lResult = ::SendMessage(hWnd, LB_ITEMFROMPOINT, 0, lParam); - int item = LOWORD(lResult); - if (HIWORD(lResult) == 0 && item >= 0) { - ::SendMessage(hWnd, LB_SETCURSEL, item, 0); -@@ -2816,7 +2816,7 @@ - case WM_MOUSEWHEEL: - wheelDelta -= static_cast<short>(HIWORD(wParam)); - if (abs(wheelDelta) >= WHEEL_DELTA) { -- int nRows = GetVisibleRows(); -+ const int nRows = GetVisibleRows(); - int linesToScroll = 1; - if (nRows > 1) { - linesToScroll = nRows - 1; -@@ -2939,12 +2939,12 @@ - LARGE_INTEGER lBegin; - lBegin.HighPart = bigBit; - lBegin.LowPart = littleBit; -- double elapsed = static_cast<double>(lEnd.QuadPart - lBegin.QuadPart); -+ const double elapsed = static_cast<double>(lEnd.QuadPart - lBegin.QuadPart); - result = elapsed / static_cast<double>(frequency.QuadPart); - } else { - endBigBit = clock(); - endLittleBit = 0; -- double elapsed = endBigBit - bigBit; -+ const double elapsed = endBigBit - bigBit; - result = elapsed / CLOCKS_PER_SEC; - } - if (reset) { -@@ -3036,7 +3036,7 @@ - - bool Platform::IsDBCSLeadByte(int codePage, char ch) { - // Byte ranges found in Wikipedia articles with relevant search strings in each case -- unsigned char uch = static_cast<unsigned char>(ch); -+ const unsigned char uch = static_cast<unsigned char>(ch); - switch (codePage) { - case 932: - // Shift_jis -@@ -3109,7 +3109,7 @@ - static bool assertionPopUps = true; - - bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { -- bool ret = assertionPopUps; -+ const bool ret = assertionPopUps; - assertionPopUps = assertionPopUps_; - return ret; - } -@@ -3118,7 +3118,7 @@ - char buffer[2000]; - sprintf(buffer, "Assertion [%s] failed at %s %d%s", c, file, line, assertionPopUps ? "" : "\r\n"); - if (assertionPopUps) { -- int idButton = ::MessageBoxA(0, buffer, "Assertion failure", -+ const int idButton = ::MessageBoxA(0, buffer, "Assertion failure", - MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL); - if (idButton == IDRETRY) { - ::DebugBreak(); -diff -r 797ed6c538fd -r d046ce80d590 win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Thu Apr 06 20:19:23 2017 +1000 -+++ b/win32/ScintillaWin.cxx Thu Apr 06 21:04:37 2017 +1000 -@@ -594,8 +594,8 @@ - } - - bool ScintillaWin::DragThreshold(Point ptStart, Point ptNow) { -- int xMove = static_cast<int>(std::abs(ptStart.x - ptNow.x)); -- int yMove = static_cast<int>(std::abs(ptStart.y - ptNow.y)); -+ const int xMove = static_cast<int>(std::abs(ptStart.x - ptNow.x)); -+ const int yMove = static_cast<int>(std::abs(ptStart.y - ptNow.y)); - return (xMove > ::GetSystemMetrics(SM_CXDRAG)) || - (yMove > ::GetSystemMetrics(SM_CYDRAG)); - } -@@ -607,7 +607,7 @@ - IDataObject *pDataObject = reinterpret_cast<IDataObject *>(&dob); - IDropSource *pDropSource = reinterpret_cast<IDropSource *>(&ds); - //Platform::DebugPrintf("About to DoDragDrop %x %x\n", pDataObject, pDropSource); -- HRESULT hr = ::DoDragDrop( -+ const HRESULT hr = ::DoDragDrop( - pDataObject, - pDropSource, - DROPEFFECT_COPY | DROPEFFECT_MOVE, &dwEffect); -@@ -635,7 +635,7 @@ - HKL inputLocale = ::GetKeyboardLayout(0); - LANGID inputLang = LOWORD(inputLocale); - char sCodePage[10]; -- int res = ::GetLocaleInfoA(MAKELCID(inputLang, SORT_DEFAULT), -+ const int res = ::GetLocaleInfoA(MAKELCID(inputLang, SORT_DEFAULT), - LOCALE_IDEFAULTANSICODEPAGE, sCodePage, sizeof(sCodePage)); - if (!res) - return 0; -@@ -687,7 +687,7 @@ - if (hRgnCheck) { - HRGN hRgnDifference = ::CreateRectRgn(0, 0, 0, 0); - if (hRgnDifference) { -- int combination = ::CombineRgn(hRgnDifference, hRgnCheck, hRgnBounds, RGN_DIFF); -+ const int combination = ::CombineRgn(hRgnDifference, hRgnCheck, hRgnBounds, RGN_DIFF); - if (combination != NULLREGION) { - contains = false; - } -@@ -788,7 +788,7 @@ - } else { - UINT cpDest = CodePageOfDocument(); - char inBufferCP[maxLenInputIME * 2]; -- int size = ::WideCharToMultiByte(cpDest, -+ const int size = ::WideCharToMultiByte(cpDest, - 0, wcs, wclen, inBufferCP, sizeof(inBufferCP) - 1, 0, 0); - for (int i=0; i<size; i++) { - AddChar(inBufferCP[i]); -@@ -800,12 +800,12 @@ - //ElapsedTime et; - - // Redirect assertions to debug output and save current state -- bool assertsPopup = Platform::ShowAssertionPopUps(false); -+ const bool assertsPopup = Platform::ShowAssertionPopUps(false); - paintState = painting; - PAINTSTRUCT ps; - PAINTSTRUCT *pps; - -- bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains -+ const bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains - // a PAINSTRUCT* from the OCX - // Removed since this interferes with reporting other assertions as it occurs repeatedly - //PLATFORM_ASSERT(hRgnUpdate == NULL); -@@ -818,7 +818,7 @@ - ::BeginPaint(MainHWND(), pps); - } - rcPaint = PRectangle::FromInts(pps->rcPaint.left, pps->rcPaint.top, pps->rcPaint.right, pps->rcPaint.bottom); -- PRectangle rcClient = GetClientRectangle(); -+ const PRectangle rcClient = GetClientRectangle(); - paintingAllText = BoundsContains(rcPaint, hRgnUpdate, rcClient); - if (technology == SC_TECHNOLOGY_DEFAULT) { - AutoSurface surfaceWindow(pps->hdc, this); -@@ -834,7 +834,7 @@ - pRenderTarget->BeginDraw(); - Paint(surfaceWindow, rcPaint); - surfaceWindow->Release(); -- HRESULT hr = pRenderTarget->EndDraw(); -+ const HRESULT hr = pRenderTarget->EndDraw(); - if (hr == static_cast<HRESULT>(D2DERR_RECREATE_TARGET)) { - DropRenderTarget(); - paintState = paintAbandoned; -@@ -939,7 +939,7 @@ - pdoc->GetCharRange(&documentStr[0], selStart, documentStrLen); - - std::wstring uniStr = StringDecode(documentStr, CodePageOfDocument()); -- int converted = HanjaDict::GetHangulOfHanja(&uniStr[0]); -+ const int converted = HanjaDict::GetHangulOfHanja(&uniStr[0]); - documentStr = StringEncode(uniStr, CodePageOfDocument()); - - if (converted > 0) { -@@ -1028,7 +1028,7 @@ - if (wcs.empty()) - return; - -- int codePage = CodePageOfDocument(); -+ const int codePage = CodePageOfDocument(); - for (size_t i = 0; i < wcs.size(); ) { - const size_t ucWidth = UTF16CharLength(wcs[i]); - const std::wstring uniChar(wcs, i, ucWidth); -@@ -1075,9 +1075,9 @@ - - std::vector<int> imeIndicator = MapImeIndicators(imc.GetImeAttributes()); - -- bool tmpRecordingMacro = recordingMacro; -+ const bool tmpRecordingMacro = recordingMacro; - recordingMacro = false; -- int codePage = CodePageOfDocument(); -+ const int codePage = CodePageOfDocument(); - for (size_t i = 0; i < wcs.size(); ) { - const size_t ucWidth = UTF16CharLength(wcs[i]); - const std::wstring uniChar(wcs, i, ucWidth); -@@ -1091,7 +1091,7 @@ - recordingMacro = tmpRecordingMacro; - - // Move IME caret from current last position to imeCaretPos. -- int imeEndToImeCaretU16 = imc.GetImeCaretPos() - static_cast<unsigned int>(wcs.size()); -+ const int imeEndToImeCaretU16 = imc.GetImeCaretPos() - static_cast<unsigned int>(wcs.size()); - Sci::Position imeCaretPosDoc = pdoc->GetRelativePositionUTF16(CurrentPosition(), imeEndToImeCaretU16); - - MoveImeCarets(- CurrentPosition() + imeCaretPosDoc); -@@ -1352,8 +1352,8 @@ - #ifdef _MSC_VER - #pragma warning(suppress: 28159) - #endif -- DWORD dwCurrent = GetTickCount(); -- DWORD dwStart = wParam ? static_cast<DWORD>(wParam) : dwCurrent; -+ const DWORD dwCurrent = GetTickCount(); -+ const DWORD dwStart = wParam ? static_cast<DWORD>(wParam) : dwCurrent; - const DWORD maxWorkTime = 50; - - if (dwCurrent >= dwStart && dwCurrent > maxWorkTime && dwCurrent - maxWorkTime < dwStart) -@@ -1484,7 +1484,7 @@ - case WM_KEYDOWN: { - //Platform::DebugPrintf("S keydown %d %x %x %x %x\n",iMessage, wParam, lParam, ::IsKeyDown(VK_SHIFT), ::IsKeyDown(VK_CONTROL)); - lastKeyDownConsumed = false; -- int ret = KeyDown(KeyTranslate(static_cast<int>(wParam)), -+ const int ret = KeyDown(KeyTranslate(static_cast<int>(wParam)), - Platform::IsKeyDown(VK_SHIFT), - Platform::IsKeyDown(VK_CONTROL), - Platform::IsKeyDown(VK_MENU), -@@ -1526,7 +1526,7 @@ - case WM_KILLFOCUS: { - HWND wOther = reinterpret_cast<HWND>(wParam); - HWND wThis = MainHWND(); -- HWND wCT = static_cast<HWND>(ct.wCallTip.GetID()); -+ const HWND wCT = static_cast<HWND>(ct.wCallTip.GetID()); - if (!wParam || - !(::IsChild(wThis, wOther) || (wOther == wCT))) { - SetFocusState(false); -@@ -1929,7 +1929,7 @@ - modified = true; - } - -- PRectangle rcText = GetTextRectangle(); -+ const PRectangle rcText = GetTextRectangle(); - int horizEndPreferred = scrollWidth; - if (horizEndPreferred < 0) - horizEndPreferred = 0; -@@ -2013,7 +2013,7 @@ - if (lenMixed > utf16Mixed.size()) { - utf16Mixed.resize(lenMixed + 8); - } -- size_t nUtf16Mixed = ::MultiByteToWideChar(cp, 0, mixed, -+ const size_t nUtf16Mixed = ::MultiByteToWideChar(cp, 0, mixed, - static_cast<int>(lenMixed), - &utf16Mixed[0], - static_cast<int>(utf16Mixed.size())); -@@ -2032,7 +2032,7 @@ - if (foldedUTF8) { - // Maximum length of a case conversion is 6 bytes, 3 characters - wchar_t wFolded[20]; -- size_t charsConverted = UTF16FromUTF8(foldedUTF8, -+ const size_t charsConverted = UTF16FromUTF8(foldedUTF8, - strlen(foldedUTF8), - wFolded, ELEMENTS(wFolded)); - for (size_t j=0; j<charsConverted; j++) -@@ -2072,18 +2072,18 @@ - char sCharacter[2] = "A"; - sCharacter[0] = static_cast<char>(i); - wchar_t wCharacter[20]; -- unsigned int lengthUTF16 = ::MultiByteToWideChar(cpDoc, 0, sCharacter, 1, -+ const unsigned int lengthUTF16 = ::MultiByteToWideChar(cpDoc, 0, sCharacter, 1, - wCharacter, ELEMENTS(wCharacter)); - if (lengthUTF16 == 1) { - const char *caseFolded = CaseConvert(wCharacter[0], CaseConversionFold); - if (caseFolded) { - wchar_t wLower[20]; -- size_t charsConverted = UTF16FromUTF8(caseFolded, -+ const size_t charsConverted = UTF16FromUTF8(caseFolded, - strlen(caseFolded), - wLower, ELEMENTS(wLower)); - if (charsConverted == 1) { - char sCharacterLowered[20]; -- unsigned int lengthConverted = ::WideCharToMultiByte(cpDoc, 0, -+ const unsigned int lengthConverted = ::WideCharToMultiByte(cpDoc, 0, - wLower, static_cast<int>(charsConverted), - sCharacterLowered, ELEMENTS(sCharacterLowered), NULL, 0); - if ((lengthConverted == 1) && (sCharacter[0] != sCharacterLowered[0])) { -@@ -2234,7 +2234,7 @@ - std::vector<char> putf; - // Default Scintilla behaviour in Unicode mode - if (IsUnicodeMode()) { -- unsigned int bytes = static_cast<unsigned int>(memUSelection.Size()); -+ const unsigned int bytes = static_cast<unsigned int>(memUSelection.Size()); - len = UTF8Length(uptr, bytes / 2); - putf.resize(len + 1); - UTF8FromUTF16(uptr, bytes / 2, &putf[0], len); -@@ -2258,7 +2258,7 @@ - if (memSelection) { - char *ptr = static_cast<char *>(memSelection.ptr); - if (ptr) { -- unsigned int bytes = static_cast<unsigned int>(memSelection.Size()); -+ const unsigned int bytes = static_cast<unsigned int>(memSelection.Size()); - unsigned int len = bytes; - for (unsigned int i = 0; i < bytes; i++) { - if ((len == bytes) && (0 == ptr[i])) -@@ -2269,7 +2269,7 @@ - if (IsUnicodeMode()) { - std::vector<wchar_t> uptr(len+1); - -- unsigned int ulen = ::MultiByteToWideChar(CP_ACP, 0, -+ const unsigned int ulen = ::MultiByteToWideChar(CP_ACP, 0, - ptr, len, &uptr[0], len+1); - - unsigned int mlen = UTF8Length(&uptr[0], ulen); -@@ -2460,7 +2460,7 @@ - return S_OK; - } - -- bool formatOK = (pFE->cfFormat == CF_TEXT) || -+ const bool formatOK = (pFE->cfFormat == CF_TEXT) || - ((pFE->cfFormat == CF_UNICODETEXT) && pd->sci->IsUnicodeMode()); - if (!formatOK || - pFE->ptd != 0 || -@@ -2855,8 +2855,8 @@ - - void ScintillaWin::HorizontalScrollMessage(WPARAM wParam) { - int xPos = xOffset; -- PRectangle rcText = GetTextRectangle(); -- int pageWidth = static_cast<int>(rcText.Width() * 2 / 3); -+ const PRectangle rcText = GetTextRectangle(); -+ const int pageWidth = static_cast<int>(rcText.Width() * 2 / 3); - switch (LoWord(wParam)) { - case SB_LINEUP: - xPos -= 20; -@@ -2930,7 +2930,7 @@ - pRenderTarget->BeginDraw(); - Paint(surfaceWindow, rcPaint); - surfaceWindow->Release(); -- HRESULT hr = pRenderTarget->EndDraw(); -+ const HRESULT hr = pRenderTarget->EndDraw(); - if (hr == static_cast<HRESULT>(D2DERR_RECREATE_TARGET)) { - DropRenderTarget(); - } -@@ -2946,7 +2946,7 @@ - - bool ScintillaWin::IsCompatibleDC(HDC hOtherDC) { - HDC hdc = ::GetDC(MainHWND()); -- bool isCompatible = -+ const bool isCompatible = - CompareDevCap(hdc, hOtherDC, TECHNOLOGY) && - CompareDevCap(hdc, hOtherDC, LOGPIXELSY) && - CompareDevCap(hdc, hOtherDC, LOGPIXELSX) && -@@ -3000,11 +3000,11 @@ - if (pIDataSource == NULL) - return E_POINTER; - FORMATETC fmtu = {CF_UNICODETEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; -- HRESULT hrHasUText = pIDataSource->QueryGetData(&fmtu); -+ const HRESULT hrHasUText = pIDataSource->QueryGetData(&fmtu); - hasOKText = (hrHasUText == S_OK); - if (!hasOKText) { - FORMATETC fmte = {CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; -- HRESULT hrHasText = pIDataSource->QueryGetData(&fmte); -+ const HRESULT hrHasText = pIDataSource->QueryGetData(&fmte); - hasOKText = (hrHasText == S_OK); - } - if (!hasOKText) { -@@ -3068,7 +3068,7 @@ - wchar_t *udata = static_cast<wchar_t *>(memUDrop.ptr); - if (udata) { - if (IsUnicodeMode()) { -- int tlen = static_cast<int>(memUDrop.Size()); -+ const int tlen = static_cast<int>(memUDrop.Size()); - // Convert UTF-16 to UTF-8 - int dataLen = UTF8Length(udata, tlen/2); - data.resize(dataLen+1); -@@ -3129,7 +3129,7 @@ - - /// Implement important part of IDataObject - STDMETHODIMP ScintillaWin::GetData(FORMATETC *pFEIn, STGMEDIUM *pSTM) { -- bool formatOK = (pFEIn->cfFormat == CF_TEXT) || -+ const bool formatOK = (pFEIn->cfFormat == CF_TEXT) || - ((pFEIn->cfFormat == CF_UNICODETEXT) && IsUnicodeMode()); - if (!formatOK || - pFEIn->ptd != 0 || -@@ -3421,7 +3421,7 @@ - // Must be called once only. - int Scintilla_RegisterClasses(void *hInstance) { - Platform_Initialise(hInstance); -- bool result = ScintillaWin::Register(static_cast<HINSTANCE>(hInstance)); -+ const bool result = ScintillaWin::Register(static_cast<HINSTANCE>(hInstance)); - #ifdef SCI_LEXER - Scintilla_LinkLexers(); - #endif -@@ -3429,7 +3429,7 @@ - } - - static int ResourcesRelease(bool fromDllMain) { -- bool result = ScintillaWin::Unregister(); -+ const bool result = ScintillaWin::Unregister(); - Platform_Finalise(fromDllMain); - return result; - } diff --git a/src/scintilla_backports/6170_df221375187c.patch b/src/scintilla_backports/6170_df221375187c.patch deleted file mode 100644 index 28479b0a..00000000 --- a/src/scintilla_backports/6170_df221375187c.patch +++ /dev/null @@ -1,25 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491548892 -36000 -# Node ID df221375187cab18a3e1c73ae83fa46805bf98db -# Parent ef932abba46c57933959a83bd63fafc429d35259 -Allowing assigning Windows and ensure cursorLast is initialized. - -diff -r ef932abba46c -r df221375187c include/Platform.h ---- a/include/Platform.h Thu Apr 06 21:04:52 2017 +1000 -+++ b/include/Platform.h Fri Apr 07 17:08:12 2017 +1000 -@@ -363,6 +363,14 @@ - virtual ~Window(); - Window &operator=(WindowID wid_) { - wid = wid_; -+ cursorLast = cursorInvalid; -+ return *this; -+ } -+ Window &operator=(const Window &other) { -+ if (this != &other) { -+ wid = other.wid; -+ cursorLast = other.cursorLast; -+ } - return *this; - } - WindowID GetID() const { return wid; } diff --git a/src/scintilla_backports/6171_99e46ea84433.patch b/src/scintilla_backports/6171_99e46ea84433.patch deleted file mode 100644 index 4b183244..00000000 --- a/src/scintilla_backports/6171_99e46ea84433.patch +++ /dev/null @@ -1,25 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491548935 -36000 -# Node ID 99e46ea84433f95e568fb9fdc7d4a92869e823ab -# Parent df221375187cab18a3e1c73ae83fa46805bf98db -Check index before checking value at index. - -diff -r df221375187c -r 99e46ea84433 src/CellBuffer.cxx ---- a/src/CellBuffer.cxx Fri Apr 07 17:08:12 2017 +1000 -+++ b/src/CellBuffer.cxx Fri Apr 07 17:08:55 2017 +1000 -@@ -348,12 +348,12 @@ - - int UndoHistory::StartRedo() { - // Drop any leading startAction -- if (actions[currentAction].at == startAction && currentAction < maxAction) -+ if (currentAction < maxAction && actions[currentAction].at == startAction) - currentAction++; - - // Count the steps in this action - int act = currentAction; -- while (actions[act].at != startAction && act < maxAction) { -+ while (act < maxAction && actions[act].at != startAction) { - act++; - } - return act - currentAction; diff --git a/src/scintilla_backports/6172_84161436cfbc.patch b/src/scintilla_backports/6172_84161436cfbc.patch deleted file mode 100644 index 8ee2d3b6..00000000 --- a/src/scintilla_backports/6172_84161436cfbc.patch +++ /dev/null @@ -1,491 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491550081 -36000 -# Node ID 84161436cfbc309da3b30e6fe5bc69c0a9331cfa -# Parent 99e46ea84433f95e568fb9fdc7d4a92869e823ab -Use same parameter names in declarations and definitions. - -diff -r 99e46ea84433 -r 84161436cfbc gtk/PlatGTK.cxx ---- a/gtk/PlatGTK.cxx Fri Apr 07 17:08:55 2017 +1000 -+++ b/gtk/PlatGTK.cxx Fri Apr 07 17:28:01 2017 +1000 -@@ -1505,13 +1505,13 @@ - GTK_WINDOW(top)); - } - --void ListBoxX::SetFont(Font &scint_font) { -+void ListBoxX::SetFont(Font &font) { - // Only do for Pango font as there have been crashes for GDK fonts -- if (Created() && PFont(scint_font)->pfd) { -+ if (Created() && PFont(font)->pfd) { - // Current font is Pango font - #if GTK_CHECK_VERSION(3,0,0) - if (cssProvider) { -- PangoFontDescription *pfd = PFont(scint_font)->pfd; -+ PangoFontDescription *pfd = PFont(font)->pfd; - std::ostringstream ssFontSetting; - ssFontSetting << "GtkTreeView, treeview { "; - ssFontSetting << "font-family: " << pango_font_description_get_family(pfd) << "; "; -@@ -1532,7 +1532,7 @@ - ssFontSetting.str().c_str(), -1, NULL); - } - #else -- gtk_widget_modify_font(PWidget(list), PFont(scint_font)->pfd); -+ gtk_widget_modify_font(PWidget(list), PFont(font)->pfd); - #endif - gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(renderer), -1); - gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(renderer), 1); -@@ -1918,14 +1918,14 @@ - } - #endif - --void Menu::Show(Point pt, Window &wnd) { -+void Menu::Show(Point pt, Window &w) { - GtkMenu *widget = static_cast<GtkMenu *>(mid); - gtk_widget_show_all(GTK_WIDGET(widget)); - #if GTK_CHECK_VERSION(3,22,0) - // Rely on GTK+ to do the right thing with positioning - gtk_menu_popup_at_pointer(widget, NULL); - #else -- GdkRectangle rcMonitor = MonitorRectangleForWidget(PWidget(wnd.GetID())); -+ GdkRectangle rcMonitor = MonitorRectangleForWidget(PWidget(w.GetID())); - GtkRequisition requisition; - #if GTK_CHECK_VERSION(3,0,0) - gtk_widget_get_preferred_size(GTK_WIDGET(widget), NULL, &requisition); -diff -r 99e46ea84433 -r 84161436cfbc gtk/ScintillaGTK.h ---- a/gtk/ScintillaGTK.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/gtk/ScintillaGTK.h Fri Apr 07 17:28:01 2017 +1000 -@@ -135,7 +135,7 @@ - void GetGtkSelectionText(GtkSelectionData *selectionData, SelectionText &selText); - void ReceivedSelection(GtkSelectionData *selection_data); - void ReceivedDrop(GtkSelectionData *selection_data); -- static void GetSelection(GtkSelectionData *selection_data, guint info, SelectionText *selected); -+ static void GetSelection(GtkSelectionData *selection_data, guint info, SelectionText *text); - void StoreOnClipboard(SelectionText *clipText); - static void ClipboardGetSelection(GtkClipboard* clip, GtkSelectionData *selection_data, guint info, void *data); - static void ClipboardClearSelection(GtkClipboard* clip, void *data); -@@ -197,7 +197,7 @@ - static AtkObject* GetAccessible(GtkWidget *widget); - - bool KoreanIME(); -- void CommitThis(char *str); -+ void CommitThis(char *commitStr); - static void Commit(GtkIMContext *context, char *str, ScintillaGTK *sciThis); - void PreeditChangedInlineThis(); - void PreeditChangedWindowedThis(); -@@ -238,7 +238,7 @@ - #if GTK_CHECK_VERSION(3,0,0) - static gboolean DrawCT(GtkWidget *widget, cairo_t *cr, CallTip *ctip); - #else -- static gboolean ExposeCT(GtkWidget *widget, GdkEventExpose *ose, CallTip *ct); -+ static gboolean ExposeCT(GtkWidget *widget, GdkEventExpose *ose, CallTip *ctip); - #endif - static gboolean PressCT(GtkWidget *widget, GdkEventButton *event, ScintillaGTK *sciThis); - -diff -r 99e46ea84433 -r 84161436cfbc gtk/ScintillaGTKAccessible.h ---- a/gtk/ScintillaGTKAccessible.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/gtk/ScintillaGTKAccessible.h Fri Apr 07 17:28:01 2017 +1000 -@@ -109,7 +109,7 @@ - gboolean SetCaretOffset(int charOffset); - gint GetOffsetAtPoint(gint x, gint y, AtkCoordType coords); - void GetCharacterExtents(int charOffset, gint *x, gint *y, gint *width, gint *height, AtkCoordType coords); -- AtkAttributeSet *GetAttributesForStyle(unsigned int style); -+ AtkAttributeSet *GetAttributesForStyle(unsigned int styleNum); - AtkAttributeSet *GetRunAttributes(int charOffset, int *startChar, int *endChar); - AtkAttributeSet *GetDefaultAttributes(); - gint GetNSelections(); -@@ -120,14 +120,14 @@ - // for AtkEditableText - bool InsertStringUTF8(Sci::Position bytePos, const gchar *utf8, Sci::Position lengthBytes); - void SetTextContents(const gchar *contents); -- void InsertText(const gchar *contents, int lengthBytes, int *charPosition); -+ void InsertText(const gchar *text, int lengthBytes, int *charPosition); - void CopyText(int startChar, int endChar); - void CutText(int startChar, int endChar); - void DeleteText(int startChar, int endChar); - void PasteText(int charPosition); - - public: -- ScintillaGTKAccessible(GtkAccessible *accessible, GtkWidget *widget); -+ ScintillaGTKAccessible(GtkAccessible *accessible_, GtkWidget *widget_); - ~ScintillaGTKAccessible(); - - static ScintillaGTKAccessible *FromAccessible(GtkAccessible *accessible); -diff -r 99e46ea84433 -r 84161436cfbc lexlib/LexerModule.h ---- a/lexlib/LexerModule.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/lexlib/LexerModule.h Fri Apr 07 17:28:01 2017 +1000 -@@ -53,9 +53,9 @@ - - ILexer *Create() const; - -- virtual void Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, -+ virtual void Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, - WordList *keywordlists[], Accessor &styler) const; -- virtual void Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, -+ virtual void Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, - WordList *keywordlists[], Accessor &styler) const; - - friend class Catalogue; -diff -r 99e46ea84433 -r 84161436cfbc lexlib/LexerNoExceptions.cxx ---- a/lexlib/LexerNoExceptions.cxx Fri Apr 07 17:08:55 2017 +1000 -+++ b/lexlib/LexerNoExceptions.cxx Fri Apr 07 17:28:01 2017 +1000 -@@ -42,20 +42,20 @@ - return -1; - } - --void SCI_METHOD LexerNoExceptions::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { -+void SCI_METHOD LexerNoExceptions::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) { - try { - Accessor astyler(pAccess, &props); -- Lexer(startPos, length, initStyle, pAccess, astyler); -+ Lexer(startPos, lengthDoc, initStyle, pAccess, astyler); - astyler.Flush(); - } catch (...) { - // Should not throw into caller as may be compiled with different compiler or options - pAccess->SetErrorStatus(SC_STATUS_FAILURE); - } - } --void SCI_METHOD LexerNoExceptions::Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { -+void SCI_METHOD LexerNoExceptions::Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) { - try { - Accessor astyler(pAccess, &props); -- Folder(startPos, length, initStyle, pAccess, astyler); -+ Folder(startPos, lengthDoc, initStyle, pAccess, astyler); - astyler.Flush(); - } catch (...) { - // Should not throw into caller as may be compiled with different compiler or options -diff -r 99e46ea84433 -r 84161436cfbc qt/ScintillaEditBase/PlatQt.cpp ---- a/qt/ScintillaEditBase/PlatQt.cpp Fri Apr 07 17:08:55 2017 +1000 -+++ b/qt/ScintillaEditBase/PlatQt.cpp Fri Apr 07 17:28:01 2017 +1000 -@@ -755,7 +755,7 @@ - - virtual void SetFont(Font &font); - virtual void Create(Window &parent, int ctrlID, Point location, -- int lineHeight, bool unicodeMode, int technology); -+ int lineHeight, bool unicodeMode_, int technology); - virtual void SetAverageCharWidth(int width); - virtual void SetVisibleRows(int rows); - virtual int GetVisibleRows() const; -diff -r 99e46ea84433 -r 84161436cfbc qt/ScintillaEditBase/PlatQt.h ---- a/qt/ScintillaEditBase/PlatQt.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/qt/ScintillaEditBase/PlatQt.h Fri Apr 07 17:28:01 2017 +1000 -@@ -75,8 +75,8 @@ - virtual void PenColour(ColourDesired fore); - virtual int LogPixelsY(); - virtual int DeviceHeightFont(int points); -- virtual void MoveTo(int x, int y); -- virtual void LineTo(int x, int y); -+ virtual void MoveTo(int x_, int y_); -+ virtual void LineTo(int x_, int y_); - virtual void Polygon(Point *pts, int npts, ColourDesired fore, - ColourDesired back); - virtual void RectangleDraw(PRectangle rc, ColourDesired fore, -@@ -85,7 +85,7 @@ - virtual void FillRectangle(PRectangle rc, Surface &surfacePattern); - virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, - ColourDesired back); -- virtual void AlphaRectangle(PRectangle rc, int corner, ColourDesired fill, -+ virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, - int alphaFill, ColourDesired outline, int alphaOutline, int flags); - virtual void DrawRGBAImage(PRectangle rc, int width, int height, - const unsigned char *pixelsImage); -@@ -113,8 +113,8 @@ - virtual void SetClip(PRectangle rc); - virtual void FlushCachedState(); - -- virtual void SetUnicodeMode(bool unicodeMode); -- virtual void SetDBCSMode(int codePage); -+ virtual void SetUnicodeMode(bool unicodeMode_); -+ virtual void SetDBCSMode(int codePage_); - - void BrushColour(ColourDesired back); - void SetCodec(Font &font); -diff -r 99e46ea84433 -r 84161436cfbc qt/ScintillaEditBase/ScintillaQt.cpp ---- a/qt/ScintillaEditBase/ScintillaQt.cpp Fri Apr 07 17:08:55 2017 +1000 -+++ b/qt/ScintillaEditBase/ScintillaQt.cpp Fri Apr 07 17:28:01 2017 +1000 -@@ -648,10 +648,10 @@ - this, SLOT(execCommand(QAction *))); - } - --sptr_t ScintillaQt::WndProc(unsigned int message, uptr_t wParam, sptr_t lParam) -+sptr_t ScintillaQt::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) - { - try { -- switch (message) { -+ switch (iMessage) { - - case SCI_SETIMEINTERACTION: - // Only inline IME supported on Qt -@@ -674,7 +674,7 @@ - #endif - - default: -- return ScintillaBase::WndProc(message, wParam, lParam); -+ return ScintillaBase::WndProc(iMessage, wParam, lParam); - } - } catch (std::bad_alloc &) { - errorStatus = SC_STATUS_BADALLOC; -diff -r 99e46ea84433 -r 84161436cfbc src/CallTip.h ---- a/src/CallTip.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/CallTip.h Fri Apr 07 17:28:01 2017 +1000 -@@ -34,7 +34,7 @@ - int posStart, int posEnd, int ytext, PRectangle rcClient, - bool highlight, bool draw); - int PaintContents(Surface *surfaceWindow, bool draw); -- bool IsTabCharacter(char c) const; -+ bool IsTabCharacter(char ch) const; - int NextTabPos(int x) const; - - public: -diff -r 99e46ea84433 -r 84161436cfbc src/CellBuffer.h ---- a/src/CellBuffer.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/CellBuffer.h Fri Apr 07 17:28:01 2017 +1000 -@@ -90,7 +90,7 @@ - UndoHistory(); - ~UndoHistory(); - -- const char *AppendAction(actionType at, Sci::Position position, const char *data, Sci::Position length, bool &startSequence, bool mayCoalesce=true); -+ const char *AppendAction(actionType at, Sci::Position position, const char *data, Sci::Position lengthData, bool &startSequence, bool mayCoalesce=true); - - void BeginUndoAction(); - void EndUndoAction(); -@@ -173,7 +173,7 @@ - /// 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. - bool SetStyleAt(Sci::Position position, char styleValue); -- bool SetStyleFor(Sci::Position position, Sci::Position length, char styleValue); -+ bool SetStyleFor(Sci::Position position, Sci::Position lengthStyle, char styleValue); - - const char *DeleteChars(Sci::Position position, Sci::Position deleteLength, bool &startSequence); - -diff -r 99e46ea84433 -r 84161436cfbc src/CharClassify.h ---- a/src/CharClassify.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/CharClassify.h Fri Apr 07 17:28:01 2017 +1000 -@@ -19,7 +19,7 @@ - enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation }; - void SetDefaultCharClasses(bool includeWordClass); - void SetCharClasses(const unsigned char *chars, cc newCharClass); -- int GetCharsOfClass(cc charClass, unsigned char *buffer) const; -+ int GetCharsOfClass(cc characterClass, unsigned char *buffer) const; - cc GetClass(unsigned char ch) const { return static_cast<cc>(charClass[ch]);} - bool IsWord(unsigned char ch) const { return static_cast<cc>(charClass[ch]) == ccWord;} - -diff -r 99e46ea84433 -r 84161436cfbc src/Document.h ---- a/src/Document.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/Document.h Fri Apr 07 17:28:01 2017 +1000 -@@ -334,7 +334,7 @@ - int SCI_METHOD GetLineIndentation(Sci_Position line); - Sci::Position SetLineIndentation(Sci::Line line, Sci::Position indent); - Sci::Position GetLineIndentPosition(Sci::Line line) const; -- Sci::Position GetColumn(Sci::Position position); -+ Sci::Position GetColumn(Sci::Position pos); - Sci::Position CountCharacters(Sci::Position startPos, Sci::Position endPos) const; - Sci::Position CountUTF16(Sci::Position startPos, Sci::Position endPos) const; - Sci::Position FindColumn(Sci::Line line, Sci::Position column); -@@ -377,7 +377,7 @@ - void ClearLevels(); - Sci::Line GetLastChild(Sci::Line lineParent, int level=-1, Sci::Line lastLine=-1); - Sci::Line GetFoldParent(Sci::Line line) const; -- void GetHighlightDelimiters(HighlightDelimiter &hDelimiter, Sci::Line line, Sci::Line lastLine); -+ void GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, Sci::Line line, Sci::Line lastLine); - - Sci::Position ExtendWordSelect(Sci::Position pos, int delta, bool onlyWordCharacters=false) const; - Sci::Position NextWordStart(Sci::Position pos, int delta) const; -diff -r 99e46ea84433 -r 84161436cfbc src/EditView.h ---- a/src/EditView.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/EditView.h Fri Apr 07 17:28:01 2017 +1000 -@@ -128,7 +128,7 @@ - Sci::Line line, int xStart, PRectangle rcLine, int subLine, XYACCUMULATOR subLineStart, DrawPhase phase); - void DrawAnnotation(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, - Sci::Line line, int xStart, PRectangle rcLine, int subLine, DrawPhase phase); -- void DrawCarets(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, Sci::Line line, -+ void DrawCarets(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, Sci::Line lineDoc, - int xStart, PRectangle rcLine, int subLine) const; - void DrawBackground(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, PRectangle rcLine, - Range lineRange, Sci::Position posLineStart, int xStart, -diff -r 99e46ea84433 -r 84161436cfbc src/Editor.cxx ---- a/src/Editor.cxx Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/Editor.cxx Fri Apr 07 17:28:01 2017 +1000 -@@ -1627,18 +1627,18 @@ - } - } - --void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { -+void Editor::PaintSelMargin(Surface *surfaceWindow, PRectangle &rc) { - if (vs.fixedColumnWidth == 0) - return; - - AllocateGraphics(); - RefreshStyleData(); -- RefreshPixMaps(surfWindow); -+ RefreshPixMaps(surfaceWindow); - - // On GTK+ with Ubuntu overlay scroll bars, the surface may have been finished - // at this point. The Initialised call checks for this case and sets the status - // to be bad which avoids crashes in following calls. -- if (!surfWindow->Initialised()) { -+ if (!surfaceWindow->Initialised()) { - return; - } - -@@ -1655,7 +1655,7 @@ - if (view.bufferedDraw) { - surface = marginView.pixmapSelMargin; - } else { -- surface = surfWindow; -+ surface = surfaceWindow; - } - - // Clip vertically to paint area to avoid drawing line numbers -@@ -1667,7 +1667,7 @@ - marginView.PaintMargin(surface, topLine, rc, rcMargin, *this, vs); - - if (view.bufferedDraw) { -- surfWindow->Copy(rcMargin, Point(rcMargin.left, rcMargin.top), *marginView.pixmapSelMargin); -+ surfaceWindow->Copy(rcMargin, Point(rcMargin.left, rcMargin.top), *marginView.pixmapSelMargin); - } - } - -diff -r 99e46ea84433 -r 84161436cfbc src/Editor.h ---- a/src/Editor.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/Editor.h Fri Apr 07 17:28:01 2017 +1000 -@@ -292,7 +292,7 @@ - SelectionPosition SPositionFromLocation(Point pt, bool canReturnInvalid=false, bool charPosition=false, bool virtualSpace=true); - Sci::Position PositionFromLocation(Point pt, bool canReturnInvalid = false, bool charPosition = false); - SelectionPosition SPositionFromLineX(Sci::Line lineDoc, int x); -- Sci::Position PositionFromLineX(Sci::Line line, int x); -+ Sci::Position PositionFromLineX(Sci::Line lineDoc, int x); - Sci::Line LineFromLocation(Point pt) const; - void SetTopLine(Sci::Line topLineNew); - -@@ -377,7 +377,7 @@ - void LinesJoin(); - void LinesSplit(int pixelWidth); - -- void PaintSelMargin(Surface *surface, PRectangle &rc); -+ void PaintSelMargin(Surface *surfaceWindow, PRectangle &rc); - void RefreshPixMaps(Surface *surfaceWindow); - void Paint(Surface *surfaceWindow, PRectangle rcArea); - long FormatRange(bool draw, Sci_RangeToFormat *pfr); -@@ -449,7 +449,7 @@ - void CheckModificationForWrap(DocModification mh); - void NotifyModified(Document *document, DocModification mh, void *userData); - void NotifyDeleted(Document *document, void *userData); -- void NotifyStyleNeeded(Document *doc, void *userData, Sci::Position endPos); -+ void NotifyStyleNeeded(Document *doc, void *userData, Sci::Position endStyleNeeded); - void NotifyLexerChanged(Document *doc, void *userData); - void NotifyErrorOccurred(Document *doc, void *userData, int status); - void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam); -diff -r 99e46ea84433 -r 84161436cfbc src/LineMarker.h ---- a/src/LineMarker.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/LineMarker.h Fri Apr 07 17:28:01 2017 +1000 -@@ -76,7 +76,7 @@ - void SetXPM(const char *textForm); - void SetXPM(const char *const *linesForm); - void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage); -- void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const; -+ void Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const; - }; - - #ifdef SCI_NAMESPACE -diff -r 99e46ea84433 -r 84161436cfbc src/PerLine.h ---- a/src/PerLine.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/PerLine.h Fri Apr 07 17:28:01 2017 +1000 -@@ -54,7 +54,7 @@ - - int MarkValue(Sci::Line line); - Sci::Line MarkerNext(Sci::Line lineStart, int mask) const; -- int AddMark(Sci::Line line, int marker, Sci::Line lines); -+ int AddMark(Sci::Line line, int markerNum, Sci::Line lines); - void MergeMarkers(Sci::Line line); - bool DeleteMark(Sci::Line line, int markerNum, bool all); - void DeleteMarkFromHandle(int markerHandle); -diff -r 99e46ea84433 -r 84161436cfbc src/PositionCache.h ---- a/src/PositionCache.h Fri Apr 07 17:08:55 2017 +1000 -+++ b/src/PositionCache.h Fri Apr 07 17:28:01 2017 +1000 -@@ -83,7 +83,7 @@ - void Invalidate(validLevel validity_); - int LineStart(int line) const; - int LineLastVisible(int line) const; -- Range SubLineRange(int line) const; -+ Range SubLineRange(int subLine) const; - bool InLine(int offset, int line) const; - void SetLineStart(int line, int start); - void SetBracesHighlight(Range rangeLine, const Sci::Position braces[], -@@ -134,7 +134,7 @@ - void Set(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_, unsigned int clock_); - void Clear(); - bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_) const; -- static unsigned int Hash(unsigned int styleNumber_, const char *s, unsigned int len); -+ static unsigned int Hash(unsigned int styleNumber_, const char *s, unsigned int len_); - bool NewerThan(const PositionCacheEntry &other) const; - void ResetClock(); - }; -@@ -194,7 +194,7 @@ - enum { lengthStartSubdivision = 300 }; - // Try to make each subdivided run lengthEachSubdivision or shorter. - enum { lengthEachSubdivision = 100 }; -- BreakFinder(const LineLayout *ll_, const Selection *psel, Range rangeLine_, Sci::Position posLineStart_, -+ BreakFinder(const LineLayout *ll_, const Selection *psel, Range lineRange_, Sci::Position posLineStart_, - int xStart, bool breakForSelection, const Document *pdoc_, const SpecialRepresentations *preprs_, const ViewStyle *pvsDraw); - ~BreakFinder(); - TextSegment Next(); -diff -r 99e46ea84433 -r 84161436cfbc win32/PlatWin.cxx ---- a/win32/PlatWin.cxx Fri Apr 07 17:08:55 2017 +1000 -+++ b/win32/PlatWin.cxx Fri Apr 07 17:28:01 2017 +1000 -@@ -1811,11 +1811,11 @@ - return rc; - } - --void Window::SetPositionRelative(PRectangle rc, Window w) { -+void Window::SetPositionRelative(PRectangle rc, Window relativeTo) { - const LONG style = ::GetWindowLong(static_cast<HWND>(wid), GWL_STYLE); - if (style & WS_POPUP) { - POINT ptOther = {0, 0}; -- ::ClientToScreen(static_cast<HWND>(w.GetID()), &ptOther); -+ ::ClientToScreen(static_cast<HWND>(relativeTo.GetID()), &ptOther); - rc.Move(static_cast<XYPOSITION>(ptOther.x), static_cast<XYPOSITION>(ptOther.y)); - - RECT rcMonitor = RectFromPRectangle(rc); -@@ -2657,9 +2657,9 @@ - ::DeleteObject(hBitmap); - } - --LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { -+LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) { - try { -- switch (uMsg) { -+ switch (iMessage) { - case WM_ERASEBKGND: - return TRUE; - -@@ -2706,13 +2706,13 @@ - - WNDPROC prevWndProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hWnd, GWLP_USERDATA)); - if (prevWndProc) { -- return ::CallWindowProc(prevWndProc, hWnd, uMsg, wParam, lParam); -+ return ::CallWindowProc(prevWndProc, hWnd, iMessage, wParam, lParam); - } else { -- return ::DefWindowProc(hWnd, uMsg, wParam, lParam); -+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam); - } - } catch (...) { - } -- return ::DefWindowProc(hWnd, uMsg, wParam, lParam); -+ return ::DefWindowProc(hWnd, iMessage, wParam, lParam); - } - - LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) { -diff -r 99e46ea84433 -r 84161436cfbc win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Fri Apr 07 17:08:55 2017 +1000 -+++ b/win32/ScintillaWin.cxx Fri Apr 07 17:28:01 2017 +1000 -@@ -356,8 +356,8 @@ - void ScrollMessage(WPARAM wParam); - void HorizontalScrollMessage(WPARAM wParam); - void FullPaint(); -- void FullPaintDC(HDC dc); -- bool IsCompatibleDC(HDC dc); -+ void FullPaintDC(HDC hdc); -+ bool IsCompatibleDC(HDC hOtherDC); - DWORD EffectFromState(DWORD grfKeyState) const; - - int SetScrollInfo(int nBar, LPCSCROLLINFO lpsi, BOOL bRedraw); diff --git a/src/scintilla_backports/6173_c9dcde8a91d3.patch b/src/scintilla_backports/6173_c9dcde8a91d3.patch deleted file mode 100644 index bd605934..00000000 --- a/src/scintilla_backports/6173_c9dcde8a91d3.patch +++ /dev/null @@ -1,23 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491552139 -36000 -# Node ID c9dcde8a91d3c5d9f28ba3a7cead581ff880e818 -# Parent 84161436cfbc309da3b30e6fe5bc69c0a9331cfa -Drop "virtual" from methods that do not need to be virtual. - -diff -r 84161436cfbc -r c9dcde8a91d3 src/Decoration.h ---- a/src/Decoration.h Fri Apr 07 17:28:01 2017 +1000 -+++ b/src/Decoration.h Fri Apr 07 18:02:19 2017 +1000 -@@ -66,10 +66,10 @@ - int Start(int indicator, int position); - int End(int indicator, int position); - -- virtual bool ClickNotified() const { -+ bool ClickNotified() const { - return clickNotified; - } -- virtual void SetClickNotified(bool notified) { -+ void SetClickNotified(bool notified) { - clickNotified = notified; - } - }; diff --git a/src/scintilla_backports/6174_150bdfbe2b5a.patch b/src/scintilla_backports/6174_150bdfbe2b5a.patch deleted file mode 100644 index fda06d5e..00000000 --- a/src/scintilla_backports/6174_150bdfbe2b5a.patch +++ /dev/null @@ -1,28 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491558264 -36000 -# Node ID 150bdfbe2b5a267eb53a67850d478d311ccd34b6 -# Parent c9dcde8a91d3c5d9f28ba3a7cead581ff880e818 -Remove unnecessary casts. - -diff -r c9dcde8a91d3 -r 150bdfbe2b5a src/PositionCache.cxx ---- a/src/PositionCache.cxx Fri Apr 07 18:02:19 2017 +1000 -+++ b/src/PositionCache.cxx Fri Apr 07 19:44:24 2017 +1000 -@@ -575,7 +575,7 @@ - for (unsigned int i=0; i<len; i++) { - positions[i] = positions_[i]; - } -- memcpy(reinterpret_cast<char *>(reinterpret_cast<void *>(positions + len)), s_, len); -+ memcpy(reinterpret_cast<void *>(positions + len), s_, len); - } - } - -@@ -594,7 +594,7 @@ - bool PositionCacheEntry::Retrieve(unsigned int styleNumber_, const char *s_, - unsigned int len_, XYPOSITION *positions_) const { - if ((styleNumber == styleNumber_) && (len == len_) && -- (memcmp(reinterpret_cast<char *>(reinterpret_cast<void *>(positions + len)), s_, len)== 0)) { -+ (memcmp(reinterpret_cast<void *>(positions + len), s_, len)== 0)) { - for (unsigned int i=0; i<len; i++) { - positions_[i] = positions[i]; - } diff --git a/src/scintilla_backports/6175_d742ec177a7e.patch b/src/scintilla_backports/6175_d742ec177a7e.patch deleted file mode 100644 index e7ee3602..00000000 --- a/src/scintilla_backports/6175_d742ec177a7e.patch +++ /dev/null @@ -1,167 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491558299 -36000 -# Node ID d742ec177a7eab50fa56cf453d32ed211f767365 -# Parent 150bdfbe2b5a267eb53a67850d478d311ccd34b6 -Prefer C++ static cast over C-style casts. - -diff -r 150bdfbe2b5a -r d742ec177a7e include/Platform.h ---- a/include/Platform.h Fri Apr 07 19:44:24 2017 +1000 -+++ b/include/Platform.h Fri Apr 07 19:44:59 2017 +1000 -@@ -78,7 +78,7 @@ - typedef float XYPOSITION; - typedef double XYACCUMULATOR; - inline int RoundXYPosition(XYPOSITION xyPos) { -- return int(xyPos + 0.5); -+ return static_cast<int>(xyPos + 0.5); - } - - // Underlying the implementation of the platform classes are platform specific types. -diff -r 150bdfbe2b5a -r d742ec177a7e lexers/LexCPP.cxx ---- a/lexers/LexCPP.cxx Fri Apr 07 19:44:24 2017 +1000 -+++ b/lexers/LexCPP.cxx Fri Apr 07 19:44:59 2017 +1000 -@@ -54,7 +54,7 @@ - // Putting a space between the '++' post-inc operator and the '+' binary op - // fixes this, and is highly recommended for readability anyway. - bool FollowsPostfixOperator(StyleContext &sc, LexAccessor &styler) { -- Sci_Position pos = (Sci_Position) sc.currentPos; -+ Sci_Position pos = static_cast<Sci_Position>(sc.currentPos); - while (--pos > 0) { - const char ch = styler[pos]; - if (ch == '+' || ch == '-') { -@@ -66,7 +66,7 @@ - - bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) { - // Don't look at styles, so no need to flush. -- Sci_Position pos = (Sci_Position) sc.currentPos; -+ Sci_Position pos = static_cast<Sci_Position>(sc.currentPos); - Sci_Position currentLine = styler.GetLine(pos); - const Sci_Position lineStartPos = styler.LineStart(currentLine); - while (--pos > lineStartPos) { -@@ -145,7 +145,7 @@ - if ((isoperator(sc.chPrev) || IsASpace(sc.chPrev)) && markerList.Length()) { - const int lengthMarker = 50; - char marker[lengthMarker+1]; -- Sci_Position currPos = (Sci_Position) sc.currentPos; -+ Sci_Position currPos = static_cast<Sci_Position>(sc.currentPos); - int i = 0; - while (i < lengthMarker) { - const char ch = styler.SafeGetCharAt(currPos + i); -diff -r 150bdfbe2b5a -r d742ec177a7e lexers/LexPython.cxx ---- a/lexers/LexPython.cxx Fri Apr 07 19:44:24 2017 +1000 -+++ b/lexers/LexPython.cxx Fri Apr 07 19:44:59 2017 +1000 -@@ -435,7 +435,7 @@ - - if (deepestSingleStateIndex != -1) { - sc.SetState(fstringStateStack[deepestSingleStateIndex].state); -- while (fstringStateStack.size() > (unsigned long)deepestSingleStateIndex) { -+ while (fstringStateStack.size() > static_cast<unsigned long>(deepestSingleStateIndex)) { - PopFromStateStack(fstringStateStack, currentFStringExp); - } - } -@@ -714,7 +714,7 @@ - sc.ForwardSetState(SCE_P_DEFAULT); - needEOLCheck = true; - -- while (fstringStateStack.size() > (unsigned long)matching_stack_i) { -+ while (fstringStateStack.size() > static_cast<unsigned long>(matching_stack_i)) { - PopFromStateStack(fstringStateStack, currentFStringExp); - } - } -diff -r 150bdfbe2b5a -r d742ec177a7e src/AutoComplete.cxx ---- a/src/AutoComplete.cxx Fri Apr 07 19:44:24 2017 +1000 -+++ b/src/AutoComplete.cxx Fri Apr 07 19:44:59 2017 +1000 -@@ -156,7 +156,7 @@ - - Sorter IndexSort(this, list); - sortMatrix.clear(); -- for (int i = 0; i < (int)IndexSort.indices.size() / 2; ++i) -+ for (int i = 0; i < static_cast<int>(IndexSort.indices.size()) / 2; ++i) - sortMatrix.push_back(i); - std::sort(sortMatrix.begin(), sortMatrix.end(), IndexSort); - if (autoSort == SC_ORDER_CUSTOM || sortMatrix.size() < 2) { -@@ -186,7 +186,7 @@ - item[wordLen] = '\0'; - sortedList += item; - } -- for (int i = 0; i < (int)sortMatrix.size(); ++i) -+ for (int i = 0; i < static_cast<int>(sortMatrix.size()); ++i) - sortMatrix[i] = i; - lb->SetList(sortedList.c_str(), separator, typesep); - } -diff -r 150bdfbe2b5a -r d742ec177a7e src/Indicator.cxx ---- a/src/Indicator.cxx Fri Apr 07 19:44:24 2017 +1000 -+++ b/src/Indicator.cxx Fri Apr 07 19:44:59 2017 +1000 -@@ -21,7 +21,8 @@ - - static PRectangle PixelGridAlign(const PRectangle &rc) { - // Move left and right side to nearest pixel to avoid blurry visuals -- return PRectangle::FromInts(int(rc.left + 0.5), int(rc.top), int(rc.right + 0.5), int(rc.bottom)); -+ return PRectangle::FromInts(static_cast<int>(rc.left + 0.5), static_cast<int>(rc.top), -+ static_cast<int>(rc.right + 0.5), static_cast<int>(rc.bottom)); - } - - void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, const PRectangle &rcCharacter, DrawState drawState, int value) const { -@@ -35,8 +36,8 @@ - surface->PenColour(sacDraw.fore); - int ymid = static_cast<int>(rc.bottom + rc.top) / 2; - if (sacDraw.style == INDIC_SQUIGGLE) { -- int x = int(rc.left+0.5); -- const int xLast = int(rc.right+0.5); -+ int x = static_cast<int>(rc.left+0.5); -+ const int xLast = static_cast<int>(rc.right+0.5); - int y = 0; - surface->MoveTo(x, static_cast<int>(rc.top) + y); - while (x < xLast) { -diff -r 150bdfbe2b5a -r d742ec177a7e win32/PlatWin.cxx ---- a/win32/PlatWin.cxx Fri Apr 07 19:44:24 2017 +1000 -+++ b/win32/PlatWin.cxx Fri Apr 07 19:44:59 2017 +1000 -@@ -1292,7 +1292,7 @@ - } - - static float RoundFloat(float f) { -- return float(int(f+0.5f)); -+ return static_cast<float>(static_cast<int>(f+0.5f)); - } - - void SurfaceD2D::LineTo(int x_, int y_) { -@@ -1899,7 +1899,7 @@ - FlipBitmap(info.hbmMask, bmp.bmWidth, bmp.bmHeight); - if (info.hbmColor != NULL) - FlipBitmap(info.hbmColor, bmp.bmWidth, bmp.bmHeight); -- info.xHotspot = (DWORD)bmp.bmWidth - 1 - info.xHotspot; -+ info.xHotspot = static_cast<DWORD>(bmp.bmWidth) - 1 - info.xHotspot; - - reverseArrowCursor = ::CreateIconIndirect(&info); - if (reverseArrowCursor != NULL) -diff -r 150bdfbe2b5a -r d742ec177a7e win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Fri Apr 07 19:44:24 2017 +1000 -+++ b/win32/ScintillaWin.cxx Fri Apr 07 19:44:59 2017 +1000 -@@ -2689,11 +2689,11 @@ - const int rcFeedLen = static_cast<int>(rcFeed.length()) * sizeof(wchar_t); - const int rcSize = sizeof(RECONVERTSTRING) + rcFeedLen + sizeof(wchar_t); - -- RECONVERTSTRING *rc = (RECONVERTSTRING *)lParam; -+ RECONVERTSTRING *rc = reinterpret_cast<RECONVERTSTRING *>(lParam); - if (!rc) - return rcSize; // Immediately be back with rcSize of memory block. - -- wchar_t *rcFeedStart = (wchar_t*)(rc + 1); -+ wchar_t *rcFeedStart = reinterpret_cast<wchar_t*>(rc + 1); - memcpy(rcFeedStart, &rcFeed[0], rcFeedLen); - - std::string rcCompString = RangeText(mainStart, mainEnd); -@@ -2704,10 +2704,10 @@ - // Map selection to dwCompStr. - // No selection assumes current caret as rcCompString without length. - rc->dwVersion = 0; // It should be absolutely 0. -- rc->dwStrLen = (DWORD)static_cast<int>(rcFeed.length()); -+ rc->dwStrLen = static_cast<DWORD>(rcFeed.length()); - rc->dwStrOffset = sizeof(RECONVERTSTRING); -- rc->dwCompStrLen = (DWORD)static_cast<int>(rcCompWstring.length()); -- rc->dwCompStrOffset = (DWORD)static_cast<int>(rcCompWstart.length()) * sizeof(wchar_t); -+ rc->dwCompStrLen = static_cast<DWORD>(rcCompWstring.length()); -+ rc->dwCompStrOffset = static_cast<DWORD>(rcCompWstart.length()) * sizeof(wchar_t); - rc->dwTargetStrLen = rc->dwCompStrLen; - rc->dwTargetStrOffset =rc->dwCompStrOffset; - diff --git a/src/scintilla_backports/6176_20120f9d1698.patch b/src/scintilla_backports/6176_20120f9d1698.patch deleted file mode 100644 index 2622c3a0..00000000 --- a/src/scintilla_backports/6176_20120f9d1698.patch +++ /dev/null @@ -1,19 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491606364 -36000 -# Node ID 20120f9d1698f2a5b36ca9fa2e01ed08fa9776fd -# Parent d742ec177a7eab50fa56cf453d32ed211f767365 -Use reference for efficiency. - -diff -r d742ec177a7e -r 20120f9d1698 src/Editor.cxx ---- a/src/Editor.cxx Fri Apr 07 19:44:59 2017 +1000 -+++ b/src/Editor.cxx Sat Apr 08 09:06:04 2017 +1000 -@@ -4301,7 +4301,7 @@ - const SelectionPosition pos = SPositionFromLocation(pt, false, true); - const Point ptPos = LocationFromPosition(pos); - for (size_t r=0; r<sel.Count(); r++) { -- const SelectionRange range = sel.Range(r); -+ const SelectionRange &range = sel.Range(r); - if (range.Contains(pos)) { - bool hit = true; - if (pos == range.Start()) { diff --git a/src/scintilla_backports/6182_7c132e9340ce.patch b/src/scintilla_backports/6182_7c132e9340ce.patch deleted file mode 100644 index 4eaca03a..00000000 --- a/src/scintilla_backports/6182_7c132e9340ce.patch +++ /dev/null @@ -1,43 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1491982645 -36000 -# Node ID 7c132e9340ce3425120c0c84820461d238f0560a -# Parent 75b60222c770944068ee3492a39e82a29c775da6 -For speed, store height of capital letters in FontMeasurements so not -recalculated for every character blob. - -diff -r 75b60222c770 -r 7c132e9340ce src/EditView.cxx ---- a/src/EditView.cxx Tue Apr 11 18:11:18 2017 +1000 -+++ b/src/EditView.cxx Wed Apr 12 17:37:25 2017 +1000 -@@ -818,8 +818,7 @@ - surface->FillRectangle(rcSegment, textBack); - } - FontAlias ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font; -- int normalCharHeight = static_cast<int>(surface->Ascent(ctrlCharsFont) - -- surface->InternalLeading(ctrlCharsFont)); -+ const int normalCharHeight = static_cast<int>(ceil(vsDraw.styles[STYLE_CONTROLCHAR].capitalHeight)); - PRectangle rcCChar = rcSegment; - rcCChar.left = rcCChar.left + 1; - rcCChar.top = rcSegment.top + vsDraw.maxAscent - normalCharHeight; -diff -r 75b60222c770 -r 7c132e9340ce src/Style.h ---- a/src/Style.h Tue Apr 11 18:11:18 2017 +1000 -+++ b/src/Style.h Wed Apr 12 17:37:25 2017 +1000 -@@ -46,6 +46,7 @@ - struct FontMeasurements { - unsigned int ascent; - unsigned int descent; -+ XYPOSITION capitalHeight; // Top of capital letter to baseline: ascent - internal leading - XYPOSITION aveCharWidth; - XYPOSITION spaceWidth; - int sizeZoomed; -diff -r 75b60222c770 -r 7c132e9340ce src/ViewStyle.cxx ---- a/src/ViewStyle.cxx Tue Apr 11 18:11:18 2017 +1000 -+++ b/src/ViewStyle.cxx Wed Apr 12 17:37:25 2017 +1000 -@@ -86,6 +86,7 @@ - - ascent = static_cast<unsigned int>(surface.Ascent(font)); - descent = static_cast<unsigned int>(surface.Descent(font)); -+ capitalHeight = surface.Ascent(font) - surface.InternalLeading(font); - aveCharWidth = surface.AverageCharWidth(font); - spaceWidth = surface.WidthChar(font, ' '); - } diff --git a/src/scintilla_backports/6183_3e2dd5970075.patch b/src/scintilla_backports/6183_3e2dd5970075.patch deleted file mode 100644 index e8da9fe3..00000000 --- a/src/scintilla_backports/6183_3e2dd5970075.patch +++ /dev/null @@ -1,18 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1492139205 -36000 -# Node ID 3e2dd597007504f8745a3fed53ccba9bbe611265 -# Parent 7c132e9340ce3425120c0c84820461d238f0560a -Ensure capitalHeight initialised. - -diff -r 7c132e9340ce -r 3e2dd5970075 src/Style.cxx ---- a/src/Style.cxx Wed Apr 12 17:37:25 2017 +1000 -+++ b/src/Style.cxx Fri Apr 14 13:06:45 2017 +1000 -@@ -68,6 +68,7 @@ - void FontMeasurements::Clear() { - ascent = 1; - descent = 1; -+ capitalHeight = 1; - aveCharWidth = 1; - spaceWidth = 1; - sizeZoomed = 2; diff --git a/src/scintilla_backports/6184_692a54eaa604.patch b/src/scintilla_backports/6184_692a54eaa604.patch deleted file mode 100644 index de8c79b8..00000000 --- a/src/scintilla_backports/6184_692a54eaa604.patch +++ /dev/null @@ -1,92 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1492230489 -36000 -# Node ID 692a54eaa6049d6ea3459f66c001ef0c8ea7668f -# Parent 3e2dd597007504f8745a3fed53ccba9bbe611265 -Use bool literals true and false instead of 1 and 0. - -diff -r 3e2dd5970075 -r 692a54eaa604 lexers/LexHTML.cxx ---- a/lexers/LexHTML.cxx Fri Apr 14 13:06:45 2017 +1000 -+++ b/lexers/LexHTML.cxx Sat Apr 15 14:28:09 2017 +1000 -@@ -490,9 +490,9 @@ - return ((ch == '/') && (chNext == '>')); - } else if (0 == strcmp(blockType, "%")) { - if (ch == '/' && isLineEnd(chNext)) -- return 1; -+ return true; - else -- return isLineEnd(ch); -+ return isLineEnd(ch); - } else if (0 == strcmp(blockType, "{")) { - return ch == '}'; - } else { -@@ -502,13 +502,13 @@ - - static bool isDjangoBlockEnd(const int ch, const int chNext, const char *blockType) { - if (strlen(blockType) == 0) { -- return 0; -+ return false; - } else if (0 == strcmp(blockType, "%")) { - return ((ch == '%') && (chNext == '}')); - } else if (0 == strcmp(blockType, "{")) { - return ((ch == '}') && (chNext == '}')); - } else { -- return 0; -+ return false; - } - } - -diff -r 3e2dd5970075 -r 692a54eaa604 src/Editor.cxx ---- a/src/Editor.cxx Fri Apr 14 13:06:45 2017 +1000 -+++ b/src/Editor.cxx Sat Apr 15 14:28:09 2017 +1000 -@@ -5331,7 +5331,7 @@ - if (action == SC_FOLDACTION_CONTRACT) { - const Sci::Line lineMaxSubord = pdoc->GetLastChild(line); - if (lineMaxSubord > line) { -- cs.SetExpanded(line, 0); -+ cs.SetExpanded(line, false); - cs.SetVisible(line + 1, lineMaxSubord, false); - - const Sci::Line lineCurrent = pdoc->LineFromPosition(sel.MainCaret()); -@@ -5346,7 +5346,7 @@ - EnsureLineVisible(line, false); - GoToLine(line); - } -- cs.SetExpanded(line, 1); -+ cs.SetExpanded(line, true); - ExpandLine(line); - } - -@@ -5419,7 +5419,7 @@ - if (lineDoc != lineParent) - EnsureLineVisible(lineParent, enforcePolicy); - if (!cs.GetExpanded(lineParent)) { -- cs.SetExpanded(lineParent, 1); -+ cs.SetExpanded(lineParent, true); - ExpandLine(lineParent); - } - } -diff -r 3e2dd5970075 -r 692a54eaa604 src/PerLine.cxx ---- a/src/PerLine.cxx Fri Apr 14 13:06:45 2017 +1000 -+++ b/src/PerLine.cxx Sat Apr 15 14:28:09 2017 +1000 -@@ -385,7 +385,7 @@ - if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line]) - return reinterpret_cast<AnnotationHeader *>(annotations[line])->style == IndividualStyles; - else -- return 0; -+ return false; - } - - int LineAnnotation::Style(Sci::Line line) const { -diff -r 3e2dd5970075 -r 692a54eaa604 src/PositionCache.cxx ---- a/src/PositionCache.cxx Fri Apr 14 13:06:45 2017 +1000 -+++ b/src/PositionCache.cxx Sat Apr 15 14:28:09 2017 +1000 -@@ -55,7 +55,7 @@ - numCharsBeforeEOL(0), - validity(llInvalid), - xHighlightGuide(0), -- highlightColumn(0), -+ highlightColumn(false), - containsCaret(false), - edgeColumn(0), - chars(0), diff --git a/src/scintilla_backports/6185_b8379bec8e70.patch b/src/scintilla_backports/6185_b8379bec8e70.patch deleted file mode 100644 index 7d946ead..00000000 --- a/src/scintilla_backports/6185_b8379bec8e70.patch +++ /dev/null @@ -1,35 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1492232428 -36000 -# Node ID b8379bec8e70bf09df25f01d0a78a53cf61b1827 -# Parent 692a54eaa6049d6ea3459f66c001ef0c8ea7668f -Fix deprecation of gdk_window_process_updates in GTK+ 3.22 by redrawing instead -of scrolling. - -diff -r 692a54eaa604 -r b8379bec8e70 gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Sat Apr 15 14:28:09 2017 +1000 -+++ b/gtk/ScintillaGTK.cxx Sat Apr 15 15:00:28 2017 +1000 -@@ -1031,16 +1031,18 @@ - } - - void ScintillaGTK::ScrollText(Sci::Line linesToMove) { -- int diff = vs.lineHeight * -linesToMove; -- //Platform::DebugPrintf("ScintillaGTK::ScrollText %d %d %0d,%0d %0d,%0d\n", linesToMove, diff, -- // rc.left, rc.top, rc.right, rc.bottom); -+ NotifyUpdateUI(); -+ -+#if GTK_CHECK_VERSION(3,22,0) -+ Redraw(); -+#else - GtkWidget *wi = PWidget(wText); -- NotifyUpdateUI(); -- - if (IS_WIDGET_REALIZED(wi)) { -+ const int diff = vs.lineHeight * -linesToMove; - gdk_window_scroll(WindowFromWidget(wi), 0, -diff); - gdk_window_process_updates(WindowFromWidget(wi), FALSE); - } -+#endif - } - - void ScintillaGTK::SetVerticalScrollPos() { diff --git a/src/scintilla_backports/6186_044d2d030263.patch b/src/scintilla_backports/6186_044d2d030263.patch deleted file mode 100644 index d0f88231..00000000 --- a/src/scintilla_backports/6186_044d2d030263.patch +++ /dev/null @@ -1,218 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1492238872 -36000 -# Node ID 044d2d0302639d08d3e0aa72886afcbd47fa39f8 -# Parent b8379bec8e70bf09df25f01d0a78a53cf61b1827 -Avoid calling virtual functions in constructors and destructors. - -diff -r b8379bec8e70 -r 044d2d030263 cocoa/ScintillaCocoa.h ---- a/cocoa/ScintillaCocoa.h Sat Apr 15 15:00:28 2017 +1000 -+++ b/cocoa/ScintillaCocoa.h Sat Apr 15 16:47:52 2017 +1000 -@@ -128,7 +128,7 @@ - void DiscardOverdraw() override; - void Redraw() override; - -- void Initialise() override; -+ void Init(); - void Finalise() override; - CaseFolder *CaseFolderForEncoding() override; - std::string CaseMapString(const std::string &s, int caseMapping) override; -diff -r b8379bec8e70 -r 044d2d030263 cocoa/ScintillaCocoa.mm ---- a/cocoa/ScintillaCocoa.mm Sat Apr 15 15:00:28 2017 +1000 -+++ b/cocoa/ScintillaCocoa.mm Sat Apr 15 16:47:52 2017 +1000 -@@ -422,7 +422,7 @@ - { - timers[tr] = nil; - } -- Initialise(); -+ Init(); - } - - //-------------------------------------------------------------------------------------------------- -@@ -439,7 +439,7 @@ - /** - * Core initialization of the control. Everything that needs to be set up happens here. - */ --void ScintillaCocoa::Initialise() -+void ScintillaCocoa::Init() - { - Scintilla_LinkLexers(); - -diff -r b8379bec8e70 -r 044d2d030263 gtk/PlatGTK.cxx ---- a/gtk/PlatGTK.cxx Sat Apr 15 15:00:28 2017 +1000 -+++ b/gtk/PlatGTK.cxx Sat Apr 15 16:47:52 2017 +1000 -@@ -168,6 +168,7 @@ - void Init(SurfaceID sid, WindowID wid) override; - void InitPixMap(int width, int height, Surface *surface_, WindowID wid) override; - -+ void Clear(); - void Release(); - bool Initialised(); - void PenColour(ColourDesired fore); -@@ -276,10 +277,10 @@ - } - - SurfaceImpl::~SurfaceImpl() { -- Release(); -+ Clear(); - } - --void SurfaceImpl::Release() { -+void SurfaceImpl::Clear() { - et = singleByte; - if (createdGC) { - createdGC = false; -@@ -303,6 +304,10 @@ - createdGC = false; - } - -+void SurfaceImpl::Release() { -+ Clear(); -+} -+ - bool SurfaceImpl::Initialised() { - #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0) - if (inited && context) { -diff -r b8379bec8e70 -r 044d2d030263 gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Sat Apr 15 15:00:28 2017 +1000 -+++ b/gtk/ScintillaGTK.cxx Sat Apr 15 16:47:52 2017 +1000 -@@ -205,7 +205,7 @@ - lastWheelMouseTime.tv_sec = 0; - lastWheelMouseTime.tv_usec = 0; - -- Initialise(); -+ Init(); - } - - ScintillaGTK::~ScintillaGTK() { -@@ -549,8 +549,7 @@ - } - } - --void ScintillaGTK::Initialise() { -- //Platform::DebugPrintf("ScintillaGTK::Initialise\n"); -+void ScintillaGTK::Init() { - parentClass = reinterpret_cast<GtkWidgetClass *>( - g_type_class_ref(gtk_container_get_type())); - -@@ -3044,7 +3043,7 @@ - - // Define default signal handlers for the class: Could move more - // of the signal handlers here (those that currently attached to wDraw -- // in Initialise() may require coordinate translation?) -+ // in Init() may require coordinate translation?) - - object_class->dispose = Dispose; - object_class->finalize = Destroy; -diff -r b8379bec8e70 -r 044d2d030263 gtk/ScintillaGTK.h ---- a/gtk/ScintillaGTK.h Sat Apr 15 15:00:28 2017 +1000 -+++ b/gtk/ScintillaGTK.h Sat Apr 15 16:47:52 2017 +1000 -@@ -81,7 +81,7 @@ - static ScintillaGTK *FromWidget(GtkWidget *widget); - static void ClassInit(OBJECT_CLASS* object_class, GtkWidgetClass *widget_class, GtkContainerClass *container_class); - private: -- virtual void Initialise(); -+ void Init(); - virtual void Finalise(); - virtual bool AbandonPaint(); - virtual void DisplayCursor(Window::Cursor c); -diff -r b8379bec8e70 -r 044d2d030263 qt/ScintillaEditBase/ScintillaQt.cpp ---- a/qt/ScintillaEditBase/ScintillaQt.cpp Sat Apr 15 15:00:28 2017 +1000 -+++ b/qt/ScintillaEditBase/ScintillaQt.cpp Sat Apr 15 16:47:52 2017 +1000 -@@ -45,7 +45,7 @@ - // Buffered drawing turned off by default to avoid this. - WndProc(SCI_SETBUFFEREDDRAW, false, 0); - -- Initialise(); -+ Init(); - - for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast<TickReason>(tr + 1)) { - timers[tr] = 0; -@@ -128,7 +128,7 @@ - - #endif - --void ScintillaQt::Initialise() -+void ScintillaQt::Init() - { - #if defined(Q_OS_WIN) || defined(Q_OS_MAC) - rectangularSelectionModifier = SCMOD_ALT; -diff -r b8379bec8e70 -r 044d2d030263 qt/ScintillaEditBase/ScintillaQt.h ---- a/qt/ScintillaEditBase/ScintillaQt.h Sat Apr 15 15:00:28 2017 +1000 -+++ b/qt/ScintillaEditBase/ScintillaQt.h Sat Apr 15 16:47:52 2017 +1000 -@@ -99,7 +99,7 @@ - void SelectionChanged(); - - private: -- virtual void Initialise(); -+ void Init(); - virtual void Finalise(); - virtual bool DragThreshold(Point ptStart, Point ptNow); - virtual bool ValidCodePage(int codePage) const; -diff -r b8379bec8e70 -r 044d2d030263 src/PerLine.cxx ---- a/src/PerLine.cxx Sat Apr 15 15:00:28 2017 +1000 -+++ b/src/PerLine.cxx Sat Apr 15 16:47:52 2017 +1000 -@@ -121,7 +121,11 @@ - } - - LineMarkers::~LineMarkers() { -- Init(); -+ for (int line = 0; line < markers.Length(); line++) { -+ delete markers[line]; -+ markers[line] = 0; -+ } -+ markers.DeleteAll(); - } - - void LineMarkers::Init() { -@@ -490,7 +494,10 @@ - } - - LineTabstops::~LineTabstops() { -- Init(); -+ for (int line = 0; line < tabstops.Length(); line++) { -+ delete tabstops[line]; -+ } -+ tabstops.DeleteAll(); - } - - void LineTabstops::Init() { -diff -r b8379bec8e70 -r 044d2d030263 src/ScintillaBase.h ---- a/src/ScintillaBase.h Sat Apr 15 15:00:28 2017 +1000 -+++ b/src/ScintillaBase.h Sat Apr 15 16:47:52 2017 +1000 -@@ -59,7 +59,7 @@ - - ScintillaBase(); - virtual ~ScintillaBase(); -- virtual void Initialise() = 0; -+ void Initialise() {} - virtual void Finalise(); - - virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false); -diff -r b8379bec8e70 -r 044d2d030263 win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Sat Apr 15 15:00:28 2017 +1000 -+++ b/win32/ScintillaWin.cxx Sat Apr 15 16:47:52 2017 +1000 -@@ -276,7 +276,7 @@ - ~ScintillaWin() override; - ScintillaWin &operator=(const ScintillaWin &); - -- void Initialise() override; -+ void Init(); - void Finalise() override; - #if defined(USE_D2D) - void EnsureRenderTarget(HDC hdc); -@@ -459,12 +459,12 @@ - if (caret.period < 0) - caret.period = 0; - -- Initialise(); -+ Init(); - } - - ScintillaWin::~ScintillaWin() {} - --void ScintillaWin::Initialise() { -+void ScintillaWin::Init() { - // Initialize COM. If the app has already done this it will have - // no effect. If the app hasn't, we really shouldn't ask them to call - // it just so this internal feature works. diff --git a/src/scintilla_backports/6187_a80a6876c301.patch b/src/scintilla_backports/6187_a80a6876c301.patch deleted file mode 100644 index 9c6a92af..00000000 --- a/src/scintilla_backports/6187_a80a6876c301.patch +++ /dev/null @@ -1,91 +0,0 @@ -# HG changeset patch -# User Neil Hodgson <nyamatongwe@gmail.com> -# Date 1492240107 -36000 -# Node ID a80a6876c301ec0caf29ef20eb2161f6af9a8552 -# Parent 044d2d0302639d08d3e0aa72886afcbd47fa39f8 -Avoid calling virtual functions in destructor. Mark overridden methods. - -diff -r 044d2d030263 -r a80a6876c301 cocoa/ScintillaCocoa.h ---- a/cocoa/ScintillaCocoa.h Sat Apr 15 16:47:52 2017 +1000 -+++ b/cocoa/ScintillaCocoa.h Sat Apr 15 17:08:27 2017 +1000 -@@ -129,7 +129,6 @@ - void Redraw() override; - - void Init(); -- void Finalise() override; - CaseFolder *CaseFolderForEncoding() override; - std::string CaseMapString(const std::string &s, int caseMapping) override; - void CancelModes() override; -@@ -137,6 +136,7 @@ - public: - ScintillaCocoa(ScintillaView* sciView_, SCIContentView* viewContent, SCIMarginView* viewMargin); - ~ScintillaCocoa() override; -+ void Finalise() override; - - void SetDelegate(id<ScintillaNotificationProtocol> delegate_); - void RegisterNotifyCallback(intptr_t windowid, SciNotifyFunc callback); -diff -r 044d2d030263 -r a80a6876c301 cocoa/ScintillaCocoa.mm ---- a/cocoa/ScintillaCocoa.mm Sat Apr 15 16:47:52 2017 +1000 -+++ b/cocoa/ScintillaCocoa.mm Sat Apr 15 17:08:27 2017 +1000 -@@ -429,7 +429,6 @@ - - ScintillaCocoa::~ScintillaCocoa() - { -- Finalise(); - [timerTarget ownerDestroyed]; - [timerTarget release]; - } -diff -r 044d2d030263 -r a80a6876c301 cocoa/ScintillaView.mm ---- a/cocoa/ScintillaView.mm Sat Apr 15 16:47:52 2017 +1000 -+++ b/cocoa/ScintillaView.mm Sat Apr 15 17:08:27 2017 +1000 -@@ -1559,6 +1559,7 @@ - - (void) dealloc - { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -+ mBackend->Finalise(); - delete mBackend; - mBackend = NULL; - mContent.owner = nil; -diff -r 044d2d030263 -r a80a6876c301 src/ScintillaBase.h ---- a/src/ScintillaBase.h Sat Apr 15 16:47:52 2017 +1000 -+++ b/src/ScintillaBase.h Sat Apr 15 17:08:27 2017 +1000 -@@ -60,12 +60,12 @@ - ScintillaBase(); - virtual ~ScintillaBase(); - void Initialise() {} -- virtual void Finalise(); -+ void Finalise(); - -- virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false); -+ void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false); - void Command(int cmdId); -- virtual void CancelModes(); -- virtual int KeyCommand(unsigned int iMessage); -+ void CancelModes(); -+ int KeyCommand(unsigned int iMessage); - - void AutoCompleteInsert(Sci::Position startPos, int removeLen, const char *text, int textLen); - void AutoCompleteStart(int lenEntered, const char *list); -@@ -87,16 +87,16 @@ - bool ShouldDisplayPopup(Point ptInWindowCoordinates) const; - void ContextMenu(Point pt); - -- virtual void ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); -- virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); -- virtual void RightButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); -+ void ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); -+ void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); -+ void RightButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); - -- void NotifyStyleToNeeded(Sci::Position endStyleNeeded); -- void NotifyLexerChanged(Document *doc, void *userData); -+ void NotifyStyleToNeeded(Sci::Position endStyleNeeded); -+ void NotifyLexerChanged(Document *doc, void *userData); - - public: - // Public so scintilla_send_message can use it -- virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); -+ sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); - }; - - #ifdef SCI_NAMESPACE diff --git a/src/scintilla_backports/6196_e4f249dbdc30.patch b/src/scintilla_backports/6196_e4f249dbdc30.patch deleted file mode 100644 index 3ca9040b..00000000 --- a/src/scintilla_backports/6196_e4f249dbdc30.patch +++ /dev/null @@ -1,28 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1492586191 -36000 -# Node ID e4f249dbdc30e33291297c312042b760f825f4c0 -# Parent ba90de635fc390837399a66841392d1e87c829d5 -Drop reinterpret_cast when can implicit cast to void* or const void*. - -diff -r ba90de635fc3 -r e4f249dbdc30 src/PositionCache.cxx ---- a/src/PositionCache.cxx Wed Apr 19 15:30:08 2017 +1000 -+++ b/src/PositionCache.cxx Wed Apr 19 17:16:31 2017 +1000 -@@ -575,7 +575,7 @@ - for (unsigned int i=0; i<len; i++) { - positions[i] = positions_[i]; - } -- memcpy(reinterpret_cast<void *>(positions + len), s_, len); -+ memcpy(positions + len, s_, len); - } - } - -@@ -594,7 +594,7 @@ - bool PositionCacheEntry::Retrieve(unsigned int styleNumber_, const char *s_, - unsigned int len_, XYPOSITION *positions_) const { - if ((styleNumber == styleNumber_) && (len == len_) && -- (memcmp(reinterpret_cast<void *>(positions + len), s_, len)== 0)) { -+ (memcmp(positions + len, s_, len)== 0)) { - for (unsigned int i=0; i<len; i++) { - positions_[i] = positions[i]; - } diff --git a/src/scintilla_backports/6215_1f02cb4a5b26.patch b/src/scintilla_backports/6215_1f02cb4a5b26.patch deleted file mode 100644 index 093df2cb..00000000 --- a/src/scintilla_backports/6215_1f02cb4a5b26.patch +++ /dev/null @@ -1,33 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1493072833 -36000 -# Node ID 1f02cb4a5b26d6774b09fc59f8fb4fbd1098c5ef -# Parent 23af3d7bb75a20bd0e3c0ccf3f341b9defa070e5 -Bug [#1940]. Canceling modes with the Esc key preserves a rectangular selection. - -diff -r 23af3d7bb75a -r 1f02cb4a5b26 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Mon Apr 24 08:36:05 2017 +1000 -+++ b/doc/ScintillaHistory.html Tue Apr 25 08:27:13 2017 +1000 -@@ -560,6 +560,10 @@ - <a href="http://sourceforge.net/p/scintilla/bugs/1931/">Bug #1931</a>. - </li> - <li> -+ Canceling modes with the Esc key preserves a rectangular selection. -+ <a href="http://sourceforge.net/p/scintilla/bugs/1940/">Bug #1940</a>. -+ </li> -+ <li> - On Cocoa, a leak of mouse tracking areas was fixed. - </li> - <li> -diff -r 23af3d7bb75a -r 1f02cb4a5b26 src/Editor.cxx ---- a/src/Editor.cxx Mon Apr 24 08:36:05 2017 +1000 -+++ b/src/Editor.cxx Tue Apr 25 08:27:13 2017 +1000 -@@ -3745,7 +3745,7 @@ - case SCI_CANCEL: // Cancel any modes - handled in subclass - // Also unselect text - CancelModes(); -- if (sel.Count() > 1) { -+ if ((sel.Count() > 1) && !sel.IsRectangular()) { - // Drop additional selections - InvalidateWholeSelection(); - sel.DropAdditionalRanges(); diff --git a/src/scintilla_backports/6222_45f968a6735a.patch b/src/scintilla_backports/6222_45f968a6735a.patch deleted file mode 100644 index 918b9579..00000000 --- a/src/scintilla_backports/6222_45f968a6735a.patch +++ /dev/null @@ -1,222 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1493717258 -36000 -# Node ID 45f968a6735a89a219c8461ea3312655cc15da83 -# Parent da6b7ddd88fe823d0e4b985ace8903ccf304d573 -More consistent use of size_t when converting Unicode formats. - -diff -r da6b7ddd88fe -r 45f968a6735a src/Document.cxx ---- a/src/Document.cxx Tue May 02 11:16:00 2017 +1000 -+++ b/src/Document.cxx Tue May 02 19:27:38 2017 +1000 -@@ -2883,7 +2883,7 @@ - - bool matched = false; - if (SC_CP_UTF8 == doc->dbcsCodePage) { -- unsigned int lenS = static_cast<unsigned int>(strlen(s)); -+ size_t lenS = strlen(s); - std::vector<wchar_t> ws(lenS + 1); - #if WCHAR_T_IS_16 - size_t outLen = UTF16FromUTF8(s, lenS, &ws[0], lenS); -diff -r da6b7ddd88fe -r 45f968a6735a src/UniConversion.cxx ---- a/src/UniConversion.cxx Tue May 02 11:16:00 2017 +1000 -+++ b/src/UniConversion.cxx Tue May 02 19:27:38 2017 +1000 -@@ -20,9 +20,9 @@ - namespace Scintilla { - #endif - --unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) { -- unsigned int len = 0; -- for (unsigned int i = 0; i < tlen && uptr[i];) { -+size_t UTF8Length(const wchar_t *uptr, size_t tlen) { -+ size_t len = 0; -+ for (size_t i = 0; i < tlen && uptr[i];) { - const unsigned int uch = uptr[i]; - if (uch < 0x80) { - len++; -@@ -40,9 +40,9 @@ - return len; - } - --void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len) { -- unsigned int k = 0; -- for (unsigned int i = 0; i < tlen && uptr[i];) { -+void UTF8FromUTF16(const wchar_t *uptr, size_t tlen, char *putf, size_t len) { -+ size_t k = 0; -+ for (size_t i = 0; i < tlen && uptr[i];) { - const unsigned int uch = uptr[i]; - if (uch < 0x80) { - putf[k++] = static_cast<char>(uch); -@@ -138,10 +138,10 @@ - return ui; - } - --unsigned int UTF32FromUTF8(const char *s, unsigned int len, unsigned int *tbuf, unsigned int tlen) { -- unsigned int ui=0; -+size_t UTF32FromUTF8(const char *s, size_t len, unsigned int *tbuf, size_t tlen) { -+ size_t ui=0; - const unsigned char *us = reinterpret_cast<const unsigned char *>(s); -- unsigned int i=0; -+ size_t i=0; - while ((i<len) && (ui<tlen)) { - unsigned char ch = us[i++]; - unsigned int value = 0; -diff -r da6b7ddd88fe -r 45f968a6735a src/UniConversion.h ---- a/src/UniConversion.h Tue May 02 11:16:00 2017 +1000 -+++ b/src/UniConversion.h Tue May 02 19:27:38 2017 +1000 -@@ -16,12 +16,12 @@ - - const int unicodeReplacementChar = 0xFFFD; - --unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen); --void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len); -+size_t UTF8Length(const wchar_t *uptr, size_t tlen); -+void UTF8FromUTF16(const wchar_t *uptr, size_t tlen, char *putf, size_t len); - unsigned int UTF8CharLength(unsigned char ch); - size_t UTF16Length(const char *s, size_t len); - size_t UTF16FromUTF8(const char *s, size_t len, wchar_t *tbuf, size_t tlen); --unsigned int UTF32FromUTF8(const char *s, unsigned int len, unsigned int *tbuf, unsigned int tlen); -+size_t UTF32FromUTF8(const char *s, size_t len, unsigned int *tbuf, size_t tlen); - unsigned int UTF16FromUTF32Character(unsigned int val, wchar_t *tbuf); - std::string FixInvalidUTF8(const std::string &text); - -diff -r da6b7ddd88fe -r 45f968a6735a win32/PlatWin.cxx ---- a/win32/PlatWin.cxx Tue May 02 11:16:00 2017 +1000 -+++ b/win32/PlatWin.cxx Tue May 02 19:27:38 2017 +1000 -@@ -481,7 +481,7 @@ - const int stackBufferLength = 1000; - class TextWide : public VarBuffer<wchar_t, stackBufferLength> { - public: -- int tlen; -+ int tlen; // Using int instead of size_t as most Win32 APIs take int. - TextWide(const char *s, int len, bool unicodeMode, int codePage=0) : - VarBuffer<wchar_t, stackBufferLength>(len) { - if (unicodeMode) { -diff -r da6b7ddd88fe -r 45f968a6735a win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Tue May 02 11:16:00 2017 +1000 -+++ b/win32/ScintillaWin.cxx Tue May 02 19:27:38 2017 +1000 -@@ -782,10 +782,10 @@ - void ScintillaWin::AddCharUTF16(wchar_t const *wcs, unsigned int wclen) { - if (IsUnicodeMode()) { - char utfval[maxLenInputIME * 3]; -- unsigned int len = UTF8Length(wcs, wclen); -+ size_t len = UTF8Length(wcs, wclen); - UTF8FromUTF16(wcs, wclen, utfval, len); - utfval[len] = '\0'; -- AddCharUTF(utfval, len); -+ AddCharUTF(utfval, static_cast<unsigned int>(len)); - } else { - UINT cpDest = CodePageOfDocument(); - char inBufferCP[maxLenInputIME * 2]; -@@ -1178,7 +1178,7 @@ - std::vector<char> docBytes(pdoc->Length(), '\0'); - pdoc->GetCharRange(&docBytes[0], 0, pdoc->Length()); - if (IsUnicodeMode()) { -- return UTF16Length(&docBytes[0], static_cast<unsigned int>(docBytes.size())); -+ return UTF16Length(&docBytes[0], docBytes.size()); - } else { - return ::MultiByteToWideChar(CodePageOfDocument(), 0, &docBytes[0], - static_cast<int>(docBytes.size()), NULL, 0); -@@ -1200,7 +1200,7 @@ - if (wParam == 0) - return 0; - size_t uLen = UTF16FromUTF8(&docBytes[0], docBytes.size(), -- ptr, static_cast<int>(wParam) - 1); -+ ptr, wParam - 1); - ptr[uLen] = L'\0'; - return uLen; - } else { -@@ -2231,11 +2231,11 @@ - if (memUSelection) { - wchar_t *uptr = static_cast<wchar_t *>(memUSelection.ptr); - if (uptr) { -- unsigned int len; -+ size_t len; - std::vector<char> putf; - // Default Scintilla behaviour in Unicode mode - if (IsUnicodeMode()) { -- const unsigned int bytes = static_cast<unsigned int>(memUSelection.Size()); -+ const size_t bytes = memUSelection.Size(); - len = UTF8Length(uptr, bytes / 2); - putf.resize(len + 1); - UTF8FromUTF16(uptr, bytes / 2, &putf[0], len); -@@ -2247,10 +2247,10 @@ - NULL, 0, NULL, NULL) - 1; // subtract 0 terminator - putf.resize(len + 1); - ::WideCharToMultiByte(cpDest, 0, uptr, -1, -- &putf[0], len + 1, NULL, NULL); -+ &putf[0], static_cast<int>(len) + 1, NULL, NULL); - } - -- InsertPasteShape(&putf[0], len, pasteShape); -+ InsertPasteShape(&putf[0], static_cast<int>(len), pasteShape); - } - memUSelection.Unlock(); - } else { -@@ -2259,27 +2259,28 @@ - if (memSelection) { - char *ptr = static_cast<char *>(memSelection.ptr); - if (ptr) { -- const unsigned int bytes = static_cast<unsigned int>(memSelection.Size()); -- unsigned int len = bytes; -- for (unsigned int i = 0; i < bytes; i++) { -+ const size_t bytes = memSelection.Size(); -+ size_t len = bytes; -+ for (size_t i = 0; i < bytes; i++) { - if ((len == bytes) && (0 == ptr[i])) - len = i; - } -+ const int ilen = static_cast<int>(len); - - // In Unicode mode, convert clipboard text to UTF-8 - if (IsUnicodeMode()) { - std::vector<wchar_t> uptr(len+1); - -- const unsigned int ulen = ::MultiByteToWideChar(CP_ACP, 0, -- ptr, len, &uptr[0], len+1); -- -- unsigned int mlen = UTF8Length(&uptr[0], ulen); -+ const size_t ulen = ::MultiByteToWideChar(CP_ACP, 0, -+ ptr, ilen, &uptr[0], ilen +1); -+ -+ const size_t mlen = UTF8Length(&uptr[0], ulen); - std::vector<char> putf(mlen+1); - UTF8FromUTF16(&uptr[0], ulen, &putf[0], mlen); - -- InsertPasteShape(&putf[0], mlen, pasteShape); -+ InsertPasteShape(&putf[0], static_cast<int>(mlen), pasteShape); - } else { -- InsertPasteShape(ptr, len, pasteShape); -+ InsertPasteShape(ptr, ilen, pasteShape); - } - } - memSelection.Unlock(); -@@ -2770,7 +2771,7 @@ - // Default Scintilla behaviour in Unicode mode - if (IsUnicodeMode()) { - size_t uchars = UTF16Length(selectedText.Data(), -- static_cast<int>(selectedText.LengthWithTerminator())); -+ selectedText.LengthWithTerminator()); - uniText.Allocate(2 * uchars); - if (uniText) { - UTF16FromUTF8(selectedText.Data(), selectedText.LengthWithTerminator(), -@@ -3069,9 +3070,9 @@ - wchar_t *udata = static_cast<wchar_t *>(memUDrop.ptr); - if (udata) { - if (IsUnicodeMode()) { -- const int tlen = static_cast<int>(memUDrop.Size()); -+ const size_t tlen = memUDrop.Size(); - // Convert UTF-16 to UTF-8 -- int dataLen = UTF8Length(udata, tlen/2); -+ const size_t dataLen = UTF8Length(udata, tlen/2); - data.resize(dataLen+1); - UTF8FromUTF16(udata, tlen/2, &data[0], dataLen); - } else { -@@ -3146,7 +3147,7 @@ - - GlobalMemory text; - if (pFEIn->cfFormat == CF_UNICODETEXT) { -- size_t uchars = UTF16Length(drag.Data(), static_cast<int>(drag.LengthWithTerminator())); -+ size_t uchars = UTF16Length(drag.Data(), drag.LengthWithTerminator()); - text.Allocate(2 * uchars); - if (text) { - UTF16FromUTF8(drag.Data(), drag.LengthWithTerminator(), diff --git a/src/scintilla_backports/6231_61adfbe4fa64.patch b/src/scintilla_backports/6231_61adfbe4fa64.patch deleted file mode 100644 index 6945055a..00000000 --- a/src/scintilla_backports/6231_61adfbe4fa64.patch +++ /dev/null @@ -1,44 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1494389973 -36000 -# Node ID 61adfbe4fa64ed5ad99e36dc7220cd3c6f9b7659 -# Parent 6c164ebad8b9b40d9e757d49f37a4354f3c7fc03 -Feature [feature-requests:#1187]. Update scroll bar when annotations added, -removed, or visibility changed. - -diff -r 6c164ebad8b9 -r 61adfbe4fa64 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Wed May 10 14:15:16 2017 +1000 -+++ b/doc/ScintillaHistory.html Wed May 10 14:19:33 2017 +1000 -@@ -571,6 +571,10 @@ - <a href="http://sourceforge.net/p/scintilla/bugs/1931/">Bug #1931</a>. - </li> - <li> -+ Update scroll bar when annotations added, removed, or visibility changed. -+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1187/">Feature #1187.</a> -+ </li> -+ <li> - Canceling modes with the Esc key preserves a rectangular selection. - <a href="http://sourceforge.net/p/scintilla/bugs/1940/">Bug #1940</a>. - </li> -diff -r 6c164ebad8b9 -r 61adfbe4fa64 src/Editor.cxx ---- a/src/Editor.cxx Wed May 10 14:15:16 2017 +1000 -+++ b/src/Editor.cxx Wed May 10 14:19:33 2017 +1000 -@@ -2629,7 +2629,9 @@ - if (mh.modificationType & SC_MOD_CHANGEANNOTATION) { - Sci::Line lineDoc = pdoc->LineFromPosition(mh.position); - if (vs.annotationVisible) { -- cs.SetHeight(lineDoc, cs.GetHeight(lineDoc) + mh.annotationLinesAdded); -+ if (cs.SetHeight(lineDoc, cs.GetHeight(lineDoc) + mh.annotationLinesAdded)) { -+ SetScrollBars(); -+ } - Redraw(); - } - } -@@ -5276,6 +5278,7 @@ - cs.SetHeight(line, cs.GetHeight(line) + annotationLines * dir); - } - } -+ SetScrollBars(); - } - Redraw(); - } diff --git a/src/scintilla_backports/6301_4bf96081f6e6.patch b/src/scintilla_backports/6301_4bf96081f6e6.patch deleted file mode 100644 index f115f49f..00000000 --- a/src/scintilla_backports/6301_4bf96081f6e6.patch +++ /dev/null @@ -1,214 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1496971874 -36000 -# Node ID 4bf96081f6e60dcbcfd0111bcd7a3cd1ced06d0a -# Parent c2c63e649256a5ea777da2b4b41fac9d57364499 -Use min and max from std instead of own version from platform. - -diff -r c2c63e649256 -r 4bf96081f6e6 cocoa/ScintillaCocoa.mm ---- a/cocoa/ScintillaCocoa.mm Fri Jun 09 11:26:02 2017 +1000 -+++ b/cocoa/ScintillaCocoa.mm Fri Jun 09 11:31:14 2017 +1000 -@@ -1887,7 +1887,7 @@ - void ScintillaCocoa::UpdateForScroll() { - Point ptOrigin = GetVisibleOriginInMain(); - xOffset = static_cast<int>(ptOrigin.x); -- int newTop = Platform::Minimum(static_cast<int>(ptOrigin.y / vs.lineHeight), MaxScrollPos()); -+ Sci::Line newTop = std::min(static_cast<Sci::Line>(ptOrigin.y / vs.lineHeight), MaxScrollPos()); - SetTopLine(newTop); - } - -diff -r c2c63e649256 -r 4bf96081f6e6 gtk/PlatGTK.cxx ---- a/gtk/PlatGTK.cxx Fri Jun 09 11:26:02 2017 +1000 -+++ b/gtk/PlatGTK.cxx Fri Jun 09 11:31:14 2017 +1000 -@@ -432,10 +432,10 @@ - if ((xDiff == 0) || (yDiff == 0)) { - // Horizontal or vertical lines can be more precisely drawn as a filled rectangle - int xEnd = x_ - xDelta; -- int left = Platform::Minimum(x, xEnd); -+ int left = std::min(x, xEnd); - int width = abs(x - xEnd) + 1; - int yEnd = y_ - yDelta; -- int top = Platform::Minimum(y, yEnd); -+ int top = std::min(y, yEnd); - int height = abs(y - yEnd) + 1; - cairo_rectangle(context, left, top, width, height); - cairo_fill(context); -@@ -618,7 +618,7 @@ - PLATFORM_ASSERT(context); - PenColour(back); - cairo_arc(context, (rc.left + rc.right) / 2, (rc.top + rc.bottom) / 2, -- Platform::Minimum(rc.Width(), rc.Height()) / 2, 0, 2*kPi); -+ std::min(rc.Width(), rc.Height()) / 2, 0, 2*kPi); - cairo_fill_preserve(context); - PenColour(fore); - cairo_stroke(context); -@@ -1307,7 +1307,7 @@ - "vertical-separator", &vertical_separator, - "expander-size", &expander_size, NULL); - row_height += vertical_separator; -- row_height = Platform::Maximum(row_height, expander_size); -+ row_height = std::max(row_height, expander_size); - return row_height; - #endif - } -diff -r c2c63e649256 -r 4bf96081f6e6 gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Fri Jun 09 11:26:02 2017 +1000 -+++ b/gtk/ScintillaGTK.cxx Fri Jun 09 11:31:14 2017 +1000 -@@ -1614,7 +1614,7 @@ - gtk_widget_show(GTK_WIDGET(PWidget(scrollbarh))); - alloc.x = 0; - alloc.y = height - horizontalScrollBarHeight; -- alloc.width = Platform::Maximum(minHScrollBarWidth, width - verticalScrollBarWidth); -+ alloc.width = std::max(minHScrollBarWidth, width - verticalScrollBarWidth); - alloc.height = horizontalScrollBarHeight; - gtk_widget_size_allocate(GTK_WIDGET(PWidget(scrollbarh)), &alloc); - } else { -@@ -1627,7 +1627,7 @@ - alloc.x = width - verticalScrollBarWidth; - alloc.y = 0; - alloc.width = verticalScrollBarWidth; -- alloc.height = Platform::Maximum(minVScrollBarHeight, height - horizontalScrollBarHeight); -+ alloc.height = std::max(minVScrollBarHeight, height - horizontalScrollBarHeight); - gtk_widget_size_allocate(GTK_WIDGET(PWidget(scrollbarv)), &alloc); - } else { - gtk_widget_hide(GTK_WIDGET(PWidget(scrollbarv))); -@@ -1648,8 +1648,8 @@ - alloc.width = requisition.width; - alloc.height = requisition.height; - #endif -- alloc.width = Platform::Maximum(alloc.width, width - verticalScrollBarWidth); -- alloc.height = Platform::Maximum(alloc.height, height - horizontalScrollBarHeight); -+ alloc.width = std::max(alloc.width, width - verticalScrollBarWidth); -+ alloc.height = std::max(alloc.height, height - horizontalScrollBarHeight); - gtk_widget_size_allocate(GTK_WIDGET(PWidget(wText)), &alloc); - } - -diff -r c2c63e649256 -r 4bf96081f6e6 lexers/LexCoffeeScript.cxx ---- a/lexers/LexCoffeeScript.cxx Fri Jun 09 11:26:02 2017 +1000 -+++ b/lexers/LexCoffeeScript.cxx Fri Jun 09 11:31:14 2017 +1000 -@@ -14,6 +14,8 @@ - #include <assert.h> - #include <ctype.h> - -+#include <algorithm> -+ - #include "Platform.h" - #include "ILexer.h" - #include "Scintilla.h" -@@ -427,7 +429,7 @@ - } - - const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK; -- const int levelBeforeComments = Platform::Maximum(indentCurrentLevel,levelAfterComments); -+ const int levelBeforeComments = std::max(indentCurrentLevel,levelAfterComments); - - // Now set all the indent levels on the lines we skipped - // Do this from end to start. Once we encounter one line -diff -r c2c63e649256 -r 4bf96081f6e6 src/Indicator.cxx ---- a/src/Indicator.cxx Fri Jun 09 11:26:02 2017 +1000 -+++ b/src/Indicator.cxx Fri Jun 09 11:31:14 2017 +1000 -@@ -55,7 +56,7 @@ - } else if (sacDraw.style == INDIC_SQUIGGLEPIXMAP) { - PRectangle rcSquiggle = PixelGridAlign(rc); - -- int width = Platform::Minimum(4000, static_cast<int>(rcSquiggle.Width())); -+ int width = std::min(4000, static_cast<int>(rcSquiggle.Width())); - RGBAImage image(width, 3, 1.0, 0); - enum { alphaFull = 0xff, alphaSide = 0x2f, alphaSide2=0x5f }; - for (int x = 0; x < width; x++) { -@@ -137,7 +138,7 @@ - rcBox.top = rcLine.top + 1; - rcBox.bottom = rcLine.bottom; - // Cap width at 4000 to avoid large allocations when mistakes made -- int width = Platform::Minimum(static_cast<int>(rcBox.Width()), 4000); -+ int width = std::min(static_cast<int>(rcBox.Width()), 4000); - RGBAImage image(width, static_cast<int>(rcBox.Height()), 1.0, 0); - // Draw horizontal lines top and bottom - for (int x=0; x<width; x++) { -@@ -156,7 +157,7 @@ - int x = static_cast<int>(rc.left); - while (x < rc.right) { - surface->MoveTo(x, ymid); -- surface->LineTo(Platform::Minimum(x + 4, static_cast<int>(rc.right)), ymid); -+ surface->LineTo(std::min(x + 4, static_cast<int>(rc.right)), ymid); - x += 7; - } - } else if (sacDraw.style == INDIC_DOTS) { -diff -r c2c63e649256 -r 4bf96081f6e6 src/LineMarker.cxx ---- a/src/LineMarker.cxx Fri Jun 09 11:26:02 2017 +1000 -+++ b/src/LineMarker.cxx Fri Jun 09 11:31:14 2017 +1000 -@@ -117,7 +118,7 @@ - PRectangle rc = rcWhole; - rc.top++; - rc.bottom--; -- int minDim = Platform::Minimum(static_cast<int>(rc.Width()), static_cast<int>(rc.Height())); -+ int minDim = std::min(static_cast<int>(rc.Width()), static_cast<int>(rc.Height())); - minDim--; // Ensure does not go beyond edge - int centreX = static_cast<int>(floor((rc.right + rc.left) / 2.0)); - const int centreY = static_cast<int>(floor((rc.bottom + rc.top) / 2.0)); -diff -r c2c63e649256 -r 4bf96081f6e6 win32/PlatWin.cxx ---- a/win32/PlatWin.cxx Fri Jun 09 11:26:02 2017 +1000 -+++ b/win32/PlatWin.cxx Fri Jun 09 11:31:14 2017 +1000 -@@ -17,8 +17,13 @@ - - #include <vector> - #include <map> -+#include <algorithm> - #include <memory> - -+// Want to use std::min and std::max so don't want Windows.h version of min and max -+#if !defined(NOMINMAX) -+#define NOMINMAX -+#endif - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 - #undef WINVER -@@ -771,7 +776,7 @@ - int width = static_cast<int>(rc.Width()); - int height = static_cast<int>(rc.Height()); - // Ensure not distorted too much by corners when small -- cornerSize = Platform::Minimum(cornerSize, (Platform::Minimum(width, height) / 2) - 2); -+ cornerSize = std::min(cornerSize, (std::min(width, height) / 2) - 2); - BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0}}; - void *image = 0; - HBITMAP hbmMem = CreateDIBSection(hMemDC, &bpih, -@@ -929,7 +934,7 @@ - SetFont(font_); - SIZE sz={0,0}; - if (!unicodeMode) { -- ::GetTextExtentPoint32A(hdc, s, Platform::Minimum(len, maxLenText), &sz); -+ ::GetTextExtentPoint32A(hdc, s, std::min(len, maxLenText), &sz); - } else { - const TextWide tbuf(s, len, unicodeMode, codePage); - ::GetTextExtentPoint32W(hdc, tbuf.buffer, tbuf.tlen, &sz); -@@ -1306,10 +1311,10 @@ - if ((xDiff == 0) || (yDiff == 0)) { - // Horizontal or vertical lines can be more precisely drawn as a filled rectangle - const int xEnd = x_ - xDelta; -- const int left = Platform::Minimum(x, xEnd); -+ const int left = std::min(x, xEnd); - const int width = abs(x - xEnd) + 1; - const int yEnd = y_ - yDelta; -- const int top = Platform::Minimum(y, yEnd); -+ const int top = std::min(y, yEnd); - const int height = abs(y - yEnd) + 1; - D2D1_RECT_F rectangle1 = D2D1::RectF(static_cast<float>(left), static_cast<float>(top), - static_cast<float>(left+width), static_cast<float>(top+height)); -@@ -2196,7 +2201,7 @@ - SelectFont(hdc, oldFont); - ::ReleaseDC(lb, hdc); - -- const int widthDesired = Platform::Maximum(textSize.cx, (len + 1) * tm.tmAveCharWidth); -+ const int widthDesired = std::max(textSize.cx, (len + 1) * tm.tmAveCharWidth); - if (width < widthDesired) - width = widthDesired; - -@@ -2436,7 +2441,7 @@ - - POINT ListBoxX::MaxTrackSize() const { - PRectangle rc = PRectangle::FromInts(0, 0, -- Platform::Maximum(MinClientWidth(), -+ std::max(static_cast<unsigned int>(MinClientWidth()), - maxCharWidth * maxItemCharacters + static_cast<int>(TextInset.x) * 2 + - TextOffset() + ::GetSystemMetrics(SM_CXVSCROLL)), - ItemHeight() * lti.Count()); diff --git a/src/scintilla_backports/6305_90741c1cb988.patch b/src/scintilla_backports/6305_90741c1cb988.patch deleted file mode 100644 index dfeae3bb..00000000 --- a/src/scintilla_backports/6305_90741c1cb988.patch +++ /dev/null @@ -1,188 +0,0 @@ -# HG changeset patch -# User Baldur Karlsson -# Date 1497048580 -36000 -# Node ID 90741c1cb988ff0eae02774204a407417598e621 -# Parent d0038cc1af239b3d0e7b57a32796536e15ef1efc -Require GTK+ 2.24 or later. Removes support for earlier versions. - -diff -r d0038cc1af23 -r 90741c1cb988 gtk/PlatGTK.cxx ---- a/gtk/PlatGTK.cxx Sat Jun 10 08:37:19 2017 +1000 -+++ b/gtk/PlatGTK.cxx Sat Jun 10 08:49:40 2017 +1000 -@@ -45,21 +45,7 @@ - } - - static cairo_surface_t *CreateSimilarSurface(GdkWindow *window, cairo_content_t content, int width, int height) { --#if GTK_CHECK_VERSION(2,22,0) - return gdk_window_create_similar_surface(window, content, width, height); --#else -- cairo_surface_t *window_surface, *surface; -- -- g_return_val_if_fail(GDK_IS_WINDOW(window), NULL); -- -- window_surface = GDK_DRAWABLE_GET_CLASS(window)->ref_cairo_surface(window); -- -- surface = cairo_surface_create_similar(window_surface, content, width, height); -- -- cairo_surface_destroy(window_surface); -- -- return surface; --#endif - } - - static GdkWindow *WindowFromWidget(GtkWidget *w) { -@@ -310,7 +296,6 @@ - } - - bool SurfaceImpl::Initialised() { --#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0) - if (inited && context) { - if (cairo_status(context) == CAIRO_STATUS_SUCCESS) { - // Even when status is success, the target surface may have been -@@ -327,7 +312,6 @@ - } - return cairo_status(context) == CAIRO_STATUS_SUCCESS; - } --#endif - return inited; - } - -@@ -537,12 +521,7 @@ - static void PathRoundRectangle(cairo_t *context, double left, double top, double width, double height, int radius) { - double degrees = kPi / 180.0; - --#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) - cairo_new_sub_path(context); --#else -- // First arc is in the top-right corner and starts from a point on the top line -- cairo_move_to(context, left + width - radius, top); --#endif - cairo_arc(context, left + width - radius, top + radius, radius, -90 * degrees, 0 * degrees); - cairo_arc(context, left + width - radius, top + height - radius, radius, 0 * degrees, 90 * degrees); - cairo_arc(context, left + radius, top + height - radius, radius, 90 * degrees, 180 * degrees); -@@ -588,11 +567,7 @@ - rc.top += (rc.Height() - height) / 2; - rc.bottom = rc.top + height; - --#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,6,0) - int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); --#else -- int stride = width * 4; --#endif - int ucs = stride * height; - std::vector<unsigned char> image(ucs); - for (int iy=0; iy<height; iy++) { -@@ -706,11 +681,7 @@ - } - pango_layout_set_font_description(layout, PFont(font_)->pfd); - pango_cairo_update_layout(context, layout); --#ifdef PANGO_VERSION - PangoLayoutLine *pll = pango_layout_get_line_readonly(layout,0); --#else -- PangoLayoutLine *pll = pango_layout_get_line(layout,0); --#endif - cairo_move_to(context, xText, ybase); - pango_cairo_show_layout_line(context, pll); - } -@@ -897,11 +868,7 @@ - } - pango_layout_set_text(layout, utfForm.c_str(), utfForm.length()); - } --#ifdef PANGO_VERSION - PangoLayoutLine *pangoLine = pango_layout_get_line_readonly(layout,0); --#else -- PangoLayoutLine *pangoLine = pango_layout_get_line(layout,0); --#endif - pango_layout_line_get_extents(pangoLine, NULL, &pos); - return doubleFromPangoUnits(pos.width); - } -diff -r d0038cc1af23 -r 90741c1cb988 gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Sat Jun 10 08:37:19 2017 +1000 -+++ b/gtk/ScintillaGTK.cxx Sat Jun 10 08:49:40 2017 +1000 -@@ -85,13 +85,8 @@ - - #include "Converter.h" - --#if GTK_CHECK_VERSION(2,20,0) - #define IS_WIDGET_REALIZED(w) (gtk_widget_get_realized(GTK_WIDGET(w))) - #define IS_WIDGET_MAPPED(w) (gtk_widget_get_mapped(GTK_WIDGET(w))) --#else --#define IS_WIDGET_REALIZED(w) (GTK_WIDGET_REALIZED(w)) --#define IS_WIDGET_MAPPED(w) (GTK_WIDGET_MAPPED(w)) --#endif - - #define SC_INDICATOR_INPUT INDIC_IME - #define SC_INDICATOR_TARGET INDIC_IME+1 -@@ -231,11 +226,7 @@ - - void ScintillaGTK::RealizeThis(GtkWidget *widget) { - //Platform::DebugPrintf("ScintillaGTK::realize this\n"); --#if GTK_CHECK_VERSION(2,20,0) - gtk_widget_set_realized(widget, TRUE); --#else -- GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); --#endif - GdkWindowAttr attrs; - attrs.window_type = GDK_WINDOW_CHILD; - GtkAllocation allocation; -@@ -322,11 +313,7 @@ - if (IS_WIDGET_MAPPED(widget)) { - gtk_widget_unmap(widget); - } --#if GTK_CHECK_VERSION(2,20,0) - gtk_widget_set_realized(widget, FALSE); --#else -- GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED); --#endif - gtk_widget_unrealize(PWidget(wText)); - if (PWidget(scrollbarv)) - gtk_widget_unrealize(PWidget(scrollbarv)); -@@ -361,11 +348,7 @@ - void ScintillaGTK::MapThis() { - try { - //Platform::DebugPrintf("ScintillaGTK::map this\n"); --#if GTK_CHECK_VERSION(2,20,0) - gtk_widget_set_mapped(PWidget(wMain), TRUE); --#else -- GTK_WIDGET_SET_FLAGS(PWidget(wMain), GTK_MAPPED); --#endif - MapWidget(PWidget(wText)); - MapWidget(PWidget(scrollbarh)); - MapWidget(PWidget(scrollbarv)); -@@ -387,11 +370,7 @@ - void ScintillaGTK::UnMapThis() { - try { - //Platform::DebugPrintf("ScintillaGTK::unmap this\n"); --#if GTK_CHECK_VERSION(2,20,0) - gtk_widget_set_mapped(PWidget(wMain), FALSE); --#else -- GTK_WIDGET_UNSET_FLAGS(PWidget(wMain), GTK_MAPPED); --#endif - DropGraphics(false); - gdk_window_hide(PWindow(wMain)); - gtk_widget_unmap(PWidget(wText)); -@@ -2723,13 +2702,8 @@ - try { - Point npt(x, y); - SetDragPosition(SPositionFromLocation(npt, false, false, UserVirtualSpace())); --#if GTK_CHECK_VERSION(2,22,0) - GdkDragAction preferredAction = gdk_drag_context_get_suggested_action(context); - GdkDragAction actions = gdk_drag_context_get_actions(context); --#else -- GdkDragAction preferredAction = context->suggested_action; -- GdkDragAction actions = context->actions; --#endif - SelectionPosition pos = SPositionFromLocation(npt); - if ((inDragDrop == ddDragging) && (PositionInSelection(pos.Position()))) { - // Avoid dragging selection onto itself as that produces a move -@@ -2807,11 +2781,7 @@ - if (!sciThis->sel.Empty()) { - sciThis->GetSelection(selection_data, info, &sciThis->drag); - } --#if GTK_CHECK_VERSION(2,22,0) - GdkDragAction action = gdk_drag_context_get_selected_action(context); --#else -- GdkDragAction action = context->action; --#endif - if (action == GDK_ACTION_MOVE) { - for (size_t r=0; r<sciThis->sel.Count(); r++) { - if (sciThis->posDrop >= sciThis->sel.Range(r).Start()) { diff --git a/src/scintilla_backports/6310_7e28cdba6d61.patch b/src/scintilla_backports/6310_7e28cdba6d61.patch deleted file mode 100644 index 12b33339..00000000 --- a/src/scintilla_backports/6310_7e28cdba6d61.patch +++ /dev/null @@ -1,695 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1497154123 -36000 -# Node ID 7e28cdba6d61e090ac6f6627c855ffd2603508e4 -# Parent f2f32d58bcd83aae163367781d2dcc65590109bc -Implement SCN_AUTOCSELECTIONCHANGE notification. - -diff -r f2f32d58bcd8 -r 7e28cdba6d61 cocoa/PlatCocoa.mm ---- a/cocoa/PlatCocoa.mm Sat Jun 10 13:22:55 2017 +1000 -+++ b/cocoa/PlatCocoa.mm Sun Jun 11 14:08:43 2017 +1000 -@@ -1274,7 +1274,9 @@ - - namespace { - --// unnamed namespace hides IListBox interface -+// Unnamed namespace hides local IListBox interface. -+// IListBox is used to cross languages to send events from Objective C++ -+// AutoCompletionDelegate and AutoCompletionDataSource to C++ ListBoxImpl. - - class IListBox { - public: -@@ -1282,18 +1284,43 @@ - virtual NSImage *ImageForRow(NSInteger row) = 0; - virtual NSString *TextForRow(NSInteger row) = 0; - virtual void DoubleClick() = 0; -+ virtual void SelectionChange() = 0; - }; - --} // unnamed namespace -+} -+ -+//----------------- AutoCompletionDelegate --------------------------------------------------------- -+ -+// AutoCompletionDelegate is an Objective C++ class so it can implement -+// NSTableViewDelegate and receive tableViewSelectionDidChange events. -+ -+@interface AutoCompletionDelegate : NSObject <NSTableViewDelegate> { -+ IListBox *box; -+} -+ -+@property IListBox *box; -+ -+@end -+ -+@implementation AutoCompletionDelegate -+ -+@synthesize box; -+ -+- (void) tableViewSelectionDidChange: (NSNotification *) notification { -+#pragma unused(notification) -+ if (box) { -+ box->SelectionChange(); -+ } -+} -+ -+@end - - //----------------- AutoCompletionDataSource ------------------------------------------------------- - --@interface AutoCompletionDataSource : -- NSObject --#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 -- <NSTableViewDataSource> --#endif --{ -+// AutoCompletionDataSource provides data to display in the list box. -+// It is also the target of the NSTableView so it receives double clicks. -+ -+@interface AutoCompletionDataSource : NSObject <NSTableViewDataSource> { - IListBox *box; - } - -@@ -1400,10 +1427,10 @@ - NSTableColumn *colIcon; - NSTableColumn *colText; - AutoCompletionDataSource *ds; -+ AutoCompletionDelegate *acd; - - LinesData ld; -- CallBackAction doubleClickAction; -- void *doubleClickActionData; -+ IListBoxDelegate *delegate; - - public: - ListBoxImpl() : -@@ -1420,8 +1447,8 @@ - colIcon(nil), - colText(nil), - ds(nil), -- doubleClickAction(nullptr), -- doubleClickActionData(nullptr) { -+ acd(nil), -+ delegate(nullptr) { - images = [[NSMutableDictionary alloc] init]; - } - ~ListBoxImpl() override { -@@ -1445,9 +1472,8 @@ - void RegisterImage(int type, const char *xpm_data) override; - void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) override; - void ClearRegisteredImages() override; -- void SetDoubleClickAction(CallBackAction action, void *data) override { -- doubleClickAction = action; -- doubleClickActionData = data; -+ void SetDelegate(IListBoxDelegate *lbDelegate) override { -+ delegate = lbDelegate; - } - void SetList(const char *list, char separator, char typesep) override; - -@@ -1459,6 +1485,7 @@ - NSImage *ImageForRow(NSInteger row) override; - NSString *TextForRow(NSInteger row) override; - void DoubleClick() override; -+ void SelectionChange() override; - }; - - void ListBoxImpl::Create(Window & /*parent*/, int /*ctrlID*/, Scintilla::Point pt, -@@ -1494,6 +1521,9 @@ - ds = [[AutoCompletionDataSource alloc] init]; - ds.box = this; - table.dataSource = ds; // Weak reference -+ acd = [[AutoCompletionDelegate alloc] init]; -+ [acd setBox: this]; -+ table.delegate = acd; - scroller.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; - [winLB.contentView addSubview: scroller]; - -@@ -1568,6 +1598,7 @@ - scroller = nil; - colIcon = nil; - colText = nil; -+ acd = nil; - ds = nil; - } - -@@ -1694,8 +1725,16 @@ - } - - void ListBoxImpl::DoubleClick() { -- if (doubleClickAction) { -- doubleClickAction(doubleClickActionData); -+ if (delegate) { -+ ListBoxEvent event(ListBoxEvent::EventType::doubleClick); -+ delegate->ListNotify(&event); -+ } -+} -+ -+void ListBoxImpl::SelectionChange() { -+ if (delegate) { -+ ListBoxEvent event(ListBoxEvent::EventType::selectionChange); -+ delegate->ListNotify(&event); - } - } - -@@ -1703,6 +1742,8 @@ - - //----------------- ListBox ------------------------------------------------------------------------ - -+// ListBox is implemented by the ListBoxImpl class. -+ - ListBox::ListBox() { - } - -diff -r f2f32d58bcd8 -r 7e28cdba6d61 doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Sat Jun 10 13:22:55 2017 +1000 -+++ b/doc/ScintillaDoc.html Sun Jun 11 14:08:43 2017 +1000 -@@ -7011,7 +7011,7 @@ - /* SCN_MARGINRIGHTCLICK, SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, */ - /* SCN_CALLTIPCLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */ - /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ -- /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ -+ /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_AUTOCSELECTIONCHANGE */ - - int ch; - /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETE, SCN_AUTOCSELECTION, */ -@@ -7022,7 +7022,8 @@ - - int modificationType; /* SCN_MODIFIED */ - const char *text; -- /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */ -+ /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED, */ -+ /* SCN_AUTOCSELECTIONCHANGE */ - - Sci_Position length; /* SCN_MODIFIED */ - Sci_Position linesAdded; /* SCN_MODIFIED */ -@@ -7033,7 +7034,7 @@ - int foldLevelNow; /* SCN_MODIFIED */ - int foldLevelPrev; /* SCN_MODIFIED */ - int margin; /* SCN_MARGINCLICK, SCN_MARGINRIGHTCLICK */ -- int listType; /* SCN_USERLISTSELECTION */ -+ int listType; /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTIONCHANGE */ - int x; /* SCN_DWELLSTART, SCN_DWELLEND */ - int y; /* SCN_DWELLSTART, SCN_DWELLEND */ - int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */ -@@ -7078,6 +7079,7 @@ - <a class="message" href="#SCN_FOCUSOUT">SCN_FOCUSOUT</a><br /> - <a class="message" href="#SCN_AUTOCCOMPLETED">SCN_AUTOCCOMPLETED</a><br /> - <a class="message" href="#SCN_MARGINRIGHTCLICK">SCN_MARGINRIGHTCLICK</a><br /> -+ <a class="message" href="#SCN_AUTOCSELECTIONCHANGE">SCN_AUTOCSELECTIONCHANGE</a><br /> - </code> - - <p>The following <code>SCI_*</code> messages are associated with these notifications:</p> -@@ -7946,10 +7948,6 @@ - The user deleted a character while autocompletion list was active. - There is no other information in SCNotification.</p> - -- <p><b id="SCN_FOCUSIN">SCN_FOCUSIN</b><br /> -- <b id="SCN_FOCUSOUT">SCN_FOCUSOUT</b><br /> -- <code>SCN_FOCUSIN</code> (2028) is fired when Scintilla receives focus and -- <code>SCN_FOCUSOUT</code> (2029) when it loses focus.</p> - - <p><b id="SCN_AUTOCCOMPLETED">SCN_AUTOCCOMPLETED<br /> - </b>This notification is generated after an autocompletion has inserted its -@@ -7958,6 +7956,48 @@ - <a class="jump" href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a></code> - notification.</p> - -+ <p><b id="SCN_AUTOCSELECTIONCHANGE">SCN_AUTOCSELECTIONCHANGE<br /> -+ </b>This notification is sent when items are highlighted in an autocompletion or user list. -+ The -+ <code>SCNotification</code> fields used are:</p> -+ -+ <table class="standard" summary="User list notification"> -+ <tbody> -+ <tr> -+ <th align="left">Field</th> -+ -+ <th align="left">Usage</th> -+ </tr> -+ </tbody> -+ -+ <tbody valign="top"> -+ <tr> -+ <td align="left"><code>listType</code></td> -+ -+ <td align="left">This is set to the <code>listType</code> parameter from the <a -+ class="message" href="#SCI_USERLISTSHOW"><code>SCI_USERLISTSHOW</code></a> message -+ or 0 for an autocompletion.</td> -+ </tr> -+ -+ <tr> -+ <td align="left"><code>text</code></td> -+ -+ <td align="left">The text of the selection.</td> -+ </tr> -+ -+ <tr> -+ <td align="left"><code>position</code></td> -+ -+ <td align="left">The position the list was displayed at.</td> -+ </tr> -+ </tbody> -+ </table> -+ -+ <p><b id="SCN_FOCUSIN">SCN_FOCUSIN</b><br /> -+ <b id="SCN_FOCUSOUT">SCN_FOCUSOUT</b><br /> -+ <code>SCN_FOCUSIN</code> (2028) is fired when Scintilla receives focus and -+ <code>SCN_FOCUSOUT</code> (2029) when it loses focus.</p> -+ - <h2 id="Images">Images</h2> - - <p>Two formats are supported for images used in margin markers and autocompletion lists, RGBA and XPM.</p> -diff -r f2f32d58bcd8 -r 7e28cdba6d61 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sat Jun 10 13:22:55 2017 +1000 -+++ b/doc/ScintillaHistory.html Sun Jun 11 14:08:43 2017 +1000 -@@ -536,6 +536,9 @@ - Support dropped for GTK+ versions before 2.24. - </li> - <li> -+ An SCN_AUTOCSELECTIONCHANGE notification is sent when items are highlighted in an autocompletion or user list. -+ </li> -+ <li> - SciTE allows user.shortcuts to be defined with symbolic Scintilla messages like - 'Ctrl+L|SCI_LINEDELETE|'. - </li> -diff -r f2f32d58bcd8 -r 7e28cdba6d61 gtk/PlatGTK.cxx ---- a/gtk/PlatGTK.cxx Sat Jun 10 13:22:55 2017 +1000 -+++ b/gtk/PlatGTK.cxx Sun Jun 11 14:08:43 2017 +1000 -@@ -1196,8 +1196,7 @@ - GtkCssProvider *cssProvider; - #endif - public: -- CallBackAction doubleClickAction; -- void *doubleClickActionData; -+ IListBoxDelegate *delegate; - - ListBoxX() : widCached(0), frame(0), list(0), scroller(0), pixhash(NULL), pixbuf_renderer(0), - renderer(0), -@@ -1206,7 +1205,7 @@ - #if GTK_CHECK_VERSION(3,0,0) - cssProvider(NULL), - #endif -- doubleClickAction(NULL), doubleClickActionData(NULL) { -+ delegate(NULL) { - } - ~ListBoxX() override { - if (pixhash) { -@@ -1243,10 +1242,7 @@ - virtual void RegisterImage(int type, const char *xpm_data); - virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage); - virtual void ClearRegisteredImages(); -- virtual void SetDoubleClickAction(CallBackAction action, void *data) { -- doubleClickAction = action; -- doubleClickActionData = data; -- } -+ virtual void SetDelegate(IListBoxDelegate *lbDelegate); - virtual void SetList(const char *listText, char separator, char typesep); - }; - -@@ -1337,8 +1333,9 @@ - static gboolean ButtonPress(GtkWidget *, GdkEventButton* ev, gpointer p) { - try { - ListBoxX* lb = static_cast<ListBoxX*>(p); -- if (ev->type == GDK_2BUTTON_PRESS && lb->doubleClickAction != NULL) { -- lb->doubleClickAction(lb->doubleClickActionData); -+ if (ev->type == GDK_2BUTTON_PRESS && lb->delegate) { -+ ListBoxEvent event(ListBoxEvent::doubleClick); -+ lb->delegate->ListNotify(&event); - return TRUE; - } - -@@ -1348,6 +1345,20 @@ - return FALSE; - } - -+static gboolean ButtonRelease(GtkWidget *, GdkEventButton* ev, gpointer p) { -+ try { -+ ListBoxX* lb = static_cast<ListBoxX*>(p); -+ if (ev->type != GDK_2BUTTON_PRESS && lb->delegate) { -+ ListBoxEvent event(ListBoxEvent::selectionChange); -+ lb->delegate->ListNotify(&event); -+ return TRUE; -+ } -+ } catch (...) { -+ // No pointer back to Scintilla to save status -+ } -+ return FALSE; -+} -+ - /* Change the active color to the selected color so the listbox uses the color - scheme that it would use if it had the focus. */ - static void StyleSet(GtkWidget *w, GtkStyle*, void*) { -@@ -1472,6 +1483,8 @@ - gtk_widget_show(widget); - g_signal_connect(G_OBJECT(widget), "button_press_event", - G_CALLBACK(ButtonPress), this); -+ g_signal_connect(G_OBJECT(widget), "button_release_event", -+ G_CALLBACK(ButtonRelease), this); - - GtkWidget *top = gtk_widget_get_toplevel(static_cast<GtkWidget *>(parent.GetID())); - gtk_window_set_transient_for(GTK_WINDOW(static_cast<GtkWidget *>(wid)), -@@ -1747,6 +1760,11 @@ - } else { - gtk_tree_selection_unselect_all(selection); - } -+ -+ if (delegate) { -+ ListBoxEvent event(ListBoxEvent::selectionChange); -+ delegate->ListNotify(&event); -+ } - } - - int ListBoxX::GetSelection() { -@@ -1843,6 +1861,10 @@ - images.Clear(); - } - -+void ListBoxX::SetDelegate(IListBoxDelegate *lbDelegate) { -+ delegate = lbDelegate; -+} -+ - void ListBoxX::SetList(const char *listText, char separator, char typesep) { - Clear(); - int count = strlen(listText) + 1; -diff -r f2f32d58bcd8 -r 7e28cdba6d61 include/Platform.h ---- a/include/Platform.h Sat Jun 10 13:22:55 2017 +1000 -+++ b/include/Platform.h Sun Jun 11 14:08:43 2017 +1000 -@@ -397,6 +397,19 @@ - * Listbox management. - */ - -+// ScintillaBase implements IListBoxDelegate to receive ListBoxEvents from a ListBox -+ -+struct ListBoxEvent { -+ enum EventType { selectionChange, doubleClick } event; -+ ListBoxEvent(EventType event_) : event(event_) { -+ } -+}; -+ -+class IListBoxDelegate { -+public: -+ virtual void ListNotify(ListBoxEvent *plbe)=0; -+}; -+ - class ListBox : public Window { - public: - ListBox(); -@@ -420,7 +433,7 @@ - virtual void RegisterImage(int type, const char *xpm_data)=0; - virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) = 0; - virtual void ClearRegisteredImages()=0; -- virtual void SetDoubleClickAction(CallBackAction, void *)=0; -+ virtual void SetDelegate(IListBoxDelegate *lbDelegate)=0; - virtual void SetList(const char* list, char separator, char typesep)=0; - }; - -diff -r f2f32d58bcd8 -r 7e28cdba6d61 include/Scintilla.h ---- a/include/Scintilla.h Sat Jun 10 13:22:55 2017 +1000 -+++ b/include/Scintilla.h Sun Jun 11 14:08:43 2017 +1000 -@@ -1102,6 +1102,7 @@ - #define SCN_FOCUSOUT 2029 - #define SCN_AUTOCCOMPLETED 2030 - #define SCN_MARGINRIGHTCLICK 2031 -+#define SCN_AUTOCSELECTIONCHANGE 2032 - /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ - - /* These structures are defined to be exactly the same shape as the Win32 -diff -r f2f32d58bcd8 -r 7e28cdba6d61 include/Scintilla.iface ---- a/include/Scintilla.iface Sat Jun 10 13:22:55 2017 +1000 -+++ b/include/Scintilla.iface Sun Jun 11 14:08:43 2017 +1000 -@@ -4855,6 +4855,7 @@ - evt void FocusOut=2029(void) - evt void AutoCCompleted=2030(string text, int position, int ch, CompletionMethods listCompletionMethod) - evt void MarginRightClick=2031(int modifiers, int position, int margin) -+evt void AutoCSelectionChange=2032(int listType, string text, int position) - - # There are no provisional APIs currently, but some arguments to SCI_SETTECHNOLOGY are provisional. - -diff -r f2f32d58bcd8 -r 7e28cdba6d61 qt/ScintillaEditBase/PlatQt.cpp ---- a/qt/ScintillaEditBase/PlatQt.cpp Sat Jun 10 13:22:55 2017 +1000 -+++ b/qt/ScintillaEditBase/PlatQt.cpp Sun Jun 11 14:08:43 2017 +1000 -@@ -772,7 +772,7 @@ - const unsigned char *pixelsImage) override; - virtual void RegisterQPixmapImage(int type, const QPixmap& pm); - void ClearRegisteredImages() override; -- void SetDoubleClickAction(CallBackAction action, void *data) override; -+ void SetDelegate(IListBoxDelegate *lbDelegate) override; - void SetList(const char *list, char separator, char typesep) override; - private: - bool unicodeMode; -@@ -785,15 +785,16 @@ - explicit ListWidget(QWidget *parent); - virtual ~ListWidget(); - -- void setDoubleClickAction(CallBackAction action, void *data); -+ void setDelegate(IListBoxDelegate *lbDelegate); -+ void selectionChanged(); - - protected: -+ void mouseReleaseEvent(QMouseEvent * event) override; - void mouseDoubleClickEvent(QMouseEvent *event) override; - QStyleOptionViewItem viewOptions() const override; - - private: -- CallBackAction doubleClickAction; -- void *doubleClickActionData; -+ IListBoxDelegate *delegate; - }; - - -@@ -946,6 +947,7 @@ - } - } - list->setCurrentRow(n); -+ list->selectionChanged(); - } - - int ListBoxImpl::GetSelection() -@@ -1014,10 +1016,10 @@ - list->setIconSize(QSize(0, 0)); - } - --void ListBoxImpl::SetDoubleClickAction(CallBackAction action, void *data) -+void ListBoxImpl::SetDelegate(IListBoxDelegate *lbDelegate) - { - ListWidget *list = static_cast<ListWidget *>(wid); -- list->setDoubleClickAction(action, data); -+ list->setDelegate(lbDelegate); - } - - void ListBoxImpl::SetList(const char *list, char separator, char typesep) -@@ -1059,24 +1061,36 @@ - } - - ListWidget::ListWidget(QWidget *parent) --: QListWidget(parent), doubleClickAction(0), doubleClickActionData(0) -+: QListWidget(parent), delegate(0) - {} - - ListWidget::~ListWidget() {} - --void ListWidget::setDoubleClickAction(CallBackAction action, void *data) -+void ListWidget::setDelegate(IListBoxDelegate *lbDelegate) - { -- doubleClickAction = action; -- doubleClickActionData = data; -+ delegate = lbDelegate; -+} -+ -+void ListWidget::selectionChanged() { -+ if (delegate) { -+ ListBoxEvent event(ListBoxEvent::EventType::selectionChange); -+ delegate->ListNotify(&event); -+ } - } - - void ListWidget::mouseDoubleClickEvent(QMouseEvent * /* event */) - { -- if (doubleClickAction != 0) { -- doubleClickAction(doubleClickActionData); -+ if (delegate) { -+ ListBoxEvent event(ListBoxEvent::EventType::doubleClick); -+ delegate->ListNotify(&event); - } - } - -+void ListWidget::mouseReleaseEvent(QMouseEvent * /* event */) -+{ -+ selectionChanged(); -+} -+ - QStyleOptionViewItem ListWidget::viewOptions() const - { - QStyleOptionViewItem result = QListWidget::viewOptions(); -diff -r f2f32d58bcd8 -r 7e28cdba6d61 src/ScintillaBase.cxx ---- a/src/ScintillaBase.cxx Sat Jun 10 13:22:55 2017 +1000 -+++ b/src/ScintillaBase.cxx Sun Jun 11 14:08:43 2017 +1000 -@@ -202,9 +202,15 @@ - return Editor::KeyCommand(iMessage); - } - --void ScintillaBase::AutoCompleteDoubleClick(void *p) { -- ScintillaBase *sci = static_cast<ScintillaBase *>(p); -- sci->AutoCompleteCompleted(0, SC_AC_DOUBLECLICK); -+void ScintillaBase::ListNotify(ListBoxEvent *plbe) { -+ switch (plbe->event) { -+ case ListBoxEvent::selectionChange: -+ AutoCompleteSelection(); -+ break; -+ case ListBoxEvent::doubleClick: -+ AutoCompleteCompleted(0, SC_AC_DOUBLECLICK); -+ break; -+ } - } - - void ScintillaBase::AutoCompleteInsert(Sci::Position startPos, int removeLen, const char *text, int textLen) { -@@ -293,7 +299,7 @@ - ac.lb->SetFont(vs.styles[STYLE_DEFAULT].font); - unsigned int aveCharWidth = static_cast<unsigned int>(vs.styles[STYLE_DEFAULT].aveCharWidth); - ac.lb->SetAverageCharWidth(aveCharWidth); -- ac.lb->SetDoubleClickAction(AutoCompleteDoubleClick, this); -+ ac.lb->SetDelegate(this); - - ac.SetList(list ? list : ""); - -@@ -340,6 +346,25 @@ - ac.Select(wordCurrent.c_str()); - } - -+void ScintillaBase::AutoCompleteSelection() { -+ int item = ac.GetSelection(); -+ std::string selected; -+ if (item != -1) { -+ selected = ac.GetValue(item); -+ } -+ -+ SCNotification scn = {}; -+ scn.nmhdr.code = SCN_AUTOCSELECTIONCHANGE; -+ scn.message = 0; -+ scn.wParam = listType; -+ scn.listType = listType; -+ Sci::Position firstPos = ac.posStart - ac.startLen; -+ scn.position = firstPos; -+ scn.lParam = firstPos; -+ scn.text = selected.c_str(); -+ NotifyParent(scn); -+} -+ - void ScintillaBase::AutoCompleteCharacterAdded(char ch) { - if (ac.IsFillUpChar(ch)) { - AutoCompleteCompleted(ch, SC_AC_FILLUP); -diff -r f2f32d58bcd8 -r 7e28cdba6d61 src/ScintillaBase.h ---- a/src/ScintillaBase.h Sat Jun 10 13:22:55 2017 +1000 -+++ b/src/ScintillaBase.h Sun Jun 11 14:08:43 2017 +1000 -@@ -18,7 +18,7 @@ - - /** - */ --class ScintillaBase : public Editor { -+class ScintillaBase : public Editor, IListBoxDelegate { - // Private so ScintillaBase objects can not be copied - explicit ScintillaBase(const ScintillaBase &); - ScintillaBase &operator=(const ScintillaBase &); -@@ -76,7 +76,8 @@ - void AutoCompleteCharacterDeleted(); - void AutoCompleteCompleted(char ch, unsigned int completionMethod); - void AutoCompleteMoveToCurrentWord(); -- static void AutoCompleteDoubleClick(void *p); -+ void AutoCompleteSelection(); -+ virtual void ListNotify(ListBoxEvent *plbe); - - void CallTipClick(); - void CallTipShow(Point pt, const char *defn); -diff -r f2f32d58bcd8 -r 7e28cdba6d61 win32/PlatWin.cxx ---- a/win32/PlatWin.cxx Sat Jun 10 13:22:55 2017 +1000 -+++ b/win32/PlatWin.cxx Sun Jun 11 14:08:43 2017 +1000 -@@ -2042,8 +2042,7 @@ - unsigned int aveCharWidth; - Window *parent; - int ctrlID; -- CallBackAction doubleClickAction; -- void *doubleClickActionData; -+ IListBoxDelegate *delegate; - const char *widestItem; - unsigned int maxCharWidth; - int resizeHit; -@@ -2063,6 +2062,7 @@ - POINT MaxTrackSize() const; - void SetRedraw(bool on); - void OnDoubleClick(); -+ void OnSelChange(); - void ResizeToCursor(); - void StartResize(WPARAM); - LRESULT NcHitTest(WPARAM, LPARAM) const; -@@ -2077,7 +2077,8 @@ - public: - ListBoxX() : lineHeight(10), fontCopy(0), technology(0), lb(0), unicodeMode(false), - desiredVisibleRows(9), maxItemCharacters(0), aveCharWidth(8), -- parent(NULL), ctrlID(0), doubleClickAction(NULL), doubleClickActionData(NULL), -+ parent(NULL), ctrlID(0), -+ delegate(nullptr), - widestItem(NULL), maxCharWidth(1), resizeHit(0), wheelDelta(0) { - } - ~ListBoxX() override { -@@ -2103,10 +2104,7 @@ - void RegisterImage(int type, const char *xpm_data) override; - void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) override; - void ClearRegisteredImages() override; -- void SetDoubleClickAction(CallBackAction action, void *data) override { -- doubleClickAction = action; -- doubleClickActionData = data; -- } -+ virtual void SetDelegate(IListBoxDelegate *lbDelegate) override; - void SetList(const char *list, char separator, char typesep) override; - void Draw(DRAWITEMSTRUCT *pDrawItem); - LRESULT WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam); -@@ -2247,6 +2245,7 @@ - SetRedraw(false); - CentreItem(n); - ::SendMessage(lb, LB_SETCURSEL, n, 0); -+ OnSelChange(); - SetRedraw(true); - } - -@@ -2377,6 +2376,10 @@ - } - } - -+void ListBoxX::SetDelegate(IListBoxDelegate *lbDelegate) { -+ delegate = lbDelegate; -+} -+ - void ListBoxX::SetList(const char *list, char separator, char typesep) { - // Turn off redraw while populating the list - this has a significant effect, even if - // the listbox is not visible. -@@ -2606,9 +2609,16 @@ - } - - void ListBoxX::OnDoubleClick() { -- -- if (doubleClickAction != NULL) { -- doubleClickAction(doubleClickActionData); -+ if (delegate) { -+ ListBoxEvent event(ListBoxEvent::EventType::doubleClick); -+ delegate->ListNotify(&event); -+ } -+} -+ -+void ListBoxX::OnSelChange() { -+ if (delegate) { -+ ListBoxEvent event(ListBoxEvent::EventType::selectionChange); -+ delegate->ListNotify(&event); - } - } - -@@ -2683,6 +2693,10 @@ - int item = LOWORD(lResult); - if (HIWORD(lResult) == 0 && item >= 0) { - ::SendMessage(hWnd, LB_SETCURSEL, item, 0); -+ ListBoxX *lbx = static_cast<ListBoxX *>(PointerFromWindow(::GetParent(hWnd))); -+ if (lbx) { -+ lbx->OnSelChange(); -+ } - } - } - return 0; diff --git a/src/scintilla_backports/6311_7030530a9a0f.patch b/src/scintilla_backports/6311_7030530a9a0f.patch deleted file mode 100644 index dc85a84d..00000000 --- a/src/scintilla_backports/6311_7030530a9a0f.patch +++ /dev/null @@ -1,1480 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1497232196 -36000 -# Node ID 7030530a9a0f4fc1203a04378e83d82f0c35e7a0 -# Parent 7e28cdba6d61e090ac6f6627c855ffd2603508e4 -Removed unused functions and methods from Platform.h. -Replaced Platform::Clamp with Sci::clamp but will later change this to -std::clamp once on full C++17 compilers. -Drop MouseButtonBounce workaround for very early GTK+/Linux. - -diff -r 7e28cdba6d61 -r 7030530a9a0f cocoa/PlatCocoa.mm ---- a/cocoa/PlatCocoa.mm Sun Jun 11 14:08:43 2017 +1000 -+++ b/cocoa/PlatCocoa.mm Mon Jun 12 11:49:56 2017 +1000 -@@ -83,18 +83,6 @@ - return rc; - } - --//----------------- Point -------------------------------------------------------------------------- -- --/** -- * Converts a point given as a long into a native Point structure. -- */ --Scintilla::Point Scintilla::Point::FromLong(long lpoint) { -- return Scintilla::Point( -- Platform::LowShortFromLong(lpoint), -- Platform::HighShortFromLong(lpoint) -- ); --} -- - //----------------- Font --------------------------------------------------------------------------- - - Font::Font(): fid(0) { -@@ -921,7 +909,7 @@ - } else if (codePage) { - int ui = 0; - for (int i=0; i<len;) { -- size_t lenChar = Platform::IsDBCSLeadByte(codePage, s[i]) ? 2 : 1; -+ size_t lenChar = DBCSIsLeadByte(codePage, s[i]) ? 2 : 1; - CGFloat xPosition = CTLineGetOffsetForStringIndex(mLine, ui+1, NULL); - for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) { - positions[i++] = static_cast<XYPOSITION>(xPosition); -@@ -984,15 +972,6 @@ - return 0; - } - --XYPOSITION SurfaceImpl::ExternalLeading(Font &font_) { -- if (!font_.GetID()) -- return 1; -- -- float leading = static_cast<QuartzTextStyle *>(font_.GetID())->getLeading(); -- return leading + 0.5f; -- --} -- - XYPOSITION SurfaceImpl::Height(Font &font_) { - - return Ascent(font_) + Descent(font_); -@@ -1043,13 +1022,6 @@ - - //-------------------------------------------------------------------------------------------------- - --bool Window::HasFocus() { -- NSView *container = (__bridge NSView *)(wid); -- return container.window.firstResponder == container; --} -- --//-------------------------------------------------------------------------------------------------- -- - static CGFloat ScreenMax() { - return NSMaxY([NSScreen mainScreen].frame); - } -@@ -1205,19 +1177,6 @@ - - //-------------------------------------------------------------------------------------------------- - --void Window::SetTitle(const char *s) { -- if (wid) { -- id idWin = (__bridge id)(wid); -- if ([idWin isKindOfClass: [NSWindow class]]) { -- NSWindow *win = idWin; -- NSString *sTitle = @(s); -- win.title = sTitle; -- } -- } --} -- --//-------------------------------------------------------------------------------------------------- -- - PRectangle Window::GetMonitorRect(Point) { - if (wid) { - id idWin = (__bridge id)(wid); -@@ -1897,85 +1856,6 @@ - - //-------------------------------------------------------------------------------------------------- - --bool Platform::MouseButtonBounce() { -- return false; --} -- --//-------------------------------------------------------------------------------------------------- -- --/** -- * Helper method for the backend to reach through to the scintilla window. -- */ --long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { -- return scintilla_send_message(w, msg, wParam, lParam); --} -- --//-------------------------------------------------------------------------------------------------- -- --/** -- * Helper method for the backend to reach through to the scintilla window. -- */ --long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { -- return scintilla_send_message(w, msg, wParam, (long) lParam); --} -- --//-------------------------------------------------------------------------------------------------- -- --bool Platform::IsDBCSLeadByte(int codePage, char ch) { -- // Byte ranges found in Wikipedia articles with relevant search strings in each case -- unsigned char uch = static_cast<unsigned char>(ch); -- switch (codePage) { -- case 932: -- // Shift_jis -- return ((uch >= 0x81) && (uch <= 0x9F)) || -- ((uch >= 0xE0) && (uch <= 0xFC)); -- // Lead bytes F0 to FC may be a Microsoft addition. -- case 936: -- // GBK -- return (uch >= 0x81) && (uch <= 0xFE); -- case 949: -- // Korean Wansung KS C-5601-1987 -- return (uch >= 0x81) && (uch <= 0xFE); -- case 950: -- // Big5 -- return (uch >= 0x81) && (uch <= 0xFE); -- case 1361: -- // Korean Johab KS C-5601-1992 -- return -- ((uch >= 0x84) && (uch <= 0xD3)) || -- ((uch >= 0xD8) && (uch <= 0xDE)) || -- ((uch >= 0xE0) && (uch <= 0xF9)); -- } -- return false; --} -- --//-------------------------------------------------------------------------------------------------- -- --int Platform::DBCSCharLength(int /* codePage */, const char * /* s */) { -- // DBCS no longer uses this. -- return 1; --} -- --//-------------------------------------------------------------------------------------------------- -- --int Platform::DBCSCharMaxLength() { -- return 2; --} -- --//-------------------------------------------------------------------------------------------------- -- --int Platform::Minimum(int a, int b) { -- return (a < b) ? a : b; --} -- --//-------------------------------------------------------------------------------------------------- -- --int Platform::Maximum(int a, int b) { -- return (a > b) ? a : b; --} -- --//-------------------------------------------------------------------------------------------------- -- - //#define TRACE - #ifdef TRACE - -@@ -2026,16 +1906,6 @@ - #endif - } - --//-------------------------------------------------------------------------------------------------- -- --int Platform::Clamp(int val, int minVal, int maxVal) { -- if (val > maxVal) -- val = maxVal; -- if (val < minVal) -- val = minVal; -- return val; --} -- - //----------------- DynamicLibrary ----------------------------------------------------------------- - - /** -diff -r 7e28cdba6d61 -r 7030530a9a0f cocoa/ScintillaCocoa.h ---- a/cocoa/ScintillaCocoa.h Sun Jun 11 14:08:43 2017 +1000 -+++ b/cocoa/ScintillaCocoa.h Mon Jun 12 11:49:56 2017 +1000 -@@ -52,6 +52,7 @@ - #include "Document.h" - #include "CaseConvert.h" - #include "UniConversion.h" -+#include "DBCS.h" - #include "Selection.h" - #include "PositionCache.h" - #include "EditModel.h" -diff -r 7e28cdba6d61 -r 7030530a9a0f cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj ---- a/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj Sun Jun 11 14:08:43 2017 +1000 -+++ b/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj Mon Jun 12 11:49:56 2017 +1000 -@@ -199,6 +199,7 @@ - 280056FC188DDD2C00F200AE /* StringCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056F9188DDD2C00F200AE /* StringCopy.h */; }; - 280056FD188DDD2C00F200AE /* SubStyles.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056FA188DDD2C00F200AE /* SubStyles.h */; }; - 28064A05190F12E100E6E47F /* LexDMIS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28064A04190F12E100E6E47F /* LexDMIS.cxx */; }; -+ 28804B2C1EEE232E00C0D154 /* DBCS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28804B2B1EEE232E00C0D154 /* DBCS.cxx */; }; - 28A067111A36B42600B4966A /* LexHex.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A067101A36B42600B4966A /* LexHex.cxx */; }; - 28A1DD51196BE0CA006EFCDD /* EditModel.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */; }; - 28A1DD52196BE0CA006EFCDD /* EditView.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */; }; -@@ -423,6 +424,7 @@ - 280056FA188DDD2C00F200AE /* SubStyles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SubStyles.h; path = ../../lexlib/SubStyles.h; sourceTree = "<group>"; }; - 28064A04190F12E100E6E47F /* LexDMIS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDMIS.cxx; path = ../../lexers/LexDMIS.cxx; sourceTree = "<group>"; }; - 282E41F3B9E2BFEDD6A05BE7 /* LexIndent.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexIndent.cxx; path = ../../lexers/LexIndent.cxx; sourceTree = SOURCE_ROOT; }; -+ 28804B2B1EEE232E00C0D154 /* DBCS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DBCS.cxx; path = ../../src/DBCS.cxx; sourceTree = "<group>"; }; - 28A067101A36B42600B4966A /* LexHex.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHex.cxx; path = ../../lexers/LexHex.cxx; sourceTree = "<group>"; }; - 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditModel.cxx; path = ../../src/EditModel.cxx; sourceTree = "<group>"; }; - 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditView.cxx; path = ../../src/EditView.cxx; sourceTree = "<group>"; }; -@@ -724,6 +726,7 @@ - 114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */, - 114B6F6411FA7597004FB6AB /* CharClassify.cxx */, - 114B6F6511FA7597004FB6AB /* ContractionState.cxx */, -+ 28804B2B1EEE232E00C0D154 /* DBCS.cxx */, - 114B6F6611FA7597004FB6AB /* Decoration.cxx */, - 114B6F6711FA7597004FB6AB /* Document.cxx */, - 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */, -@@ -1010,6 +1013,7 @@ - 114B6F3911FA7526004FB6AB /* LexMySQL.cxx in Sources */, - 114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */, - 114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */, -+ 28804B2C1EEE232E00C0D154 /* DBCS.cxx in Sources */, - 114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */, - 114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */, - 28B6470D1B54C0720009DC49 /* LexDiff.cxx in Sources */, -diff -r 7e28cdba6d61 -r 7030530a9a0f gtk/PlatGTK.cxx ---- a/gtk/PlatGTK.cxx Sun Jun 11 14:08:43 2017 +1000 -+++ b/gtk/PlatGTK.cxx Mon Jun 12 11:49:56 2017 +1000 -@@ -107,12 +107,6 @@ - return static_cast<GtkWidget *>(wid); - } - --Point Point::FromLong(long lpoint) { -- return Point( -- Platform::LowShortFromLong(lpoint), -- Platform::HighShortFromLong(lpoint)); --} -- - Font::Font() : fid(0) {} - - Font::~Font() {} -@@ -184,7 +178,6 @@ - XYPOSITION Ascent(Font &font_); - XYPOSITION Descent(Font &font_); - XYPOSITION InternalLeading(Font &font_); -- XYPOSITION ExternalLeading(Font &font_); - XYPOSITION Height(Font &font_); - XYPOSITION AverageCharWidth(Font &font_); - -@@ -925,10 +918,6 @@ - return 0; - } - --XYPOSITION SurfaceImpl::ExternalLeading(Font &) { -- return 0; --} -- - XYPOSITION SurfaceImpl::Height(Font &font_) { - return Ascent(font_) + Descent(font_); - } -@@ -978,10 +967,6 @@ - } - } - --bool Window::HasFocus() { -- return gtk_widget_has_focus(GTK_WIDGET(wid)); --} -- - PRectangle Window::GetPosition() { - // Before any size allocated pretend its 1000 wide so not scrolled - PRectangle rc(0, 0, 1000, 1000); -@@ -1125,10 +1110,6 @@ - #endif - } - --void Window::SetTitle(const char *s) { -- gtk_window_set_title(GTK_WINDOW(wid), s); --} -- - /* Returns rectangle of monitor pt is on, both rect and pt are in Window's - gdk window coordinates */ - PRectangle Window::GetMonitorRect(Point pt) { -@@ -2025,83 +2006,10 @@ - return 500; // Half a second - } - --bool Platform::MouseButtonBounce() { -- return true; --} -- - void Platform::DebugDisplay(const char *s) { - fprintf(stderr, "%s", s); - } - --bool Platform::IsKeyDown(int) { -- // TODO: discover state of keys in GTK+/X -- return false; --} -- --long Platform::SendScintilla( -- WindowID w, unsigned int msg, unsigned long wParam, long lParam) { -- return scintilla_send_message(SCINTILLA(w), msg, wParam, lParam); --} -- --long Platform::SendScintillaPointer( -- WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { -- return scintilla_send_message(SCINTILLA(w), msg, wParam, -- reinterpret_cast<sptr_t>(lParam)); --} -- --bool Platform::IsDBCSLeadByte(int codePage, char ch) { -- // Byte ranges found in Wikipedia articles with relevant search strings in each case -- unsigned char uch = static_cast<unsigned char>(ch); -- switch (codePage) { -- case 932: -- // Shift_jis -- return ((uch >= 0x81) && (uch <= 0x9F)) || -- ((uch >= 0xE0) && (uch <= 0xFC)); -- // Lead bytes F0 to FC may be a Microsoft addition. -- case 936: -- // GBK -- return (uch >= 0x81) && (uch <= 0xFE); -- case 950: -- // Big5 -- return (uch >= 0x81) && (uch <= 0xFE); -- // Korean EUC-KR may be code page 949. -- } -- return false; --} -- --int Platform::DBCSCharLength(int codePage, const char *s) { -- if (codePage == 932 || codePage == 936 || codePage == 950) { -- return IsDBCSLeadByte(codePage, s[0]) ? 2 : 1; -- } else { -- int bytes = mblen(s, MB_CUR_MAX); -- if (bytes >= 1) -- return bytes; -- else -- return 1; -- } --} -- --int Platform::DBCSCharMaxLength() { -- return MB_CUR_MAX; -- //return 2; --} -- --// These are utility functions not really tied to a platform -- --int Platform::Minimum(int a, int b) { -- if (a < b) -- return a; -- else -- return b; --} -- --int Platform::Maximum(int a, int b) { -- if (a > b) -- return a; -- else -- return b; --} -- - //#define TRACE - - #ifdef TRACE -@@ -2134,14 +2042,6 @@ - abort(); - } - --int Platform::Clamp(int val, int minVal, int maxVal) { -- if (val > maxVal) -- val = maxVal; -- if (val < minVal) -- val = minVal; -- return val; --} -- - void Platform_Initialise() { - } - -diff -r 7e28cdba6d61 -r 7030530a9a0f gtk/makefile ---- a/gtk/makefile Sun Jun 11 14:08:43 2017 +1000 -+++ b/gtk/makefile Mon Jun 12 11:49:56 2017 +1000 -@@ -78,7 +78,7 @@ - CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS) - endif - --CXXTFLAGS:=--std=gnu++0x $(CTFLAGS) $(REFLAGS) -+CXXTFLAGS:=--std=gnu++17 $(CTFLAGS) $(REFLAGS) - - CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION)) - MARSHALLER=scintilla-marshal.o -diff -r 7e28cdba6d61 -r 7030530a9a0f include/Platform.h ---- a/include/Platform.h Sun Jun 11 14:08:43 2017 +1000 -+++ b/include/Platform.h Mon Jun 12 11:49:56 2017 +1000 -@@ -109,8 +109,6 @@ - } - - // Other automatically defined methods (assignment, copy constructor, destructor) are fine -- -- static Point FromLong(long lpoint); - }; - - /** -@@ -332,7 +330,6 @@ - virtual XYPOSITION Ascent(Font &font_)=0; - virtual XYPOSITION Descent(Font &font_)=0; - virtual XYPOSITION InternalLeading(Font &font_)=0; -- virtual XYPOSITION ExternalLeading(Font &font_)=0; - virtual XYPOSITION Height(Font &font_)=0; - virtual XYPOSITION AverageCharWidth(Font &font_)=0; - -@@ -376,7 +373,6 @@ - WindowID GetID() const { return wid; } - bool Created() const { return wid != 0; } - void Destroy(); -- bool HasFocus(); - PRectangle GetPosition(); - void SetPosition(PRectangle rc); - void SetPositionRelative(PRectangle rc, Window relativeTo); -@@ -387,7 +383,6 @@ - virtual void SetFont(Font &font); - enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand }; - void SetCursor(Cursor curs); -- void SetTitle(const char *s); - PRectangle GetMonitorRect(Point pt); - private: - Cursor cursorLast; -@@ -503,34 +498,14 @@ - static const char *DefaultFont(); - static int DefaultFontSize(); - static unsigned int DoubleClickTime(); -- static bool MouseButtonBounce(); - static void DebugDisplay(const char *s); -- static bool IsKeyDown(int key); -- static long SendScintilla( -- WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0); -- static long SendScintillaPointer( -- WindowID w, unsigned int msg, unsigned long wParam=0, void *lParam=0); -- static bool IsDBCSLeadByte(int codePage, char ch); -- static int DBCSCharLength(int codePage, const char *s); -- static int DBCSCharMaxLength(); -- -- // These are utility functions not really tied to a platform -- static int Minimum(int a, int b); -- static int Maximum(int a, int b); -- // Next three assume 16 bit shorts and 32 bit longs - static long LongFromTwoShorts(short a,short b) { - return (a) | ((b) << 16); - } -- static short HighShortFromLong(long x) { -- return static_cast<short>(x >> 16); -- } -- static short LowShortFromLong(long x) { -- return static_cast<short>(x & 0xffff); -- } -+ - static void DebugPrintf(const char *format, ...); - static bool ShowAssertionPopUps(bool assertionPopUps_); - static void Assert(const char *c, const char *file, int line) CLANG_ANALYZER_NORETURN; -- static int Clamp(int val, int minVal, int maxVal); - }; - - #ifdef NDEBUG -diff -r 7e28cdba6d61 -r 7030530a9a0f qt/ScintillaEdit/ScintillaEdit.pro ---- a/qt/ScintillaEdit/ScintillaEdit.pro Sun Jun 11 14:08:43 2017 +1000 -+++ b/qt/ScintillaEdit/ScintillaEdit.pro Mon Jun 12 11:49:56 2017 +1000 -@@ -10,18 +10,14 @@ - TARGET = ScintillaEdit - TEMPLATE = lib - CONFIG += lib_bundle -- --unix { -- # <regex> requires C++11 support -- greaterThan(QT_MAJOR_VERSION, 4){ -- CONFIG += c++11 -- } else { -- QMAKE_CXXFLAGS += -std=c++0x -- } --} -+CONFIG += c++14 - - VERSION = 3.7.5 - -+win32 { -+ QMAKE_CXXFLAGS += -std:c++latest -+} -+ - SOURCES += \ - ScintillaEdit.cpp \ - ScintillaDocument.cpp \ -@@ -48,6 +44,7 @@ - ../../src/EditModel.cxx \ - ../../src/Document.cxx \ - ../../src/Decoration.cxx \ -+ ../../src/DBCS.cxx \ - ../../src/ContractionState.cxx \ - ../../src/CharClassify.cxx \ - ../../src/CellBuffer.cxx \ -diff -r 7e28cdba6d61 -r 7030530a9a0f qt/ScintillaEditBase/PlatQt.cpp ---- a/qt/ScintillaEditBase/PlatQt.cpp Sun Jun 11 14:08:43 2017 +1000 -+++ b/qt/ScintillaEditBase/PlatQt.cpp Mon Jun 12 11:49:56 2017 +1000 -@@ -10,6 +10,7 @@ - - #include "PlatQt.h" - #include "Scintilla.h" -+#include "DBCS.h" - #include "FontQuality.h" - - #include <QApplication> -@@ -489,7 +490,7 @@ - // DBCS - int ui = 0; - for (int i=0; i<len;) { -- size_t lenChar = Platform::IsDBCSLeadByte(codePage, s[i]) ? 2 : 1; -+ size_t lenChar = DBCSIsLeadByte(codePage, s[i]) ? 2 : 1; - qreal xPosition = tl.cursorToX(ui+1); - for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) { - positions[i++] = xPosition; -@@ -539,12 +540,6 @@ - return 0; - } - --XYPOSITION SurfaceImpl::ExternalLeading(Font &font) --{ -- QFontMetricsF metrics(*FontPointer(font), device); -- return metrics.leading(); --} -- - XYPOSITION SurfaceImpl::Height(Font &font) - { - QFontMetricsF metrics(*FontPointer(font), device); -@@ -625,11 +620,6 @@ - wid = 0; - } - --bool Window::HasFocus() --{ -- return wid ? window(wid)->hasFocus() : false; --} -- - PRectangle Window::GetPosition() - { - // Before any size allocated pretend its 1000 wide so not scrolled -@@ -725,12 +715,6 @@ - } - } - --void Window::SetTitle(const char *s) --{ -- if (wid) -- window(wid)->setWindowTitle(s); --} -- - /* Returns rectangle of monitor pt is on, both rect and pt are in Window's - window coordinates */ - PRectangle Window::GetMonitorRect(Point pt) -@@ -1201,47 +1185,6 @@ - return QApplication::doubleClickInterval(); - } - --bool Platform::MouseButtonBounce() --{ -- return false; --} -- --bool Platform::IsKeyDown(int /*key*/) --{ -- return false; --} -- --long Platform::SendScintilla(WindowID /*w*/, -- unsigned int /*msg*/, -- unsigned long /*wParam*/, -- long /*lParam*/) --{ -- return 0; --} -- --long Platform::SendScintillaPointer(WindowID /*w*/, -- unsigned int /*msg*/, -- unsigned long /*wParam*/, -- void * /*lParam*/) --{ -- return 0; --} -- --int Platform::Minimum(int a, int b) --{ -- return qMin(a, b); --} -- --int Platform::Maximum(int a, int b) --{ -- return qMax(a, b); --} -- --int Platform::Clamp(int val, int minVal, int maxVal) --{ -- return qBound(minVal, val, maxVal); --} -- - void Platform::DebugDisplay(const char *s) - { - qWarning("Scintilla: %s", s); -@@ -1276,51 +1219,6 @@ - } - } - -- --bool Platform::IsDBCSLeadByte(int codePage, char ch) --{ -- // Byte ranges found in Wikipedia articles with relevant search strings in each case -- unsigned char uch = static_cast<unsigned char>(ch); -- switch (codePage) { -- case 932: -- // Shift_jis -- return ((uch >= 0x81) && (uch <= 0x9F)) || -- ((uch >= 0xE0) && (uch <= 0xEF)); -- case 936: -- // GBK -- return (uch >= 0x81) && (uch <= 0xFE); -- case 949: -- // Korean Wansung KS C-5601-1987 -- return (uch >= 0x81) && (uch <= 0xFE); -- case 950: -- // Big5 -- return (uch >= 0x81) && (uch <= 0xFE); -- case 1361: -- // Korean Johab KS C-5601-1992 -- return -- ((uch >= 0x84) && (uch <= 0xD3)) || -- ((uch >= 0xD8) && (uch <= 0xDE)) || -- ((uch >= 0xE0) && (uch <= 0xF9)); -- } -- return false; --} -- --int Platform::DBCSCharLength(int codePage, const char *s) --{ -- if (codePage == 932 || codePage == 936 || codePage == 949 || -- codePage == 950 || codePage == 1361) { -- return IsDBCSLeadByte(codePage, s[0]) ? 2 : 1; -- } else { -- return 1; -- } --} -- --int Platform::DBCSCharMaxLength() --{ -- return 2; --} -- -- - //---------------------------------------------------------------------- - - static QElapsedTimer timer; -diff -r 7e28cdba6d61 -r 7030530a9a0f qt/ScintillaEditBase/PlatQt.h ---- a/qt/ScintillaEditBase/PlatQt.h Sun Jun 11 14:08:43 2017 +1000 -+++ b/qt/ScintillaEditBase/PlatQt.h Mon Jun 12 11:49:56 2017 +1000 -@@ -106,7 +106,6 @@ - XYPOSITION Ascent(Font &font) override; - XYPOSITION Descent(Font &font) override; - XYPOSITION InternalLeading(Font &font) override; -- XYPOSITION ExternalLeading(Font &font) override; - XYPOSITION Height(Font &font) override; - XYPOSITION AverageCharWidth(Font &font) override; - -diff -r 7e28cdba6d61 -r 7030530a9a0f qt/ScintillaEditBase/ScintillaEditBase.pro ---- a/qt/ScintillaEditBase/ScintillaEditBase.pro Sun Jun 11 14:08:43 2017 +1000 -+++ b/qt/ScintillaEditBase/ScintillaEditBase.pro Mon Jun 12 11:49:56 2017 +1000 -@@ -10,18 +10,14 @@ - TARGET = ScintillaEditBase - TEMPLATE = lib - CONFIG += lib_bundle -- --unix { -- # <regex> requires C++11 support -- greaterThan(QT_MAJOR_VERSION, 4){ -- CONFIG += c++11 -- } else { -- QMAKE_CXXFLAGS += -std=c++0x -- } --} -+CONFIG += c++14 - - VERSION = 3.7.5 - -+win32 { -+ QMAKE_CXXFLAGS += -std:c++latest -+} -+ - SOURCES += \ - PlatQt.cpp \ - ScintillaQt.cpp \ -@@ -46,6 +42,7 @@ - ../../src/EditModel.cxx \ - ../../src/Document.cxx \ - ../../src/Decoration.cxx \ -+ ../../src/DBCS.cxx \ - ../../src/ContractionState.cxx \ - ../../src/CharClassify.cxx \ - ../../src/CellBuffer.cxx \ -diff -r 7e28cdba6d61 -r 7030530a9a0f qt/ScintillaEditPy/ScintillaEditPy.pro ---- a/qt/ScintillaEditPy/ScintillaEditPy.pro Sun Jun 11 14:08:43 2017 +1000 -+++ b/qt/ScintillaEditPy/ScintillaEditPy.pro Mon Jun 12 11:49:56 2017 +1000 -@@ -6,21 +6,14 @@ - - # Clear debug & release so that sepbuild.pri can set one or the other - CONFIG -= debug release -+CONFIG += c++14 - - include(sepbuild.pri) - - VERSION = $$SCINTILLA_VERSION - --unix { -- # <regex> requires C++11 support -- greaterThan(QT_MAJOR_VERSION, 4){ -- CONFIG += c++11 -- } else { -- QMAKE_CXXFLAGS += -std=c++0x -Wno-deprecated-declarations -- } --} -- - win32 { -+ QMAKE_CXXFLAGS += -std:c++latest - DebugBuild { - TARGET_EXT = _d.pyd - } -diff -r 7e28cdba6d61 -r 7030530a9a0f scripts/HeaderOrder.txt ---- a/scripts/HeaderOrder.txt Sun Jun 11 14:08:43 2017 +1000 -+++ b/scripts/HeaderOrder.txt Mon Jun 12 11:49:56 2017 +1000 -@@ -129,6 +129,7 @@ - #include "CaseConvert.h" - #include "UniConversion.h" - #include "UnicodeFromUTF8.h" -+#include "DBCS.h" - #include "Selection.h" - #include "PositionCache.h" - #include "FontQuality.h" -diff -r 7e28cdba6d61 -r 7030530a9a0f src/DBCS.cxx ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/src/DBCS.cxx Mon Jun 12 11:49:56 2017 +1000 -@@ -0,0 +1,48 @@ -+// Scintilla source code edit control -+/** @file DBCS.cxx -+ ** Functions to handle DBCS double byte encodings like Shift-JIS. -+ **/ -+// Copyright 2017 by Neil Hodgson <neilh@scintilla.org> -+// The License.txt file describes the conditions under which this software may be distributed. -+ -+#include "DBCS.h" -+ -+#ifdef SCI_NAMESPACE -+using namespace Scintilla; -+#endif -+ -+#ifdef SCI_NAMESPACE -+namespace Scintilla { -+#endif -+ -+bool DBCSIsLeadByte(int codePage, char ch) { -+ // Byte ranges found in Wikipedia articles with relevant search strings in each case -+ const unsigned char uch = static_cast<unsigned char>(ch); -+ switch (codePage) { -+ case 932: -+ // Shift_jis -+ return ((uch >= 0x81) && (uch <= 0x9F)) || -+ ((uch >= 0xE0) && (uch <= 0xFC)); -+ // Lead bytes F0 to FC may be a Microsoft addition. -+ case 936: -+ // GBK -+ return (uch >= 0x81) && (uch <= 0xFE); -+ case 949: -+ // Korean Wansung KS C-5601-1987 -+ return (uch >= 0x81) && (uch <= 0xFE); -+ case 950: -+ // Big5 -+ return (uch >= 0x81) && (uch <= 0xFE); -+ case 1361: -+ // Korean Johab KS C-5601-1992 -+ return -+ ((uch >= 0x84) && (uch <= 0xD3)) || -+ ((uch >= 0xD8) && (uch <= 0xDE)) || -+ ((uch >= 0xE0) && (uch <= 0xF9)); -+ } -+ return false; -+} -+ -+#ifdef SCI_NAMESPACE -+} -+#endif -diff -r 7e28cdba6d61 -r 7030530a9a0f src/DBCS.h ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/src/DBCS.h Mon Jun 12 11:49:56 2017 +1000 -@@ -0,0 +1,21 @@ -+// Scintilla source code edit control -+/** @file DBCS.h -+ ** Functions to handle DBCS double byte encodings like Shift-JIS. -+ **/ -+// Copyright 2017 by Neil Hodgson <neilh@scintilla.org> -+// The License.txt file describes the conditions under which this software may be distributed. -+ -+#ifndef DBCS_H -+#define DBCS_H -+ -+#ifdef SCI_NAMESPACE -+namespace Scintilla { -+#endif -+ -+bool DBCSIsLeadByte(int codePage, char ch); -+ -+#ifdef SCI_NAMESPACE -+} -+#endif -+ -+#endif -diff -r 7e28cdba6d61 -r 7030530a9a0f src/Document.cxx ---- a/src/Document.cxx Sun Jun 11 14:08:43 2017 +1000 -+++ b/src/Document.cxx Mon Jun 12 11:49:56 2017 +1000 -@@ -564,7 +564,7 @@ - } - - Sci::Position Document::ClampPositionIntoDocument(Sci::Position pos) const { -- return Platform::Clamp(pos, 0, Length()); -+ return Sci::clamp(pos, 0, Length()); - } - - bool Document::IsCrLf(Sci::Position pos) const { -diff -r 7e28cdba6d61 -r 7030530a9a0f src/Editor.cxx ---- a/src/Editor.cxx Sun Jun 11 14:08:43 2017 +1000 -+++ b/src/Editor.cxx Mon Jun 12 11:49:56 2017 +1000 -@@ -888,10 +888,10 @@ - Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); - if (moveDir > 0) { - // lineDisplay is already line before fold as lines in fold use display line of line after fold -- lineDisplay = Platform::Clamp(lineDisplay, 0, cs.LinesDisplayed()); -+ lineDisplay = Sci::clamp(lineDisplay, 0, cs.LinesDisplayed()); - return SelectionPosition(pdoc->LineStart(cs.DocFromDisplay(lineDisplay))); - } else { -- lineDisplay = Platform::Clamp(lineDisplay - 1, 0, cs.LinesDisplayed()); -+ lineDisplay = Sci::clamp(lineDisplay - 1, 0, cs.LinesDisplayed()); - return SelectionPosition(pdoc->LineEnd(cs.DocFromDisplay(lineDisplay))); - } - } -@@ -915,7 +915,7 @@ - } - - void Editor::ScrollTo(Sci::Line line, bool moveThumb) { -- const Sci::Line topLineNew = Platform::Clamp(line, 0, MaxScrollPos()); -+ const Sci::Line topLineNew = Sci::clamp(line, 0, MaxScrollPos()); - if (topLineNew != topLine) { - // Try to optimise small scrolls - #ifndef UNDER_CE -@@ -1154,7 +1154,7 @@ - } else { - // yMarginT must equal to caretYSlop, with a minimum of 1 and - // a maximum of slightly less than half the heigth of the text area. -- yMarginT = Platform::Clamp(caretYSlop, 1, halfScreen); -+ yMarginT = Sci::clamp(caretYSlop, 1, halfScreen); - if (bEven) { - yMarginB = yMarginT; - } else { -@@ -1164,7 +1164,7 @@ - yMoveT = yMarginT; - if (bEven) { - if (bJump) { -- yMoveT = Platform::Clamp(caretYSlop * 3, 1, halfScreen); -+ yMoveT = Sci::clamp(caretYSlop * 3, 1, halfScreen); - } - yMoveB = yMoveT; - } else { -@@ -1179,7 +1179,7 @@ - } - } else { // Not strict - yMoveT = bJump ? caretYSlop * 3 : caretYSlop; -- yMoveT = Platform::Clamp(yMoveT, 1, halfScreen); -+ yMoveT = Sci::clamp(yMoveT, 1, halfScreen); - if (bEven) { - yMoveB = yMoveT; - } else { -@@ -1229,7 +1229,7 @@ - newXY.topLine = std::min(newXY.topLine, lineCaret); - } - } -- newXY.topLine = Platform::Clamp(newXY.topLine, 0, MaxScrollPos()); -+ newXY.topLine = Sci::clamp(newXY.topLine, 0, MaxScrollPos()); - } - - // Horizontal positioning -@@ -1251,7 +1251,7 @@ - } else { - // xMargin must equal to caretXSlop, with a minimum of 2 and - // a maximum of slightly less than half the width of the text area. -- xMarginR = Platform::Clamp(caretXSlop, 2, halfScreen); -+ xMarginR = Sci::clamp(caretXSlop, 2, halfScreen); - if (bEven) { - xMarginL = xMarginR; - } else { -@@ -1260,7 +1260,7 @@ - } - if (bJump && bEven) { - // Jump is used only in even mode -- xMoveL = xMoveR = Platform::Clamp(caretXSlop * 3, 1, halfScreen); -+ xMoveL = xMoveR = Sci::clamp(caretXSlop * 3, 1, halfScreen); - } else { - xMoveL = xMoveR = 0; // Not used, avoid a warning - } -@@ -1283,7 +1283,7 @@ - } - } else { // Not strict - xMoveR = bJump ? caretXSlop * 3 : caretXSlop; -- xMoveR = Platform::Clamp(xMoveR, 1, halfScreen); -+ xMoveR = Sci::clamp(xMoveR, 1, halfScreen); - if (bEven) { - xMoveL = xMoveR; - } else { -@@ -1505,7 +1505,7 @@ - const Sci::Line lineDocTop = cs.DocFromDisplay(topLine); - const int subLineTop = topLine - cs.DisplayFromDoc(lineDocTop); - if (ws == wsVisible) { -- lineToWrap = Platform::Clamp(lineDocTop-5, wrapPending.start, pdoc->LinesTotal()); -+ lineToWrap = Sci::clamp(lineDocTop-5, wrapPending.start, pdoc->LinesTotal()); - // Priority wrap to just after visible area. - // Since wrapping could reduce display lines, treat each - // as taking only one display line. -@@ -1561,7 +1561,7 @@ - - if (wrapOccurred) { - SetScrollBars(); -- SetTopLine(Platform::Clamp(goodTopLine, 0, MaxScrollPos())); -+ SetTopLine(Sci::clamp(goodTopLine, 0, MaxScrollPos())); - SetVerticalScrollPos(); - } - -@@ -1816,7 +1816,7 @@ - // TODO: ensure always showing as many lines as possible - // May not be, if, for example, window made larger - if (topLine > MaxScrollPos()) { -- SetTopLine(Platform::Clamp(topLine, 0, MaxScrollPos())); -+ SetTopLine(Sci::clamp(topLine, 0, MaxScrollPos())); - SetVerticalScrollPos(); - Redraw(); - } -@@ -2641,7 +2641,7 @@ - if (mh.linesAdded != 0) { - // Avoid scrolling of display if change before current display - if (mh.position < posTopLine && !CanDeferToLastStep(mh)) { -- Sci::Line newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos()); -+ Sci::Line newTop = Sci::clamp(topLine + mh.linesAdded, 0, MaxScrollPos()); - if (newTop != topLine) { - SetTopLine(newTop); - SetVerticalScrollPos(); -@@ -2877,7 +2877,7 @@ - } else { - Point pt = LocationFromPosition(sel.MainCaret()); - -- topLineNew = Platform::Clamp( -+ topLineNew = Sci::clamp( - topLine + direction * LinesToScroll(), 0, MaxScrollPos()); - newPos = SPositionFromLocation( - Point::FromInts(lastXChosen - xOffset, static_cast<int>(pt.y) + direction * (vs.lineHeight * LinesToScroll())), -@@ -3209,6 +3209,14 @@ - - namespace { - -+short HighShortFromLong(long x) { -+ return static_cast<short>(x >> 16); -+} -+ -+short LowShortFromLong(long x) { -+ return static_cast<short>(x & 0xffff); -+} -+ - unsigned int WithExtends(unsigned int iMessage) { - switch (iMessage) { - case SCI_CHARLEFT: return SCI_CHARLEFTEXTEND; -@@ -4470,30 +4478,27 @@ - if (!ctrl || !multipleSelection || (selectionType != selChar && selectionType != selWord)) - SetEmptySelection(newPos.Position()); - bool doubleClick = false; -- // Stop mouse button bounce changing selection type -- if (!Platform::MouseButtonBounce() || curTime != lastClickTime) { -- if (inSelMargin) { -- // Inside margin selection type should be either selSubLine or selWholeLine. -- if (selectionType == selSubLine) { -- // If it is selSubLine, we're inside a *double* click and word wrap is enabled, -- // so we switch to selWholeLine in order to select whole line. -- selectionType = selWholeLine; -- } else if (selectionType != selSubLine && selectionType != selWholeLine) { -- // If it is neither, reset selection type to line selection. -- selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine; -- } -+ if (inSelMargin) { -+ // Inside margin selection type should be either selSubLine or selWholeLine. -+ if (selectionType == selSubLine) { -+ // If it is selSubLine, we're inside a *double* click and word wrap is enabled, -+ // so we switch to selWholeLine in order to select whole line. -+ selectionType = selWholeLine; -+ } else if (selectionType != selSubLine && selectionType != selWholeLine) { -+ // If it is neither, reset selection type to line selection. -+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine; -+ } -+ } else { -+ if (selectionType == selChar) { -+ selectionType = selWord; -+ doubleClick = true; -+ } else if (selectionType == selWord) { -+ // Since we ended up here, we're inside a *triple* click, which should always select -+ // whole line regardless of word wrap being enabled or not. -+ selectionType = selWholeLine; - } else { -- if (selectionType == selChar) { -- selectionType = selWord; -- doubleClick = true; -- } else if (selectionType == selWord) { -- // Since we ended up here, we're inside a *triple* click, which should always select -- // whole line regardless of word wrap being enabled or not. -- selectionType = selWholeLine; -- } else { -- selectionType = selChar; -- originalAnchorPos = sel.MainCaret(); -- } -+ selectionType = selChar; -+ originalAnchorPos = sel.MainCaret(); - } - } - -@@ -5082,7 +5087,7 @@ - // When scrolling, allow less time to ensure responsive - const double secondsAllowed = scrolling ? 0.005 : 0.02; - -- const Sci::Line linesToStyle = Platform::Clamp(static_cast<int>(secondsAllowed / pdoc->durationStyleOneLine), -+ const Sci::Line linesToStyle = Sci::clamp(static_cast<int>(secondsAllowed / pdoc->durationStyleOneLine), - 10, 0x10000); - const Sci::Line stylingMaxLine = std::min( - static_cast<Sci::Line>(pdoc->LineFromPosition(pdoc->GetEndStyled()) + linesToStyle), -@@ -5426,18 +5431,18 @@ - const Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); - if (visiblePolicy & VISIBLE_SLOP) { - if ((topLine > lineDisplay) || ((visiblePolicy & VISIBLE_STRICT) && (topLine + visibleSlop > lineDisplay))) { -- SetTopLine(Platform::Clamp(lineDisplay - visibleSlop, 0, MaxScrollPos())); -+ SetTopLine(Sci::clamp(lineDisplay - visibleSlop, 0, MaxScrollPos())); - SetVerticalScrollPos(); - Redraw(); - } else if ((lineDisplay > topLine + LinesOnScreen() - 1) || - ((visiblePolicy & VISIBLE_STRICT) && (lineDisplay > topLine + LinesOnScreen() - 1 - visibleSlop))) { -- SetTopLine(Platform::Clamp(lineDisplay - LinesOnScreen() + 1 + visibleSlop, 0, MaxScrollPos())); -+ SetTopLine(Sci::clamp(lineDisplay - LinesOnScreen() + 1 + visibleSlop, 0, MaxScrollPos())); - SetVerticalScrollPos(); - Redraw(); - } - } else { - if ((topLine > lineDisplay) || (lineDisplay > topLine + LinesOnScreen() - 1) || (visiblePolicy & VISIBLE_STRICT)) { -- SetTopLine(Platform::Clamp(lineDisplay - LinesOnScreen() / 2 + 1, 0, MaxScrollPos())); -+ SetTopLine(Sci::clamp(lineDisplay - LinesOnScreen() / 2 + 1, 0, MaxScrollPos())); - SetVerticalScrollPos(); - Redraw(); - } -@@ -6040,7 +6045,7 @@ - return pdoc->MovePositionOutsideChar(static_cast<int>(wParam) + 1, 1, true); - - case SCI_POSITIONRELATIVE: -- return Platform::Clamp(pdoc->GetRelativePosition(static_cast<int>(wParam), static_cast<int>(lParam)), 0, pdoc->Length()); -+ return Sci::clamp(pdoc->GetRelativePosition(static_cast<int>(wParam), static_cast<int>(lParam)), 0, pdoc->Length()); - - case SCI_LINESCROLL: - ScrollTo(topLine + static_cast<Sci::Line>(lParam)); -@@ -7290,13 +7295,13 @@ - return vs.caretWidth; - - case SCI_ASSIGNCMDKEY: -- kmap.AssignCmdKey(Platform::LowShortFromLong(static_cast<long>(wParam)), -- Platform::HighShortFromLong(static_cast<long>(wParam)), static_cast<unsigned int>(lParam)); -+ kmap.AssignCmdKey(LowShortFromLong(static_cast<long>(wParam)), -+ HighShortFromLong(static_cast<long>(wParam)), static_cast<unsigned int>(lParam)); - break; - - case SCI_CLEARCMDKEY: -- kmap.AssignCmdKey(Platform::LowShortFromLong(static_cast<long>(wParam)), -- Platform::HighShortFromLong(static_cast<long>(wParam)), SCI_NULL); -+ kmap.AssignCmdKey(LowShortFromLong(static_cast<long>(wParam)), -+ HighShortFromLong(static_cast<long>(wParam)), SCI_NULL); - break; - - case SCI_CLEARALLCMDKEYS: -diff -r 7e28cdba6d61 -r 7030530a9a0f src/Position.h ---- a/src/Position.h Sun Jun 11 14:08:43 2017 +1000 -+++ b/src/Position.h Mon Jun 12 11:49:56 2017 +1000 -@@ -25,6 +25,14 @@ - - const Position invalidPosition = -1; - -+inline int clamp(int val, int minVal, int maxVal) { -+ if (val > maxVal) -+ val = maxVal; -+ if (val < minVal) -+ val = minVal; -+ return val; -+} -+ - } - - #endif -diff -r 7e28cdba6d61 -r 7030530a9a0f src/ViewStyle.cxx ---- a/src/ViewStyle.cxx Sun Jun 11 14:08:43 2017 +1000 -+++ b/src/ViewStyle.cxx Mon Jun 12 11:49:56 2017 +1000 -@@ -460,7 +460,7 @@ - } - - int ViewStyle::GetFrameWidth() const { -- return Platform::Clamp(caretLineFrame, 1, lineHeight / 3); -+ return Sci::clamp(caretLineFrame, 1, lineHeight / 3); - } - - bool ViewStyle::IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const { -diff -r 7e28cdba6d61 -r 7030530a9a0f win32/PlatWin.cxx ---- a/win32/PlatWin.cxx Sun Jun 11 14:08:43 2017 +1000 -+++ b/win32/PlatWin.cxx Mon Jun 12 11:49:56 2017 +1000 -@@ -46,6 +46,7 @@ - #include "StringCopy.h" - #include "XPM.h" - #include "UniConversion.h" -+#include "DBCS.h" - #include "FontQuality.h" - - #ifndef SPI_GETFONTSMOOTHINGCONTRAST -@@ -75,10 +76,6 @@ - namespace Scintilla { - #endif - --Point Point::FromLong(long lpoint) { -- return Point(static_cast<short>(LOWORD(lpoint)), static_cast<short>(HIWORD(lpoint))); --} -- - static RECT RectFromPRectangle(PRectangle prc) { - RECT rc = {static_cast<LONG>(prc.left), static_cast<LONG>(prc.top), - static_cast<LONG>(prc.right), static_cast<LONG>(prc.bottom)}; -@@ -558,7 +555,6 @@ - XYPOSITION Ascent(Font &font_) override; - XYPOSITION Descent(Font &font_) override; - XYPOSITION InternalLeading(Font &font_) override; -- XYPOSITION ExternalLeading(Font &font_) override; - XYPOSITION Height(Font &font_) override; - XYPOSITION AverageCharWidth(Font &font_) override; - -@@ -1010,13 +1006,6 @@ - return static_cast<XYPOSITION>(tm.tmInternalLeading); - } - --XYPOSITION SurfaceGDI::ExternalLeading(Font &font_) { -- SetFont(font_); -- TEXTMETRIC tm; -- ::GetTextMetrics(hdc, &tm); -- return static_cast<XYPOSITION>(tm.tmExternalLeading); --} -- - XYPOSITION SurfaceGDI::Height(Font &font_) { - SetFont(font_); - TEXTMETRIC tm; -@@ -1121,7 +1110,6 @@ - XYPOSITION Ascent(Font &font_) override; - XYPOSITION Descent(Font &font_) override; - XYPOSITION InternalLeading(Font &font_) override; -- XYPOSITION ExternalLeading(Font &font_) override; - XYPOSITION Height(Font &font_) override; - XYPOSITION AverageCharWidth(Font &font_) override; - -@@ -1671,7 +1659,7 @@ - int ui = 0; - for (int i=0; i<len && ui<tbuf.tlen;) { - positions[i] = poses.buffer[ui]; -- if (Platform::IsDBCSLeadByte(codePageText, s[i])) { -+ if (DBCSIsLeadByte(codePageText, s[i])) { - positions[i+1] = poses.buffer[ui]; - i += 2; - } else { -@@ -1716,11 +1704,6 @@ - return floor(yInternalLeading); - } - --XYPOSITION SurfaceD2D::ExternalLeading(Font &) { -- // Not implemented, always return one -- return 1; --} -- - XYPOSITION SurfaceD2D::Height(Font &font_) { - return Ascent(font_) + Descent(font_); - } -@@ -1786,10 +1769,6 @@ - wid = 0; - } - --bool Window::HasFocus() { -- return ::GetFocus() == wid; --} -- - PRectangle Window::GetPosition() { - RECT rc; - ::GetWindowRect(static_cast<HWND>(wid), &rc); -@@ -1952,10 +1931,6 @@ - } - } - --void Window::SetTitle(const char *s) { -- ::SetWindowTextA(static_cast<HWND>(wid), s); --} -- - /* Returns rectangle of monitor pt is on, both rect and pt are in Window's - coordinates */ - PRectangle Window::GetMonitorRect(Point pt) { -@@ -3024,85 +2999,10 @@ - return ::GetDoubleClickTime(); - } - --bool Platform::MouseButtonBounce() { -- return false; --} -- - void Platform::DebugDisplay(const char *s) { - ::OutputDebugStringA(s); - } - --bool Platform::IsKeyDown(int key) { -- return (::GetKeyState(key) & 0x80000000) != 0; --} -- --long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { -- // This should never be called - its here to satisfy an old interface -- return static_cast<long>(::SendMessage(static_cast<HWND>(w), msg, wParam, lParam)); --} -- --long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { -- // This should never be called - its here to satisfy an old interface -- return static_cast<long>(::SendMessage(static_cast<HWND>(w), msg, wParam, -- reinterpret_cast<LPARAM>(lParam))); --} -- --bool Platform::IsDBCSLeadByte(int codePage, char ch) { -- // Byte ranges found in Wikipedia articles with relevant search strings in each case -- const unsigned char uch = static_cast<unsigned char>(ch); -- switch (codePage) { -- case 932: -- // Shift_jis -- return ((uch >= 0x81) && (uch <= 0x9F)) || -- ((uch >= 0xE0) && (uch <= 0xEF)); -- case 936: -- // GBK -- return (uch >= 0x81) && (uch <= 0xFE); -- case 949: -- // Korean Wansung KS C-5601-1987 -- return (uch >= 0x81) && (uch <= 0xFE); -- case 950: -- // Big5 -- return (uch >= 0x81) && (uch <= 0xFE); -- case 1361: -- // Korean Johab KS C-5601-1992 -- return -- ((uch >= 0x84) && (uch <= 0xD3)) || -- ((uch >= 0xD8) && (uch <= 0xDE)) || -- ((uch >= 0xE0) && (uch <= 0xF9)); -- } -- return false; --} -- --int Platform::DBCSCharLength(int codePage, const char *s) { -- if (codePage == 932 || codePage == 936 || codePage == 949 || -- codePage == 950 || codePage == 1361) { -- return Platform::IsDBCSLeadByte(codePage, s[0]) ? 2 : 1; -- } else { -- return 1; -- } --} -- --int Platform::DBCSCharMaxLength() { -- return 2; --} -- --// These are utility functions not really tied to a platform -- --int Platform::Minimum(int a, int b) { -- if (a < b) -- return a; -- else -- return b; --} -- --int Platform::Maximum(int a, int b) { -- if (a > b) -- return a; -- else -- return b; --} -- - //#define TRACE - - #ifdef TRACE -@@ -3147,14 +3047,6 @@ - } - } - --int Platform::Clamp(int val, int minVal, int maxVal) { -- if (val > maxVal) -- val = maxVal; -- if (val < minVal) -- val = minVal; -- return val; --} -- - void Platform_Initialise(void *hInstance) { - ::InitializeCriticalSection(&crPlatformLock); - hinstPlatformRes = static_cast<HINSTANCE>(hInstance); -diff -r 7e28cdba6d61 -r 7030530a9a0f win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Sun Jun 11 14:08:43 2017 +1000 -+++ b/win32/ScintillaWin.cxx Mon Jun 12 11:49:56 2017 +1000 -@@ -156,6 +156,14 @@ - return Point::FromInts(pt.x, pt.y); - } - -+static Point PointFromLong(long lpoint) { -+ return Point(static_cast<short>(LOWORD(lpoint)), static_cast<short>(HIWORD(lpoint))); -+} -+ -+static bool KeyboardIsKeyDown(int key) { -+ return (::GetKeyState(key) & 0x80000000) != 0; -+} -+ - class ScintillaWin; // Forward declaration for COM interface subobjects - - typedef void VFunction(void); -@@ -1376,19 +1384,19 @@ - ::ImmNotifyIME(imc.hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); - // - //Platform::DebugPrintf("Buttdown %d %x %x %x %x %x\n",iMessage, wParam, lParam, -- // Platform::IsKeyDown(VK_SHIFT), -- // Platform::IsKeyDown(VK_CONTROL), -- // Platform::IsKeyDown(VK_MENU)); -+ // KeyboardIsKeyDown(VK_SHIFT), -+ // KeyboardIsKeyDown(VK_CONTROL), -+ // KeyboardIsKeyDown(VK_MENU)); - ::SetFocus(MainHWND()); -- ButtonDown(Point::FromLong(static_cast<long>(lParam)), ::GetMessageTime(), -+ ButtonDown(PointFromLong(static_cast<long>(lParam)), ::GetMessageTime(), - (wParam & MK_SHIFT) != 0, - (wParam & MK_CONTROL) != 0, -- Platform::IsKeyDown(VK_MENU)); -+ KeyboardIsKeyDown(VK_MENU)); - } - break; - - case WM_MOUSEMOVE: { -- const Point pt = Point::FromLong(static_cast<long>(lParam)); -+ const Point pt = PointFromLong(static_cast<long>(lParam)); - - // Windows might send WM_MOUSEMOVE even though the mouse has not been moved: - // http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx -@@ -1397,7 +1405,7 @@ - ButtonMoveWithModifiers(pt, - ((wParam & MK_SHIFT) != 0 ? SCI_SHIFT : 0) | - ((wParam & MK_CONTROL) != 0 ? SCI_CTRL : 0) | -- (Platform::IsKeyDown(VK_MENU) ? SCI_ALT : 0)); -+ (KeyboardIsKeyDown(VK_MENU) ? SCI_ALT : 0)); - } - } - break; -@@ -1408,22 +1416,22 @@ - return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam); - - case WM_LBUTTONUP: -- ButtonUp(Point::FromLong(static_cast<long>(lParam)), -+ ButtonUp(PointFromLong(static_cast<long>(lParam)), - ::GetMessageTime(), - (wParam & MK_CONTROL) != 0); - break; - - case WM_RBUTTONDOWN: { - ::SetFocus(MainHWND()); -- Point pt = Point::FromLong(static_cast<long>(lParam)); -+ Point pt = PointFromLong(static_cast<long>(lParam)); - if (!PointInSelection(pt)) { - CancelModes(); -- SetEmptySelection(PositionFromLocation(Point::FromLong(static_cast<long>(lParam)))); -+ SetEmptySelection(PositionFromLocation(PointFromLong(static_cast<long>(lParam)))); - } - - RightButtonDownWithModifiers(pt, ::GetMessageTime(), ModifierFlags((wParam & MK_SHIFT) != 0, - (wParam & MK_CONTROL) != 0, -- Platform::IsKeyDown(VK_MENU))); -+ KeyboardIsKeyDown(VK_MENU))); - } - break; - -@@ -1487,9 +1495,9 @@ - //Platform::DebugPrintf("S keydown %d %x %x %x %x\n",iMessage, wParam, lParam, ::IsKeyDown(VK_SHIFT), ::IsKeyDown(VK_CONTROL)); - lastKeyDownConsumed = false; - const int ret = KeyDown(KeyTranslate(static_cast<int>(wParam)), -- Platform::IsKeyDown(VK_SHIFT), -- Platform::IsKeyDown(VK_CONTROL), -- Platform::IsKeyDown(VK_MENU), -+ KeyboardIsKeyDown(VK_SHIFT), -+ KeyboardIsKeyDown(VK_CONTROL), -+ KeyboardIsKeyDown(VK_MENU), - &lastKeyDownConsumed); - if (!ret && !lastKeyDownConsumed) { - return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam); -@@ -1573,7 +1581,7 @@ - } - - case WM_CONTEXTMENU: { -- Point pt = Point::FromLong(static_cast<long>(lParam)); -+ Point pt = PointFromLong(static_cast<long>(lParam)); - POINT rpt = {static_cast<int>(pt.x), static_cast<int>(pt.y)}; - ::ScreenToClient(MainHWND(), &rpt); - const Point ptClient = PointFromPOINT(rpt); -@@ -3350,7 +3358,7 @@ - return 0; - } else if (iMessage == WM_LBUTTONDOWN) { - // This does not fire due to the hit test code -- sciThis->ct.MouseClick(Point::FromLong(static_cast<long>(lParam))); -+ sciThis->ct.MouseClick(PointFromLong(static_cast<long>(lParam))); - sciThis->CallTipClick(); - return 0; - } else if (iMessage == WM_SETCURSOR) { -diff -r 7e28cdba6d61 -r 7030530a9a0f win32/makefile ---- a/win32/makefile Sun Jun 11 14:08:43 2017 +1000 -+++ b/win32/makefile Mon Jun 12 11:49:56 2017 +1000 -@@ -13,7 +13,7 @@ - LDMINGW = -Wl,--enable-runtime-pseudo-reloc-v2 -Wl,--add-stdcall-alias - LIBSMINGW = -lstdc++ - STRIPOPTION = -s --CXXSTD = gnu++0x -+CXXSTD = gnu++17 - endif - - .SUFFIXES: .cxx -@@ -83,6 +83,7 @@ - CharacterSet.o \ - CharClassify.o \ - ContractionState.o \ -+ DBCS.o \ - Decoration.o \ - Document.o \ - EditModel.o \ -diff -r 7e28cdba6d61 -r 7030530a9a0f win32/scintilla.mak ---- a/win32/scintilla.mak Sun Jun 11 14:08:43 2017 +1000 -+++ b/win32/scintilla.mak Mon Jun 12 11:49:56 2017 +1000 -@@ -25,7 +25,7 @@ - !ENDIF - - CRTFLAGS=-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_DEPRECATE=1 -D_SCL_SECURE_NO_WARNINGS=1 $(XP_DEFINE) --CXXFLAGS=-Zi -TP -MP -W4 -EHsc $(CRTFLAGS) -+CXXFLAGS=-Zi -TP -MP -W4 -EHsc -std:c++latest $(CRTFLAGS) - CXXDEBUG=-Od -MTd -DDEBUG - CXXNDEBUG=-O1 -MT -DNDEBUG -GL - NAME=-Fo -@@ -75,6 +75,7 @@ - $(DIR_O)\CharacterSet.obj \ - $(DIR_O)\CharClassify.obj \ - $(DIR_O)\ContractionState.obj \ -+ $(DIR_O)\DBCS.obj \ - $(DIR_O)\Decoration.obj \ - $(DIR_O)\Document.obj \ - $(DIR_O)\EditModel.obj \ diff --git a/src/scintilla_backports/6314_af83baede430.patch b/src/scintilla_backports/6314_af83baede430.patch deleted file mode 100644 index ef028826..00000000 --- a/src/scintilla_backports/6314_af83baede430.patch +++ /dev/null @@ -1,535 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1497239386 -36000 -# Node ID af83baede4309993b2ef0aa4f30968148855bc11 -# Parent 2d4cb83e92975d4b8d578f29807031fcf532605a -Simplify mouse and keyboard handling by only retaining the 'WithModifiers" form. -All events include a set of keyboard modifier flags. -Older calls that passed individual parameters for each key were removed. - -diff -r 2d4cb83e9297 -r af83baede430 cocoa/ScintillaCocoa.mm ---- a/cocoa/ScintillaCocoa.mm Mon Jun 12 12:49:30 2017 +1000 -+++ b/cocoa/ScintillaCocoa.mm Mon Jun 12 13:49:46 2017 +1000 -@@ -2262,7 +2262,9 @@ - - // Mouse location is given in screen coordinates and might also be outside of our bounds. - Point location = ConvertPoint(event.locationInWindow); -- ButtonMove(location); -+ ButtonMoveWithModifiers(location, -+ (int)(event.timestamp * 1000), -+ TranslateModifierFlags(event.modifierFlags)); - } - } - -@@ -2276,22 +2278,16 @@ - - void ScintillaCocoa::MouseDown(NSEvent *event) { - Point location = ConvertPoint(event.locationInWindow); -- NSTimeInterval time = event.timestamp; -- bool command = (event.modifierFlags & NSCommandKeyMask) != 0; -- bool shift = (event.modifierFlags & NSShiftKeyMask) != 0; -- bool alt = (event.modifierFlags & NSAlternateKeyMask) != 0; -- -- ButtonDown(Point(location.x, location.y), (int)(time * 1000), shift, command, alt); -+ ButtonDownWithModifiers(location, -+ (int)(event.timestamp * 1000), -+ TranslateModifierFlags(event.modifierFlags)); - } - - void ScintillaCocoa::RightMouseDown(NSEvent *event) { - Point location = ConvertPoint(event.locationInWindow); -- NSTimeInterval time = event.timestamp; -- bool command = (event.modifierFlags & NSCommandKeyMask) != 0; -- bool shift = (event.modifierFlags & NSShiftKeyMask) != 0; -- bool alt = (event.modifierFlags & NSAlternateKeyMask) != 0; -- -- RightButtonDownWithModifiers(Point(location.x, location.y), (int)(time * 1000), ModifierFlags(shift, command, alt)); -+ RightButtonDownWithModifiers(location, -+ (int)(event.timestamp * 1000), -+ TranslateModifierFlags(event.modifierFlags)); - } - - //-------------------------------------------------------------------------------------------------- -@@ -2299,16 +2295,17 @@ - void ScintillaCocoa::MouseMove(NSEvent *event) { - lastMouseEvent = event; - -- ButtonMoveWithModifiers(ConvertPoint(event.locationInWindow), TranslateModifierFlags(event.modifierFlags)); -+ ButtonMoveWithModifiers(ConvertPoint(event.locationInWindow), -+ (int)(event.timestamp * 1000), -+ TranslateModifierFlags(event.modifierFlags)); - } - - //-------------------------------------------------------------------------------------------------- - - void ScintillaCocoa::MouseUp(NSEvent *event) { -- NSTimeInterval time = event.timestamp; -- bool control = (event.modifierFlags & NSControlKeyMask) != 0; -- -- ButtonUp(ConvertPoint(event.locationInWindow), (int)(time * 1000), control); -+ ButtonUpWithModifiers(ConvertPoint(event.locationInWindow), -+ (int)(event.timestamp * 1000), -+ TranslateModifierFlags(event.modifierFlags)); - } - - //-------------------------------------------------------------------------------------------------- -@@ -2344,7 +2341,7 @@ - } - - void ScintillaCocoa::DeleteBackward() { -- KeyDown(SCK_BACK, false, false, false, nil); -+ KeyDownWithModifiers(SCK_BACK, 0, nil); - } - - void ScintillaCocoa::Cut() { -diff -r 2d4cb83e9297 -r af83baede430 gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Mon Jun 12 12:49:30 2017 +1000 -+++ b/gtk/ScintillaGTK.cxx Mon Jun 12 13:49:46 2017 +1000 -@@ -1775,7 +1775,11 @@ - // If mouse released on scroll bar then the position is relative to the - // scrollbar, not the drawing window so just repeat the most recent point. - pt = sciThis->ptMouseLast; -- sciThis->ButtonUp(pt, event->time, (event->state & GDK_CONTROL_MASK) != 0); -+ const int modifiers = ModifierFlags( -+ (event->state & GDK_SHIFT_MASK) != 0, -+ (event->state & GDK_CONTROL_MASK) != 0, -+ (event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0); -+ sciThis->ButtonUpWithModifiers(pt, event->time, modifiers); - } - } catch (...) { - sciThis->errorStatus = SC_STATUS_FAILURE; -@@ -1912,10 +1916,11 @@ - //Platform::DebugPrintf("Move %x %x %d %c %d %d\n", - // sciThis,event->window,event->time,event->is_hint? 'h' :'.', x, y); - Point pt(x, y); -- int modifiers = ((event->state & GDK_SHIFT_MASK) != 0 ? SCI_SHIFT : 0) | -- ((event->state & GDK_CONTROL_MASK) != 0 ? SCI_CTRL : 0) | -- ((event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0 ? SCI_ALT : 0); -- sciThis->ButtonMoveWithModifiers(pt, modifiers); -+ const int modifiers = ModifierFlags( -+ (event->state & GDK_SHIFT_MASK) != 0, -+ (event->state & GDK_CONTROL_MASK) != 0, -+ (event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0); -+ sciThis->ButtonMoveWithModifiers(pt, event->time, modifiers); - } catch (...) { - sciThis->errorStatus = SC_STATUS_FAILURE; - } -diff -r 2d4cb83e9297 -r af83baede430 qt/ScintillaEditBase/ScintillaEditBase.cpp ---- a/qt/ScintillaEditBase/ScintillaEditBase.cpp Mon Jun 12 12:49:30 2017 +1000 -+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp Mon Jun 12 13:49:46 2017 +1000 -@@ -241,7 +241,9 @@ - bool alt = QApplication::keyboardModifiers() & Qt::AltModifier; - - bool consumed = false; -- bool added = sqt->KeyDown(key, shift, ctrl, alt, &consumed) != 0; -+ bool added = sqt->KeyDownWithModifiers(key, -+ ScintillaQt::ModifierFlags(shift, ctrl, alt), -+ &consumed) != 0; - if (!consumed) - consumed = added; - -@@ -314,24 +316,19 @@ - bool alt = QApplication::keyboardModifiers() & Qt::AltModifier; - #endif - -- sqt->ButtonDown(pos, time.elapsed(), shift, ctrl, alt); -+ sqt->ButtonDownWithModifiers(pos, time.elapsed(), ScintillaQt::ModifierFlags(shift, ctrl, alt)); - } - - if (event->button() == Qt::RightButton) { -- bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier; -- bool ctrl = QApplication::keyboardModifiers() & Qt::ControlModifier; -- bool alt = QApplication::keyboardModifiers() & Qt::AltModifier; -- -- sqt->RightButtonDownWithModifiers(pos, time.elapsed(), ScintillaQt::ModifierFlags(shift, ctrl, alt)); -+ sqt->RightButtonDownWithModifiers(pos, time.elapsed(), ModifiersOfKeyboard()); - } - } - - void ScintillaEditBase::mouseReleaseEvent(QMouseEvent *event) - { - Point point = PointFromQPoint(event->pos()); -- bool ctrl = QApplication::keyboardModifiers() & Qt::ControlModifier; - if (event->button() == Qt::LeftButton) -- sqt->ButtonUp(point, time.elapsed(), ctrl); -+ sqt->ButtonUpWithModifiers(point, time.elapsed(), ModifiersOfKeyboard()); - - int pos = send(SCI_POSITIONFROMPOINT, point.x, point.y); - int line = send(SCI_LINEFROMPOSITION, pos); -@@ -361,9 +358,9 @@ - bool alt = QApplication::keyboardModifiers() & Qt::AltModifier; - #endif - -- int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | (alt ? SCI_ALT : 0); -+ const int modifiers = ScintillaQt::ModifierFlags(shift, ctrl, alt); - -- sqt->ButtonMoveWithModifiers(pos, modifiers); -+ sqt->ButtonMoveWithModifiers(pos, time.elapsed(), modifiers); - } - - void ScintillaEditBase::contextMenuEvent(QContextMenuEvent *event) -@@ -794,3 +791,12 @@ - { - emit command(wParam, lParam); - } -+ -+int ScintillaEditBase::ModifiersOfKeyboard() const -+{ -+ const bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier; -+ const bool ctrl = QApplication::keyboardModifiers() & Qt::ControlModifier; -+ const bool alt = QApplication::keyboardModifiers() & Qt::AltModifier; -+ -+ return ScintillaQt::ModifierFlags(shift, ctrl, alt); -+} -diff -r 2d4cb83e9297 -r af83baede430 qt/ScintillaEditBase/ScintillaEditBase.h ---- a/qt/ScintillaEditBase/ScintillaEditBase.h Mon Jun 12 12:49:30 2017 +1000 -+++ b/qt/ScintillaEditBase/ScintillaEditBase.h Mon Jun 12 13:49:46 2017 +1000 -@@ -147,6 +147,7 @@ - static bool IsHangul(const QChar qchar); - void MoveImeCarets(int offset); - void DrawImeIndicator(int indicator, int len); -+ int ModifiersOfKeyboard() const; - }; - - #ifdef SCI_NAMESPACE -diff -r 2d4cb83e9297 -r af83baede430 src/Editor.cxx ---- a/src/Editor.cxx Mon Jun 12 12:49:30 2017 +1000 -+++ b/src/Editor.cxx Mon Jun 12 13:49:46 2017 +1000 -@@ -2340,10 +2340,6 @@ - NotifyParent(scn); - } - --void Editor::NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt) { -- NotifyDoubleClick(pt, ModifierFlags(shift, ctrl, alt)); --} -- - void Editor::NotifyHotSpotDoubleClicked(Sci::Position position, int modifiers) { - SCNotification scn = {}; - scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK; -@@ -2352,10 +2348,6 @@ - NotifyParent(scn); - } - --void Editor::NotifyHotSpotDoubleClicked(Sci::Position position, bool shift, bool ctrl, bool alt) { -- NotifyHotSpotDoubleClicked(position, ModifierFlags(shift, ctrl, alt)); --} -- - void Editor::NotifyHotSpotClicked(Sci::Position position, int modifiers) { - SCNotification scn = {}; - scn.nmhdr.code = SCN_HOTSPOTCLICK; -@@ -2364,10 +2356,6 @@ - NotifyParent(scn); - } - --void Editor::NotifyHotSpotClicked(Sci::Position position, bool shift, bool ctrl, bool alt) { -- NotifyHotSpotClicked(position, ModifierFlags(shift, ctrl, alt)); --} -- - void Editor::NotifyHotSpotReleaseClick(Sci::Position position, int modifiers) { - SCNotification scn = {}; - scn.nmhdr.code = SCN_HOTSPOTRELEASECLICK; -@@ -2376,10 +2364,6 @@ - NotifyParent(scn); - } - --void Editor::NotifyHotSpotReleaseClick(Sci::Position position, bool shift, bool ctrl, bool alt) { -- NotifyHotSpotReleaseClick(position, ModifierFlags(shift, ctrl, alt)); --} -- - bool Editor::NotifyUpdateUI() { - if (needUpdateUI) { - SCNotification scn = {}; -@@ -2410,10 +2394,6 @@ - } - } - --void Editor::NotifyIndicatorClick(bool click, Sci::Position position, bool shift, bool ctrl, bool alt) { -- NotifyIndicatorClick(click, position, ModifierFlags(shift, ctrl, alt)); --} -- - bool Editor::NotifyMarginClick(Point pt, int modifiers) { - const int marginClicked = vs.MarginFromLocation(pt); - if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) { -@@ -2452,10 +2432,6 @@ - } - } - --bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) { -- return NotifyMarginClick(pt, ModifierFlags(shift, ctrl, alt)); --} -- - bool Editor::NotifyMarginRightClick(Point pt, int modifiers) { - int marginRightClicked = vs.MarginFromLocation(pt); - if ((marginRightClicked >= 0) && vs.ms[marginRightClicked].sensitive) { -@@ -3882,10 +3858,6 @@ - } - } - --int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) { -- return KeyDownWithModifiers(key, ModifierFlags(shift, ctrl, alt), consumed); --} -- - void Editor::Indent(bool forwards) { - UndoGroup ug(pdoc); - for (size_t r=0; r<sel.Count(); r++) { -@@ -4630,10 +4602,6 @@ - return; - } - --void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) { -- return ButtonDownWithModifiers(pt, curTime, ModifierFlags(shift, ctrl, alt)); --} -- - bool Editor::PositionIsHotspot(Sci::Position position) const { - return vs.styles[pdoc->StyleIndexAt(position)].hotspot; - } -@@ -4703,7 +4671,7 @@ - return hotspot; - } - --void Editor::ButtonMoveWithModifiers(Point pt, int modifiers) { -+void Editor::ButtonMoveWithModifiers(Point pt, unsigned int, int modifiers) { - if ((ptMouseLast.x != pt.x) || (ptMouseLast.y != pt.y)) { - DwellEnd(true); - } -@@ -4830,11 +4798,7 @@ - } - } - --void Editor::ButtonMove(Point pt) { -- ButtonMoveWithModifiers(pt, 0); --} -- --void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) { -+void Editor::ButtonUpWithModifiers(Point pt, unsigned int curTime, int modifiers) { - //Platform::DebugPrintf("ButtonUp %d %d\n", HaveMouseCapture(), inDragDrop); - SelectionPosition newPos = SPositionFromLocation(pt, false, false, - AllowVirtualSpace(virtualSpaceOptions, sel.IsRectangular())); -@@ -4851,7 +4815,7 @@ - hotSpotClickPos = INVALID_POSITION; - SelectionPosition newCharPos = SPositionFromLocation(pt, false, true, false); - newCharPos = MovePositionOutsideChar(newCharPos, -1); -- NotifyHotSpotReleaseClick(newCharPos.Position(), ctrl ? SCI_CTRL : 0); -+ NotifyHotSpotReleaseClick(newCharPos.Position(), modifiers & SCI_CTRL); - } - if (HaveMouseCapture()) { - if (PointInSelMargin(pt)) { -@@ -4872,7 +4836,7 @@ - if (selStart < selEnd) { - if (drag.Length()) { - const int length = static_cast<int>(drag.Length()); -- if (ctrl) { -+ if (modifiers & SCI_CTRL) { - const Sci::Position lengthInserted = pdoc->InsertString( - newPos.Position(), drag.Data(), length); - if (lengthInserted > 0) { -@@ -4929,7 +4893,7 @@ - void Editor::Tick() { - if (HaveMouseCapture()) { - // Auto scroll -- ButtonMove(ptMouseLast); -+ ButtonMoveWithModifiers(ptMouseLast, 0, 0); - } - if (caret.period > 0) { - timer.ticksToWait -= timer.tickSize; -@@ -4996,7 +4960,7 @@ - break; - case tickScroll: - // Auto scroll -- ButtonMove(ptMouseLast); -+ ButtonMoveWithModifiers(ptMouseLast, 0, 0); - break; - case tickWiden: - SetScrollBars(); -diff -r 2d4cb83e9297 -r af83baede430 src/Editor.h ---- a/src/Editor.h Mon Jun 12 12:49:30 2017 +1000 -+++ b/src/Editor.h Mon Jun 12 13:49:46 2017 +1000 -@@ -425,19 +425,13 @@ - void NotifySavePoint(bool isSavePoint); - void NotifyModifyAttempt(); - virtual void NotifyDoubleClick(Point pt, int modifiers); -- virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt); - void NotifyHotSpotClicked(Sci::Position position, int modifiers); -- void NotifyHotSpotClicked(Sci::Position position, bool shift, bool ctrl, bool alt); - void NotifyHotSpotDoubleClicked(Sci::Position position, int modifiers); -- void NotifyHotSpotDoubleClicked(Sci::Position position, bool shift, bool ctrl, bool alt); - void NotifyHotSpotReleaseClick(Sci::Position position, int modifiers); -- void NotifyHotSpotReleaseClick(Sci::Position position, bool shift, bool ctrl, bool alt); - bool NotifyUpdateUI(); - void NotifyPainted(); - void NotifyIndicatorClick(bool click, Sci::Position position, int modifiers); -- void NotifyIndicatorClick(bool click, Sci::Position position, bool shift, bool ctrl, bool alt); - bool NotifyMarginClick(Point pt, int modifiers); -- bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt); - bool NotifyMarginRightClick(Point pt, int modifiers); - void NotifyNeedShown(Sci::Position pos, Sci::Position len); - void NotifyDwelling(Point pt, bool state); -@@ -476,7 +470,6 @@ - virtual int KeyCommand(unsigned int iMessage); - virtual int KeyDefault(int /* key */, int /*modifiers*/); - int KeyDownWithModifiers(int key, int modifiers, bool *consumed); -- int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed=0); - - void Indent(bool forwards); - -@@ -510,10 +503,8 @@ - void MouseLeave(); - virtual void ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); - virtual void RightButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); -- virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); -- void ButtonMoveWithModifiers(Point pt, int modifiers); -- void ButtonMove(Point pt); -- void ButtonUp(Point pt, unsigned int curTime, bool ctrl); -+ void ButtonMoveWithModifiers(Point pt, unsigned int curTime, int modifiers); -+ void ButtonUpWithModifiers(Point pt, unsigned int curTime, int modifiers); - - void Tick(); - bool Idle(); -diff -r 2d4cb83e9297 -r af83baede430 src/ScintillaBase.cxx ---- a/src/ScintillaBase.cxx Mon Jun 12 12:49:30 2017 +1000 -+++ b/src/ScintillaBase.cxx Mon Jun 12 13:49:46 2017 +1000 -@@ -537,10 +537,6 @@ - Editor::ButtonDownWithModifiers(pt, curTime, modifiers); - } - --void ScintillaBase::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) { -- ButtonDownWithModifiers(pt, curTime, ModifierFlags(shift, ctrl, alt)); --} -- - void ScintillaBase::RightButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers) { - CancelModes(); - Editor::RightButtonDownWithModifiers(pt, curTime, modifiers); -diff -r 2d4cb83e9297 -r af83baede430 src/ScintillaBase.h ---- a/src/ScintillaBase.h Mon Jun 12 12:49:30 2017 +1000 -+++ b/src/ScintillaBase.h Mon Jun 12 13:49:46 2017 +1000 -@@ -88,7 +88,6 @@ - void ContextMenu(Point pt); - - void ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); -- void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); - void RightButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers); - - void NotifyStyleToNeeded(Sci::Position endStyleNeeded); -diff -r 2d4cb83e9297 -r af83baede430 win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Mon Jun 12 12:49:30 2017 +1000 -+++ b/win32/ScintillaWin.cxx Mon Jun 12 13:49:46 2017 +1000 -@@ -156,7 +156,7 @@ - return Point::FromInts(pt.x, pt.y); - } - --static Point PointFromLong(long lpoint) { -+static Point PointFromLParam(sptr_t lpoint) { - return Point(static_cast<short>(LOWORD(lpoint)), static_cast<short>(HIWORD(lpoint))); - } - -@@ -305,6 +305,8 @@ - - bool DragThreshold(Point ptStart, Point ptNow) override; - void StartDrag() override; -+ static int MouseModifiers(uptr_t wParam); -+ - Sci::Position TargetAsUTF8(char *text); - void AddCharUTF16(wchar_t const *wcs, unsigned int wclen); - Sci::Position EncodedFromUTF8(char *utf8, char *encoded) const; -@@ -632,6 +634,12 @@ - SetDragPosition(SelectionPosition(Sci::invalidPosition)); - } - -+int ScintillaWin::MouseModifiers(uptr_t wParam) { -+ return ModifierFlags((wParam & MK_SHIFT) != 0, -+ (wParam & MK_CONTROL) != 0, -+ KeyboardIsKeyDown(VK_MENU)); -+} -+ - // Avoid warnings everywhere for old style casts by concentrating them here - static WORD LoWord(uptr_t l) { - return LOWORD(l); -@@ -1388,24 +1396,19 @@ - // KeyboardIsKeyDown(VK_CONTROL), - // KeyboardIsKeyDown(VK_MENU)); - ::SetFocus(MainHWND()); -- ButtonDown(PointFromLong(static_cast<long>(lParam)), ::GetMessageTime(), -- (wParam & MK_SHIFT) != 0, -- (wParam & MK_CONTROL) != 0, -- KeyboardIsKeyDown(VK_MENU)); -+ ButtonDownWithModifiers(PointFromLParam(lParam), ::GetMessageTime(), -+ MouseModifiers(wParam)); - } - break; - - case WM_MOUSEMOVE: { -- const Point pt = PointFromLong(static_cast<long>(lParam)); -+ const Point pt = PointFromLParam(lParam); - - // Windows might send WM_MOUSEMOVE even though the mouse has not been moved: - // http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx - if (ptMouseLast.x != pt.x || ptMouseLast.y != pt.y) { - SetTrackMouseLeaveEvent(true); -- ButtonMoveWithModifiers(pt, -- ((wParam & MK_SHIFT) != 0 ? SCI_SHIFT : 0) | -- ((wParam & MK_CONTROL) != 0 ? SCI_CTRL : 0) | -- (KeyboardIsKeyDown(VK_MENU) ? SCI_ALT : 0)); -+ ButtonMoveWithModifiers(pt, ::GetMessageTime(), MouseModifiers(wParam)); - } - } - break; -@@ -1416,22 +1419,19 @@ - return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam); - - case WM_LBUTTONUP: -- ButtonUp(PointFromLong(static_cast<long>(lParam)), -- ::GetMessageTime(), -- (wParam & MK_CONTROL) != 0); -+ ButtonUpWithModifiers(PointFromLParam(lParam), -+ ::GetMessageTime(), MouseModifiers(wParam)); - break; - - case WM_RBUTTONDOWN: { - ::SetFocus(MainHWND()); -- Point pt = PointFromLong(static_cast<long>(lParam)); -+ Point pt = PointFromLParam(lParam); - if (!PointInSelection(pt)) { - CancelModes(); -- SetEmptySelection(PositionFromLocation(PointFromLong(static_cast<long>(lParam)))); -+ SetEmptySelection(PositionFromLocation(PointFromLParam(lParam))); - } - -- RightButtonDownWithModifiers(pt, ::GetMessageTime(), ModifierFlags((wParam & MK_SHIFT) != 0, -- (wParam & MK_CONTROL) != 0, -- KeyboardIsKeyDown(VK_MENU))); -+ RightButtonDownWithModifiers(pt, ::GetMessageTime(), MouseModifiers(wParam)); - } - break; - -@@ -1494,10 +1494,10 @@ - case WM_KEYDOWN: { - //Platform::DebugPrintf("S keydown %d %x %x %x %x\n",iMessage, wParam, lParam, ::IsKeyDown(VK_SHIFT), ::IsKeyDown(VK_CONTROL)); - lastKeyDownConsumed = false; -- const int ret = KeyDown(KeyTranslate(static_cast<int>(wParam)), -- KeyboardIsKeyDown(VK_SHIFT), -+ const int ret = KeyDownWithModifiers(KeyTranslate(static_cast<int>(wParam)), -+ ModifierFlags(KeyboardIsKeyDown(VK_SHIFT), - KeyboardIsKeyDown(VK_CONTROL), -- KeyboardIsKeyDown(VK_MENU), -+ KeyboardIsKeyDown(VK_MENU)), - &lastKeyDownConsumed); - if (!ret && !lastKeyDownConsumed) { - return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam); -@@ -1581,7 +1581,7 @@ - } - - case WM_CONTEXTMENU: { -- Point pt = PointFromLong(static_cast<long>(lParam)); -+ Point pt = PointFromLParam(lParam); - POINT rpt = {static_cast<int>(pt.x), static_cast<int>(pt.y)}; - ::ScreenToClient(MainHWND(), &rpt); - const Point ptClient = PointFromPOINT(rpt); -@@ -3358,7 +3358,7 @@ - return 0; - } else if (iMessage == WM_LBUTTONDOWN) { - // This does not fire due to the hit test code -- sciThis->ct.MouseClick(PointFromLong(static_cast<long>(lParam))); -+ sciThis->ct.MouseClick(PointFromLParam(lParam)); - sciThis->CallTipClick(); - return 0; - } else if (iMessage == WM_SETCURSOR) { diff --git a/src/scintilla_backports/6317_82cb780a04d1.patch b/src/scintilla_backports/6317_82cb780a04d1.patch deleted file mode 100644 index f3660d1b..00000000 --- a/src/scintilla_backports/6317_82cb780a04d1.patch +++ /dev/null @@ -1,53 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1497328847 -36000 -# Node ID 82cb780a04d12256758fc545b35779dc971d2de6 -# Parent 44fa26c9177437cd9d12ecbed3c9d6f9e1985a89 -Bug [#1949]. Fix drawing failure in wrap mode for delete to start/end of line. - -diff -r 44fa26c91774 -r 82cb780a04d1 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Tue Jun 13 14:33:53 2017 +1000 -+++ b/doc/ScintillaHistory.html Tue Jun 13 14:40:47 2017 +1000 -@@ -547,6 +547,11 @@ - <a href="http://sourceforge.net/p/scintilla/bugs/1919/">Bug #1919</a>. - </li> - <li> -+ Fix drawing failure when in wrap mode for delete to start/end of line which -+ affects later lines but did not redraw them. -+ <a href="http://sourceforge.net/p/scintilla/bugs/1949/">Bug #1949</a>. -+ </li> -+ <li> - On Qt, mouse tracking is reenabled when the window is reshown. - <a href="http://sourceforge.net/p/scintilla/bugs/1948/">Bug #1948</a>. - </li> -diff -r 44fa26c91774 -r 82cb780a04d1 src/Editor.cxx ---- a/src/Editor.cxx Tue Jun 13 14:33:53 2017 +1000 -+++ b/src/Editor.cxx Tue Jun 13 14:40:47 2017 +1000 -@@ -818,8 +818,11 @@ - const Sci::Line currentLine = pdoc->LineFromPosition(newPos.Position()); - if (ensureVisible) { - // In case in need of wrapping to ensure DisplayFromDoc works. -- if (currentLine >= wrapPending.start) -- WrapLines(wsAll); -+ if (currentLine >= wrapPending.start) { -+ if (WrapLines(wsAll)) { -+ Redraw(); -+ } -+ } - XYScrollPosition newXY = XYScrollToMakeVisible( - SelectionRange(posDrag.IsValid() ? posDrag : newPos), xysDefault); - if (previousPos.IsValid() && (newXY.xOffset == xOffset)) { -@@ -5290,8 +5293,11 @@ - void Editor::EnsureLineVisible(Sci::Line lineDoc, bool enforcePolicy) { - - // In case in need of wrapping to ensure DisplayFromDoc works. -- if (lineDoc >= wrapPending.start) -- WrapLines(wsAll); -+ if (lineDoc >= wrapPending.start) { -+ if (WrapLines(wsAll)) { -+ Redraw(); -+ } -+ } - - if (!cs.GetVisible(lineDoc)) { - // Back up to find a non-blank line diff --git a/src/scintilla_backports/6323_8d56eaef4f0a.patch b/src/scintilla_backports/6323_8d56eaef4f0a.patch deleted file mode 100644 index e8f1a3e4..00000000 --- a/src/scintilla_backports/6323_8d56eaef4f0a.patch +++ /dev/null @@ -1,69 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1497838218 -36000 -# Node ID 8d56eaef4f0a8807f083d8a3e0d5f5738d43bd20 -# Parent a3b66b2525e795e352cc02daa3a30d19a3d86e39 -The default encoding is now UTF-8. - -diff -r a3b66b2525e7 -r 8d56eaef4f0a doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Sat Jun 17 10:23:38 2017 +1000 -+++ b/doc/ScintillaDoc.html Mon Jun 19 12:10:18 2017 +1000 -@@ -3684,14 +3684,15 @@ - - <p><b id="SCI_SETCODEPAGE">SCI_SETCODEPAGE(int codePage)</b><br /> - <b id="SCI_GETCODEPAGE">SCI_GETCODEPAGE → int</b><br /> -- Scintilla has some support for Japanese, Chinese and Korean DBCS. Use this message with -+ Scintilla supports UTF-8, Japanese, Chinese and Korean DBCS along with single byte encodings like Latin-1. -+ UTF-8 (<code>SC_CP_UTF8</code>) is the default. Use this message with - <code class="parameter">codePage</code> set to the code page number to set Scintilla to use code page information -- to ensure double byte characters are treated as one character rather than two. This also stops -- the caret from moving between the two bytes in a double byte character. -- Do not use this message to choose between different single byte character sets: it doesn't do that. -+ to ensure multiple byte characters are treated as one character rather than multiple. This also stops -+ the caret from moving between the bytes in a multi-byte character. -+ Do not use this message to choose between different single byte character sets - use -+ <a class="seealso" href="#SCI_STYLESETCHARACTERSET">SCI_STYLESETCHARACTERSET</a>. - Call with -- <code class="parameter">codePage</code> set to zero to disable DBCS support. The default is -- <code>SCI_SETCODEPAGE(0)</code>.</p> -+ <code class="parameter">codePage</code> set to zero to disable multi-byte support.</p> - - <p>Code page <code>SC_CP_UTF8</code> (65001) sets Scintilla into Unicode mode with the document - treated as a sequence of characters expressed in UTF-8. The text is converted to the platform's -@@ -3700,9 +3701,8 @@ - horizontal space, such as Thai, will mostly work but there are some issues where the characters - are drawn separately leading to visual glitches. Bi-directional text is not supported. </p> - -- <p>Code page can be set to 932 (Japanese Shift-JIS), 936 (Simplified Chinese GBK), -- 949 (Korean Unified Hangul Code), 950 (Traditional Chinese Big5), or 1361 (Korean Johab) -- although these may require installation of language specific support.</p> -+ <p>Code page can be set to 65001 (UTF-8), 932 (Japanese Shift-JIS), 936 (Simplified Chinese GBK), -+ 949 (Korean Unified Hangul Code), 950 (Traditional Chinese Big5), or 1361 (Korean Johab).</p> - - <p><b id="SCI_SETIMEINTERACTION">SCI_SETIMEINTERACTION(int imeInteraction)</b><br /> - <b id="SCI_GETIMEINTERACTION">SCI_GETIMEINTERACTION → int</b><br /> -diff -r a3b66b2525e7 -r 8d56eaef4f0a doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sat Jun 17 10:23:38 2017 +1000 -+++ b/doc/ScintillaHistory.html Mon Jun 19 12:10:18 2017 +1000 -@@ -536,6 +536,9 @@ - Support dropped for GTK+ versions before 2.24. - </li> - <li> -+ The default encoding in Scintilla is UTF-8. -+ </li> -+ <li> - An SCN_AUTOCSELECTIONCHANGE notification is sent when items are highlighted in an autocompletion or user list. - </li> - <li> -diff -r a3b66b2525e7 -r 8d56eaef4f0a src/Document.cxx ---- a/src/Document.cxx Sat Jun 17 10:23:38 2017 +1000 -+++ b/src/Document.cxx Mon Jun 19 12:10:18 2017 +1000 -@@ -101,7 +101,7 @@ - #else - eolMode = SC_EOL_LF; - #endif -- dbcsCodePage = 0; -+ dbcsCodePage = SC_CP_UTF8; - lineEndBitSet = SC_LINE_END_TYPE_DEFAULT; - endStyled = 0; - styleClock = 0; diff --git a/src/scintilla_backports/6327_95346e626cf8.patch b/src/scintilla_backports/6327_95346e626cf8.patch deleted file mode 100644 index cea1ff0d..00000000 --- a/src/scintilla_backports/6327_95346e626cf8.patch +++ /dev/null @@ -1,1794 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1498107131 -36000 -# Node ID 95346e626cf85a564bf2277197ab4915a4ef2932 -# Parent c15f84c11e1770cdbeeb1aaf5e88b068b5304292 -Cast between Sci_Position.h types used for lexers and Position.h types used in -core to allow the Sci_Position.h types to widen to 64-bits. - -diff -r c15f84c11e17 -r 95346e626cf8 src/Document.cxx ---- a/src/Document.cxx Thu Jun 22 14:36:26 2017 +1000 -+++ b/src/Document.cxx Thu Jun 22 14:52:11 2017 +1000 -@@ -62,7 +62,7 @@ - // code looks for child lines which may trigger styling. - performingStyle = true; - -- Sci::Position lengthDoc = pdoc->Length(); -+ Sci::Position lengthDoc = static_cast<Sci::Position>(pdoc->Length()); - if (end == -1) - end = lengthDoc; - Sci::Position len = end - start; -@@ -302,7 +302,7 @@ - int Document::AddMark(Sci::Line line, int markerNum) { - if (line >= 0 && line <= LinesTotal()) { - const int prev = static_cast<LineMarkers *>(perLineData[ldMarkers])-> - AddMark(line, markerNum, LinesTotal()); -- DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); -+ DocModification mh(SC_MOD_CHANGEMARKER, static_cast<Sci::Position>(LineStart(line)), 0, 0, 0, line); - NotifyModified(mh); - return prev; -@@ -319,13 +319,13 @@ - if (m & 1) - static_cast<LineMarkers *>(perLineData[ldMarkers])-> - AddMark(line, i, LinesTotal()); -- DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); -+ DocModification mh(SC_MOD_CHANGEMARKER, static_cast<Sci::Position>(LineStart(line)), 0, 0, 0, line); - NotifyModified(mh); - } - - void Document::DeleteMark(Sci::Line line, int markerNum) { - static_cast<LineMarkers *>(perLineData[ldMarkers])->DeleteMark(line, markerNum, false); -- DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); -+ DocModification mh(SC_MOD_CHANGEMARKER, static_cast<Sci::Position>(LineStart(line)), 0, 0, 0, line); - NotifyModified(mh); - } - -@@ -354,7 +354,7 @@ - } - - Sci_Position SCI_METHOD Document::LineStart(Sci_Position line) const { -- return cb.LineStart(line); -+ return cb.LineStart(static_cast<Sci::Line>(line)); - } - - bool Document::IsLineStartPosition(Sci::Position position) const { -@@ -365,7 +365,7 @@ - if (line >= LinesTotal() - 1) { - return LineStart(line + 1); - } else { -- Sci::Position position = LineStart(line + 1); -+ Sci::Position position = static_cast<Sci::Position>(LineStart(line + 1)); - if (SC_CP_UTF8 == dbcsCodePage) { - const unsigned char bytes[] = { - static_cast<unsigned char>(cb.CharAt(position-3)), -@@ -396,11 +396,11 @@ - } - - Sci_Position SCI_METHOD Document::LineFromPosition(Sci_Position pos) const { -- return cb.LineFromPosition(pos); -+ return cb.LineFromPosition(static_cast<Sci::Position>(pos)); - } - - Sci::Position Document::LineEndPosition(Sci::Position position) const { -- return LineEnd(LineFromPosition(position)); -+ return static_cast<Sci::Position>(LineEnd(LineFromPosition(position))); - } - - bool Document::IsLineEndPosition(Sci::Position position) const { -@@ -412,9 +412,9 @@ - } - - Sci::Position Document::VCHomePosition(Sci::Position position) const { -- Sci::Line line = LineFromPosition(position); -- Sci::Position startPosition = LineStart(line); -- const Sci::Position endLine = LineEnd(line); -+ Sci::Line line = static_cast<Sci::Line>(LineFromPosition(position)); -+ Sci::Position startPosition = static_cast<Sci::Position>(LineStart(line)); -+ const Sci::Position endLine = static_cast<Sci::Position>(LineEnd(line)); - Sci::Position startText = startPosition; - while (startText < endLine && (cb.CharAt(startText) == ' ' || cb.CharAt(startText) == '\t')) - startText++; -@@ -425,10 +425,10 @@ - } - - int SCI_METHOD Document::SetLevel(Sci_Position line, int level) { -- const int prev = static_cast<LineLevels *>(perLineData[ldLevels])->SetLevel(line, level, LinesTotal()); -+ const int prev = static_cast<LineLevels *>(perLineData[ldLevels])->SetLevel(static_cast<Sci::Line>(line), level, LinesTotal()); - if (prev != level) { - DocModification mh(SC_MOD_CHANGEFOLD | SC_MOD_CHANGEMARKER, -- LineStart(line), 0, 0, 0, line); -+ static_cast<Sci::Position>(LineStart(line)), 0, 0, 0, static_cast<Sci::Line>(line)); - mh.foldLevelNow = level; - mh.foldLevelPrev = prev; - NotifyModified(mh); -@@ -437,7 +437,7 @@ - } - - int SCI_METHOD Document::GetLevel(Sci_Position line) const { -- return static_cast<LineLevels *>(perLineData[ldLevels])->GetLevel(line); -+ return static_cast<LineLevels *>(perLineData[ldLevels])->GetLevel(static_cast<Sci::Line>(line)); - } - - void Document::ClearLevels() { -@@ -458,7 +458,7 @@ - const Sci::Line lookLastLine = (lastLine != -1) ? std::min(LinesTotal() - 1, lastLine) : -1; - Sci::Line lineMaxSubord = lineParent; - while (lineMaxSubord < maxLine - 1) { -- EnsureStyledTo(LineStart(lineMaxSubord + 2)); -+ EnsureStyledTo(static_cast<Sci::Position>(LineStart(lineMaxSubord + 2))); - if (!IsSubordinate(level, GetLevel(lineMaxSubord + 1))) - break; - if ((lookLastLine != -1) && (lineMaxSubord >= lookLastLine) && !(GetLevel(lineMaxSubord) & SC_FOLDLEVELWHITEFLAG)) -@@ -583,7 +583,7 @@ - } else if (SC_CP_UTF8 == dbcsCodePage) { - const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(pos)); - const int widthCharBytes = UTF8BytesOfLead[leadByte]; -- Sci::Position lengthDoc = Length(); -+ Sci::Position lengthDoc = static_cast<Sci::Position>(Length()); - if ((pos + widthCharBytes) > lengthDoc) - return lengthDoc - pos; - else -@@ -633,7 +633,7 @@ - if (pos <= 0) - return 0; - if (pos >= Length()) -- return Length(); -+ return static_cast<Sci::Position>(Length()); - - // PLATFORM_ASSERT(pos > 0 && pos < Length()); - if (checkLineEnd && IsCrLf(pos - 1)) { -@@ -662,7 +662,7 @@ - } else { - // Anchor DBCS calculations at start of line because start of line can - // not be a DBCS trail byte. -- const Sci::Position posStartLine = LineStart(LineFromPosition(pos)); -+ const Sci::Position posStartLine = static_cast<Sci::Position>(LineStart(LineFromPosition(pos))); - if (pos == posStartLine) - return pos; - -@@ -700,7 +700,7 @@ - if (pos + increment <= 0) - return 0; - if (pos + increment >= Length()) -- return Length(); -+ return static_cast<Sci::Position>(Length()); - - if (dbcsCodePage) { - if (SC_CP_UTF8 == dbcsCodePage) { -@@ -741,11 +741,11 @@ - int mbsize = IsDBCSLeadByte(cb.CharAt(pos)) ? 2 : 1; - pos += mbsize; - if (pos > Length()) -- pos = Length(); -+ pos = static_cast<Sci::Position>(Length()); - } else { - // Anchor DBCS calculations at start of line because start of line can - // not be a DBCS trail byte. -- const Sci::Position posStartLine = LineStart(LineFromPosition(pos)); -+ const Sci::Position posStartLine = static_cast<Sci::Position>(LineStart(LineFromPosition(pos))); - // See http://msdn.microsoft.com/en-us/library/cc194792%28v=MSDN.10%29.aspx - // http://msdn.microsoft.com/en-us/library/cc194790.aspx - if ((pos - 1) <= posStartLine) { -@@ -856,7 +856,7 @@ - - // Return -1 on out-of-bounds - Sci_Position SCI_METHOD Document::GetRelativePosition(Sci_Position positionStart, Sci_Position characterOffset) const { -- Sci::Position pos = positionStart; -+ Sci::Position pos = static_cast<Sci::Position>(positionStart); - if (dbcsCodePage) { - const int increment = (characterOffset > 0) ? 1 : -1; - while (characterOffset != 0) { -@@ -867,7 +867,7 @@ - characterOffset -= increment; - } - } else { -- pos = positionStart + characterOffset; -+ pos = static_cast<Sci::Position>(positionStart + characterOffset); - if ((pos < 0) || (pos > Length())) - return INVALID_POSITION; - } -@@ -899,7 +899,8 @@ - int character; - int bytesInCharacter = 1; - if (dbcsCodePage) { -- const unsigned char leadByte = static_cast<unsigned char>(cb.CharAt(position)); -+ const unsigned char leadByte = static_cast<unsigned char>( -+ cb.CharAt(static_cast<Sci::Position>(position))); - if (SC_CP_UTF8 == dbcsCodePage) { - if (UTF8IsAscii(leadByte)) { - // Single byte character or invalid -@@ -908,7 +909,8 @@ - const int widthCharBytes = UTF8BytesOfLead[leadByte]; - unsigned char charBytes[UTF8MaxBytes] = {leadByte,0,0,0}; - for (int b=1; b<widthCharBytes; b++) -- charBytes[b] = static_cast<unsigned char>(cb.CharAt(position+b)); -+ charBytes[b] = static_cast<unsigned char>( -+ cb.CharAt(static_cast<Sci::Position>(position+b))); - const int utf8status = UTF8Classify(charBytes, widthCharBytes); - if (utf8status & UTF8MaskInvalid) { - // Report as singleton surrogate values which are invalid Unicode -@@ -921,13 +923,14 @@ - } else { - if (IsDBCSLeadByte(leadByte)) { - bytesInCharacter = 2; -- character = (leadByte << 8) | static_cast<unsigned char>(cb.CharAt(position+1)); -+ character = (leadByte << 8) | static_cast<unsigned char>( -+ cb.CharAt(static_cast<Sci::Position>(position+1))); - } else { - character = leadByte; - } - } - } else { -- character = cb.CharAt(position); -+ character = cb.CharAt(static_cast<Sci::Position>(position)); - } - if (pWidth) { - *pWidth = bytesInCharacter; -@@ -1137,8 +1140,8 @@ - - int SCI_METHOD Document::AddData(char *data, Sci_Position length) { - try { -- Sci::Position position = Length(); -- InsertString(position, data, length); -+ Sci::Position position = static_cast<Sci::Position>(Length()); -+ InsertString(position, data, static_cast<Sci::Position>(length)); - } catch (std::bad_alloc &) { - return SC_STATUS_BADALLOC; - } catch (...) { -@@ -1335,8 +1338,8 @@ - int SCI_METHOD Document::GetLineIndentation(Sci_Position line) { - int indent = 0; - if ((line >= 0) && (line < LinesTotal())) { -- const Sci::Position lineStart = LineStart(line); -- const Sci::Position length = Length(); -+ const Sci::Position lineStart = static_cast<Sci::Position>(LineStart(line)); -+ const Sci::Position length = static_cast<Sci::Position>(Length()); - for (Sci::Position i = lineStart; i < length; i++) { - const char ch = cb.CharAt(i); - if (ch == ' ') -@@ -1356,7 +1359,7 @@ - indent = 0; - if (indent != indentOfLine) { - std::string linebuf = CreateIndentation(indent, tabInChars, !useTabs); -- Sci::Position thisLineStart = LineStart(line); -+ Sci::Position thisLineStart = static_cast<Sci::Position>(LineStart(line)); - Sci::Position indentPos = GetLineIndentPosition(line); - UndoGroup ug(this); - DeleteChars(thisLineStart, indentPos - thisLineStart); -@@ -1370,8 +1373,8 @@ - Sci::Position Document::GetLineIndentPosition(Sci::Line line) const { - if (line < 0) - return 0; -- Sci::Position pos = LineStart(line); -- const Sci::Position length = Length(); -+ Sci::Position pos = static_cast<Sci::Position>(LineStart(line)); -+ const Sci::Position length = static_cast<Sci::Position>(Length()); - while ((pos < length) && IsSpaceOrTab(cb.CharAt(pos))) { - pos++; - } -@@ -1380,9 +1383,9 @@ - - Sci::Position Document::GetColumn(Sci::Position pos) { - Sci::Position column = 0; -- Sci::Line line = LineFromPosition(pos); -+ Sci::Line line = static_cast<Sci::Line>(LineFromPosition(pos)); - if ((line >= 0) && (line < LinesTotal())) { -- for (Sci::Position i = LineStart(line); i < pos;) { -+ for (Sci::Position i = static_cast<Sci::Position>(LineStart(line)); i < pos;) { - const char ch = cb.CharAt(i); - if (ch == '\t') { - column = NextTab(column, tabInChars); -@@ -1430,7 +1433,7 @@ - } - - Sci::Position Document::FindColumn(Sci::Line line, Sci::Position column) { -- Sci::Position position = LineStart(line); -+ Sci::Position position = static_cast<Sci::Position>(LineStart(line)); - if ((line >= 0) && (line < LinesTotal())) { - Sci::Position columnCurrent = 0; - while ((columnCurrent < column) && (position < Length())) { -@@ -1530,8 +1533,8 @@ - } - - bool Document::IsWhiteLine(Sci::Line line) const { -- Sci::Position currentChar = LineStart(line); -- const Sci::Position endLine = LineEnd(line); -+ Sci::Position currentChar = static_cast<Sci::Position>(LineStart(line)); -+ const Sci::Position endLine = static_cast<Sci::Position>(LineEnd(line)); - while (currentChar < endLine) { - if (cb.CharAt(currentChar) != ' ' && cb.CharAt(currentChar) != '\t') { - return false; -@@ -1542,7 +1545,7 @@ - } - - Sci::Position Document::ParaUp(Sci::Position pos) const { -- Sci::Line line = LineFromPosition(pos); -+ Sci::Line line = static_cast<Sci::Line>(LineFromPosition(pos)); - line--; - while (line >= 0 && IsWhiteLine(line)) { // skip empty lines - line--; -@@ -1551,11 +1554,11 @@ - line--; - } - line++; -- return LineStart(line); -+ return static_cast<Sci::Position>(LineStart(line)); - } - - Sci::Position Document::ParaDown(Sci::Position pos) const { -- Sci::Line line = LineFromPosition(pos); -+ Sci::Line line = static_cast<Sci::Line>(LineFromPosition(pos)); - while (line < LinesTotal() && !IsWhiteLine(line)) { // skip non-empty lines - line++; - } -@@ -1563,9 +1566,9 @@ - line++; - } - if (line < LinesTotal()) -- return LineStart(line); -+ return static_cast<Sci::Position>(LineStart(line)); - else // end of a document -- return LineEnd(line-1); -+ return static_cast<Sci::Position>(LineEnd(line-1)); - } - - bool Document::IsASCIIWordByte(unsigned char ch) const { -@@ -2040,12 +2043,12 @@ - } else { - enteredStyling++; - Sci::Position prevEndStyled = endStyled; -- if (cb.SetStyleFor(endStyled, length, style)) { -+ if (cb.SetStyleFor(static_cast<Sci::Position>(endStyled), static_cast<Sci::Position>(length), style)) { - DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER, -- prevEndStyled, length); -+ prevEndStyled, static_cast<Sci::Position>(length)); - NotifyModified(mh); - } -- endStyled += length; -+ endStyled += static_cast<Sci::Position>(length); - enteredStyling--; - return true; - } -@@ -2083,8 +2086,8 @@ - if ((enteredStyling == 0) && (pos > GetEndStyled())) { - IncrementStyleClock(); - if (pli && !pli->UseContainerLexing()) { -- Sci::Line lineEndStyled = LineFromPosition(GetEndStyled()); -- Sci::Position endStyledTo = LineStart(lineEndStyled); -+ Sci::Line lineEndStyled = static_cast<Sci::Line>(LineFromPosition(GetEndStyled())); -+ Sci::Position endStyledTo = static_cast<Sci::Position>(LineStart(lineEndStyled)); - pli->Colourise(endStyledTo, pos); - } else { - // Ask the watchers to style, and stop as soon as one responds. -@@ -2106,11 +2109,11 @@ - // Most recent value contributes 25% to smoothed value. - const double alpha = 0.25; - -- const Sci::Line lineFirst = LineFromPosition(GetEndStyled()); -+ const Sci::Line lineFirst = static_cast<Sci::Line>(LineFromPosition(GetEndStyled())); - ElapsedTime etStyling; - EnsureStyledTo(pos); - const double durationStyling = etStyling.Duration(); -- const Sci::Line lineLast = LineFromPosition(GetEndStyled()); -+ const Sci::Line lineLast = static_cast<Sci::Line>(LineFromPosition(GetEndStyled())); - if (lineLast >= lineFirst + 8) { - // Only adjust for styling multiple lines to avoid instability - const double durationOneLine = durationStyling / (lineLast - lineFirst); -@@ -2139,16 +2142,17 @@ - } - - int SCI_METHOD Document::SetLineState(Sci_Position line, int state) { -- const int statePrevious = static_cast<LineState *>(perLineData[ldState])->SetLineState(line, state); -+ const int statePrevious = static_cast<LineState *>(perLineData[ldState])->SetLineState(static_cast<Sci::Line>(line), state); - if (state != statePrevious) { -- DocModification mh(SC_MOD_CHANGELINESTATE, LineStart(line), 0, 0, 0, line); -+ DocModification mh(SC_MOD_CHANGELINESTATE, static_cast<Sci::Position>(LineStart(line)), 0, 0, 0, -+ static_cast<Sci::Line>(line)); - NotifyModified(mh); - } - return statePrevious; - } - - int SCI_METHOD Document::GetLineState(Sci_Position line) const { -- return static_cast<LineState *>(perLineData[ldState])->GetLineState(line); -+ return static_cast<LineState *>(perLineData[ldState])->GetLineState(static_cast<Sci::Line>(line)); - } - - Sci::Line Document::GetMaxLineState() const { -@@ -2156,7 +2160,8 @@ - } - - void SCI_METHOD Document::ChangeLexerState(Sci_Position start, Sci_Position end) { -- DocModification mh(SC_MOD_LEXERSTATE, start, end-start, 0, 0, 0); -+ DocModification mh(SC_MOD_LEXERSTATE, static_cast<Sci::Position>(start), -+ static_cast<Sci::Position>(end-start), 0, 0, 0); - NotifyModified(mh); - } - -@@ -2168,18 +2173,21 @@ - - void Document::MarginSetText(Sci::Line line, const char *text) { - static_cast<LineAnnotation *>(perLineData[ldMargin])->SetText(line, text); -- DocModification mh(SC_MOD_CHANGEMARGIN, LineStart(line), 0, 0, 0, line); -+ DocModification mh(SC_MOD_CHANGEMARGIN, static_cast<Sci::Position>(LineStart(line)), -+ 0, 0, 0, line); - NotifyModified(mh); - } - - void Document::MarginSetStyle(Sci::Line line, int style) { - static_cast<LineAnnotation *>(perLineData[ldMargin])->SetStyle(line, style); -- NotifyModified(DocModification(SC_MOD_CHANGEMARGIN, LineStart(line), 0, 0, 0, line)); -+ NotifyModified(DocModification(SC_MOD_CHANGEMARGIN, static_cast<Sci::Position>(LineStart(line)), -+ 0, 0, 0, line)); - } - - void Document::MarginSetStyles(Sci::Line line, const unsigned char *styles) { - static_cast<LineAnnotation *>(perLineData[ldMargin])->SetStyles(line, styles); -- NotifyModified(DocModification(SC_MOD_CHANGEMARGIN, LineStart(line), 0, 0, 0, line)); -+ NotifyModified(DocModification(SC_MOD_CHANGEMARGIN, static_cast<Sci::Position>(LineStart(line)), -+ 0, 0, 0, line)); - } - - void Document::MarginClearAll() { -@@ -2201,7 +2209,8 @@ - const Sci::Line linesBefore = AnnotationLines(line); - Annotations()->SetText(line, text); - const int linesAfter = AnnotationLines(line); -- DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line), 0, 0, 0, line); -+ DocModification mh(SC_MOD_CHANGEANNOTATION, static_cast<Sci::Position>(LineStart(line)), -+ 0, 0, 0, line); - mh.annotationLinesAdded = linesAfter - linesBefore; - NotifyModified(mh); - } -@@ -2209,7 +2218,7 @@ - - void Document::AnnotationSetStyle(Sci::Line line, int style) { - static_cast<LineAnnotation *>(perLineData[ldAnnotation])->SetStyle(line, style); -- DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line), 0, 0, 0, line); -+ DocModification mh(SC_MOD_CHANGEANNOTATION, static_cast<Sci::Position>(LineStart(line)), 0, 0, 0, line); - NotifyModified(mh); - } - -@@ -2240,9 +2249,11 @@ - } - - void SCI_METHOD Document::DecorationFillRange(Sci_Position position, int value, Sci_Position fillLength) { -- if (decorations.FillRange(position, value, fillLength)) { -+ Sci::Position sciPosition = static_cast<Sci::Position>(position); -+ Sci::Position sciFillLength = static_cast<Sci::Position>(fillLength); -+ if (decorations.FillRange(sciPosition, value, sciFillLength)) { - DocModification mh(SC_MOD_CHANGEINDICATOR | SC_PERFORMED_USER, -- position, fillLength); -+ sciPosition, sciFillLength); - NotifyModified(mh); - } - } -@@ -2387,7 +2398,7 @@ - - Sci::Position Document::WordPartRight(Sci::Position pos) const { - CharacterExtracted ceStart = CharacterAfter(pos); -- const Sci::Position length = Length(); -+ const Sci::Position length = static_cast<Sci::Position>(Length()); - if (IsWordPartSeparator(ceStart.character)) { - while (pos < length && IsWordPartSeparator(CharacterAfter(pos).character)) - pos += CharacterAfter(pos).widthBytes; -@@ -2538,25 +2549,25 @@ - startPos = doc->MovePositionOutsideChar(minPos, 1, false); - endPos = doc->MovePositionOutsideChar(maxPos, 1, false); - -- lineRangeStart = doc->LineFromPosition(startPos); -- lineRangeEnd = doc->LineFromPosition(endPos); -+ lineRangeStart = static_cast<Sci::Line>(doc->LineFromPosition(startPos)); -+ lineRangeEnd = static_cast<Sci::Line>(doc->LineFromPosition(endPos)); - if ((increment == 1) && - (startPos >= doc->LineEnd(lineRangeStart)) && - (lineRangeStart < lineRangeEnd)) { - // the start position is at end of line or between line end characters. - lineRangeStart++; -- startPos = doc->LineStart(lineRangeStart); -+ startPos = static_cast<Sci::Position>(doc->LineStart(lineRangeStart)); - } else if ((increment == -1) && - (startPos <= doc->LineStart(lineRangeStart)) && - (lineRangeStart > lineRangeEnd)) { - // the start position is at beginning of line. - lineRangeStart--; -- startPos = doc->LineEnd(lineRangeStart); -+ startPos = static_cast<Sci::Position>(doc->LineEnd(lineRangeStart)); - } - lineRangeBreak = lineRangeEnd + increment; - } - Range LineRange(Sci::Line line) const { -- Range range(doc->LineStart(line), doc->LineEnd(line)); -+ Range range(static_cast<Sci::Position>(doc->LineStart(line)), static_cast<Sci::Position>(doc->LineEnd(line))); - if (increment == 1) { - if (line == lineRangeStart) - range.start = startPos; -@@ -2976,8 +2987,8 @@ - const char searchEnd = s[*length - 1]; - const char searchEndPrev = (*length > 1) ? s[*length - 2] : '\0'; - for (Sci::Line line = resr.lineRangeStart; line != resr.lineRangeBreak; line += resr.increment) { -- Sci::Position startOfLine = doc->LineStart(line); -- Sci::Position endOfLine = doc->LineEnd(line); -+ Sci::Position startOfLine = static_cast<Sci::Position>(doc->LineStart(line)); -+ Sci::Position endOfLine = static_cast<Sci::Position>(doc->LineEnd(line)); - if (resr.increment == 1) { - if (line == resr.lineRangeStart) { - if ((resr.startPos != startOfLine) && (s[0] == '^')) -@@ -3034,7 +3045,7 @@ - - const char *BuiltinRegex::SubstituteByPosition(Document *doc, const char *text, Sci::Position *length) { - substituted.clear(); -- DocumentIndexer di(doc, doc->Length()); -+ DocumentIndexer di(doc, static_cast<Sci::Position>(doc->Length())); - search.GrabMatches(di); - for (int j = 0; j < *length; j++) { - if (text[j] == '\\') { -diff -r c15f84c11e17 -r 95346e626cf8 src/Document.h ---- a/src/Document.h Thu Jun 22 14:36:26 2017 +1000 -+++ b/src/Document.h Thu Jun 22 14:52:11 2017 +1000 -@@ -360,10 +360,10 @@ - - char CharAt(Sci::Position position) const { return cb.CharAt(position); } - void SCI_METHOD GetCharRange(char *buffer, Sci_Position position, Sci_Position lengthRetrieve) const { -- cb.GetCharRange(buffer, position, lengthRetrieve); -+ cb.GetCharRange(buffer, static_cast<Sci::Position>(position), static_cast<Sci::Position>(lengthRetrieve)); - } -- char SCI_METHOD StyleAt(Sci_Position position) const { return cb.StyleAt(position); } -- int StyleIndexAt(Sci_Position position) const { return static_cast<unsigned char>(cb.StyleAt(position)); } -+ char SCI_METHOD StyleAt(Sci_Position position) const { return cb.StyleAt(static_cast<Sci::Position>(position)); } -+ int StyleIndexAt(Sci_Position position) const { return static_cast<unsigned char>(cb.StyleAt(static_cast<Sci::Position>(position))); } - void GetStyleRange(unsigned char *buffer, Sci::Position position, Sci::Position lengthRetrieve) const { - cb.GetStyleRange(buffer, position, lengthRetrieve); - } -diff -r c15f84c11e17 -r 95346e626cf8 src/EditView.cxx ---- a/src/EditView.cxx Thu Jun 22 14:36:26 2017 +1000 -+++ b/src/EditView.cxx Thu Jun 22 14:52:11 2017 +1000 -@@ -339,10 +339,10 @@ - } - - LineLayout *EditView::RetrieveLineLayout(Sci::Line lineNumber, const EditModel &model) { -- Sci::Position posLineStart = model.pdoc->LineStart(lineNumber); -- Sci::Position posLineEnd = model.pdoc->LineStart(lineNumber + 1); -+ Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(lineNumber)); -+ Sci::Position posLineEnd = static_cast<Sci::Position>(model.pdoc->LineStart(lineNumber + 1)); - PLATFORM_ASSERT(posLineEnd >= posLineStart); -- Sci::Line lineCaret = model.pdoc->LineFromPosition(model.sel.MainCaret()); -+ Sci::Line lineCaret = static_cast<Sci::Line>(model.pdoc->LineFromPosition(model.sel.MainCaret())); - return llc.Retrieve(lineNumber, lineCaret, - posLineEnd - posLineStart, model.pdoc->GetStyleClock(), - model.LinesOnScreen() + 1, model.pdoc->LinesTotal()); -@@ -359,8 +359,8 @@ - - PLATFORM_ASSERT(line < model.pdoc->LinesTotal()); - PLATFORM_ASSERT(ll->chars != NULL); -- Sci::Position posLineStart = model.pdoc->LineStart(line); -- Sci::Position posLineEnd = model.pdoc->LineStart(line + 1); -+ Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(line)); -+ Sci::Position posLineEnd = static_cast<Sci::Position>(model.pdoc->LineStart(line + 1)); - // If the line is very long, limit the treatment to a length that should fit in the viewport - if (posLineEnd >(posLineStart + ll->maxLineLength)) { - posLineEnd = posLineStart + ll->maxLineLength; -@@ -368,7 +368,7 @@ - if (ll->validity == LineLayout::llCheckTextAndStyle) { - Sci::Position lineLength = posLineEnd - posLineStart; - if (!vstyle.viewEOL) { -- lineLength = model.pdoc->LineEnd(line) - posLineStart; -+ lineLength = static_cast<Sci::Position>(model.pdoc->LineEnd(line)) - posLineStart; - } - if (lineLength == ll->numCharsInLine) { - // See if chars, styles, indicators, are all the same -@@ -427,7 +427,7 @@ - const int lineLength = posLineEnd - posLineStart; - model.pdoc->GetCharRange(ll->chars, posLineStart, lineLength); - model.pdoc->GetStyleRange(ll->styles, posLineStart, lineLength); -- const int numCharsBeforeEOL = model.pdoc->LineEnd(line) - posLineStart; -+ const int numCharsBeforeEOL = static_cast<Sci::Position>(model.pdoc->LineEnd(line)) - posLineStart; - const int numCharsInLine = (vstyle.viewEOL) ? lineLength : numCharsBeforeEOL; - for (Sci::Position styleInLine = 0; styleInLine < numCharsInLine; styleInLine++) { - const unsigned char styleByte = ll->styles[styleInLine]; -@@ -598,12 +598,12 @@ - Point pt; - if (pos.Position() == INVALID_POSITION) - return pt; -- Sci::Line lineDoc = model.pdoc->LineFromPosition(pos.Position()); -- Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); -+ Sci::Line lineDoc = static_cast<Sci::Line>(model.pdoc->LineFromPosition(pos.Position())); -+ Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc)); - if ((pe & peLineEnd) && (lineDoc > 0) && (pos.Position() == posLineStart)) { - // Want point at end of first line - lineDoc--; -- posLineStart = model.pdoc->LineStart(lineDoc); -+ posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc)); - } - const Sci::Line lineVisible = model.cs.DisplayFromDoc(lineDoc); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); -@@ -624,7 +624,7 @@ - return rangeSubLine; - } - const Sci::Line lineDoc = model.cs.DocFromDisplay(lineVisible); -- const Sci::Position positionLineStart = model.pdoc->LineStart(lineDoc); -+ const Sci::Position positionLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc)); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); -@@ -633,7 +633,7 @@ - if (subLine < ll->lines) { - rangeSubLine = ll->SubLineRange(subLine); - if (subLine == ll->lines-1) { -- rangeSubLine.end = model.pdoc->LineStart(lineDoc + 1) - -+ rangeSubLine.end = static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc + 1)) - - positionLineStart; - } - } -@@ -652,8 +652,9 @@ - if (canReturnInvalid && (lineDoc < 0)) - return SelectionPosition(INVALID_POSITION); - if (lineDoc >= model.pdoc->LinesTotal()) -- return SelectionPosition(canReturnInvalid ? INVALID_POSITION : model.pdoc->Length()); -- const Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); -+ return SelectionPosition(canReturnInvalid ? INVALID_POSITION : -+ static_cast<Sci::Position>(model.pdoc->Length())); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc)); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); -@@ -696,7 +697,7 @@ - SelectionPosition EditView::SPositionFromLineX(Surface *surface, const EditModel &model, Sci::Line lineDoc, int x, const ViewStyle &vs) { - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { -- const Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc)); - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); - const Range rangeSubLine = ll->SubLineRange(0); - const XYPOSITION subLineStart = ll->positions[rangeSubLine.start]; -@@ -713,12 +714,12 @@ - } - - Sci::Line EditView::DisplayFromPosition(Surface *surface, const EditModel &model, Sci::Position pos, const ViewStyle &vs) { -- const Sci::Line lineDoc = model.pdoc->LineFromPosition(pos); -+ const Sci::Line lineDoc = static_cast<Sci::Line>(model.pdoc->LineFromPosition(pos)); - Sci::Line lineDisplay = model.cs.DisplayFromDoc(lineDoc); - AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc, model)); - if (surface && ll) { - LayoutLine(model, lineDoc, surface, vs, ll, model.wrapWidth); -- const Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc)); - const Sci::Position posInLine = pos - posLineStart; - lineDisplay--; // To make up for first increment ahead. - for (int subLine = 0; subLine < ll->lines; subLine++) { -@@ -731,11 +732,11 @@ - } - - Sci::Position EditView::StartEndDisplayLine(Surface *surface, const EditModel &model, Sci::Position pos, bool start, const ViewStyle &vs) { -- const Sci::Line line = model.pdoc->LineFromPosition(pos); -+ const Sci::Line line = static_cast<Sci::Line>(model.pdoc->LineFromPosition(pos)); - AutoLineLayout ll(llc, RetrieveLineLayout(line, model)); - Sci::Position posRet = INVALID_POSITION; - if (surface && ll) { -- const Sci::Position posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(line)); - LayoutLine(model, line, surface, vs, ll, model.wrapWidth); - const Sci::Position posInLine = pos - posLineStart; - if (posInLine <= ll->maxLineLength) { -@@ -862,14 +863,14 @@ - PRectangle rcLine, Sci::Line line, Sci::Position lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart, - ColourOptional background) { - -- const Sci::Position posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(line)); - PRectangle rcSegment = rcLine; - - const bool lastSubLine = subLine == (ll->lines - 1); - XYPOSITION virtualSpace = 0; - if (lastSubLine) { - const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; -- virtualSpace = model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)) * spaceWidth; -+ virtualSpace = model.sel.VirtualSpaceFor(static_cast<Sci::Position>(model.pdoc->LineEnd(line))) * spaceWidth; - } - const XYPOSITION xEol = static_cast<XYPOSITION>(ll->positions[lineEnd] - subLineStart); - -@@ -879,7 +880,9 @@ - rcSegment.right = xEol + xStart + virtualSpace; - surface->FillRectangle(rcSegment, background.isSet ? background : vsDraw.styles[ll->styles[ll->numCharsInLine]].back); - if (!hideSelection && ((vsDraw.selAlpha == SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA))) { -- SelectionSegment virtualSpaceRange(SelectionPosition(model.pdoc->LineEnd(line)), SelectionPosition(model.pdoc->LineEnd(line), model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)))); -+ SelectionSegment virtualSpaceRange(SelectionPosition(static_cast<Sci::Position>(model.pdoc->LineEnd(line))), -+ SelectionPosition(static_cast<Sci::Position>(model.pdoc->LineEnd(line)), -+ model.sel.VirtualSpaceFor(static_cast<Sci::Position>(model.pdoc->LineEnd(line))))); - for (size_t r = 0; r<model.sel.Count(); r++) { - const int alpha = (r == model.sel.Main()) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - if (alpha == SC_ALPHA_NOALPHA) { -@@ -902,7 +905,7 @@ - int eolInSelection = 0; - int alpha = SC_ALPHA_NOALPHA; - if (!hideSelection) { -- Sci::Position posAfterLineEnd = model.pdoc->LineStart(line + 1); -+ Sci::Position posAfterLineEnd = static_cast<Sci::Position>(model.pdoc->LineStart(line + 1)); - eolInSelection = (lastSubLine == true) ? model.sel.InSelectionForEOL(posAfterLineEnd) : 0; - alpha = (eolInSelection == 1) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - } -@@ -1039,7 +1042,7 @@ - static void DrawIndicators(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, - Sci::Line line, int xStart, PRectangle rcLine, int subLine, Sci::Position lineEnd, bool under, Sci::Position hoverIndicatorPos) { - // Draw decorators -- const Sci::Position posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(line)); - const Sci::Position lineStart = ll->LineStart(subLine); - const Sci::Position posLineEnd = posLineStart + lineEnd; - -@@ -1109,13 +1112,14 @@ - int eolInSelection = 0; - int alpha = SC_ALPHA_NOALPHA; - if (!hideSelection) { -- Sci::Position posAfterLineEnd = model.pdoc->LineStart(line + 1); -+ Sci::Position posAfterLineEnd = static_cast<Sci::Position>(model.pdoc->LineStart(line + 1)); - eolInSelection = (subLine == (ll->lines - 1)) ? model.sel.InSelectionForEOL(posAfterLineEnd) : 0; - alpha = (eolInSelection == 1) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - } - - const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth; -- XYPOSITION virtualSpace = model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)) * spaceWidth; -+ XYPOSITION virtualSpace = model.sel.VirtualSpaceFor( -+ static_cast<Sci::Position>(model.pdoc->LineEnd(line))) * spaceWidth; - rcSegment.left = xStart + static_cast<XYPOSITION>(ll->positions[ll->numCharsInLine] - subLineStart) + virtualSpace + vsDraw.aveCharWidth; - rcSegment.right = rcSegment.left + static_cast<XYPOSITION>(widthFoldDisplayText); - -@@ -1316,7 +1320,7 @@ - const bool drawDrag = model.posDrag.IsValid(); - if (hideSelection && !drawDrag) - return; -- const Sci::Position posLineStart = model.pdoc->LineStart(lineDoc); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc)); - // For each selection draw - for (size_t r = 0; (r<model.sel.Count()) || drawDrag; r++) { - const bool mainCaret = r == model.sel.Main(); -@@ -1550,12 +1554,12 @@ - static void DrawTranslucentSelection(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, - Sci::Line line, PRectangle rcLine, int subLine, Range lineRange, int xStart) { - if ((vsDraw.selAlpha != SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha != SC_ALPHA_NOALPHA)) { -- const Sci::Position posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(line)); - const XYACCUMULATOR subLineStart = ll->positions[lineRange.start]; - // For each selection draw - Sci::Position virtualSpaces = 0; - if (subLine == (ll->lines - 1)) { -- virtualSpaces = model.sel.VirtualSpaceFor(model.pdoc->LineEnd(line)); -+ virtualSpaces = model.sel.VirtualSpaceFor(static_cast<Sci::Position>(model.pdoc->LineEnd(line))); - } - const SelectionPosition posStart(posLineStart + lineRange.start); - const SelectionPosition posEnd(posLineStart + lineRange.end, virtualSpaces); -@@ -1815,7 +1819,7 @@ - Sci::Line line, Sci::Line lineVisible, PRectangle rcLine, int xStart, int subLine) { - if ((vsDraw.viewIndentationGuides == ivLookForward || vsDraw.viewIndentationGuides == ivLookBoth) - && (subLine == 0)) { -- const Sci::Position posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(line)); - int indentSpace = model.pdoc->GetLineIndentation(line); - int xStartText = static_cast<int>(ll->positions[model.pdoc->GetLineIndentPosition(line) - posLineStart]); - -@@ -1876,7 +1880,7 @@ - // See if something overrides the line background color. - const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret); - -- const Sci::Position posLineStart = model.pdoc->LineStart(line); -+ const Sci::Position posLineStart = static_cast<Sci::Position>(model.pdoc->LineStart(line)); - - const Range lineRange = ll->SubLineRange(subLine); - const XYACCUMULATOR subLineStart = ll->positions[lineRange.start]; -@@ -1990,7 +1994,7 @@ - SelectionPosition posCaret = model.sel.RangeMain().caret; - if (model.posDrag.IsValid()) - posCaret = model.posDrag; -- const Sci::Line lineCaret = model.pdoc->LineFromPosition(posCaret.Position()); -+ const Sci::Line lineCaret = static_cast<Sci::Line>(model.pdoc->LineFromPosition(posCaret.Position())); - - PRectangle rcTextArea = rcClient; - if (vsDraw.marginInside) { -@@ -2060,7 +2064,8 @@ - rcLine.top = static_cast<XYPOSITION>(ypos); - rcLine.bottom = static_cast<XYPOSITION>(ypos + vsDraw.lineHeight); - -- Range rangeLine(model.pdoc->LineStart(lineDoc), model.pdoc->LineStart(lineDoc + 1)); -+ Range rangeLine(static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc)), -+ static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc + 1))); - - // Highlight the current braces if any - ll->SetBracesHighlight(rangeLine, model.braces, static_cast<char>(model.bracesMatchStyle), -@@ -2149,7 +2154,7 @@ - int eolInSelection = 0; - int alpha = SC_ALPHA_NOALPHA; - if (!hideSelection) { -- Sci::Position posAfterLineEnd = model.pdoc->LineStart(line + 1); -+ Sci::Position posAfterLineEnd = static_cast<Sci::Position>(model.pdoc->LineStart(line + 1)); - eolInSelection = (subLine == (ll->lines - 1)) ? model.sel.InSelectionForEOL(posAfterLineEnd) : 0; - alpha = (eolInSelection == 1) ? vsDraw.selAlpha : vsDraw.selAdditionalAlpha; - } -@@ -2258,19 +2263,21 @@ - vsPrint.Refresh(*surfaceMeasure, model.pdoc->tabInChars); // Recalculate fixedColumnWidth - } - -- Sci::Line linePrintStart = model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMin)); -+ Sci::Line linePrintStart = static_cast<Sci::Line>( -+ model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMin))); - Sci::Line linePrintLast = linePrintStart + (pfr->rc.bottom - pfr->rc.top) / vsPrint.lineHeight - 1; - if (linePrintLast < linePrintStart) - linePrintLast = linePrintStart; -- Sci::Line linePrintMax = model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMax)); -+ Sci::Line linePrintMax = static_cast<Sci::Line>( -+ model.pdoc->LineFromPosition(static_cast<int>(pfr->chrg.cpMax))); - if (linePrintLast > linePrintMax) - linePrintLast = linePrintMax; - //Platform::DebugPrintf("Formatting lines=[%0d,%0d,%0d] top=%0d bottom=%0d line=%0d %0d\n", - // linePrintStart, linePrintLast, linePrintMax, pfr->rc.top, pfr->rc.bottom, vsPrint.lineHeight, - // surfaceMeasure->Height(vsPrint.styles[STYLE_LINENUMBER].font)); -- Sci::Position endPosPrint = model.pdoc->Length(); -+ Sci::Position endPosPrint = static_cast<Sci::Position>(model.pdoc->Length()); - if (linePrintLast < model.pdoc->LinesTotal()) -- endPosPrint = model.pdoc->LineStart(linePrintLast + 1); -+ endPosPrint = static_cast<Sci::Position>(model.pdoc->LineStart(linePrintLast + 1)); - - // Ensure we are styled to where we are formatting. - model.pdoc->EnsureStyledTo(endPosPrint); -@@ -2296,7 +2303,7 @@ - - // Copy this line and its styles from the document into local arrays - // and determine the x position at which each character starts. -- LineLayout ll(model.pdoc->LineStart(lineDoc + 1) - model.pdoc->LineStart(lineDoc) + 1); -+ LineLayout ll(static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc + 1) - model.pdoc->LineStart(lineDoc) + 1)); - LayoutLine(model, lineDoc, surfaceMeasure, vsPrint, &ll, widthPrint); - - ll.containsCaret = false; -@@ -2311,7 +2318,8 @@ - // to start printing from to ensure a particular position is on the first - // line of the page. - if (visibleLine == 0) { -- const Sci::Position startWithinLine = nPrintPos - model.pdoc->LineStart(lineDoc); -+ const Sci::Position startWithinLine = nPrintPos - -+ static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc)); - for (int iwl = 0; iwl < ll.lines - 1; iwl++) { - if (ll.LineStart(iwl) <= startWithinLine && ll.LineStart(iwl + 1) >= startWithinLine) { - visibleLine = -iwl; -@@ -2355,7 +2363,7 @@ - } - visibleLine++; - if (iwl == ll.lines - 1) -- nPrintPos = model.pdoc->LineStart(lineDoc + 1); -+ nPrintPos = static_cast<Sci::Position>(model.pdoc->LineStart(lineDoc + 1)); - else - nPrintPos += ll.LineStart(iwl + 1) - ll.LineStart(iwl); - } -diff -r c15f84c11e17 -r 95346e626cf8 src/Editor.cxx ---- a/src/Editor.cxx Thu Jun 22 14:36:26 2017 +1000 -+++ b/src/Editor.cxx Thu Jun 22 14:52:11 2017 +1000 -@@ -357,7 +357,7 @@ - if (sp.Position() < 0) { - return SelectionPosition(0); - } else if (sp.Position() > pdoc->Length()) { -- return SelectionPosition(pdoc->Length()); -+ return SelectionPosition(static_cast<Sci::Position>(pdoc->Length())); - } else { - // If not at end of line then set offset to 0 - if (!pdoc->IsLineEndPosition(sp.Position())) -@@ -418,7 +418,7 @@ - SelectionPosition Editor::SPositionFromLineX(Sci::Line lineDoc, int x) { - RefreshStyleData(); - if (lineDoc >= pdoc->LinesTotal()) -- return SelectionPosition(pdoc->Length()); -+ return SelectionPosition(static_cast<Sci::Position>(pdoc->Length())); - //Platform::DebugPrintf("Position of (%d,%d) line = %d top=%d\n", pt.x, pt.y, line, topLine); - AutoSurface surface(this); - return view.SPositionFromLineX(surface, *this, lineDoc, x, vs); -@@ -437,7 +437,7 @@ - topLine = topLineNew; - ContainerNeedsUpdate(SC_UPDATE_V_SCROLL); - } -- posTopLine = pdoc->LineStart(cs.DocFromDisplay(topLine)); -+ posTopLine = static_cast<Sci::Position>(pdoc->LineStart(cs.DocFromDisplay(topLine))); - } - - /** -@@ -500,7 +500,7 @@ - rcMarkers.right = rcMarkers.left + vs.fixedColumnWidth; - } - if (line != -1) { -- PRectangle rcLine = RectangleFromRange(Range(pdoc->LineStart(line)), 0); -+ PRectangle rcLine = RectangleFromRange(Range(static_cast<Sci::Position>(pdoc->LineStart(line))), 0); - - // Inflate line rectangle if there are image markers with height larger than line height - if (vs.largestMarkerHeight > vs.lineHeight) { -@@ -529,8 +529,10 @@ - } - - PRectangle Editor::RectangleFromRange(Range r, int overlap) { -- const Sci::Line minLine = cs.DisplayFromDoc(pdoc->LineFromPosition(r.First())); -- const Sci::Line maxLine = cs.DisplayLastFromDoc(pdoc->LineFromPosition(r.Last())); -+ const Sci::Line minLine = cs.DisplayFromDoc( -+ static_cast<Sci::Line>(pdoc->LineFromPosition(r.First()))); -+ const Sci::Line maxLine = cs.DisplayLastFromDoc( -+ static_cast<Sci::Line>(pdoc->LineFromPosition(r.Last()))); - const PRectangle rcClientDrawing = GetClientDrawingRectangle(); - PRectangle rc; - const int leftTextOverlap = ((xOffset == 0) && (vs.leftMarginWidth > 0)) ? 1 : 0; -@@ -572,8 +574,10 @@ - if (sel.selType == Selection::selThin) { - xCaret = xAnchor; - } -- const Sci::Line lineAnchorRect = pdoc->LineFromPosition(sel.Rectangular().anchor.Position()); -- const Sci::Line lineCaret = pdoc->LineFromPosition(sel.Rectangular().caret.Position()); -+ const Sci::Line lineAnchorRect = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(sel.Rectangular().anchor.Position())); -+ const Sci::Line lineCaret = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(sel.Rectangular().caret.Position())); - const int increment = (lineCaret > lineAnchorRect) ? 1 : -1; - for (Sci::Line line=lineAnchorRect; line != lineCaret+increment; line += increment) { - SelectionRange range(SPositionFromLineX(line, xCaret), SPositionFromLineX(line, xAnchor)); -@@ -626,16 +630,20 @@ - void Editor::SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_) { - currentPos_ = ClampPositionIntoDocument(currentPos_); - anchor_ = ClampPositionIntoDocument(anchor_); -- Sci::Line currentLine = pdoc->LineFromPosition(currentPos_.Position()); -+ Sci::Line currentLine = static_cast<Sci::Line>(pdoc->LineFromPosition(currentPos_.Position())); - /* For Line selection - ensure the anchor and caret are always - at the beginning and end of the region lines. */ - if (sel.selType == Selection::selLines) { - if (currentPos_ > anchor_) { -- anchor_ = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(anchor_.Position()))); -- currentPos_ = SelectionPosition(pdoc->LineEnd(pdoc->LineFromPosition(currentPos_.Position()))); -+ anchor_ = SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineStart(pdoc->LineFromPosition(anchor_.Position())))); -+ currentPos_ = SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineEnd(pdoc->LineFromPosition(currentPos_.Position())))); - } else { -- currentPos_ = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(currentPos_.Position()))); -- anchor_ = SelectionPosition(pdoc->LineEnd(pdoc->LineFromPosition(anchor_.Position()))); -+ currentPos_ = SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineStart(pdoc->LineFromPosition(currentPos_.Position())))); -+ anchor_ = SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineEnd(pdoc->LineFromPosition(anchor_.Position())))); - } - } - SelectionRange rangeNew(currentPos_, anchor_); -@@ -660,7 +668,7 @@ - // Just move the caret on the main selection - void Editor::SetSelection(SelectionPosition currentPos_) { - currentPos_ = ClampPositionIntoDocument(currentPos_); -- Sci::Line currentLine = pdoc->LineFromPosition(currentPos_.Position()); -+ Sci::Line currentLine = static_cast<Sci::Line>(pdoc->LineFromPosition(currentPos_.Position())); - if (sel.Count() > 1 || !(sel.RangeMain().caret == currentPos_)) { - InvalidateSelection(SelectionRange(currentPos_)); - } -@@ -686,7 +694,8 @@ - } - - void Editor::SetEmptySelection(SelectionPosition currentPos_) { -- Sci::Line currentLine = pdoc->LineFromPosition(currentPos_.Position()); -+ Sci::Line currentLine = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(currentPos_.Position())); - SelectionRange rangeNew(ClampPositionIntoDocument(currentPos_)); - if (sel.Count() > 1 || !(sel.RangeMain() == rangeNew)) { - InvalidateSelection(rangeNew); -@@ -815,7 +824,8 @@ - } - - void Editor::MovedCaret(SelectionPosition newPos, SelectionPosition previousPos, bool ensureVisible) { -- const Sci::Line currentLine = pdoc->LineFromPosition(newPos.Position()); -+ const Sci::Line currentLine = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(newPos.Position())); - if (ensureVisible) { - // In case in need of wrapping to ensure DisplayFromDoc works. - if (currentLine >= wrapPending.start) { -@@ -884,7 +894,7 @@ - SelectionPosition Editor::MovePositionSoVisible(SelectionPosition pos, int moveDir) { - pos = ClampPositionIntoDocument(pos); - pos = MovePositionOutsideChar(pos, moveDir); -- Sci::Line lineDoc = pdoc->LineFromPosition(pos.Position()); -+ Sci::Line lineDoc = static_cast<Sci::Line>(pdoc->LineFromPosition(pos.Position())); - if (cs.GetVisible(lineDoc)) { - return pos; - } else { -@@ -892,10 +902,12 @@ - if (moveDir > 0) { - // lineDisplay is already line before fold as lines in fold use display line of line after fold - lineDisplay = Sci::clamp(lineDisplay, 0, cs.LinesDisplayed()); -- return SelectionPosition(pdoc->LineStart(cs.DocFromDisplay(lineDisplay))); -+ return SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineStart(cs.DocFromDisplay(lineDisplay)))); - } else { - lineDisplay = Sci::clamp(lineDisplay - 1, 0, cs.LinesDisplayed()); -- return SelectionPosition(pdoc->LineEnd(cs.DocFromDisplay(lineDisplay))); -+ return SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineEnd(cs.DocFromDisplay(lineDisplay)))); - } - } - } -@@ -965,7 +977,8 @@ - } - - void Editor::VerticalCentreCaret() { -- const Sci::Line lineDoc = pdoc->LineFromPosition(sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret()); -+ const Sci::Line lineDoc = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(sel.IsRectangular() ? sel.Rectangular().caret.Position() : sel.MainCaret())); - const Sci::Line lineDisplay = cs.DisplayFromDoc(lineDoc); - const Sci::Line newTop = lineDisplay - (LinesOnScreen() / 2); - if (topLine != newTop) { -@@ -984,19 +997,19 @@ - - // if selection doesn't start at the beginning of the line, set the new start - Sci::Position selectionStart = SelectionStart().Position(); -- const Sci::Line startLine = pdoc->LineFromPosition(selectionStart); -- const Sci::Position beginningOfStartLine = pdoc->LineStart(startLine); -+ const Sci::Line startLine = static_cast<Sci::Line>(pdoc->LineFromPosition(selectionStart)); -+ const Sci::Position beginningOfStartLine = static_cast<Sci::Position>(pdoc->LineStart(startLine)); - selectionStart = beginningOfStartLine; - - // if selection doesn't end at the beginning of a line greater than that of the start, - // then set it at the beginning of the next one - Sci::Position selectionEnd = SelectionEnd().Position(); -- const Sci::Line endLine = pdoc->LineFromPosition(selectionEnd); -- const Sci::Position beginningOfEndLine = pdoc->LineStart(endLine); -+ const Sci::Line endLine = static_cast<Sci::Line>(pdoc->LineFromPosition(selectionEnd)); -+ const Sci::Position beginningOfEndLine = static_cast<Sci::Position>(pdoc->LineStart(endLine)); - bool appendEol = false; - if (selectionEnd > beginningOfEndLine - || selectionStart == selectionEnd) { -- selectionEnd = pdoc->LineStart(endLine + 1); -+ selectionEnd = static_cast<Sci::Position>(pdoc->LineStart(endLine + 1)); - appendEol = (selectionEnd == pdoc->Length() && pdoc->LineFromPosition(selectionEnd) == endLine); - } - -@@ -1031,7 +1044,7 @@ - - const char *eol = StringFromEOLMode(pdoc->eolMode); - if (currentLine + lineDelta >= pdoc->LinesTotal()) -- pdoc->InsertString(pdoc->Length(), eol, istrlen(eol)); -+ pdoc->InsertString(static_cast<Sci::Position>(pdoc->Length()), eol, istrlen(eol)); - GoToLine(currentLine + lineDelta); - - selectionLength = pdoc->InsertString(CurrentPosition(), selectedText.Data(), selectionLength); -@@ -1521,7 +1534,7 @@ - lineToWrapEnd = std::min(lineToWrapEnd, lineEndNeedWrap); - - // Ensure all lines being wrapped are styled. -- pdoc->EnsureStyledTo(pdoc->LineStart(lineToWrapEnd)); -+ pdoc->EnsureStyledTo(static_cast<Sci::Position>(pdoc->LineStart(lineToWrapEnd))); - - if (lineToWrap < lineToWrapEnd) { - -@@ -1597,15 +1610,15 @@ - const PRectangle rcText = GetTextRectangle(); - pixelWidth = static_cast<int>(rcText.Width()); - } -- Sci::Line lineStart = pdoc->LineFromPosition(targetStart); -- Sci::Line lineEnd = pdoc->LineFromPosition(targetEnd); -+ Sci::Line lineStart = static_cast<Sci::Line>(pdoc->LineFromPosition(targetStart)); -+ Sci::Line lineEnd = static_cast<Sci::Line>(pdoc->LineFromPosition(targetEnd)); - const char *eol = StringFromEOLMode(pdoc->eolMode); - UndoGroup ug(pdoc); - for (Sci::Line line = lineStart; line <= lineEnd; line++) { - AutoSurface surface(this); - AutoLineLayout ll(view.llc, view.RetrieveLineLayout(line, *this)); - if (surface && ll) { -- Sci::Position posLineStart = pdoc->LineStart(line); -+ Sci::Position posLineStart = static_cast<Sci::Position>(pdoc->LineStart(line)); - view.LayoutLine(*this, line, surface, vs, ll, pixelWidth); - Sci::Position lengthInsertedTotal = 0; - for (int subLine = 1; subLine < ll->lines; subLine++) { -@@ -1617,7 +1630,7 @@ - lengthInsertedTotal += lengthInserted; - } - } -- lineEnd = pdoc->LineFromPosition(targetEnd); -+ lineEnd = static_cast<Sci::Line>(pdoc->LineFromPosition(targetEnd)); - } - } - } -@@ -1834,7 +1847,7 @@ - - Sci::Position Editor::RealizeVirtualSpace(Sci::Position position, Sci::Position virtualSpace) { - if (virtualSpace > 0) { -- const Sci::Line line = pdoc->LineFromPosition(position); -+ const Sci::Line line = static_cast<Sci::Line>(pdoc->LineFromPosition(position)); - const Sci::Position indent = pdoc->GetLineIndentPosition(line); - if (indent == position) { - return pdoc->SetLineIndentation(line, pdoc->GetLineIndentation(line) + virtualSpace); -@@ -1915,7 +1928,7 @@ - if (Wrapping()) { - AutoSurface surface(this); - if (surface) { -- if (WrapOneLine(surface, pdoc->LineFromPosition(positionInsert))) { -+ if (WrapOneLine(surface, static_cast<Sci::Line>(pdoc->LineFromPosition(positionInsert)))) { - SetScrollBars(); - SetVerticalScrollPos(); - Redraw(); -@@ -2031,7 +2044,8 @@ - PasteRectangular(sel.Start(), text, len); - } else { - if (shape == pasteLine) { -- Sci::Position insertPos = pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret())); -+ Sci::Position insertPos = static_cast<Sci::Position>( -+ pdoc->LineStart(pdoc->LineFromPosition(sel.MainCaret()))); - Sci::Position lengthInserted = pdoc->InsertString(insertPos, text, len); - // add the newline if necessary - if ((len > 0) && (text[len - 1] != '\n' && text[len - 1] != '\r')) { -@@ -2072,7 +2086,7 @@ - { - UndoGroup ug(pdoc); - if (0 != pdoc->Length()) { -- pdoc->DeleteChars(0, pdoc->Length()); -+ pdoc->DeleteChars(0, static_cast<Sci::Position>(pdoc->Length())); - } - if (!pdoc->IsReadOnly()) { - cs.Clear(); -@@ -2118,7 +2132,7 @@ - } - sel.Clear(); - sel.RangeMain() = SelectionRange(pos); -- Sci::Line line = pdoc->LineFromPosition(sel.MainCaret()); -+ Sci::Line line = static_cast<Sci::Line>(pdoc->LineFromPosition(sel.MainCaret())); - UndoGroup ug(pdoc); - sel.RangeMain().caret = RealizeVirtualSpace(sel.RangeMain().caret); - int xInsert = XFromPosition(sel.RangeMain().caret); -@@ -2131,9 +2145,9 @@ - line++; - if (line >= pdoc->LinesTotal()) { - if (pdoc->eolMode != SC_EOL_LF) -- pdoc->InsertString(pdoc->Length(), "\r", 1); -+ pdoc->InsertString(static_cast<Sci::Position>(pdoc->Length()), "\r", 1); - if (pdoc->eolMode != SC_EOL_CR) -- pdoc->InsertString(pdoc->Length(), "\n", 1); -+ pdoc->InsertString(static_cast<Sci::Position>(pdoc->Length()), "\n", 1); - } - // Pad the end of lines with spaces if required - sel.RangeMain().caret.SetPosition(PositionFromLineX(line, xInsert)); -@@ -2193,7 +2207,7 @@ - - void Editor::SelectAll() { - sel.Clear(); -- SetSelection(0, pdoc->Length()); -+ SetSelection(0, static_cast<Sci::Position>(pdoc->Length())); - Redraw(); - } - -@@ -2230,7 +2244,8 @@ - sel.Range(r).caret.SetVirtualSpace(sel.Range(r).caret.VirtualSpace() - 1); - sel.Range(r).anchor.SetVirtualSpace(sel.Range(r).caret.VirtualSpace()); - } else { -- Sci::Line lineCurrentPos = pdoc->LineFromPosition(sel.Range(r).caret.Position()); -+ Sci::Line lineCurrentPos = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(sel.Range(r).caret.Position())); - if (allowLineStartDeletion || (pdoc->LineStart(lineCurrentPos) != sel.Range(r).caret.Position())) { - if (pdoc->GetColumn(sel.Range(r).caret.Position()) <= pdoc->GetLineIndentation(lineCurrentPos) && - pdoc->GetColumn(sel.Range(r).caret.Position()) > 0 && pdoc->backspaceUnindents) { -@@ -2388,11 +2403,11 @@ - bool Editor::NotifyMarginClick(Point pt, int modifiers) { - const int marginClicked = vs.MarginFromLocation(pt); - if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) { -- Sci::Position position = pdoc->LineStart(LineFromLocation(pt)); -+ Sci::Position position = static_cast<Sci::Position>(pdoc->LineStart(LineFromLocation(pt))); - if ((vs.ms[marginClicked].mask & SC_MASK_FOLDERS) && (foldAutomatic & SC_AUTOMATICFOLD_CLICK)) { - const bool ctrl = (modifiers & SCI_CTRL) != 0; - const bool shift = (modifiers & SCI_SHIFT) != 0; -- Sci::Line lineClick = pdoc->LineFromPosition(position); -+ Sci::Line lineClick = static_cast<Sci::Line>(pdoc->LineFromPosition(position)); - if (shift && ctrl) { - FoldAll(SC_FOLDACTION_TOGGLE); - } else { -@@ -2426,7 +2441,7 @@ - bool Editor::NotifyMarginRightClick(Point pt, int modifiers) { - int marginRightClicked = vs.MarginFromLocation(pt); - if ((marginRightClicked >= 0) && vs.ms[marginRightClicked].sensitive) { -- Sci::Position position = pdoc->LineStart(LineFromLocation(pt)); -+ Sci::Position position = static_cast<Sci::Position>(pdoc->LineStart(LineFromLocation(pt))); - SCNotification scn = {}; - scn.nmhdr.code = SCN_MARGINRIGHTCLICK; - scn.modifiers = modifiers; -@@ -2476,7 +2491,7 @@ - void Editor::CheckModificationForWrap(DocModification mh) { - if (mh.modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) { - view.llc.Invalidate(LineLayout::llCheckTextAndStyle); -- Sci::Line lineDoc = pdoc->LineFromPosition(mh.position); -+ Sci::Line lineDoc = static_cast<Sci::Line>(pdoc->LineFromPosition(mh.position)); - Sci::Line lines = std::max(static_cast<Sci::Line>(0), mh.linesAdded); - if (Wrapping()) { - NeedWrapping(lineDoc, lineDoc + lines + 1); -@@ -2518,7 +2533,8 @@ - if (mh.modificationType & SC_MOD_CHANGELINESTATE) { - if (paintState == painting) { - CheckForChangeOutsidePaint( -- Range(pdoc->LineStart(mh.line), pdoc->LineStart(mh.line + 1))); -+ Range(static_cast<Sci::Position>(pdoc->LineStart(mh.line)), -+ static_cast<Sci::Position>(pdoc->LineStart(mh.line + 1)))); - } else { - // Could check that change is before last visible line. - Redraw(); -@@ -2563,20 +2579,20 @@ - } - if ((mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) && cs.HiddenLines()) { - // Some lines are hidden so may need shown. -- const Sci::Line lineOfPos = pdoc->LineFromPosition(mh.position); -+ const Sci::Line lineOfPos = static_cast<Sci::Line>(pdoc->LineFromPosition(mh.position)); - Sci::Position endNeedShown = mh.position; - if (mh.modificationType & SC_MOD_BEFOREINSERT) { - if (pdoc->ContainsLineEnd(mh.text, mh.length) && (mh.position != pdoc->LineStart(lineOfPos))) -- endNeedShown = pdoc->LineStart(lineOfPos+1); -+ endNeedShown = static_cast<Sci::Position>(pdoc->LineStart(lineOfPos+1)); - } else if (mh.modificationType & SC_MOD_BEFOREDELETE) { - // If the deletion includes any EOL then we extend the need shown area. - endNeedShown = mh.position + mh.length; -- Sci::Line lineLast = pdoc->LineFromPosition(mh.position+mh.length); -+ Sci::Line lineLast = static_cast<Sci::Line>(pdoc->LineFromPosition(mh.position+mh.length)); - for (Sci::Line line = lineOfPos + 1; line <= lineLast; line++) { - const Sci::Line lineMaxSubord = pdoc->GetLastChild(line, -1, -1); - if (lineLast < lineMaxSubord) { - lineLast = lineMaxSubord; -- endNeedShown = pdoc->LineEnd(lineLast); -+ endNeedShown = static_cast<Sci::Position>(pdoc->LineEnd(lineLast)); - } - } - } -@@ -2585,7 +2601,7 @@ - if (mh.linesAdded != 0) { - // Update contraction state for inserted and removed lines - // lineOfPos should be calculated in context of state before modification, shouldn't it -- Sci::Line lineOfPos = pdoc->LineFromPosition(mh.position); -+ Sci::Line lineOfPos = static_cast<Sci::Line>(pdoc->LineFromPosition(mh.position)); - if (mh.position > pdoc->LineStart(lineOfPos)) - lineOfPos++; // Affecting subsequent lines - if (mh.linesAdded > 0) { -@@ -2596,7 +2612,7 @@ - view.LinesAddedOrRemoved(lineOfPos, mh.linesAdded); - } - if (mh.modificationType & SC_MOD_CHANGEANNOTATION) { -- Sci::Line lineDoc = pdoc->LineFromPosition(mh.position); -+ Sci::Line lineDoc = static_cast<Sci::Line>(pdoc->LineFromPosition(mh.position)); - if (vs.annotationVisible) { - if (cs.SetHeight(lineDoc, cs.GetHeight(lineDoc) + mh.annotationLinesAdded)) { - SetScrollBars(); -@@ -2616,7 +2632,7 @@ - } - - if (paintState == notPainting && !CanDeferToLastStep(mh)) { -- QueueIdleWork(WorkNeeded::workStyle, pdoc->Length()); -+ QueueIdleWork(WorkNeeded::workStyle, static_cast<Sci::Position>(pdoc->Length())); - Redraw(); - } - } else { -@@ -2824,12 +2840,12 @@ - Sci::Line topLineNew; - SelectionPosition newPos; - -- const Sci::Line currentLine = pdoc->LineFromPosition(sel.MainCaret()); -+ const Sci::Line currentLine = static_cast<Sci::Line>(pdoc->LineFromPosition(sel.MainCaret())); - const Sci::Line topStutterLine = topLine + caretYSlop; -- const Sci::Line bottomStutterLine = -+ const Sci::Line bottomStutterLine = static_cast<Sci::Line>( - pdoc->LineFromPosition(PositionFromLocation( - Point::FromInts(lastXChosen - xOffset, direction * vs.lineHeight * LinesToScroll()))) -- - caretYSlop - 1; -+ - caretYSlop - 1); - - if (stuttered && (direction < 0 && currentLine > topStutterLine)) { - topLineNew = topLine; -@@ -2907,15 +2923,17 @@ - } - - void Editor::LineTranspose() { -- Sci::Line line = pdoc->LineFromPosition(sel.MainCaret()); -+ Sci::Line line = static_cast<Sci::Line>(pdoc->LineFromPosition(sel.MainCaret())); - if (line > 0) { - UndoGroup ug(pdoc); - -- const Sci::Position startPrevious = pdoc->LineStart(line - 1); -- const std::string linePrevious = RangeText(startPrevious, pdoc->LineEnd(line - 1)); -- -- Sci::Position startCurrent = pdoc->LineStart(line); -- const std::string lineCurrent = RangeText(startCurrent, pdoc->LineEnd(line)); -+ const Sci::Position startPrevious = static_cast<Sci::Position>(pdoc->LineStart(line - 1)); -+ const std::string linePrevious = RangeText(startPrevious, -+ static_cast<Sci::Position>(pdoc->LineEnd(line - 1))); -+ -+ Sci::Position startCurrent = static_cast<Sci::Position>(pdoc->LineStart(line)); -+ const std::string lineCurrent = RangeText(startCurrent, -+ static_cast<Sci::Position>(pdoc->LineEnd(line))); - - pdoc->DeleteChars(startCurrent, static_cast<Sci::Position>(lineCurrent.length())); - pdoc->DeleteChars(startPrevious, static_cast<Sci::Position>(linePrevious.length())); -@@ -2931,8 +2949,10 @@ - } - - void Editor::LineReverse() { -- const Sci::Line lineStart = pdoc->LineFromPosition(sel.RangeMain().Start().Position()); -- const Sci::Line lineEnd = pdoc->LineFromPosition(sel.RangeMain().End().Position()-1); -+ const Sci::Line lineStart = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(sel.RangeMain().Start().Position())); -+ const Sci::Line lineEnd = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(sel.RangeMain().End().Position()-1)); - const Sci::Line lineDiff = lineEnd - lineStart; - if (lineDiff <= 0) - return; -@@ -2940,10 +2960,10 @@ - for (Sci::Line i=(lineDiff+1)/2-1; i>=0; --i) { - const Sci::Line lineNum2 = lineEnd - i; - const Sci::Line lineNum1 = lineStart + i; -- Sci::Position lineStart2 = pdoc->LineStart(lineNum2); -- const Sci::Position lineStart1 = pdoc->LineStart(lineNum1); -- const std::string line2 = RangeText(lineStart2, pdoc->LineEnd(lineNum2)); -- const std::string line1 = RangeText(lineStart1, pdoc->LineEnd(lineNum1)); -+ Sci::Position lineStart2 = static_cast<Sci::Position>(pdoc->LineStart(lineNum2)); -+ const Sci::Position lineStart1 = static_cast<Sci::Position>(pdoc->LineStart(lineNum1)); -+ const std::string line2 = RangeText(lineStart2, static_cast<Sci::Position>(pdoc->LineEnd(lineNum2))); -+ const std::string line1 = RangeText(lineStart1, static_cast<Sci::Position>(pdoc->LineEnd(lineNum1))); - const Sci::Position lineLen2 = static_cast<Sci::Position>(line2.length()); - const Sci::Position lineLen1 = static_cast<Sci::Position>(line1.length()); - pdoc->DeleteChars(lineStart2, lineLen2); -@@ -2953,7 +2973,8 @@ - pdoc->InsertString(lineStart1, line2.c_str(), lineLen2); - } - // Wholly select all affected lines -- sel.RangeMain() = SelectionRange(pdoc->LineStart(lineStart), pdoc->LineStart(lineEnd+1)); -+ sel.RangeMain() = SelectionRange(static_cast<Sci::Position>(pdoc->LineStart(lineStart)), -+ static_cast<Sci::Position>(pdoc->LineStart(lineEnd+1))); - } - - void Editor::Duplicate(bool forLine) { -@@ -2971,9 +2992,9 @@ - SelectionPosition start = sel.Range(r).Start(); - SelectionPosition end = sel.Range(r).End(); - if (forLine) { -- Sci::Line line = pdoc->LineFromPosition(sel.Range(r).caret.Position()); -- start = SelectionPosition(pdoc->LineStart(line)); -- end = SelectionPosition(pdoc->LineEnd(line)); -+ Sci::Line line = static_cast<Sci::Line>(pdoc->LineFromPosition(sel.Range(r).caret.Position())); -+ start = SelectionPosition(static_cast<Sci::Position>(pdoc->LineStart(line))); -+ end = SelectionPosition(static_cast<Sci::Position>(pdoc->LineEnd(line))); - } - std::string text = RangeText(start.Position(), end.Position()); - Sci::Position lengthInserted = eolLen; -@@ -2984,8 +3005,9 @@ - if (sel.Count() && sel.IsRectangular()) { - SelectionPosition last = sel.Last(); - if (forLine) { -- Sci::Line line = pdoc->LineFromPosition(last.Position()); -- last = SelectionPosition(last.Position() + pdoc->LineStart(line+1) - pdoc->LineStart(line)); -+ Sci::Line line = static_cast<Sci::Line>(pdoc->LineFromPosition(last.Position())); -+ last = SelectionPosition(last.Position() + -+ static_cast<Sci::Position>(pdoc->LineStart(line+1) - pdoc->LineStart(line))); - } - if (sel.Rectangular().anchor > sel.Rectangular().caret) - sel.Rectangular().anchor = last; -@@ -3054,8 +3076,8 @@ - int skipLines = 0; - - if (vs.annotationVisible) { -- const Sci::Line lineDoc = pdoc->LineFromPosition(spStart.Position()); -- const Point ptStartLine = LocationFromPosition(pdoc->LineStart(lineDoc)); -+ const Sci::Line lineDoc = static_cast<Sci::Line>(pdoc->LineFromPosition(spStart.Position())); -+ const Point ptStartLine = LocationFromPosition(static_cast<Sci::Position>(pdoc->LineStart(lineDoc))); - const int subLine = static_cast<int>(pt.y - ptStartLine.y) / vs.lineHeight; - - if (direction < 0 && subLine == 0) { -@@ -3145,7 +3167,7 @@ - Sci::Position savedPos = sel.MainCaret(); - do { - MovePositionTo(SelectionPosition(direction > 0 ? pdoc->ParaDown(sel.MainCaret()) : pdoc->ParaUp(sel.MainCaret())), selt); -- lineDoc = pdoc->LineFromPosition(sel.MainCaret()); -+ lineDoc = static_cast<Sci::Line>(pdoc->LineFromPosition(sel.MainCaret())); - if (direction > 0) { - if (sel.MainCaret() >= pdoc->Length() && !cs.GetVisible(lineDoc)) { - if (selt == Selection::noSel) { -@@ -3321,7 +3343,8 @@ - } - break; - case SCI_HOMERECTEXTEND: -- spCaret = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(spCaret.Position()))); -+ spCaret = SelectionPosition( -+ static_cast<Sci::Position>(pdoc->LineStart(pdoc->LineFromPosition(spCaret.Position())))); - break; - case SCI_VCHOMERECTEXTEND: - spCaret = SelectionPosition(pdoc->VCHomePosition(spCaret.Position())); -@@ -3392,7 +3415,8 @@ - break; - case SCI_HOME: - case SCI_HOMEEXTEND: -- spCaret = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(spCaret.Position()))); -+ spCaret = SelectionPosition( -+ static_cast<Sci::Position>(pdoc->LineStart(pdoc->LineFromPosition(spCaret.Position())))); - break; - case SCI_HOMEDISPLAY: - case SCI_HOMEDISPLAYEXTEND: -@@ -3402,7 +3426,8 @@ - case SCI_HOMEWRAPEXTEND: - spCaret = MovePositionSoVisible(StartEndDisplayLine(spCaret.Position(), true), -1); - if (spCaretNow <= spCaret) -- spCaret = SelectionPosition(pdoc->LineStart(pdoc->LineFromPosition(spCaret.Position()))); -+ spCaret = SelectionPosition( -+ static_cast<Sci::Position>(pdoc->LineStart(pdoc->LineFromPosition(spCaret.Position())))); - break; - case SCI_VCHOME: - case SCI_VCHOMEEXTEND: -@@ -3552,13 +3577,13 @@ - break; - case SCI_DELLINELEFT: - rangeDelete = Range( -- pdoc->LineStart(pdoc->LineFromPosition(sel.Range(r).caret.Position())), -+ static_cast<Sci::Position>(pdoc->LineStart(pdoc->LineFromPosition(sel.Range(r).caret.Position()))), - sel.Range(r).caret.Position()); - break; - case SCI_DELLINERIGHT: - rangeDelete = Range( - sel.Range(r).caret.Position(), -- pdoc->LineEnd(pdoc->LineFromPosition(sel.Range(r).caret.Position()))); -+ static_cast<Sci::Position>(pdoc->LineEnd(pdoc->LineFromPosition(sel.Range(r).caret.Position())))); - break; - } - if (!RangeContainsProtected(rangeDelete.start, rangeDelete.end)) { -@@ -3669,11 +3694,11 @@ - SetLastXChosen(); - break; - case SCI_DOCUMENTEND: -- MovePositionTo(pdoc->Length()); -+ MovePositionTo(static_cast<Sci::Position>(pdoc->Length())); - SetLastXChosen(); - break; - case SCI_DOCUMENTENDEXTEND: -- MovePositionTo(pdoc->Length(), Selection::selStream); -+ MovePositionTo(static_cast<Sci::Position>(pdoc->Length()), Selection::selStream); - SetLastXChosen(); - break; - case SCI_STUTTEREDPAGEUP: -@@ -3780,26 +3805,26 @@ - return DelWordOrLine(iMessage); - - case SCI_LINECOPY: { -- const Sci::Line lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -- const Sci::Line lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); -- CopyRangeToClipboard(pdoc->LineStart(lineStart), -- pdoc->LineStart(lineEnd + 1)); -+ const Sci::Line lineStart = static_cast<Sci::Line>(pdoc->LineFromPosition(SelectionStart().Position())); -+ const Sci::Line lineEnd = static_cast<Sci::Line>(pdoc->LineFromPosition(SelectionEnd().Position())); -+ CopyRangeToClipboard(static_cast<Sci::Position>(pdoc->LineStart(lineStart)), -+ static_cast<Sci::Position>(pdoc->LineStart(lineEnd + 1))); - } - break; - case SCI_LINECUT: { -- const Sci::Line lineStart = pdoc->LineFromPosition(SelectionStart().Position()); -- const Sci::Line lineEnd = pdoc->LineFromPosition(SelectionEnd().Position()); -- const Sci::Position start = pdoc->LineStart(lineStart); -- const Sci::Position end = pdoc->LineStart(lineEnd + 1); -+ const Sci::Line lineStart = static_cast<Sci::Line>(pdoc->LineFromPosition(SelectionStart().Position())); -+ const Sci::Line lineEnd = static_cast<Sci::Line>(pdoc->LineFromPosition(SelectionEnd().Position())); -+ const Sci::Position start = static_cast<Sci::Position>(pdoc->LineStart(lineStart)); -+ const Sci::Position end = static_cast<Sci::Position>(pdoc->LineStart(lineEnd + 1)); - SetSelection(start, end); - Cut(); - SetLastXChosen(); - } - break; - case SCI_LINEDELETE: { -- const Sci::Line line = pdoc->LineFromPosition(sel.MainCaret()); -- const Sci::Position start = pdoc->LineStart(line); -- const Sci::Position end = pdoc->LineStart(line + 1); -+ const Sci::Line line = static_cast<Sci::Line>(pdoc->LineFromPosition(sel.MainCaret())); -+ const Sci::Position start = static_cast<Sci::Position>(pdoc->LineStart(line)); -+ const Sci::Position end = static_cast<Sci::Position>(pdoc->LineStart(line + 1)); - pdoc->DeleteChars(start, end - start); - } - break; -@@ -3852,9 +3877,10 @@ - void Editor::Indent(bool forwards) { - UndoGroup ug(pdoc); - for (size_t r=0; r<sel.Count(); r++) { -- Sci::Line lineOfAnchor = pdoc->LineFromPosition(sel.Range(r).anchor.Position()); -+ Sci::Line lineOfAnchor = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(sel.Range(r).anchor.Position())); - Sci::Position caretPosition = sel.Range(r).caret.Position(); -- Sci::Line lineCurrentPos = pdoc->LineFromPosition(caretPosition); -+ Sci::Line lineCurrentPos = static_cast<Sci::Line>(pdoc->LineFromPosition(caretPosition)); - if (lineOfAnchor == lineCurrentPos) { - if (forwards) { - pdoc->DeleteChars(sel.Range(r).Start().Position(), sel.Range(r).Length()); -@@ -3900,8 +3926,10 @@ - } - } - } else { // Multiline -- const Sci::Position anchorPosOnLine = sel.Range(r).anchor.Position() - pdoc->LineStart(lineOfAnchor); -- const Sci::Position currentPosPosOnLine = caretPosition - pdoc->LineStart(lineCurrentPos); -+ const Sci::Position anchorPosOnLine = sel.Range(r).anchor.Position() - -+ static_cast<Sci::Position>(pdoc->LineStart(lineOfAnchor)); -+ const Sci::Position currentPosPosOnLine = caretPosition - -+ static_cast<Sci::Position>(pdoc->LineStart(lineCurrentPos)); - // Multiple lines selected so indent / dedent - const Sci::Line lineTopSel = std::min(lineOfAnchor, lineCurrentPos); - Sci::Line lineBottomSel = std::max(lineOfAnchor, lineCurrentPos); -@@ -3910,14 +3938,18 @@ - pdoc->Indent(forwards, lineBottomSel, lineTopSel); - if (lineOfAnchor < lineCurrentPos) { - if (currentPosPosOnLine == 0) -- sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor)); -+ sel.Range(r) = SelectionRange(static_cast<Sci::Position>(pdoc->LineStart(lineCurrentPos)), -+ static_cast<Sci::Position>(pdoc->LineStart(lineOfAnchor))); - else -- sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos + 1), pdoc->LineStart(lineOfAnchor)); -+ sel.Range(r) = SelectionRange(static_cast<Sci::Position>(pdoc->LineStart(lineCurrentPos + 1)), -+ static_cast<Sci::Position>(pdoc->LineStart(lineOfAnchor))); - } else { - if (anchorPosOnLine == 0) -- sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor)); -+ sel.Range(r) = SelectionRange(static_cast<Sci::Position>(pdoc->LineStart(lineCurrentPos)), -+ static_cast<Sci::Position>(pdoc->LineStart(lineOfAnchor))); - else -- sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor + 1)); -+ sel.Range(r) = SelectionRange(static_cast<Sci::Position>(pdoc->LineStart(lineCurrentPos)), -+ static_cast<Sci::Position>(pdoc->LineStart(lineOfAnchor + 1))); - } - } - } -@@ -4003,7 +4035,7 @@ - pdoc->SetCaseFolder(CaseFolderForEncoding()); - try { - if (iMessage == SCI_SEARCHNEXT) { -- pos = pdoc->FindText(searchAnchor, pdoc->Length(), txt, -+ pos = pdoc->FindText(searchAnchor, static_cast<Sci::Position>(pdoc->Length()), txt, - static_cast<int>(wParam), - &lengthFound); - } else { -@@ -4068,7 +4100,7 @@ - lineNo = pdoc->LinesTotal(); - if (lineNo < 0) - lineNo = 0; -- SetEmptySelection(pdoc->LineStart(lineNo)); -+ SetEmptySelection(static_cast<Sci::Position>(pdoc->LineStart(lineNo))); - ShowCaretAtCurrentPosition(); - EnsureCaretVisible(); - } -@@ -4096,9 +4128,9 @@ - void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) { - if (sel.Empty()) { - if (allowLineCopy) { -- Sci::Line currentLine = pdoc->LineFromPosition(sel.MainCaret()); -- Sci::Position start = pdoc->LineStart(currentLine); -- Sci::Position end = pdoc->LineEnd(currentLine); -+ Sci::Line currentLine = static_cast<Sci::Line>(pdoc->LineFromPosition(sel.MainCaret())); -+ Sci::Position start = static_cast<Sci::Position>(pdoc->LineStart(currentLine)); -+ Sci::Position end = static_cast<Sci::Position>(pdoc->LineEnd(currentLine)); - - std::string text = RangeText(start, end); - if (pdoc->eolMode != SC_EOL_LF) -@@ -4314,17 +4346,17 @@ - void Editor::LineSelection(Sci::Position lineCurrentPos_, Sci::Position lineAnchorPos_, bool wholeLine) { - Sci::Position selCurrentPos, selAnchorPos; - if (wholeLine) { -- Sci::Line lineCurrent_ = pdoc->LineFromPosition(lineCurrentPos_); -- Sci::Line lineAnchor_ = pdoc->LineFromPosition(lineAnchorPos_); -+ Sci::Line lineCurrent_ = static_cast<Sci::Line>(pdoc->LineFromPosition(lineCurrentPos_)); -+ Sci::Line lineAnchor_ = static_cast<Sci::Line>(pdoc->LineFromPosition(lineAnchorPos_)); - if (lineAnchorPos_ < lineCurrentPos_) { -- selCurrentPos = pdoc->LineStart(lineCurrent_ + 1); -- selAnchorPos = pdoc->LineStart(lineAnchor_); -+ selCurrentPos = static_cast<Sci::Position>(pdoc->LineStart(lineCurrent_ + 1)); -+ selAnchorPos = static_cast<Sci::Position>(pdoc->LineStart(lineAnchor_)); - } else if (lineAnchorPos_ > lineCurrentPos_) { -- selCurrentPos = pdoc->LineStart(lineCurrent_); -- selAnchorPos = pdoc->LineStart(lineAnchor_ + 1); -+ selCurrentPos = static_cast<Sci::Position>(pdoc->LineStart(lineCurrent_)); -+ selAnchorPos = static_cast<Sci::Position>(pdoc->LineStart(lineAnchor_ + 1)); - } else { // Same line, select it -- selCurrentPos = pdoc->LineStart(lineAnchor_ + 1); -- selAnchorPos = pdoc->LineStart(lineAnchor_); -+ selCurrentPos = static_cast<Sci::Position>(pdoc->LineStart(lineAnchor_ + 1)); -+ selAnchorPos = static_cast<Sci::Position>(pdoc->LineStart(lineAnchor_)); - } - } else { - if (lineAnchorPos_ < lineCurrentPos_) { -@@ -4946,9 +4978,9 @@ - // detect multiline comment additions and heals single line comments - Sci::Line lineAfter = TopLineOfMain() + static_cast<Sci::Line>(rcArea.bottom - 1) / vs.lineHeight + 1; - if (lineAfter < cs.LinesDisplayed()) -- return pdoc->LineStart(cs.DocFromDisplay(lineAfter) + 1); -+ return static_cast<Sci::Position>(pdoc->LineStart(cs.DocFromDisplay(lineAfter) + 1)); - else -- return pdoc->Length(); -+ return static_cast<Sci::Position>(pdoc->Length()); - } - - // Style to a position within the view. If this causes a change at end of last line then -@@ -5020,7 +5052,7 @@ - void Editor::IdleStyling() { - const Sci::Position posAfterArea = PositionAfterArea(GetClientRectangle()); - const Sci::Position endGoal = (idleStyling >= SC_IDLESTYLING_AFTERVISIBLE) ? -- pdoc->Length() : posAfterArea; -+ static_cast<Sci::Position>(pdoc->Length()) : posAfterArea; - const Sci::Position posAfterMax = PositionAfterMaxStyling(endGoal, false); - pdoc->StyleToAdjustingLineDuration(posAfterMax); - if (pdoc->GetEndStyled() >= endGoal) { -@@ -5032,7 +5064,7 @@ - // Style the line after the modification as this allows modifications that change just the - // line of the modification to heal instead of propagating to the rest of the window. - if (workNeeded.items & WorkNeeded::workStyle) { -- StyleToPositionInView(pdoc->LineStart(pdoc->LineFromPosition(workNeeded.upTo) + 2)); -+ StyleToPositionInView(static_cast<Sci::Position>(pdoc->LineStart(pdoc->LineFromPosition(workNeeded.upTo) + 2))); - } - NotifyUpdateUI(); - workNeeded.Reset(); -@@ -5227,7 +5259,8 @@ - cs.SetExpanded(line, false); - cs.SetVisible(line + 1, lineMaxSubord, false); - -- const Sci::Line lineCurrent = pdoc->LineFromPosition(sel.MainCaret()); -+ const Sci::Line lineCurrent = static_cast<Sci::Line>( -+ pdoc->LineFromPosition(sel.MainCaret())); - if (lineCurrent > line && lineCurrent <= lineMaxSubord) { - // This does not re-expand the fold - EnsureCaretVisible(); -@@ -5346,7 +5379,7 @@ - } - - void Editor::FoldAll(int action) { -- pdoc->EnsureStyledTo(pdoc->Length()); -+ pdoc->EnsureStyledTo(static_cast<Sci::Position>(pdoc->Length())); - Sci::Line maxLine = pdoc->LinesTotal(); - bool expanding = action == SC_FOLDACTION_EXPAND; - if (action == SC_FOLDACTION_TOGGLE) { -@@ -5435,8 +5468,8 @@ - - void Editor::NeedShown(Sci::Position pos, Sci::Position len) { - if (foldAutomatic & SC_AUTOMATICFOLD_SHOW) { -- const Sci::Line lineStart = pdoc->LineFromPosition(pos); -- const Sci::Line lineEnd = pdoc->LineFromPosition(pos+len); -+ const Sci::Line lineStart = static_cast<Sci::Line>(pdoc->LineFromPosition(pos)); -+ const Sci::Line lineEnd = static_cast<Sci::Line>(pdoc->LineFromPosition(pos+len)); - for (Sci::Line line = lineStart; line <= lineEnd; line++) { - EnsureLineVisible(line, false); - } -@@ -5704,7 +5737,7 @@ - if (lParam == 0) - return 0; - UndoGroup ug(pdoc); -- pdoc->DeleteChars(0, pdoc->Length()); -+ pdoc->DeleteChars(0, static_cast<Sci::Position>(pdoc->Length())); - SetEmptySelection(0); - const char *text = CharPtrFromSPtr(lParam); - pdoc->InsertString(0, text, istrlen(text)); -@@ -5781,8 +5814,10 @@ - break; - - case SCI_GETLINE: { // Risk of overwriting the end of the buffer -- Sci::Position lineStart = pdoc->LineStart(static_cast<Sci::Line>(wParam)); -- Sci::Position lineEnd = pdoc->LineStart(static_cast<Sci::Line>(wParam + 1)); -+ Sci::Position lineStart = static_cast<Sci::Position>( -+ pdoc->LineStart(static_cast<Sci::Line>(wParam))); -+ Sci::Position lineEnd = static_cast<Sci::Position>( -+ pdoc->LineStart(static_cast<Sci::Line>(wParam + 1))); - if (lParam == 0) { - return lineEnd - lineStart; - } -@@ -5807,7 +5842,7 @@ - Sci::Position nStart = static_cast<Sci::Position>(wParam); - Sci::Position nEnd = static_cast<Sci::Position>(lParam); - if (nEnd < 0) -- nEnd = pdoc->Length(); -+ nEnd = static_cast<Sci::Position>(pdoc->Length()); - if (nStart < 0) - nStart = nEnd; // Remove selection - InvalidateSelection(SelectionRange(nStart, nEnd)); -@@ -5893,7 +5928,7 @@ - - case SCI_TARGETWHOLEDOCUMENT: - targetStart = 0; -- targetEnd = pdoc->Length(); -+ targetEnd = static_cast<Sci::Position>(pdoc->Length()); - break; - - case SCI_TARGETFROMSELECTION: -@@ -5940,7 +5975,8 @@ - return pdoc->MovePositionOutsideChar(static_cast<int>(wParam) + 1, 1, true); - - case SCI_POSITIONRELATIVE: -- return Sci::clamp(pdoc->GetRelativePosition(static_cast<int>(wParam), static_cast<int>(lParam)), 0, pdoc->Length()); -+ return Sci::clamp(static_cast<int>(pdoc->GetRelativePosition(static_cast<int>(wParam), static_cast<int>(lParam))), -+ 0, static_cast<int>(pdoc->Length())); - - case SCI_LINESCROLL: - ScrollTo(topLine + static_cast<Sci::Line>(lParam)); -@@ -6001,7 +6037,7 @@ - Sci_TextRange *tr = reinterpret_cast<Sci_TextRange *>(lParam); - Sci::Position cpMax = static_cast<Sci::Position>(tr->chrg.cpMax); - if (cpMax == -1) -- cpMax = pdoc->Length(); -+ cpMax = static_cast<Sci::Position>(pdoc->Length()); - PLATFORM_ASSERT(cpMax <= pdoc->Length()); - int len = static_cast<int>(cpMax - tr->chrg.cpMin); // No -1 as cpMin and cpMax are referring to inter character positions - pdoc->GetCharRange(tr->lpstrText, static_cast<int>(tr->chrg.cpMin), len); -@@ -6072,7 +6108,8 @@ - return 0; - - case SCI_APPENDTEXT: -- pdoc->InsertString(pdoc->Length(), CharPtrFromSPtr(lParam), static_cast<int>(wParam)); -+ pdoc->InsertString(static_cast<Sci::Position>(pdoc->Length()), -+ CharPtrFromSPtr(lParam), static_cast<int>(wParam)); - return 0; - - case SCI_CLEARALL: -@@ -6311,9 +6348,9 @@ - break; - - case SCI_GETCURLINE: { -- const Sci::Line lineCurrentPos = pdoc->LineFromPosition(sel.MainCaret()); -- const Sci::Position lineStart = pdoc->LineStart(lineCurrentPos); -- const Sci::Position lineEnd = pdoc->LineStart(lineCurrentPos + 1); -+ const Sci::Line lineCurrentPos = static_cast<Sci::Line>(pdoc->LineFromPosition(sel.MainCaret())); -+ const Sci::Position lineStart = static_cast<Sci::Position>(pdoc->LineStart(lineCurrentPos)); -+ const Sci::Position lineEnd = static_cast<Sci::Position>(pdoc->LineStart(lineCurrentPos + 1)); - if (lParam == 0) { - return 1 + lineEnd - lineStart; - } -@@ -7585,8 +7622,9 @@ - } - case SCI_GETLINESELSTARTPOSITION: - case SCI_GETLINESELENDPOSITION: { -- SelectionSegment segmentLine(SelectionPosition(pdoc->LineStart(static_cast<int>(wParam))), -- SelectionPosition(pdoc->LineEnd(static_cast<int>(wParam)))); -+ SelectionSegment segmentLine( -+ SelectionPosition(static_cast<Sci::Position>(pdoc->LineStart(static_cast<int>(wParam)))), -+ SelectionPosition(static_cast<Sci::Position>(pdoc->LineEnd(static_cast<int>(wParam))))); - for (size_t r=0; r<sel.Count(); r++) { - const SelectionSegment portion = sel.Range(r).Intersect(segmentLine); - if (portion.start.IsValid()) { -diff -r c15f84c11e17 -r 95346e626cf8 src/MarginView.cxx ---- a/src/MarginView.cxx Thu Jun 22 14:36:26 2017 +1000 -+++ b/src/MarginView.cxx Thu Jun 22 14:52:11 2017 +1000 -@@ -248,7 +248,8 @@ - } - if (highlightDelimiter.isEnabled) { - Sci::Line lastLine = model.cs.DocFromDisplay(topLine + model.LinesOnScreen()) + 1; -- model.pdoc->GetHighlightDelimiters(highlightDelimiter, model.pdoc->LineFromPosition(model.sel.MainCaret()), lastLine); -+ model.pdoc->GetHighlightDelimiters(highlightDelimiter, -+ static_cast<Sci::Line>(model.pdoc->LineFromPosition(model.sel.MainCaret())), lastLine); - } - } - -diff -r c15f84c11e17 -r 95346e626cf8 win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Thu Jun 22 14:36:26 2017 +1000 -+++ b/win32/ScintillaWin.cxx Thu Jun 22 14:52:11 2017 +1000 -@@ -1676,7 +1676,7 @@ - Sci::Position nStart = static_cast<Sci::Position>(wParam); - Sci::Position nEnd = static_cast<Sci::Position>(lParam); - if (nStart == 0 && nEnd == -1) { -- nEnd = pdoc->Length(); -+ nEnd = static_cast<Sci::Position>(pdoc->Length()); - } - if (nStart == -1) { - nStart = nEnd; // Remove selection -@@ -1693,7 +1693,7 @@ - Sci_CharacterRange *pCR = reinterpret_cast<Sci_CharacterRange *>(lParam); - sel.selType = Selection::selStream; - if (pCR->cpMin == 0 && pCR->cpMax == -1) { -- SetSelection(pCR->cpMin, pdoc->Length()); -+ SetSelection(pCR->cpMin, static_cast<Sci::Position>(pdoc->Length())); - } else { - SetSelection(pCR->cpMin, pCR->cpMax); - } -@@ -2679,11 +2679,11 @@ - // Look around: baseStart <-- (|mainStart| -- mainEnd) --> baseEnd. - const Sci::Position mainStart = sel.RangeMain().Start().Position(); - const Sci::Position mainEnd = sel.RangeMain().End().Position(); -- const Sci::Line curLine = pdoc->LineFromPosition(mainStart); -+ const Sci::Line curLine = static_cast<Sci::Line>(pdoc->LineFromPosition(mainStart)); - if (curLine != pdoc->LineFromPosition(mainEnd)) - return 0; -- const Sci::Position baseStart = pdoc->LineStart(curLine); -- const Sci::Position baseEnd = pdoc->LineEnd(curLine); -+ const Sci::Position baseStart = static_cast<Sci::Position>(pdoc->LineStart(curLine)); -+ const Sci::Position baseEnd = static_cast<Sci::Position>(pdoc->LineEnd(curLine)); - if ((baseStart == baseEnd) || (mainEnd > baseEnd)) - return 0; - -@@ -2743,7 +2743,7 @@ - } else { - // Ensure docCompStart+docCompLen be not beyond lineEnd. - // since docCompLen by byte might break eol. -- Sci::Position lineEnd = pdoc->LineEnd(pdoc->LineFromPosition(rBase)); -+ Sci::Position lineEnd = static_cast<Sci::Position>(pdoc->LineEnd(pdoc->LineFromPosition(rBase))); - Sci::Position overflow = (docCompStart + docCompLen) - lineEnd; - if (overflow > 0) { - pdoc->DeleteChars(docCompStart, docCompLen - overflow); diff --git a/src/scintilla_backports/6339_79f86be9e988.patch b/src/scintilla_backports/6339_79f86be9e988.patch deleted file mode 100644 index 70a7b037..00000000 --- a/src/scintilla_backports/6339_79f86be9e988.patch +++ /dev/null @@ -1,51 +0,0 @@ -# HG changeset patch -# User Justin Dailey -# Date 1499396123 -36000 -# Node ID 79f86be9e988efc5b1462ae549c271c4f3a1b82c -# Parent 5a311da5df4077a7666cbfede428d8f29a6d14e6 -Redraw when overtype changed so caret change visible even when not blinking. -Notify application with SC_UPDATE_SELECTION when overtype changed - previously -sent SC_UPDATE_CONTENT. - -diff -r 5a311da5df40 -r 79f86be9e988 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Mon Jul 03 05:45:07 2017 -0700 -+++ b/doc/ScintillaHistory.html Fri Jul 07 12:55:23 2017 +1000 -@@ -565,6 +565,11 @@ - <a href="http://sourceforge.net/p/scintilla/bugs/1919/">Bug #1919</a>. - </li> - <li> -+ Ensure redraw when application changes overtype mode so caret change visible even when not blinking. -+ Notify application with SC_UPDATE_SELECTION when overtype changed - previously -+ sent SC_UPDATE_CONTENT. -+ </li> -+ <li> - Fix drawing failure when in wrap mode for delete to start/end of line which - affects later lines but did not redraw them. - <a href="http://sourceforge.net/p/scintilla/bugs/1949/">Bug #1949</a>. -diff -r 5a311da5df40 -r 79f86be9e988 src/Editor.cxx ---- a/src/Editor.cxx Mon Jul 03 05:45:07 2017 -0700 -+++ b/src/Editor.cxx Fri Jul 07 12:55:23 2017 +1000 -@@ -3733,9 +3733,8 @@ - break; - case SCI_EDITTOGGLEOVERTYPE: - inOverstrike = !inOverstrike; -+ ContainerNeedsUpdate(SC_UPDATE_SELECTION); - ShowCaretAtCurrentPosition(); -- ContainerNeedsUpdate(SC_UPDATE_CONTENT); -- NotifyUpdateUI(); - break; - case SCI_CANCEL: // Cancel any modes - handled in subclass - // Also unselect text -@@ -7637,7 +7636,11 @@ - } - - case SCI_SETOVERTYPE: -- inOverstrike = wParam != 0; -+ if (inOverstrike != (wParam != 0)) { -+ inOverstrike = wParam != 0; -+ ContainerNeedsUpdate(SC_UPDATE_SELECTION); -+ ShowCaretAtCurrentPosition(); -+ } - break; - - case SCI_GETOVERTYPE: diff --git a/src/scintilla_backports/6340_ebec660dcf48.patch b/src/scintilla_backports/6340_ebec660dcf48.patch deleted file mode 100644 index ba1d1e37..00000000 --- a/src/scintilla_backports/6340_ebec660dcf48.patch +++ /dev/null @@ -1,35 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1499397575 -36000 -# Node ID ebec660dcf48ec92301441140550f67d3e7ceb29 -# Parent 79f86be9e988efc5b1462ae549c271c4f3a1b82c -Bug [#1949]. Fix drawing failure in wrap mode for GTK+ 2.x. - -diff -r 79f86be9e988 -r ebec660dcf48 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Fri Jul 07 12:55:23 2017 +1000 -+++ b/doc/ScintillaHistory.html Fri Jul 07 13:19:35 2017 +1000 -@@ -572,6 +572,7 @@ - <li> - Fix drawing failure when in wrap mode for delete to start/end of line which - affects later lines but did not redraw them. -+ Also fixed drawing for wrap mode on GTK+ 2.x. - <a href="http://sourceforge.net/p/scintilla/bugs/1949/">Bug #1949</a>. - </li> - <li> -diff -r 79f86be9e988 -r ebec660dcf48 gtk/ScintillaGTK.cxx ---- a/gtk/ScintillaGTK.cxx Fri Jul 07 12:55:23 2017 +1000 -+++ b/gtk/ScintillaGTK.cxx Fri Jul 07 13:19:35 2017 +1000 -@@ -2599,11 +2599,12 @@ - Paint(surfaceWindow.get(), rcPaint); - surfaceWindow->Release(); - cairo_destroy(cr); - } -- if (paintState == paintAbandoned) { -+ if ((paintState == paintAbandoned) || repaintFullWindow) { - // Painting area was insufficient to cover new styling or brace highlight positions - FullPaint(); - } - paintState = notPainting; -+ repaintFullWindow = false; - - if (rgnUpdate) { diff --git a/src/scintilla_backports/6342_52f12c3eebcd.patch b/src/scintilla_backports/6342_52f12c3eebcd.patch deleted file mode 100644 index 6f7a340a..00000000 --- a/src/scintilla_backports/6342_52f12c3eebcd.patch +++ /dev/null @@ -1,69 +0,0 @@ -# HG changeset patch -# User Justin Dailey -# Date 1499559915 -36000 -# Node ID 52f12c3eebcd37757503136e1c3a3c693120c50b -# Parent 040330eec86d765ffdaffe85e55b30c794302c2b -Bug [#1955]. The data parameter to ILoader::AddData made const. - -diff -r 040330eec86d -r 52f12c3eebcd doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Sun Jul 09 10:03:53 2017 +1000 -+++ b/doc/ScintillaDoc.html Sun Jul 09 10:25:15 2017 +1000 -@@ -5761,7 +5761,7 @@ - <span class="S5">public</span><span class="S10">:</span><br /> - <span class="S0"> </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>Release<span class="S10">()</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br /> - <span class="S0"> </span><span class="S2">// Returns a status code from SC_STATUS_*</span><br /> --<span class="S0"> </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>AddData<span class="S10">(</span><span class="S5">char</span><span class="S0"> </span><span class="S10">*</span>data<span class="S10">,</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>length<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br /> -+<span class="S0"> </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">int</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>AddData<span class="S10">(</span><span class="S5">const</span><span class="S0"> </span><span class="S5">char</span><span class="S0"> </span><span class="S10">*</span>data<span class="S10">,</span><span class="S0"> </span>Sci_Position<span class="S0"> </span>length<span class="S10">)</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br /> - <span class="S0"> </span><span class="S5">virtual</span><span class="S0"> </span><span class="S5">void</span><span class="S0"> </span><span class="S10">*</span><span class="S0"> </span>SCI_METHOD<span class="S0"> </span>ConvertToDocument<span class="S10">()</span><span class="S0"> </span><span class="S10">=</span><span class="S0"> </span><span class="S4">0</span><span class="S10">;</span><br /> - <span class="S10">};</span><br /> - </div> -diff -r 040330eec86d -r 52f12c3eebcd doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sun Jul 09 10:03:53 2017 +1000 -+++ b/doc/ScintillaHistory.html Sun Jul 09 10:25:15 2017 +1000 -@@ -542,6 +542,10 @@ - An SCN_AUTOCSELECTIONCHANGE notification is sent when items are highlighted in an autocompletion or user list. - </li> - <li> -+ The data parameter to ILoader::AddData made const. -+ <a href="http://sourceforge.net/p/scintilla/bugs/1955/">Bug #1955</a>. -+ </li> -+ <li> - SciTE's embedded Lua interpreter updated to Lua 5.3. - </li> - <li> -diff -r 040330eec86d -r 52f12c3eebcd include/ILexer.h ---- a/include/ILexer.h Sun Jul 09 10:03:53 2017 +1000 -+++ b/include/ILexer.h Sun Jul 09 10:25:15 2017 +1000 -@@ -85,7 +85,7 @@ - public: - virtual int SCI_METHOD Release() = 0; - // Returns a status code from SC_STATUS_* -- virtual int SCI_METHOD AddData(char *data, Sci_Position length) = 0; -+ virtual int SCI_METHOD AddData(const char *data, Sci_Position length) = 0; - virtual void * SCI_METHOD ConvertToDocument() = 0; - }; - -diff -r 040330eec86d -r 52f12c3eebcd src/Document.cxx ---- a/src/Document.cxx Sun Jul 09 10:03:53 2017 +1000 -+++ b/src/Document.cxx Sun Jul 09 10:25:15 2017 +1000 -@@ -1138,7 +1138,7 @@ - insertion.assign(s, length); - } - --int SCI_METHOD Document::AddData(char *data, Sci_Position length) { -+int SCI_METHOD Document::AddData(const char *data, Sci_Position length) { - try { - Sci::Position position = static_cast<Sci::Position>(Length()); - InsertString(position, data, static_cast<Sci::Position>(length)); -diff -r 040330eec86d -r 52f12c3eebcd src/Document.h ---- a/src/Document.h Sun Jul 09 10:03:53 2017 +1000 -+++ b/src/Document.h Sun Jul 09 10:25:15 2017 +1000 -@@ -316,7 +316,7 @@ - bool DeleteChars(Sci::Position pos, Sci::Position len); - Sci::Position InsertString(Sci::Position position, const char *s, Sci::Position insertLength); - void ChangeInsertion(const char *s, Sci::Position length); -- int SCI_METHOD AddData(char *data, Sci_Position length); -+ int SCI_METHOD AddData(const char *data, Sci_Position length); - void * SCI_METHOD ConvertToDocument(); - Sci::Position Undo(); - Sci::Position Redo(); diff --git a/src/scintilla_backports/6379_b44bb3627bbd.patch b/src/scintilla_backports/6379_b44bb3627bbd.patch deleted file mode 100644 index eba641a1..00000000 --- a/src/scintilla_backports/6379_b44bb3627bbd.patch +++ /dev/null @@ -1,131 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1503646603 -36000 -# Node ID b44bb3627bbd8ea7c41e9b7b35cf2910025c9519 -# Parent 25eea2ed15fc97965212a2a03d5ef6978821f59b -Moved *StyleBits* APIs into deprecated category. - -diff -r 25eea2ed15fc -r b44bb3627bbd include/Scintilla.h ---- a/include/Scintilla.h Sat Aug 19 10:44:32 2017 +1000 -+++ b/include/Scintilla.h Fri Aug 25 17:36:43 2017 +1000 -@@ -320,8 +320,6 @@ - #define SCI_SETWHITESPACEBACK 2085 - #define SCI_SETWHITESPACESIZE 2086 - #define SCI_GETWHITESPACESIZE 2087 --#define SCI_SETSTYLEBITS 2090 --#define SCI_GETSTYLEBITS 2091 - #define SCI_SETLINESTATE 2092 - #define SCI_GETLINESTATE 2093 - #define SCI_GETMAXLINESTATE 2094 -@@ -988,7 +986,6 @@ - #define SCI_GETPROPERTY 4008 - #define SCI_GETPROPERTYEXPANDED 4009 - #define SCI_GETPROPERTYINT 4010 --#define SCI_GETSTYLEBITSNEEDED 4011 - #define SCI_GETLEXERLANGUAGE 4012 - #define SCI_PRIVATELEXERCALL 4013 - #define SCI_PROPERTYNAMES 4014 -@@ -1216,6 +1213,10 @@ - #define RangeToFormat Sci_RangeToFormat - #define NotifyHeader Sci_NotifyHeader - -+#define SCI_SETSTYLEBITS 2090 -+#define SCI_GETSTYLEBITS 2091 -+#define SCI_GETSTYLEBITSNEEDED 4011 -+ - #endif - - #endif -diff -r 25eea2ed15fc -r b44bb3627bbd include/Scintilla.iface ---- a/include/Scintilla.iface Sat Aug 19 10:44:32 2017 +1000 -+++ b/include/Scintilla.iface Fri Aug 25 17:36:43 2017 +1000 -@@ -702,14 +702,6 @@ - # Get the size of the dots used to mark space characters. - get int GetWhitespaceSize=2087(,) - --# Divide each styling byte into lexical class bits (default: 5) and indicator --# bits (default: 3). If a lexer requires more than 32 lexical states, then this --# is used to expand the possible states. --set void SetStyleBits=2090(int bits,) -- --# Retrieve number of bits in style bytes used to hold the lexical state. --get int GetStyleBits=2091(,) -- - # Used to hold extra styling information for each line. - set void SetLineState=2092(int line, int state) - -@@ -2638,9 +2630,6 @@ - # interpreted as an int AFTER any "$()" variable replacement. - get int GetPropertyInt=4010(string key, int defaultValue) - --# Retrieve the number of bits the current lexer needs for styling. --get int GetStyleBitsNeeded=4011(,) -- - # Retrieve the name of the lexer. - # Return the length of the text. - # Result is NUL-terminated. -@@ -4875,6 +4864,17 @@ - - cat Deprecated - -+# Divide each styling byte into lexical class bits (default: 5) and indicator -+# bits (default: 3). If a lexer requires more than 32 lexical states, then this -+# is used to expand the possible states. -+set void SetStyleBits=2090(int bits,) -+ -+# Retrieve number of bits in style bytes used to hold the lexical state. -+get int GetStyleBits=2091(,) -+ -+# Retrieve the number of bits the current lexer needs for styling. -+get int GetStyleBitsNeeded=4011(,) -+ - # Deprecated in 3.5.5 - - # Always interpret keyboard input as Unicode -diff -r 25eea2ed15fc -r b44bb3627bbd src/Editor.cxx ---- a/src/Editor.cxx Sat Aug 19 10:44:32 2017 +1000 -+++ b/src/Editor.cxx Fri Aug 25 17:36:43 2017 +1000 -@@ -6971,12 +6971,15 @@ - vs.ResetDefaultStyle(); - InvalidateStyleRedraw(); - break; -+ -+#ifdef INCLUDE_DEPRECATED_FEATURES - case SCI_SETSTYLEBITS: - vs.EnsureStyle(0xff); - break; - - case SCI_GETSTYLEBITS: - return 8; -+#endif - - case SCI_SETLINESTATE: - return pdoc->SetLineState(static_cast<int>(wParam), static_cast<int>(lParam)); -diff -r 25eea2ed15fc -r b44bb3627bbd src/ScintillaBase.cxx ---- a/src/ScintillaBase.cxx Sat Aug 19 10:44:32 2017 +1000 -+++ b/src/ScintillaBase.cxx Fri Aug 25 17:36:43 2017 +1000 -@@ -1092,8 +1092,10 @@ - return reinterpret_cast<sptr_t>( - DocumentLexState()->PrivateCall(static_cast<int>(wParam), reinterpret_cast<void *>(lParam))); - -+#ifdef INCLUDE_DEPRECATED_FEATURES - case SCI_GETSTYLEBITSNEEDED: - return 8; -+#endif - - case SCI_PROPERTYNAMES: - return StringResult(lParam, DocumentLexState()->PropertyNames()); -diff -r 25eea2ed15fc -r b44bb3627bbd test/lexTests.py ---- a/test/lexTests.py Sat Aug 19 10:44:32 2017 +1000 -+++ b/test/lexTests.py Fri Aug 25 17:36:43 2017 +1000 -@@ -75,9 +75,7 @@ - self.ed.EmptyUndoBuffer() - self.ed.SetCodePage(65001) - self.ed.LexerLanguage = lexerName -- bits = self.ed.StyleBitsNeeded -- mask = 2 << bits - 1 -- self.ed.StyleBits = bits -+ mask = 0xff - for i in range(len(keywords)): - self.ed.SetKeyWords(i, keywords[i]) - diff --git a/src/scintilla_backports/6388_96506cab38bd.patch b/src/scintilla_backports/6388_96506cab38bd.patch deleted file mode 100644 index 5ff68a60..00000000 --- a/src/scintilla_backports/6388_96506cab38bd.patch +++ /dev/null @@ -1,33 +0,0 @@ -# HG changeset patch -# User Neil Hodgson <nyamatongwe@gmail.com> -# Date 1505266064 -36000 -# Node ID 96506cab38bdbd86feac8a0aa671854091b7610b -# Parent d62863ae40a38b08b7b1e3bc13a874b9e8f1c6d2 -Bug [#1971]. Fix line selection by clicking in the margin when scrolled. - -diff -r d62863ae40a3 -r 96506cab38bd doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Mon Sep 11 09:05:35 2017 +1000 -+++ b/doc/ScintillaHistory.html Wed Sep 13 11:27:44 2017 +1000 -@@ -554,6 +554,10 @@ - The SQL lexer uses sql.backslash.escapes for double quoted strings. - <a href="http://sourceforge.net/p/scintilla/bugs/1968/">Bug #1968</a>. - </li> -+ <li> -+ On Cocoa, fix line selection by clicking in the margin when scrolled. -+ <a href="http://sourceforge.net/p/scintilla/bugs/1971">Bug #1971</a>. -+ </li> - </ul> - <h3> - <a href="http://www.scintilla.org/scite400.zip">Release 4.0.0</a> -diff -r d62863ae40a3 -r 96506cab38bd src/Editor.cxx ---- a/src/Editor.cxx Mon Sep 11 09:05:35 2017 +1000 -+++ b/src/Editor.cxx Wed Sep 13 11:27:44 2017 +1000 -@@ -4320,6 +4320,8 @@ - PRectangle rcSelMargin = GetClientRectangle(); - rcSelMargin.right = static_cast<XYPOSITION>(vs.textStart - vs.leftMarginWidth); - rcSelMargin.left = static_cast<XYPOSITION>(vs.textStart - vs.fixedColumnWidth); -+ const Point ptOrigin = GetVisibleOriginInMain(); -+ rcSelMargin.Move(0, -ptOrigin.y); - return rcSelMargin.ContainsWholePixel(pt); - } else { - return false; diff --git a/src/scintilla_backports/6397_2db0528f34b5.patch b/src/scintilla_backports/6397_2db0528f34b5.patch deleted file mode 100644 index 098c700e..00000000 --- a/src/scintilla_backports/6397_2db0528f34b5.patch +++ /dev/null @@ -1,33 +0,0 @@ -# HG changeset patch -# User Zufu Liu -# Date 1508018757 -39600 -# Node ID 2db0528f34b5b79890fd6c04897091474c18839a -# Parent 85f99a613e89325580b2202031b99f88e1c73bb1 -Bug [#1978]. Minor undefined behaviour fixed. - -diff -r 85f99a613e89 -r 2db0528f34b5 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sun Oct 15 08:57:00 2017 +1100 -+++ b/doc/ScintillaHistory.html Sun Oct 15 09:05:57 2017 +1100 -@@ -557,6 +557,10 @@ - <a href="http://sourceforge.net/p/scintilla/bugs/1968/">Bug #1968</a>. - </li> - <li> -+ Minor undefined behaviour fixed. -+ <a href="http://sourceforge.net/p/scintilla/bugs/1978">Bug #1978</a>. -+ </li> -+ <li> - On Cocoa, improve scrolling on macOS 10.12. - <a href="http://sourceforge.net/p/scintilla/bugs/1885">Bug #1885</a>. - </li> -diff -r 85f99a613e89 -r 2db0528f34b5 src/ViewStyle.cxx ---- a/src/ViewStyle.cxx Sun Oct 15 08:57:00 2017 +1100 -+++ b/src/ViewStyle.cxx Sun Oct 15 09:05:57 2017 +1100 -@@ -192,7 +192,7 @@ - } - maskDrawInText = 0; - for (int markBit = 0; markBit < 32; markBit++) { -- const int maskBit = 1 << markBit; -+ const int maskBit = 1U << markBit; - switch (markers[markBit].markType) { - case SC_MARK_EMPTY: - maskInLine &= ~maskBit; diff --git a/src/scintilla_backports/6418_85205da6ec1b.patch b/src/scintilla_backports/6418_85205da6ec1b.patch deleted file mode 100644 index 19db1d1f..00000000 --- a/src/scintilla_backports/6418_85205da6ec1b.patch +++ /dev/null @@ -1,79 +0,0 @@ -# HG changeset patch -# User Mitchell -# Date 1511141091 -39600 -# Node ID 85205da6ec1b8eeb14c3edc94064fb0d8f685377 -# Parent f78045efae202c3da36b6f347cc695da44a1d522 -Add SCI_GETMOVEEXTENDSSELECTION. - -diff -r f78045efae20 -r 85205da6ec1b doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Mon Nov 20 11:48:00 2017 +1100 -+++ b/doc/ScintillaDoc.html Mon Nov 20 12:24:51 2017 +1100 -@@ -1222,6 +1222,7 @@ - <a class="message" href="#SCI_SELECTIONISRECTANGLE">SCI_SELECTIONISRECTANGLE → bool</a><br /> - <a class="message" href="#SCI_SETSELECTIONMODE">SCI_SETSELECTIONMODE(int selectionMode)</a><br /> - <a class="message" href="#SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE → int</a><br /> -+ <a class="message" href="#SCI_GETMOVEEXTENDSSELECTION">SCI_GETMOVEEXTENDSSELECTION → bool</a><br /> - <a class="message" href="#SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line) → position</a><br /> - <a class="message" href="#SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line) → position</a><br /> - <a class="message" href="#SCI_MOVECARETINSIDEVIEW">SCI_MOVECARETINSIDEVIEW</a><br /> -@@ -1425,6 +1426,10 @@ - <code>SC_SEL_THIN</code> is the mode after a rectangular selection has been typed into and ensures - that no characters are selected.</p> - -+ <p><b id="SCI_GETMOVEEXTENDSSELECTION">SCI_GETMOVEEXTENDSSELECTION → bool</b><br /> -+ This returns 1 if regular caret moves will extend or reduce the selection, 0 if not. -+ <code>SCI_SETSELECTIONMODE</code> toggles this setting between on and off.</p> -+ - <p><b id="SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line) → position</b><br /> - <b id="SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line) → position</b><br /> - Retrieve the position of the start and end of the selection at the given line with -diff -r f78045efae20 -r 85205da6ec1b doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Mon Nov 20 11:48:00 2017 +1100 -+++ b/doc/ScintillaHistory.html Mon Nov 20 12:24:51 2017 +1100 -@@ -534,6 +534,10 @@ - Released 26 October 2017. - </li> - <li> -+ Add SCI_GETMOVEEXTENDSSELECTION to allow applications to add more -+ complex selection commands. -+ </li> -+ <li> - Improve VHDL lexer's handling of character literals and escape characters in strings. - </li> - <li> -diff -r f78045efae20 -r 85205da6ec1b include/Scintilla.h ---- a/include/Scintilla.h Mon Nov 20 11:48:00 2017 +1100 -+++ b/include/Scintilla.h Mon Nov 20 12:24:51 2017 +1100 -@@ -758,6 +758,7 @@ - #define SC_SEL_THIN 3 - #define SCI_SETSELECTIONMODE 2422 - #define SCI_GETSELECTIONMODE 2423 -+#define SCI_GETMOVEEXTENDSSELECTION 2706 - #define SCI_GETLINESELSTARTPOSITION 2424 - #define SCI_GETLINESELENDPOSITION 2425 - #define SCI_LINEDOWNRECTEXTEND 2426 -diff -r f78045efae20 -r 85205da6ec1b include/Scintilla.iface ---- a/include/Scintilla.iface Mon Nov 20 11:48:00 2017 +1100 -+++ b/include/Scintilla.iface Mon Nov 20 12:24:51 2017 +1100 -@@ -1964,6 +1964,9 @@ - # Get the mode of the current selection. - get int GetSelectionMode=2423(,) - -+# Get whether or not regular caret moves will extend or reduce the selection. -+get bool GetMoveExtendsSelection=2706(,) -+ - # Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). - fun position GetLineSelStartPosition=2424(int line,) - -diff -r f78045efae20 -r 85205da6ec1b src/Editor.cxx ---- a/src/Editor.cxx Mon Nov 20 11:48:00 2017 +1100 -+++ b/src/Editor.cxx Mon Nov 20 12:24:51 2017 +1100 -@@ -7625,6 +7625,8 @@ - default: // ?! - return SC_SEL_STREAM; - } -+ case SCI_GETMOVEEXTENDSSELECTION: -+ return sel.MoveExtends(); - case SCI_GETLINESELSTARTPOSITION: - case SCI_GETLINESELENDPOSITION: { - SelectionSegment segmentLine( diff --git a/src/scintilla_backports/6419_8760026bba6a.patch b/src/scintilla_backports/6419_8760026bba6a.patch deleted file mode 100644 index a477a80e..00000000 --- a/src/scintilla_backports/6419_8760026bba6a.patch +++ /dev/null @@ -1,142 +0,0 @@ -# HG changeset patch -# User Neil Hodgson <nyamatongwe@gmail.com> -# Date 1511240678 -39600 -# Node ID 8760026bba6ab6a5c6ee3d2d7bd7a291ecb74574 -# Parent 85205da6ec1b8eeb14c3edc94064fb0d8f685377 -Update marshalling of signals from Scintilla, changing deprecated NONE to VOID. -Has no effect on clients as NONE was an alias for VOID. - -diff -r 85205da6ec1b -r 8760026bba6a gtk/scintilla-marshal.c ---- a/gtk/scintilla-marshal.c Mon Nov 20 12:24:51 2017 +1100 -+++ b/gtk/scintilla-marshal.c Tue Nov 21 16:04:38 2017 +1100 -@@ -1,6 +1,4 @@ -- --#include <glib-object.h> -- -+#include <glib-object.h> - - #ifdef G_ENABLE_DEBUG - #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) -@@ -48,8 +46,7 @@ - #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer - #endif /* !G_ENABLE_DEBUG */ - -- --/* NONE:INT,OBJECT (scintilla-marshal.list:1) */ -+/* VOID:INT,OBJECT (scintilla-marshal.list:1) */ - void - scintilla_marshal_VOID__INT_OBJECT (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, -@@ -58,13 +55,13 @@ - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) - { -- typedef void (*GMarshalFunc_VOID__INT_OBJECT) (gpointer data1, -- gint arg_1, -- gpointer arg_2, -- gpointer data2); -+ typedef void (*GMarshalFunc_VOID__INT_OBJECT) (gpointer data1, -+ gint arg1, -+ gpointer arg2, -+ gpointer data2); -+ GCClosure *cc = (GCClosure *) closure; -+ gpointer data1, data2; - GMarshalFunc_VOID__INT_OBJECT callback; -- GCClosure *cc = (GCClosure*) closure; -- gpointer data1, data2; - - g_return_if_fail (n_param_values == 3); - -@@ -86,7 +83,7 @@ - data2); - } - --/* NONE:INT,BOXED (scintilla-marshal.list:2) */ -+/* VOID:INT,BOXED (scintilla-marshal.list:2) */ - void - scintilla_marshal_VOID__INT_BOXED (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, -@@ -95,13 +92,13 @@ - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) - { -- typedef void (*GMarshalFunc_VOID__INT_BOXED) (gpointer data1, -- gint arg_1, -- gpointer arg_2, -- gpointer data2); -+ typedef void (*GMarshalFunc_VOID__INT_BOXED) (gpointer data1, -+ gint arg1, -+ gpointer arg2, -+ gpointer data2); -+ GCClosure *cc = (GCClosure *) closure; -+ gpointer data1, data2; - GMarshalFunc_VOID__INT_BOXED callback; -- GCClosure *cc = (GCClosure*) closure; -- gpointer data1, data2; - - g_return_if_fail (n_param_values == 3); - -diff -r 85205da6ec1b -r 8760026bba6a gtk/scintilla-marshal.h ---- a/gtk/scintilla-marshal.h Mon Nov 20 12:24:51 2017 +1100 -+++ b/gtk/scintilla-marshal.h Tue Nov 21 16:04:38 2017 +1100 -@@ -1,30 +1,30 @@ -+/* This file is generated, all changes will be lost */ -+#ifndef __SCINTILLA_MARSHAL_MARSHAL_H__ -+#define __SCINTILLA_MARSHAL_MARSHAL_H__ - --#ifndef __scintilla_marshal_MARSHAL_H__ --#define __scintilla_marshal_MARSHAL_H__ -- --#include <glib-object.h> -+#include <glib-object.h> - - G_BEGIN_DECLS - --/* NONE:INT,OBJECT (scintilla-marshal.list:1) */ --extern void scintilla_marshal_VOID__INT_OBJECT (GClosure *closure, -- GValue *return_value, -- guint n_param_values, -- const GValue *param_values, -- gpointer invocation_hint, -- gpointer marshal_data); --#define scintilla_marshal_NONE__INT_OBJECT scintilla_marshal_VOID__INT_OBJECT -+/* VOID:INT,OBJECT (scintilla-marshal.list:1) */ -+extern -+void scintilla_marshal_VOID__INT_OBJECT (GClosure *closure, -+ GValue *return_value, -+ guint n_param_values, -+ const GValue *param_values, -+ gpointer invocation_hint, -+ gpointer marshal_data); - --/* NONE:INT,BOXED (scintilla-marshal.list:2) */ --extern void scintilla_marshal_VOID__INT_BOXED (GClosure *closure, -- GValue *return_value, -- guint n_param_values, -- const GValue *param_values, -- gpointer invocation_hint, -- gpointer marshal_data); --#define scintilla_marshal_NONE__INT_BOXED scintilla_marshal_VOID__INT_BOXED -+/* VOID:INT,BOXED (scintilla-marshal.list:2) */ -+extern -+void scintilla_marshal_VOID__INT_BOXED (GClosure *closure, -+ GValue *return_value, -+ guint n_param_values, -+ const GValue *param_values, -+ gpointer invocation_hint, -+ gpointer marshal_data); -+ - - G_END_DECLS - --#endif /* __scintilla_marshal_MARSHAL_H__ */ -- -+#endif /* __SCINTILLA_MARSHAL_MARSHAL_H__ */ -diff -r 85205da6ec1b -r 8760026bba6a gtk/scintilla-marshal.list ---- a/gtk/scintilla-marshal.list Mon Nov 20 12:24:51 2017 +1100 -+++ b/gtk/scintilla-marshal.list Tue Nov 21 16:04:38 2017 +1100 -@@ -1,2 +1,2 @@ --NONE:INT,OBJECT --NONE:INT,BOXED -+VOID:INT,OBJECT -+VOID:INT,BOXED diff --git a/src/scintilla_backports/6421_fd2f856b8d58.patch b/src/scintilla_backports/6421_fd2f856b8d58.patch deleted file mode 100644 index 9e354864..00000000 --- a/src/scintilla_backports/6421_fd2f856b8d58.patch +++ /dev/null @@ -1,68 +0,0 @@ -# HG changeset patch -# User Greg Smith -# Date 1513111541 -39600 -# Node ID fd2f856b8d582df2e3e60073721a84b9f464a72b -# Parent 2286dd5fa6259c67cc8ce0d4c39b1c2e6f85ff1f -Use explicit typedefs instead of deprecated derivation from std::iterator. -This fixes a C4996 / STL4015 warning from Visual C++ 2017.5 that the -std::iterator class template is deprecated in C++17. - -diff -r 2286dd5fa625 -r fd2f856b8d58 src/Document.cxx ---- a/src/Document.cxx Tue Nov 21 16:16:25 2017 +1100 -+++ b/src/Document.cxx Wed Dec 13 07:45:41 2017 +1100 -@@ -2600,8 +2600,14 @@ - - #ifndef NO_CXX11_REGEX - --class ByteIterator : public std::iterator<std::bidirectional_iterator_tag, char> { -+class ByteIterator { - public: -+ typedef std::bidirectional_iterator_tag iterator_category; -+ typedef char value_type; -+ typedef ptrdiff_t difference_type; -+ typedef char* pointer; -+ typedef char& reference; -+ - const Document *doc; - Sci::Position position; - ByteIterator(const Document *doc_ = 0, Sci::Position position_ = 0) : doc(doc_), position(position_) { -@@ -2663,7 +2669,7 @@ - - // On Windows, report non-BMP characters as 2 separate surrogates as that - // matches wregex since it is based on wchar_t. --class UTF8Iterator : public std::iterator<std::bidirectional_iterator_tag, wchar_t> { -+class UTF8Iterator { - // These 3 fields determine the iterator position and are used for comparisons - const Document *doc; - Sci::Position position; -@@ -2673,6 +2679,12 @@ - size_t lenCharacters; - wchar_t buffered[2]; - public: -+ typedef std::bidirectional_iterator_tag iterator_category; -+ typedef wchar_t value_type; -+ typedef ptrdiff_t difference_type; -+ typedef wchar_t* pointer; -+ typedef wchar_t& reference; -+ - UTF8Iterator(const Document *doc_ = 0, Sci::Position position_ = 0) : - doc(doc_), position(position_), characterIndex(0), lenBytes(0), lenCharacters(0) { - buffered[0] = 0; -@@ -2775,10 +2787,16 @@ - - // On Unix, report non-BMP characters as single characters - --class UTF8Iterator : public std::iterator<std::bidirectional_iterator_tag, wchar_t> { -+class UTF8Iterator { - const Document *doc; - Sci::Position position; - public: -+ typedef std::bidirectional_iterator_tag iterator_category; -+ typedef wchar_t value_type; -+ typedef ptrdiff_t difference_type; -+ typedef wchar_t* pointer; -+ typedef wchar_t& reference; -+ - UTF8Iterator(const Document *doc_=0, Sci::Position position_=0) : doc(doc_), position(position_) { - } - UTF8Iterator(const UTF8Iterator &other) NOEXCEPT { diff --git a/src/scintilla_backports/6425_73343682cbda.patch b/src/scintilla_backports/6425_73343682cbda.patch deleted file mode 100644 index 0126d946..00000000 --- a/src/scintilla_backports/6425_73343682cbda.patch +++ /dev/null @@ -1,170 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1513656040 -39600 -# Node ID 73343682cbda0937c5427ee45ea6c9104d97ac1e -# Parent 5246ca55cf2443dbd6d37bc6dfede6d5f3a14a36 -Start of bidirectional code - implement SCI_SETBIDIRECTIONAL. - -diff -r 5246ca55cf24 -r 73343682cbda doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Wed Jan 10 10:04:03 2018 +1100 -+++ b/doc/ScintillaDoc.html Tue Dec 19 15:00:40 2017 +1100 -@@ -119,7 +119,7 @@ - - <h1>Scintilla Documentation</h1> - -- <p>Last edited 11 August 2017 NH</p> -+ <p>Last edited 10 January 2018 NH</p> - - <p>There is <a class="jump" href="Design.html">an overview of the internal design of - Scintilla</a>.<br /> -@@ -3594,6 +3594,10 @@ - <a class="message" href="#SCI_GETCODEPAGE">SCI_GETCODEPAGE → int</a><br /> - <a class="message" href="#SCI_SETIMEINTERACTION">SCI_SETIMEINTERACTION(int imeInteraction)</a><br /> - <a class="message" href="#SCI_GETIMEINTERACTION">SCI_GETIMEINTERACTION → int</a><br /> -+<div class="provisional"> -+ <a class="message" href="#SCI_SETBIDIRECTIONAL"><span class="provisional">SCI_SETBIDIRECTIONAL(int bidirectional)</span></a><br /> -+ <a class="message" href="#SCI_GETBIDIRECTIONAL">SCI_GETBIDIRECTIONAL → int</a><br /> -+</div> - <a class="message" href="#SCI_GRABFOCUS">SCI_GRABFOCUS</a><br /> - <a class="message" href="#SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</a><br /> - <a class="message" href="#SCI_GETFOCUS">SCI_GETFOCUS → bool</a><br /> -@@ -3718,6 +3722,27 @@ - and the inline behaviour with <code>SCI_SETIMEINTERACTION(SC_IME_INLINE)</code>. - Scintilla may ignore this call in some cases. For example, the inline behaviour might only be supported for some languages.</p> - -+<div class="provisional"> -+ <a href="#ProvisionalMessages">These bidirectional features are not yet implemented and the API is provisional</a><br /> -+ <p><b id="SCI_SETBIDIRECTIONAL">SCI_SETBIDIRECTIONAL(int bidirectional)</b><br /> -+ <b id="SCI_GETBIDIRECTIONAL">SCI_GETBIDIRECTIONAL → int</b><br /> -+ Some languages, like Arabic and Hebrew, are written from right to left instead of from left to right as English is. -+ Documents that use multiple languages may contain both directions and this is termed "bidirectional". -+ The default text direction may be right to left or left to right. -+ Scintilla only correctly displays bidirectional text on some platforms and there can be additional processing and storage -+ costs to this. -+ Currently, bidirectional text only works on Win32 using DirectWrite. -+ As some applications may not want to pay the costs, bidirectional support must be explicitly enabled by calling -+ <code>SCI_SETBIDIRECTIONAL(SC_BIDIRECTIONAL_L2R)</code> (1) which chooses left to right as the default direction or -+ <code>SCI_SETBIDIRECTIONAL(SC_BIDIRECTIONAL_R2L)</code> (2) for default right to left. -+ This should be done after setting the technology to <code>SC_TECHNOLOGY_DIRECTWRITE</code>, -+ <code>SC_TECHNOLOGY_DIRECTWRITERETAIN</code>, or -+ <code>SC_TECHNOLOGY_DIRECTWRITEDC</code>.</p> -+ <p>If the call succeeded <code>SCI_GETBIDIRECTIONAL</code> will return the same value otherwise -+ <code>SC_BIDIRECTIONAL_DISABLED</code> (0) is returned. -+ </p> -+</div> -+ - <p><b id="SCI_GRABFOCUS">SCI_GRABFOCUS</b><br /> - <b id="SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</b><br /> - <b id="SCI_GETFOCUS">SCI_GETFOCUS → bool</b><br /> -@@ -8073,8 +8098,6 @@ - - <p>Provisional features are displayed in this document with <span class="provisional">a distinctive background colour</span>.</p> - -- <p>There are currently no provisional messages or values.</p> -- - <p>Some developers may want to only use features that are stable and have graduated from - provisional status. To avoid using provisional messages compile with the symbol - <code>SCI_DISABLE_PROVISIONAL</code> defined.</p> -diff -r 5246ca55cf24 -r 73343682cbda include/Scintilla.h ---- a/include/Scintilla.h Wed Jan 10 10:04:03 2018 +1100 -+++ b/include/Scintilla.h Tue Dec 19 15:00:40 2017 +1100 -@@ -1103,6 +1103,13 @@ - #define SCN_AUTOCCOMPLETED 2030 - #define SCN_MARGINRIGHTCLICK 2031 - #define SCN_AUTOCSELECTIONCHANGE 2032 -+#ifndef SCI_DISABLE_PROVISIONAL -+#define SC_BIDIRECTIONAL_DISABLED 0 -+#define SC_BIDIRECTIONAL_L2R 1 -+#define SC_BIDIRECTIONAL_R2L 2 -+#define SCI_GETBIDIRECTIONAL 2708 -+#define SCI_SETBIDIRECTIONAL 2709 -+#endif - /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ - - /* These structures are defined to be exactly the same shape as the Win32 -diff -r 5246ca55cf24 -r 73343682cbda include/Scintilla.iface ---- a/include/Scintilla.iface Wed Jan 10 10:04:03 2018 +1100 -+++ b/include/Scintilla.iface Tue Dec 19 15:00:40 2017 +1100 -@@ -4861,10 +4861,19 @@ - evt void MarginRightClick=2031(int modifiers, int position, int margin) - evt void AutoCSelectionChange=2032(int listType, string text, int position) - --# There are no provisional APIs currently, but some arguments to SCI_SETTECHNOLOGY are provisional. -- - cat Provisional - -+enu Bidirectional=SC_BIDIRECTIONAL_ -+val SC_BIDIRECTIONAL_DISABLED=0 -+val SC_BIDIRECTIONAL_L2R=1 -+val SC_BIDIRECTIONAL_R2L=2 -+ -+# Retrieve bidirectional text display state. -+get int GetBidirectional=2708(,) -+ -+# Set bidirectional text display state. -+set void SetBidirectional=2709(int bidirectional,) -+ - cat Deprecated - - # Divide each styling byte into lexical class bits (default: 5) and indicator -diff -r 5246ca55cf24 -r 73343682cbda src/EditModel.cxx ---- a/src/EditModel.cxx Wed Jan 10 10:04:03 2018 +1100 -+++ b/src/EditModel.cxx Tue Dec 19 15:00:40 2017 +1100 -@@ -63,6 +63,7 @@ - highlightGuideColumn = 0; - primarySelection = true; - imeInteraction = imeWindowed; -+ bidirectional = bidiDisabled; - foldFlags = 0; - foldDisplayTextStyle = SC_FOLDDISPLAYTEXT_HIDDEN; - hotspot = Range(Sci::invalidPosition); -diff -r 5246ca55cf24 -r 73343682cbda src/EditModel.h ---- a/src/EditModel.h Wed Jan 10 10:04:03 2018 +1100 -+++ b/src/EditModel.h Tue Dec 19 15:00:40 2017 +1100 -@@ -38,6 +38,8 @@ - - enum IMEInteraction { imeWindowed, imeInline } imeInteraction; - -+ enum Bidirectional { bidiDisabled, bidiL2R, bidiR2L } bidirectional; -+ - int foldFlags; - int foldDisplayTextStyle; - ContractionState cs; -diff -r 5246ca55cf24 -r 73343682cbda src/Editor.cxx ---- a/src/Editor.cxx Wed Jan 10 10:04:03 2018 +1100 -+++ b/src/Editor.cxx Tue Dec 19 15:00:40 2017 +1100 -@@ -6736,6 +6736,13 @@ - case SCI_GETIMEINTERACTION: - return imeInteraction; - -+ case SCI_SETBIDIRECTIONAL: -+ // SCI_SETBIDIRECTIONAL is implemented on platform subclasses if they support bidirectional text. -+ break; -+ -+ case SCI_GETBIDIRECTIONAL: -+ return static_cast<sptr_t>(bidirectional); -+ - // Marker definition and setting - case SCI_MARKERDEFINE: - if (wParam <= MARKER_MAX) { -diff -r 5246ca55cf24 -r 73343682cbda win32/ScintillaWin.cxx ---- a/win32/ScintillaWin.cxx Wed Jan 10 10:04:03 2018 +1100 -+++ b/win32/ScintillaWin.cxx Tue Dec 19 15:00:40 2017 +1100 -@@ -1744,6 +1744,17 @@ - } - break; - -+ case SCI_SETBIDIRECTIONAL: -+ if (technology == SC_TECHNOLOGY_DEFAULT) { -+ bidirectional = EditModel::Bidirectional::bidiDisabled; -+ } else if ((wParam >= SC_BIDIRECTIONAL_DISABLED) && (wParam <= SC_BIDIRECTIONAL_R2L)) { -+ bidirectional = static_cast<EditModel::Bidirectional>(wParam); -+ } -+ // Invalidate all cached information including layout. -+ DropGraphics(true); -+ InvalidateStyleRedraw(); -+ break; -+ - #ifdef SCI_LEXER - case SCI_LOADLEXERLIBRARY: - LexerManager::GetInstance()->Load(reinterpret_cast<const char *>(lParam)); diff --git a/src/scintilla_backports/6434_ed27432729c3.patch b/src/scintilla_backports/6434_ed27432729c3.patch deleted file mode 100644 index fafca810..00000000 --- a/src/scintilla_backports/6434_ed27432729c3.patch +++ /dev/null @@ -1,50 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1517090168 -39600 -# Node ID ed27432729c386c48ef4f11459aeb2ed1f0856c8 -# Parent 231ac99e1fdc2b0fa62668cf5495b2f7df3f4d82 -Use std::abs in preference to abs as std::abs is generic and abs casts to int -which may drop information. - -diff -r 231ac99e1fdc -r ed27432729c3 src/Document.cxx ---- a/src/Document.cxx Sun Jan 28 08:32:17 2018 +1100 -+++ b/src/Document.cxx Sun Jan 28 08:56:08 2018 +1100 -@@ -10,6 +10,7 @@ - #include <cassert> - #include <cstring> - #include <cstdio> -+#include <cmath> - - #include <stdexcept> - #include <string> -@@ -877,7 +878,7 @@ - const Sci::Position posNext = NextPosition(pos, increment); - if (posNext == pos) - return INVALID_POSITION; -- if (abs(pos-posNext) > 3) // 4 byte character = 2*UTF16. -+ if (std::abs(pos-posNext) > 3) // 4 byte character = 2*UTF16. - characterOffset -= increment; - pos = posNext; - characterOffset -= increment; -diff -r 231ac99e1fdc -r ed27432729c3 src/Editor.cxx ---- a/src/Editor.cxx Sun Jan 28 08:32:17 2018 +1100 -+++ b/src/Editor.cxx Sun Jan 28 08:56:08 2018 +1100 -@@ -11,8 +11,8 @@ - #include <cstring> - #include <cctype> - #include <cstdio> -- - #include <cmath> -+ - #include <stdexcept> - #include <string> - #include <vector> -@@ -934,7 +934,7 @@ - // Try to optimise small scrolls - #ifndef UNDER_CE - const Sci::Line linesToMove = topLine - topLineNew; -- const bool performBlit = (abs(linesToMove) <= 10) && (paintState == notPainting); -+ const bool performBlit = (std::abs(linesToMove) <= 10) && (paintState == notPainting); - willRedrawAll = !performBlit; - #endif - SetTopLine(topLineNew); diff --git a/src/scintilla_backports/6441_92c8f0f1b3e6.patch b/src/scintilla_backports/6441_92c8f0f1b3e6.patch deleted file mode 100644 index edcc6338..00000000 --- a/src/scintilla_backports/6441_92c8f0f1b3e6.patch +++ /dev/null @@ -1,157 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1516925530 -39600 -# Node ID 92c8f0f1b3e64900cbb868a56936898693b9cfcc -# Parent a1731ae83d2ac87c29f6b502efc5c4a747e0b704 -Add documentOption argument to SCI_CREATELOADER. - -diff -r a1731ae83d2a -r 92c8f0f1b3e6 doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Tue Jan 30 12:40:53 2018 +1100 -+++ b/doc/ScintillaDoc.html Fri Jan 26 11:12:10 2018 +1100 -@@ -119,7 +119,7 @@ - - <h1>Scintilla Documentation</h1> - -- <p>Last edited 10 January 2018 NH</p> -+ <p>Last edited 31 January 2018 NH</p> - - <p>There is <a class="jump" href="Design.html">an overview of the internal design of - Scintilla</a>.<br /> -@@ -5711,7 +5711,7 @@ - <code><a class="message" href="#SCI_GETDOCPOINTER">SCI_GETDOCPOINTER → document *</a><br /> - <a class="message" href="#SCI_SETDOCPOINTER">SCI_SETDOCPOINTER(<unused>, document - *doc)</a><br /> -- <a class="message" href="#SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT → document *</a><br /> -+ <a class="message" href="#SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT(int bytes, int documentOption) → document *</a><br /> - <a class="message" href="#SCI_ADDREFDOCUMENT">SCI_ADDREFDOCUMENT(<unused>, document - *doc)</a><br /> - <a class="message" href="#SCI_RELEASEDOCUMENT">SCI_RELEASEDOCUMENT(<unused>, document -@@ -5732,13 +5732,20 @@ - window.<br /> - 6. If <code class="parameter">doc</code> was not 0, its reference count is increased by 1.</p> - -- <p><b id="SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT → document *</b><br /> -+ <p><b id="SCI_CREATEDOCUMENT">SCI_CREATEDOCUMENT(int bytes, int documentOption) → document *</b><br /> - This message creates a new, empty document and returns a pointer to it. This document is not -- selected into the editor and starts with a reference count of 1. This means that you have -- ownership of it and must either reduce its reference count by 1 after using -+ selected into the editor and starts with a reference count of 1. This means that you have -+ ownership of it and must either reduce its reference count by 1 after using - <code>SCI_SETDOCPOINTER</code> so that the Scintilla window owns it or you must make sure that -- you reduce the reference count by 1 with <code>SCI_RELEASEDOCUMENT</code> before you close the -- application to avoid memory leaks.</p> -+ you reduce the reference count by 1 with <code>SCI_RELEASEDOCUMENT</code> before you close the -+ application to avoid memory leaks. The <code class="parameter">bytes</code> argument determines -+ the initial memory allocation for the document as it is more efficient -+ to allocate once rather than rely on the buffer growing as data is added. -+ If <code>SCI_CREATEDOCUMENT</code> fails then 0 is returned.</p> -+ -+ <p>The <code class="parameter">documentOption</code> argument may be used in future versions -+ to choose between different document capabilities which affect memory allocation and performance. -+ The only valid value for now is <code>SC_DOCUMENTOPTION_DEFAULT</code> (0).</p> - - <p><b id="SCI_ADDREFDOCUMENT">SCI_ADDREFDOCUMENT(<unused>, document *doc)</b><br /> - This increases the reference count of a document by 1. If you want to replace the current -@@ -5765,7 +5772,7 @@ - - <h3 id="BackgroundLoad">Loading in the background</h3> - -- <code><a class="message" href="#SCI_CREATELOADER">SCI_CREATELOADER(int bytes) → int</a><br /> -+ <code><a class="message" href="#SCI_CREATELOADER">SCI_CREATELOADER(int bytes, int documentOption) → int</a><br /> - </code> - - <p>An application can load all of a file into a buffer it allocates on a background thread and then add the data in that buffer -@@ -5774,13 +5781,17 @@ - - <p>To avoid these issues, a loader object may be created and used to load the file. The loader object supports the ILoader interface.</p> - -- <p><b id="SCI_CREATELOADER">SCI_CREATELOADER(int bytes) → int</b><br /> -+ <p><b id="SCI_CREATELOADER">SCI_CREATELOADER(int bytes, int documentOption) → int</b><br /> - Create an object that supports the <code>ILoader</code> interface which can be used to load data and then - be turned into a Scintilla document object for attachment to a view object. - The <code class="parameter">bytes</code> argument determines the initial memory allocation for the document as it is more efficient - to allocate once rather than rely on the buffer growing as data is added. - If <code>SCI_CREATELOADER</code> fails then 0 is returned.</p> - -+ <p>The <code class="parameter">documentOption</code> argument may be used in future versions -+ to choose between different document capabilities which affect memory allocation and performance. -+ The only valid value for now is <code>SC_DOCUMENTOPTION_DEFAULT</code> (0).</p> -+ - <h4>ILoader</h4> - - <div class="highlighted"> -@@ -6573,7 +6584,7 @@ - On GTK+, there are storage and performance costs to accessibility, so it can be disabled - by calling <code>SCI_SETACCESSIBILITY</code>. - </p> -- -+ - <table class="standard" summary="Accessibility status"> - <tbody> - <tr> -@@ -6603,7 +6614,7 @@ - </tr> - </tbody> - </table> -- -+ - <h2 id="Lexer">Lexer</h2> - - <p>If you define the symbol <code>SCI_LEXER</code> when building Scintilla, (this is sometimes -@@ -6894,7 +6905,7 @@ - <p> - Methods that return strings as <code>const char *</code> are not required to maintain separate allocations indefinitely: - lexer implementations may own a single buffer that is reused for each call. --Callers should make an immediate copy of returned strings. -+Callers should make an immediate copy of returned strings. - </p> - - <p> -diff -r a1731ae83d2a -r 92c8f0f1b3e6 include/Scintilla.h ---- a/include/Scintilla.h Tue Jan 30 12:40:53 2018 +1100 -+++ b/include/Scintilla.h Fri Jan 26 11:12:10 2018 +1100 -@@ -689,6 +689,7 @@ - #define SCI_SELECTIONISRECTANGLE 2372 - #define SCI_SETZOOM 2373 - #define SCI_GETZOOM 2374 -+#define SC_DOCUMENTOPTION_DEFAULT 0 - #define SCI_CREATEDOCUMENT 2375 - #define SCI_ADDREFDOCUMENT 2376 - #define SCI_RELEASEDOCUMENT 2377 -diff -r a1731ae83d2a -r 92c8f0f1b3e6 include/Scintilla.iface ---- a/include/Scintilla.iface Tue Jan 30 12:40:53 2018 +1100 -+++ b/include/Scintilla.iface Fri Jan 26 11:12:10 2018 +1100 -@@ -1771,9 +1771,12 @@ - # Retrieve the zoom level. - get int GetZoom=2374(,) - -+enu DocumentOption=SC_DOCUMENTOPTION_ -+val SC_DOCUMENTOPTION_DEFAULT=0 -+ - # Create a new document object. - # Starts with reference count of 1 and not selected into editor. --fun int CreateDocument=2375(,) -+fun int CreateDocument=2375(int bytes, int documentOption) - # Extend life of document. - fun void AddRefDocument=2376(, int doc) - # Release a reference to the document, deleting document if it fades to black. -@@ -2540,7 +2543,7 @@ - get int GetTechnology=2631(,) - - # Create an ILoader*. --fun int CreateLoader=2632(int bytes,) -+fun int CreateLoader=2632(int bytes, int documentOption) - - # On OS X, show a find indicator. - fun void FindIndicatorShow=2640(position start, position end) -diff -r a1731ae83d2a -r 92c8f0f1b3e6 src/Editor.cxx ---- a/src/Editor.cxx Tue Jan 30 12:40:53 2018 +1100 -+++ b/src/Editor.cxx Fri Jan 26 11:12:10 2018 +1100 -@@ -7556,6 +7556,7 @@ - case SCI_CREATEDOCUMENT: { - Document *doc = new Document(); - doc->AddRef(); -+ doc->Allocate(static_cast<int>(wParam)); - return reinterpret_cast<sptr_t>(doc); - } - diff --git a/src/scintilla_backports/6442_3e3bfe29a819.patch b/src/scintilla_backports/6442_3e3bfe29a819.patch deleted file mode 100644 index acc6dbae..00000000 --- a/src/scintilla_backports/6442_3e3bfe29a819.patch +++ /dev/null @@ -1,319 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1516950278 -39600 -# Node ID 3e3bfe29a819c1f7a1761096ec54e9b6ee446a68 -# Parent 92c8f0f1b3e64900cbb868a56936898693b9cfcc -Extend SplitVector to allow more than 2 billion elements on 64-bit systems. - -diff -r 92c8f0f1b3e6 -r 3e3bfe29a819 src/CellBuffer.cxx ---- a/src/CellBuffer.cxx Fri Jan 26 11:12:10 2018 +1100 -+++ b/src/CellBuffer.cxx Fri Jan 26 18:04:38 2018 +1100 -@@ -394,7 +394,7 @@ - } - - Sci::Position CellBuffer::GapPosition() const { -- return substance.GapPosition(); -+ return static_cast<Sci::Position>(substance.GapPosition()); - } - - // The char* returned is to an allocation owned by the undo history -@@ -457,7 +457,7 @@ - } - - Sci::Position CellBuffer::Length() const { -- return substance.Length(); -+ return static_cast<Sci::Position>(substance.Length()); - } - - void CellBuffer::Allocate(Sci::Position newSize) { -diff -r 92c8f0f1b3e6 -r 3e3bfe29a819 src/Partitioning.h ---- a/src/Partitioning.h Fri Jan 26 11:12:10 2018 +1100 -+++ b/src/Partitioning.h Fri Jan 26 18:04:38 2018 +1100 -@@ -16,7 +16,7 @@ - - class SplitVectorWithRangeAdd : public SplitVector<int> { - public: -- explicit SplitVectorWithRangeAdd(int growSize_) { -+ explicit SplitVectorWithRangeAdd(ptrdiff_t growSize_) { - SetGrowSize(growSize_); - ReAllocate(growSize_); - } -@@ -25,12 +25,12 @@ - void operator=(const SplitVectorWithRangeAdd &) = delete; - ~SplitVectorWithRangeAdd() { - } -- void RangeAddDelta(int start, int end, int delta) { -+ void RangeAddDelta(ptrdiff_t start, ptrdiff_t end, int delta) { - // end is 1 past end, so end-start is number of elements to change -- int i = 0; -- const int rangeLength = end - start; -- int range1Length = rangeLength; -- const int part1Left = part1Length - start; -+ ptrdiff_t i = 0; -+ const ptrdiff_t rangeLength = end - start; -+ ptrdiff_t range1Length = rangeLength; -+ const ptrdiff_t part1Left = part1Length - start; - if (range1Length > part1Left) - range1Length = part1Left; - while (i < range1Length) { -@@ -67,7 +67,7 @@ - } - stepPartition = partitionUpTo; - if (stepPartition >= body->Length()-1) { -- stepPartition = body->Length()-1; -+ stepPartition = Partitions(); - stepLength = 0; - } - } -@@ -80,7 +80,7 @@ - stepPartition = partitionDownTo; - } - -- void Allocate(int growSize) { -+ void Allocate(ptrdiff_t growSize) { - body = new SplitVectorWithRangeAdd(growSize); - stepPartition = 0; - stepLength = 0; -@@ -101,7 +101,7 @@ - } - - int Partitions() const { -- return body->Length()-1; -+ return static_cast<int>(body->Length()-1); - } - - void InsertPartition(int partition, int pos) { -@@ -132,7 +132,7 @@ - BackStep(partitionInsert); - stepLength += delta; - } else { -- ApplyStep(body->Length()-1); -+ ApplyStep(Partitions()); - stepPartition = partitionInsert; - stepLength = delta; - } -@@ -168,10 +168,10 @@ - int PartitionFromPosition(int pos) const { - if (body->Length() <= 1) - return 0; -- if (pos >= (PositionFromPartition(body->Length()-1))) -- return body->Length() - 1 - 1; -+ if (pos >= (PositionFromPartition(Partitions()))) -+ return Partitions() - 1; - int lower = 0; -- int upper = body->Length()-1; -+ int upper = Partitions(); - do { - const int middle = (upper + lower + 1) / 2; // Round high - int posMiddle = body->ValueAt(middle); -diff -r 92c8f0f1b3e6 -r 3e3bfe29a819 src/PerLine.cxx ---- a/src/PerLine.cxx Fri Jan 26 11:12:10 2018 +1100 -+++ b/src/PerLine.cxx Fri Jan 26 18:04:38 2018 +1100 -@@ -135,7 +135,7 @@ - Sci::Line LineMarkers::MarkerNext(Sci::Line lineStart, int mask) const { - if (lineStart < 0) - lineStart = 0; -- const Sci::Line length = markers.Length(); -+ const Sci::Line length = static_cast<Sci::Line>(markers.Length()); - for (Sci::Line iLine = lineStart; iLine < length; iLine++) { - const MarkerHandleSet *onLine = markers[iLine].get(); - if (onLine && ((onLine->MarkValue() & mask) != 0)) -@@ -281,7 +281,7 @@ - } - - Sci::Line LineState::GetMaxLineState() const { -- return lineStates.Length(); -+ return static_cast<Sci::Line>(lineStates.Length()); - } - - static int NumberLines(const char *text) { -diff -r 92c8f0f1b3e6 -r 3e3bfe29a819 src/SplitVector.h ---- a/src/SplitVector.h Fri Jan 26 11:12:10 2018 +1100 -+++ b/src/SplitVector.h Fri Jan 26 18:04:38 2018 +1100 -@@ -16,15 +16,15 @@ - protected: - T *body; -- int size; -- int lengthBody; -- int part1Length; -- int gapLength; /// invariant: gapLength == size - lengthBody -- int growSize; -+ ptrdiff_t size; -+ ptrdiff_t lengthBody; -+ ptrdiff_t part1Length; -+ ptrdiff_t gapLength; /// invariant: gapLength == size - lengthBody -+ ptrdiff_t growSize; - - /// Move the gap to a particular position so that insertion and - /// deletion at that point will not require much copying and - /// hence be fast. -- void GapTo(int position) { -+ void GapTo(ptrdiff_t position) { - if (position != part1Length) { - if (position < part1Length) { - // Moving the gap towards start so moving elements towards end -@@ -45,11 +45,11 @@ - - /// Check that there is room in the buffer for an insertion, - /// reallocating if more space needed. -- void RoomFor(int insertionLength) { -+ void RoomFor(ptrdiff_t insertionLength) { - if (gapLength <= insertionLength) { - while (growSize < size / 6) - growSize *= 2; - ReAllocate(size + insertionLength + growSize); - } - } - -@@ -75,18 +75,18 @@ - ~SplitVector() { - } - -- int GetGrowSize() const { -+ ptrdiff_t GetGrowSize() const { - return growSize; - } -- -- void SetGrowSize(int growSize_) { -+ -+ void SetGrowSize(ptrdiff_t growSize_) { - growSize = growSize_; - } - - /// Reallocate the storage for the buffer to be newSize and - /// copy exisiting contents to the new buffer. - /// Must not be used to decrease the size of the buffer. -- void ReAllocate(int newSize) { -+ void ReAllocate(ptrdiff_t newSize) { - if (newSize < 0) - throw std::runtime_error("SplitVector::ReAllocate: negative size."); - -@@ -104,9 +104,9 @@ - - /// Retrieve the character at a particular position. - /// Retrieving positions outside the range of the buffer returns 0. - /// The assertions here are disabled since calling code can be - /// simpler if out of range access works and returns 0. -- T ValueAt(int position) const { -+ T ValueAt(ptrdiff_t position) const { - if (position < part1Length) { - //PLATFORM_ASSERT(position >= 0); - if (position < 0) { -@@ -124,7 +124,7 @@ - } - } - -- void SetValueAt(int position, T v) { -+ void SetValueAt(ptrdiff_t position, T v) { - if (position < part1Length) { - PLATFORM_ASSERT(position >= 0); - if (position < 0) { -@@ -144,7 +144,7 @@ - } - } - -- T &operator[](int position) const { -+ T &operator[](ptrdiff_t position) const { - PLATFORM_ASSERT(position >= 0 && position < lengthBody); - if (position < part1Length) { - return body[position]; -@@ -166,13 +166,13 @@ - } - - /// Retrieve the length of the buffer. -- int Length() const { -+ ptrdiff_t Length() const { - return lengthBody; - } - - /// Insert a single value into the buffer. - /// Inserting at positions outside the current range fails. -- void Insert(int position, T v) { -+ void Insert(ptrdiff_t position, T v) { - PLATFORM_ASSERT((position >= 0) && (position <= lengthBody)); - if ((position < 0) || (position > lengthBody)) { - return; -@@ -187,7 +187,7 @@ - - /// Insert a number of elements into the buffer setting their value. - /// Inserting at positions outside the current range fails. -- void InsertValue(int position, int insertLength, T v) { -+ void InsertValue(ptrdiff_t position, ptrdiff_t insertLength, T v) { - PLATFORM_ASSERT((position >= 0) && (position <= lengthBody)); - if (insertLength > 0) { - if ((position < 0) || (position > lengthBody)) { -@@ -225,14 +225,14 @@ - - /// Ensure at least length elements allocated, - /// appending zero valued elements if needed. -- void EnsureLength(int wantedLength) { -+ void EnsureLength(ptrdiff_t wantedLength) { - if (Length() < wantedLength) { - InsertValue(Length(), wantedLength - Length(), 0); - } - } - - /// Insert text into the buffer from an array. -- void InsertFromArray(int positionToInsert, const T s[], int positionFrom, int insertLength) { -+ void InsertFromArray(ptrdiff_t positionToInsert, const T s[], ptrdiff_t positionFrom, ptrdiff_t insertLength) { - PLATFORM_ASSERT((positionToInsert >= 0) && (positionToInsert <= lengthBody)); - if (insertLength > 0) { - if ((positionToInsert < 0) || (positionToInsert > lengthBody)) { -@@ -248,7 +248,7 @@ - } - - /// Delete one element from the buffer. -- void Delete(int position) { -+ void Delete(ptrdiff_t position) { - PLATFORM_ASSERT((position >= 0) && (position < lengthBody)); - if ((position < 0) || (position >= lengthBody)) { - return; -@@ -258,7 +258,7 @@ - - /// Delete a range from the buffer. - /// Deleting positions outside the current range fails. -- void DeleteRange(int position, int deleteLength) { -+ void DeleteRange(ptrdiff_t position, ptrdiff_t deleteLength) { - PLATFORM_ASSERT((position >= 0) && (position + deleteLength <= lengthBody)); - if ((position < 0) || ((position + deleteLength) > lengthBody)) { - return; -@@ -277,17 +277,17 @@ - // Retrieve a range of elements into an array -- void GetRange(T *buffer, int position, int retrieveLength) const { -+ void GetRange(T *buffer, ptrdiff_t position, ptrdiff_t retrieveLength) const { - // Split into up to 2 ranges, before and after the split then use memcpy on each. -- int range1Length = 0; -+ ptrdiff_t range1Length = 0; - if (position < part1Length) { -- const int part1AfterPosition = part1Length - position; -+ const ptrdiff_t part1AfterPosition = part1Length - position; - range1Length = retrieveLength; - if (range1Length > part1AfterPosition) - range1Length = part1AfterPosition; - } - std::copy(body + position, body + position + range1Length, buffer); - buffer += range1Length; - position = position + range1Length + gapLength; -- int range2Length = retrieveLength - range1Length; -+ ptrdiff_t range2Length = retrieveLength - range1Length; - std::copy(body + position, body + position + range2Length, buffer); - } - -@@ -308,7 +308,7 @@ - return body; - } - -- T *RangePointer(int position, int rangeLength) { -+ T *RangePointer(ptrdiff_t position, ptrdiff_t rangeLength) { - if (position < part1Length) { - if ((position + rangeLength) > part1Length) { - // Range overlaps gap, so move gap to start of range. -@@ -323,7 +323,7 @@ - } - } - -- int GapPosition() const { -+ ptrdiff_t GapPosition() const { - return part1Length; - } - }; diff --git a/src/scintilla_backports/6444_1bd57324aa36.patch b/src/scintilla_backports/6444_1bd57324aa36.patch deleted file mode 100644 index 93552ba4..00000000 --- a/src/scintilla_backports/6444_1bd57324aa36.patch +++ /dev/null @@ -1,279 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1517436441 -39600 -# Node ID 1bd57324aa36e3fce1ed8a2371001b062322884b -# Parent ab4efcbfdae68d1ec053db212edb1440326a7f1c -Templatize Partitioning so it can hold different types. - -diff -r ab4efcbfdae6 -r 1bd57324aa36 src/CellBuffer.h ---- a/src/CellBuffer.h Wed Jan 31 17:08:48 2018 +1100 -+++ b/src/CellBuffer.h Thu Feb 01 09:07:21 2018 +1100 -@@ -24,7 +24,7 @@ - */ - class LineVector { - -- Partitioning starts; -+ Partitioning<int> starts; - PerLine *perLine; - - public: -diff -r ab4efcbfdae6 -r 1bd57324aa36 src/ContractionState.cxx ---- a/src/ContractionState.cxx Wed Jan 31 17:08:48 2018 +1100 -+++ b/src/ContractionState.cxx Thu Feb 01 09:07:21 2018 +1100 -@@ -39,7 +39,7 @@ - expanded = new RunStyles(); - heights = new RunStyles(); - foldDisplayTexts = new SparseVector<const char *>(); -- displayLines = new Partitioning(4); -+ displayLines = new Partitioning<int>(4); - InsertLines(0, linesInDocument); - } - } -diff -r ab4efcbfdae6 -r 1bd57324aa36 src/ContractionState.h ---- a/src/ContractionState.h Wed Jan 31 17:08:48 2018 +1100 -+++ b/src/ContractionState.h Thu Feb 01 09:07:21 2018 +1100 -@@ -21,7 +21,7 @@ - RunStyles *expanded; - RunStyles *heights; - SparseVector<const char *> *foldDisplayTexts; -- Partitioning *displayLines; -+ Partitioning<int> *displayLines; - Sci::Line linesInDocument; - - void EnsureData(); -diff -r ab4efcbfdae6 -r 1bd57324aa36 src/Partitioning.h ---- a/src/Partitioning.h Wed Jan 31 17:08:48 2018 +1100 -+++ b/src/Partitioning.h Thu Feb 01 09:07:21 2018 +1100 -@@ -14,29 +14,30 @@ - /// in a range. - /// Used by the Partitioning class. - --class SplitVectorWithRangeAdd : public SplitVector<int> { -+template <typename T> -+class SplitVectorWithRangeAdd : public SplitVector<T> { - public: - explicit SplitVectorWithRangeAdd(ptrdiff_t growSize_) { -- SetGrowSize(growSize_); -- ReAllocate(growSize_); -+ this->SetGrowSize(growSize_); -+ this->ReAllocate(growSize_); - } - ~SplitVectorWithRangeAdd() { - } -- void RangeAddDelta(ptrdiff_t start, ptrdiff_t end, int delta) { -+ void RangeAddDelta(ptrdiff_t start, ptrdiff_t end, T delta) { - // end is 1 past end, so end-start is number of elements to change - ptrdiff_t i = 0; - const ptrdiff_t rangeLength = end - start; - ptrdiff_t range1Length = rangeLength; -- const ptrdiff_t part1Left = part1Length - start; -+ const ptrdiff_t part1Left = this->part1Length - start; - if (range1Length > part1Left) - range1Length = part1Left; - while (i < range1Length) { -- body[start++] += delta; -+ this->body[start++] += delta; - i++; - } -- start += gapLength; -+ start += this->gapLength; - while (i < rangeLength) { -- body[start++] += delta; -+ this->body[start++] += delta; - i++; - } - } -@@ -52,16 +53,17 @@ - /// When needed, positions after the interval are considered part of the last partition - /// but the end of the last partition can be found with PositionFromPartition(last+1). - -+template <typename T> - class Partitioning { - private: - // To avoid calculating all the partition positions whenever any text is inserted - // there may be a step somewhere in the list. -- int stepPartition; -- int stepLength; -- SplitVectorWithRangeAdd *body; -+ T stepPartition; -+ T stepLength; -+ SplitVectorWithRangeAdd<T> *body; - - // Move step forward -- void ApplyStep(int partitionUpTo) { -+ void ApplyStep(T partitionUpTo) { - if (stepLength != 0) { - body->RangeAddDelta(stepPartition+1, partitionUpTo + 1, stepLength); - } -@@ -73,7 +75,7 @@ - } - - // Move step backward -- void BackStep(int partitionDownTo) { -+ void BackStep(T partitionDownTo) { - if (stepLength != 0) { - body->RangeAddDelta(partitionDownTo+1, stepPartition+1, -stepLength); - } -@@ -81,7 +83,7 @@ - } - - void Allocate(ptrdiff_t growSize) { -- body = new SplitVectorWithRangeAdd(growSize); -+ body = new SplitVectorWithRangeAdd<T>(growSize); - stepPartition = 0; - stepLength = 0; - body->Insert(0, 0); // This value stays 0 for ever -@@ -100,11 +102,11 @@ - ~Partitioning() { - } - -- int Partitions() const { -- return static_cast<int>(body->Length()-1); -+ T Partitions() const { -+ return static_cast<T>(body->Length())-1; - } - -- void InsertPartition(int partition, int pos) { -+ void InsertPartition(T partition, T pos) { - if (stepPartition < partition) { - ApplyStep(partition); - } -@@ -112,7 +114,7 @@ - stepPartition++; - } - -- void SetPartitionStartPosition(int partition, int pos) { -+ void SetPartitionStartPosition(T partition, T pos) { - ApplyStep(partition+1); - if ((partition < 0) || (partition > body->Length())) { - return; -@@ -120,7 +122,7 @@ - body->SetValueAt(partition, pos); - } - -- void InsertText(int partitionInsert, int delta) { -+ void InsertText(T partitionInsert, T delta) { - // Point all the partitions after the insertion point further along in the buffer - if (stepLength != 0) { - if (partitionInsert >= stepPartition) { -@@ -142,7 +144,7 @@ - } - } - -- void RemovePartition(int partition) { -+ void RemovePartition(T partition) { - if (partition > stepPartition) { - ApplyStep(partition); - stepPartition--; -@@ -152,29 +154,29 @@ - body->Delete(partition); - } - -- int PositionFromPartition(int partition) const { -+ T PositionFromPartition(T partition) const { - PLATFORM_ASSERT(partition >= 0); - PLATFORM_ASSERT(partition < body->Length()); - if ((partition < 0) || (partition >= body->Length())) { - return 0; - } -- int pos = body->ValueAt(partition); -+ T pos = body->ValueAt(partition); - if (partition > stepPartition) - pos += stepLength; - return pos; - } - - /// Return value in range [0 .. Partitions() - 1] even for arguments outside interval -- int PartitionFromPosition(int pos) const { -+ T PartitionFromPosition(T pos) const { - if (body->Length() <= 1) - return 0; - if (pos >= (PositionFromPartition(Partitions()))) - return Partitions() - 1; -- int lower = 0; -- int upper = Partitions(); -+ T lower = 0; -+ T upper = Partitions(); - do { -- const int middle = (upper + lower + 1) / 2; // Round high -- int posMiddle = body->ValueAt(middle); -+ const T middle = (upper + lower + 1) / 2; // Round high -+ T posMiddle = body->ValueAt(middle); - if (middle > stepPartition) - posMiddle += stepLength; - if (pos < posMiddle) { -diff -r ab4efcbfdae6 -r 1bd57324aa36 src/RunStyles.cxx ---- a/src/RunStyles.cxx Wed Jan 31 17:08:48 2018 +1100 -+++ b/src/RunStyles.cxx Thu Feb 01 09:07:21 2018 +1100 -@@ -70,7 +70,7 @@ - } - - RunStyles::RunStyles() { -- starts = new Partitioning(8); -+ starts = new Partitioning<int>(8); - styles = new SplitVector<int>(); - styles->InsertValue(0, 2, 0); - } -@@ -204,7 +204,7 @@ - starts = NULL; - delete styles; - styles = NULL; -- starts = new Partitioning(8); -+ starts = new Partitioning<int>(8); - styles = new SplitVector<int>(); - styles->InsertValue(0, 2, 0); - } -diff -r ab4efcbfdae6 -r 1bd57324aa36 src/RunStyles.h ---- a/src/RunStyles.h Wed Jan 31 17:08:48 2018 +1100 -+++ b/src/RunStyles.h Thu Feb 01 09:07:21 2018 +1100 -@@ -14,7 +14,7 @@ - - class RunStyles { - private: -- Partitioning *starts; -+ Partitioning<int> *starts; - SplitVector<int> *styles; - int RunFromPosition(int position) const; - int SplitRun(int position); -diff -r ab4efcbfdae6 -r 1bd57324aa36 src/SparseVector.h ---- a/src/SparseVector.h Wed Jan 31 17:08:48 2018 +1100 -+++ b/src/SparseVector.h Thu Feb 01 09:07:21 2018 +1100 -@@ -15,7 +15,7 @@ - template <typename T> - class SparseVector { - private: -- Partitioning *starts; -+ Partitioning<int> *starts; - SplitVector<T> *values; - // Private so SparseVector objects can not be copied - SparseVector(const SparseVector &); -@@ -26,7 +26,7 @@ - } - public: - SparseVector() { -- starts = new Partitioning(8); -+ starts = new Partitioning<int>(8); - values = new SplitVector<T>(); - values->InsertValue(0, 2, T()); - } -diff -r ab4efcbfdae6 -r 1bd57324aa36 test/unit/testPartitioning.cxx ---- a/test/unit/testPartitioning.cxx Wed Jan 31 17:08:48 2018 +1100 -+++ b/test/unit/testPartitioning.cxx Thu Feb 01 09:07:21 2018 +1100 -@@ -26,7 +26,7 @@ - - TEST_CASE("SplitVectorWithRangeAdd") { - -- SplitVectorWithRangeAdd svwra(growSize); -+ SplitVectorWithRangeAdd<int> svwra(growSize); - - SECTION("IsEmptyInitially") { - REQUIRE(0 == svwra.Length()); -@@ -49,7 +49,7 @@ - - TEST_CASE("Partitioning") { - -- Partitioning part(growSize); -+ Partitioning<int> part(growSize); - - SECTION("IsEmptyInitially") { - REQUIRE(1 == part.Partitions()); diff --git a/src/scintilla_backports/6445_89d992f380a1.patch b/src/scintilla_backports/6445_89d992f380a1.patch deleted file mode 100644 index b0b9acae..00000000 --- a/src/scintilla_backports/6445_89d992f380a1.patch +++ /dev/null @@ -1,418 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1517437334 -39600 -# Node ID 89d992f380a1ce28a3ba6934230388ffaf1ea611 -# Parent 1bd57324aa36e3fce1ed8a2371001b062322884b -Templatize RunStyles so it can be over ranges of different types and contain -different style types. -Currently only instantiated over <int, int>. - -diff -r 1bd57324aa36 -r 89d992f380a1 src/ContractionState.cxx ---- a/src/ContractionState.cxx Thu Feb 01 09:07:21 2018 +1100 -+++ b/src/ContractionState.cxx Thu Feb 01 09:22:14 2018 +1100 -@@ -35,9 +35,9 @@ - - void ContractionState::EnsureData() { - if (OneToOne()) { -- visible = new RunStyles(); -- expanded = new RunStyles(); -- heights = new RunStyles(); -+ visible = new RunStyles<int, int>(); -+ expanded = new RunStyles<int, int>(); -+ heights = new RunStyles<int, int>(); - foldDisplayTexts = new SparseVector<const char *>(); - displayLines = new Partitioning<int>(4); - InsertLines(0, linesInDocument); -diff -r 1bd57324aa36 -r 89d992f380a1 src/ContractionState.h ---- a/src/ContractionState.h Thu Feb 01 09:07:21 2018 +1100 -+++ b/src/ContractionState.h Thu Feb 01 09:22:14 2018 +1100 -@@ -17,9 +17,9 @@ - */ - class ContractionState { - // These contain 1 element for every document line. -- RunStyles *visible; -- RunStyles *expanded; -- RunStyles *heights; -+ RunStyles<int, int> *visible; -+ RunStyles<int, int> *expanded; -+ RunStyles<int, int> *heights; - SparseVector<const char *> *foldDisplayTexts; - Partitioning<int> *displayLines; - Sci::Line linesInDocument; -diff -r 1bd57324aa36 -r 89d992f380a1 src/Decoration.h ---- a/src/Decoration.h Thu Feb 01 09:07:21 2018 +1100 -+++ b/src/Decoration.h Thu Feb 01 09:22:14 2018 +1100 -@@ -12,7 +12,7 @@ - class Decoration { - int indicator; - public: - Decoration *next; -- RunStyles rs; -+ RunStyles<int, int> rs; - - explicit Decoration(int indicator_); -diff -r 1bd57324aa36 -r 89d992f380a1 src/RunStyles.cxx ---- a/src/RunStyles.cxx Thu Feb 01 09:07:21 2018 +1100 -+++ b/src/RunStyles.cxx Thu Feb 01 09:22:14 2018 +1100 -@@ -26,8 +26,9 @@ - using namespace Scintilla; - - // Find the first run at a position --int RunStyles::RunFromPosition(int position) const { -- int run = starts->PartitionFromPosition(position); -+template <typename DISTANCE, typename STYLE> -+DISTANCE RunStyles<DISTANCE, STYLE>::RunFromPosition(DISTANCE position) const { -+ DISTANCE run = starts->PartitionFromPosition(position); - // Go to first element with this position - while ((run > 0) && (position == starts->PositionFromPartition(run-1))) { - run--; -@@ -36,11 +37,12 @@ - } - - // If there is no run boundary at position, insert one continuing style. --int RunStyles::SplitRun(int position) { -- int run = RunFromPosition(position); -- const int posRun = starts->PositionFromPartition(run); -+template <typename DISTANCE, typename STYLE> -+DISTANCE RunStyles<DISTANCE, STYLE>::SplitRun(DISTANCE position) { -+ DISTANCE run = RunFromPosition(position); -+ const DISTANCE posRun = starts->PositionFromPartition(run); - if (posRun < position) { -- int runStyle = ValueAt(position); -+ STYLE runStyle = ValueAt(position); - run++; - starts->InsertPartition(run, position); - styles->InsertValue(run, 1, runStyle); -@@ -48,12 +50,14 @@ - return run; - } - --void RunStyles::RemoveRun(int run) { -+template <typename DISTANCE, typename STYLE> -+void RunStyles<DISTANCE, STYLE>::RemoveRun(DISTANCE run) { - starts->RemovePartition(run); - styles->DeleteRange(run, 1); - } - --void RunStyles::RemoveRunIfEmpty(int run) { -+template <typename DISTANCE, typename STYLE> -+void RunStyles<DISTANCE, STYLE>::RemoveRunIfEmpty(DISTANCE run) { - if ((run < starts->Partitions()) && (starts->Partitions() > 1)) { - if (starts->PositionFromPartition(run) == starts->PositionFromPartition(run+1)) { - RemoveRun(run); -@@ -61,7 +65,8 @@ - } - } - --void RunStyles::RemoveRunIfSameAsPrevious(int run) { -+template <typename DISTANCE, typename STYLE> -+void RunStyles<DISTANCE, STYLE>::RemoveRunIfSameAsPrevious(DISTANCE run) { - if ((run > 0) && (run < starts->Partitions())) { - if (styles->ValueAt(run-1) == styles->ValueAt(run)) { - RemoveRun(run); -@@ -69,34 +74,39 @@ - } - } - --RunStyles::RunStyles() { -- starts = new Partitioning<int>(8); -- styles = new SplitVector<int>(); -+template <typename DISTANCE, typename STYLE> -+RunStyles<DISTANCE, STYLE>::RunStyles() { -+ starts = new Partitioning<DISTANCE>(8); -+ styles = new SplitVector<STYLE>(); - styles->InsertValue(0, 2, 0); - } - --RunStyles::~RunStyles() { -+template <typename DISTANCE, typename STYLE> -+RunStyles<DISTANCE, STYLE>::~RunStyles() { - delete starts; - starts = NULL; - delete styles; - styles = NULL; - } - --int RunStyles::Length() const { -+template <typename DISTANCE, typename STYLE> -+DISTANCE RunStyles<DISTANCE, STYLE>::Length() const { - return starts->PositionFromPartition(starts->Partitions()); - } - --int RunStyles::ValueAt(int position) const { -+template <typename DISTANCE, typename STYLE> -+STYLE RunStyles<DISTANCE, STYLE>::ValueAt(DISTANCE position) const { - return styles->ValueAt(starts->PartitionFromPosition(position)); - } - --int RunStyles::FindNextChange(int position, int end) const { -- const int run = starts->PartitionFromPosition(position); -+template <typename DISTANCE, typename STYLE> -+DISTANCE RunStyles<DISTANCE, STYLE>::FindNextChange(DISTANCE position, DISTANCE end) const { -+ const DISTANCE run = starts->PartitionFromPosition(position); - if (run < starts->Partitions()) { -- const int runChange = starts->PositionFromPartition(run); -+ const DISTANCE runChange = starts->PositionFromPartition(run); - if (runChange > position) - return runChange; -- const int nextChange = starts->PositionFromPartition(run + 1); -+ const DISTANCE nextChange = starts->PositionFromPartition(run + 1); - if (nextChange > position) { - return nextChange; - } else if (position < end) { -@@ -105,23 +115,26 @@ - } - } - --int RunStyles::StartRun(int position) const { -+template <typename DISTANCE, typename STYLE> -+DISTANCE RunStyles<DISTANCE, STYLE>::StartRun(DISTANCE position) const { - return starts->PositionFromPartition(starts->PartitionFromPosition(position)); - } - --int RunStyles::EndRun(int position) const { -+template <typename DISTANCE, typename STYLE> -+DISTANCE RunStyles<DISTANCE, STYLE>::EndRun(DISTANCE position) const { - return starts->PositionFromPartition(starts->PartitionFromPosition(position) + 1); - } - --bool RunStyles::FillRange(int &position, int value, int &fillLength) { -+template <typename DISTANCE, typename STYLE> -+bool RunStyles<DISTANCE, STYLE>::FillRange(DISTANCE &position, STYLE value, DISTANCE &fillLength) { - if (fillLength <= 0) { - return false; - } -- int end = position + fillLength; -+ DISTANCE end = position + fillLength; - if (end > Length()) { - return false; - } -- int runEnd = RunFromPosition(end); -+ DISTANCE runEnd = RunFromPosition(end); - if (styles->ValueAt(runEnd) == value) { - // End already has value so trim range. - end = starts->PositionFromPartition(runEnd); -@@ -133,7 +146,7 @@ - } else { - runEnd = SplitRun(end); - } -- int runStart = RunFromPosition(position); -+ DISTANCE runStart = RunFromPosition(position); - if (styles->ValueAt(runStart) == value) { - // Start is in expected value so trim range. - runStart++; -@@ -148,7 +161,7 @@ - if (runStart < runEnd) { - styles->SetValueAt(runStart, value); - // Remove each old run over the range -- for (int run=runStart+1; run<runEnd; run++) { -+ for (DISTANCE run=runStart+1; run<runEnd; run++) { - RemoveRun(runStart+1); - } - runEnd = RunFromPosition(end); -@@ -162,20 +175,22 @@ - } - } - --void RunStyles::SetValueAt(int position, int value) { -- int len = 1; -+template <typename DISTANCE, typename STYLE> -+void RunStyles<DISTANCE, STYLE>::SetValueAt(DISTANCE position, STYLE value) { -+ DISTANCE len = 1; - FillRange(position, value, len); - } - --void RunStyles::InsertSpace(int position, int insertLength) { -- int runStart = RunFromPosition(position); -+template <typename DISTANCE, typename STYLE> -+void RunStyles<DISTANCE, STYLE>::InsertSpace(DISTANCE position, DISTANCE insertLength) { -+ DISTANCE runStart = RunFromPosition(position); - if (starts->PositionFromPartition(runStart) == position) { -- int runStyle = ValueAt(position); -+ STYLE runStyle = ValueAt(position); - // Inserting at start of run so make previous longer - if (runStart == 0) { - // Inserting at start of document so ensure 0 - if (runStyle) { -- styles->SetValueAt(0, 0); -+ styles->SetValueAt(0, STYLE()); - starts->InsertPartition(1, 0); - styles->InsertValue(1, 1, runStyle); - starts->InsertText(0, insertLength); -@@ -195,20 +210,22 @@ - } - } - --void RunStyles::DeleteAll() { -+template <typename DISTANCE, typename STYLE> -+void RunStyles<DISTANCE, STYLE>::DeleteAll() { - delete starts; - starts = NULL; - delete styles; - styles = NULL; -- starts = new Partitioning<int>(8); -- styles = new SplitVector<int>(); -+ starts = new Partitioning<DISTANCE>(8); -+ styles = new SplitVector<STYLE>(); - styles->InsertValue(0, 2, 0); - } - --void RunStyles::DeleteRange(int position, int deleteLength) { -- int end = position + deleteLength; -- int runStart = RunFromPosition(position); -- int runEnd = RunFromPosition(end); -+template <typename DISTANCE, typename STYLE> -+void RunStyles<DISTANCE, STYLE>::DeleteRange(DISTANCE position, DISTANCE deleteLength) { -+ DISTANCE end = position + deleteLength; -+ DISTANCE runStart = RunFromPosition(position); -+ DISTANCE runEnd = RunFromPosition(end); - if (runStart == runEnd) { - // Deleting from inside one run - starts->InsertText(runStart, -deleteLength); -@@ -214,7 +231,7 @@ - runEnd = SplitRun(end); - starts->InsertText(runStart, -deleteLength); - // Remove each old run over the range -- for (int run=runStart; run<runEnd; run++) { -+ for (DISTANCE run=runStart; run<runEnd; run++) { - RemoveRun(runStart); - } - RemoveRunIfEmpty(runStart); -@@ -222,11 +239,13 @@ - } - } - --int RunStyles::Runs() const { -+template <typename DISTANCE, typename STYLE> -+DISTANCE RunStyles<DISTANCE, STYLE>::Runs() const { - return starts->Partitions(); - } - --bool RunStyles::AllSame() const { -+template <typename DISTANCE, typename STYLE> -+bool RunStyles<DISTANCE, STYLE>::AllSame() const { - for (int run = 1; run < starts->Partitions(); run++) { - if (styles->ValueAt(run) != styles->ValueAt(run - 1)) - return false; -@@ -234,13 +253,15 @@ - return true; - } - --bool RunStyles::AllSameAs(int value) const { -+template <typename DISTANCE, typename STYLE> -+bool RunStyles<DISTANCE, STYLE>::AllSameAs(STYLE value) const { - return AllSame() && (styles->ValueAt(0) == value); - } - --int RunStyles::Find(int value, int start) const { -+template <typename DISTANCE, typename STYLE> -+DISTANCE RunStyles<DISTANCE, STYLE>::Find(STYLE value, DISTANCE start) const { - if (start < Length()) { -- int run = start ? RunFromPosition(start) : 0; -+ DISTANCE run = start ? RunFromPosition(start) : 0; - if (styles->ValueAt(run) == value) - return start; - run++; -@@ -253,7 +274,8 @@ - return -1; - } - --void RunStyles::Check() const { -+template <typename DISTANCE, typename STYLE> -+void RunStyles<DISTANCE, STYLE>::Check() const { - if (Length() < 0) { - throw std::runtime_error("RunStyles: Length can not be negative."); - } -@@ -263,9 +285,9 @@ - if (starts->Partitions() != styles->Length()-1) { - throw std::runtime_error("RunStyles: Partitions and styles different lengths."); - } -- int start=0; -+ DISTANCE start=0; - while (start < Length()) { -- const int end = EndRun(start); -+ const DISTANCE end = EndRun(start); - if (start >= end) { - throw std::runtime_error("RunStyles: Partition is 0 length."); - } -@@ -280,3 +302,9 @@ - } - } - } -+ -+#ifdef SCI_NAMESPACE -+template class Scintilla::RunStyles<int, int>; -+#else -+template class RunStyles<int, int>; -+#endif -diff -r 1bd57324aa36 -r 89d992f380a1 src/RunStyles.h ---- a/src/RunStyles.h Thu Feb 01 09:07:21 2018 +1100 -+++ b/src/RunStyles.h Thu Feb 01 09:22:14 2018 +1100 -@@ -12,35 +12,36 @@ - namespace Scintilla { - #endif - -+template <typename DISTANCE, typename STYLE> - class RunStyles { - private: -- Partitioning<int> *starts; -- SplitVector<int> *styles; -- int RunFromPosition(int position) const; -- int SplitRun(int position); -- void RemoveRun(int run); -- void RemoveRunIfEmpty(int run); -- void RemoveRunIfSameAsPrevious(int run); -+ Partitioning<DISTANCE> *starts; -+ SplitVector<STYLE> *styles; -+ DISTANCE RunFromPosition(DISTANCE position) const; -+ DISTANCE SplitRun(DISTANCE position); -+ void RemoveRun(DISTANCE run); -+ void RemoveRunIfEmpty(DISTANCE run); -+ void RemoveRunIfSameAsPrevious(DISTANCE run); - // Private so RunStyles objects can not be copied - RunStyles(const RunStyles &); - public: - RunStyles(); - ~RunStyles(); -- int Length() const; -- int ValueAt(int position) const; -- int FindNextChange(int position, int end) const; -- int StartRun(int position) const; -- int EndRun(int position) const; -+ DISTANCE Length() const; -+ STYLE ValueAt(DISTANCE position) const; -+ DISTANCE FindNextChange(DISTANCE position, DISTANCE end) const; -+ DISTANCE StartRun(DISTANCE position) const; -+ DISTANCE EndRun(DISTANCE position) const; - // Returns true if some values may have changed -- bool FillRange(int &position, int value, int &fillLength); -- void SetValueAt(int position, int value); -- void InsertSpace(int position, int insertLength); -+ bool FillRange(DISTANCE &position, STYLE value, DISTANCE &fillLength); -+ void SetValueAt(DISTANCE position, STYLE value); -+ void InsertSpace(DISTANCE position, DISTANCE insertLength); - void DeleteAll(); -- void DeleteRange(int position, int deleteLength); -- int Runs() const; -+ void DeleteRange(DISTANCE position, DISTANCE deleteLength); -+ DISTANCE Runs() const; - bool AllSame() const; -- bool AllSameAs(int value) const; -- int Find(int value, int start) const; -+ bool AllSameAs(STYLE value) const; -+ DISTANCE Find(STYLE value, DISTANCE start) const; - - void Check() const; - }; -diff -r 1bd57324aa36 -r 89d992f380a1 test/unit/testRunStyles.cxx ---- a/test/unit/testRunStyles.cxx Thu Feb 01 09:07:21 2018 +1100 -+++ b/test/unit/testRunStyles.cxx Thu Feb 01 09:22:14 2018 +1100 -@@ -22,7 +22,7 @@ - - TEST_CASE("RunStyles") { - -- RunStyles rs; -+ RunStyles<int, int> rs; - - SECTION("IsEmptyInitially") { - REQUIRE(0 == rs.Length()); diff --git a/src/scintilla_backports/6448_431b814a54a6.patch b/src/scintilla_backports/6448_431b814a54a6.patch deleted file mode 100644 index a0fca282..00000000 --- a/src/scintilla_backports/6448_431b814a54a6.patch +++ /dev/null @@ -1,307 +0,0 @@ -# HG changeset patch -# User Neil <nyamatongwe@gmail.com> -# Date 1517542495 -39600 -# Node ID 431b814a54a62d81c8069655bbbebec7bda782e3 -# Parent 44ff2195a2026367e556e7dd9ef83af81a07219e -Implement SC_DOCUMENTOPTION_STYLES_NONE. - -diff -r 44ff2195a202 -r 431b814a54a6 doc/ScintillaDoc.html ---- a/doc/ScintillaDoc.html Fri Feb 02 08:37:32 2018 +1100 -+++ b/doc/ScintillaDoc.html Fri Feb 02 14:34:55 2018 +1100 -@@ -119,7 +119,7 @@ - - <h1>Scintilla Documentation</h1> - -- <p>Last edited 31 January 2018 NH</p> -+ <p>Last edited 1 February 2018 NH</p> - - <p>There is <a class="jump" href="Design.html">an overview of the internal design of - Scintilla</a>.<br /> -@@ -5743,9 +5743,38 @@ - to allocate once rather than rely on the buffer growing as data is added. - If <code>SCI_CREATEDOCUMENT</code> fails then 0 is returned.</p> - -- <p>The <code class="parameter">documentOption</code> argument may be used in future versions -- to choose between different document capabilities which affect memory allocation and performance. -- The only valid value for now is <code>SC_DOCUMENTOPTION_DEFAULT</code> (0).</p> -+ <p id="documentOption">The <code class="parameter">documentOption</code> argument -+ chooses between different document capabilities which affect memory allocation and performance with -+ <code>SC_DOCUMENTOPTION_DEFAULT</code> (0) choosing standard options. -+ <code>SC_DOCUMENTOPTION_STYLES_NONE</code> (1) stops allocation of memory to style characters -+ which saves significant memory, often 40% with the whole document treated as being style 0. -+ Lexers may still produce visual styling by using indicators.</p> -+ -+ <table class="standard" summary="Document options"> -+ <tbody> -+ <tr> -+ <th align="left">Symbol</th> -+ <th align="left">Value</th> -+ <th align="left">Effect</th> -+ </tr> -+ </tbody> -+ -+ <tbody valign="top"> -+ -+ <tr> -+ <td align="left">SC_DOCUMENTOPTION_DEFAULT</td> -+ <td align="left">0</td> -+ <td align="left">Standard behaviour</td> -+ </tr> -+ -+ <tr> -+ <td align="left">SC_DOCUMENTOPTION_STYLES_NONE</td> -+ <td align="left">1</td> -+ <td align="left">Stop allocation of memory for styles and treat all text as style 0.</td> -+ </tr> -+ -+ </tbody> -+ </table> - - <p><b id="SCI_ADDREFDOCUMENT">SCI_ADDREFDOCUMENT(<unused>, document *doc)</b><br /> - This increases the reference count of a document by 1. If you want to replace the current -@@ -5788,9 +5817,8 @@ - to allocate once rather than rely on the buffer growing as data is added. - If <code>SCI_CREATELOADER</code> fails then 0 is returned.</p> - -- <p>The <code class="parameter">documentOption</code> argument may be used in future versions -- to choose between different document capabilities which affect memory allocation and performance. -- The only valid value for now is <code>SC_DOCUMENTOPTION_DEFAULT</code> (0).</p> -+ <p>The <code class="parameter">documentOption</code> argument -+ is described in the <a class="seealso" href="#documentOption"><code>SCI_CREATEDOCUMENT</code></a> section.</p> - - <h4>ILoader</h4> - -diff -r 44ff2195a202 -r 431b814a54a6 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Fri Feb 02 08:37:32 2018 +1100 -+++ b/doc/ScintillaHistory.html Fri Feb 02 14:34:55 2018 +1100 -@@ -539,6 +539,11 @@ - </li> - <li> - SCI_CREATEDOCUMENT adds a bytes argument to allocate memory for an initial size. -+ SCI_CREATELOADER and SCI_CREATEDOCUMENT add a documentOption argument to -+ allow choosing different document capabilities. -+ </li> -+ <li> -+ Add SC_DOCUMENTOPTION_STYLES_NONE option to stop allocating memory for styles. - </li> - <li> - Add SCI_GETMOVEEXTENDSSELECTION to allow applications to add more -diff -r 44ff2195a202 -r 431b814a54a6 include/Scintilla.h ---- a/include/Scintilla.h Fri Feb 02 08:37:32 2018 +1100 -+++ b/include/Scintilla.h Fri Feb 02 14:34:55 2018 +1100 -@@ -690,6 +690,7 @@ - #define SCI_SETZOOM 2373 - #define SCI_GETZOOM 2374 - #define SC_DOCUMENTOPTION_DEFAULT 0 -+#define SC_DOCUMENTOPTION_STYLES_NONE 1 - #define SCI_CREATEDOCUMENT 2375 - #define SCI_ADDREFDOCUMENT 2376 - #define SCI_RELEASEDOCUMENT 2377 -diff -r 44ff2195a202 -r 431b814a54a6 include/Scintilla.iface ---- a/include/Scintilla.iface Fri Feb 02 08:37:32 2018 +1100 -+++ b/include/Scintilla.iface Fri Feb 02 14:34:55 2018 +1100 -@@ -1773,6 +1773,7 @@ - - enu DocumentOption=SC_DOCUMENTOPTION_ - val SC_DOCUMENTOPTION_DEFAULT=0 -+val SC_DOCUMENTOPTION_STYLES_NONE=1 - - # Create a new document object. - # Starts with reference count of 1 and not selected into editor. -diff -r 44ff2195a202 -r 431b814a54a6 qt/ScintillaEdit/ScintillaDocument.cpp ---- a/qt/ScintillaEdit/ScintillaDocument.cpp Fri Feb 02 08:37:32 2018 +1100 -+++ b/qt/ScintillaEdit/ScintillaDocument.cpp Fri Feb 02 14:34:55 2018 +1100 -@@ -91,7 +91,7 @@ - ScintillaDocument::ScintillaDocument(QObject *parent, void *pdoc_) : - QObject(parent), pdoc(pdoc_), docWatcher(0) { - if (!pdoc) { -- pdoc = new Document(); -+ pdoc = new Document(SC_DOCUMENTOPTION_DEFAULT); - } - docWatcher = new WatcherHelper(this); - (static_cast<Document *>(pdoc))->AddRef(); -diff -r 44ff2195a202 -r 431b814a54a6 src/CellBuffer.cxx ---- a/src/CellBuffer.cxx Fri Feb 02 08:37:32 2018 +1100 -+++ b/src/CellBuffer.cxx Fri Feb 02 14:34:55 2018 +1100 -@@ -342,7 +342,8 @@ - currentAction++; - } - --CellBuffer::CellBuffer() { -+CellBuffer::CellBuffer(bool hasStyles_) : -+ hasStyles(hasStyles_) { - readOnly = false; - utf8LineEnds = 0; - collectingUndo = true; -@@ -369,7 +370,7 @@ - } - - char CellBuffer::StyleAt(Sci::Position position) const { -- return style.ValueAt(position); -+ return hasStyles ? style.ValueAt(position) : 0; - } - - void CellBuffer::GetStyleRange(unsigned char *buffer, Sci::Position position, Sci::Position lengthRetrieve) const { -@@ -377,6 +378,10 @@ - return; - if (position < 0) - return; -+ if (!hasStyles) { -+ std::fill(buffer, buffer + lengthRetrieve, static_cast<unsigned char>(0)); -+ return; -+ } - if ((position + lengthRetrieve) > style.Length()) { - Platform::DebugPrintf("Bad GetStyleRange %d for %d of %d\n", position, - lengthRetrieve, style.Length()); -@@ -414,6 +419,9 @@ - } - - bool CellBuffer::SetStyleAt(Sci::Position position, char styleValue) { -+ if (!hasStyles) { -+ return false; -+ } - const char curVal = style.ValueAt(position); - if (curVal != styleValue) { - style.SetValueAt(position, styleValue); -@@ -424,6 +432,9 @@ - } - - bool CellBuffer::SetStyleFor(Sci::Position position, Sci::Position lengthStyle, char styleValue) { -+ if (!hasStyles) { -+ return false; -+ } - bool changed = false; - PLATFORM_ASSERT(lengthStyle == 0 || - (lengthStyle > 0 && lengthStyle + position <= style.Length())); -@@ -462,7 +473,9 @@ - - void CellBuffer::Allocate(Sci::Position newSize) { - substance.ReAllocate(newSize); -- style.ReAllocate(newSize); -+ if (hasStyles) { -+ style.ReAllocate(newSize); -+ } - } - - void CellBuffer::SetLineEndTypes(int utf8LineEnds_) { -@@ -608,7 +621,9 @@ - } - - substance.InsertFromArray(position, s, 0, insertLength); -- style.InsertValue(position, insertLength, 0); -+ if (hasStyles) { -+ style.InsertValue(position, insertLength, 0); -+ } - - Sci::Line lineInsert = lv.LineFromPosition(position) + 1; - bool atLineStart = lv.LineStart(lineInsert-1) == position; -@@ -738,7 +753,9 @@ - } - } - substance.DeleteRange(position, deleteLength); -- style.DeleteRange(position, deleteLength); -+ if (hasStyles) { -+ style.DeleteRange(position, deleteLength); -+ } - } - - bool CellBuffer::SetUndoCollection(bool collectUndo) { -diff -r 44ff2195a202 -r 431b814a54a6 src/CellBuffer.h ---- a/src/CellBuffer.h Fri Feb 02 08:37:32 2018 +1100 -+++ b/src/CellBuffer.h Fri Feb 02 14:34:55 2018 +1100 -@@ -133,6 +133,7 @@ - */ - class CellBuffer { - private: -+ bool hasStyles; - SplitVector<char> substance; - SplitVector<char> style; - bool readOnly; -@@ -151,7 +152,7 @@ - - public: - -- CellBuffer(); -+ CellBuffer(bool hasStyles_); - ~CellBuffer(); - - /// Retrieving positions outside the range of the buffer works and returns 0 -diff -r 44ff2195a202 -r 431b814a54a6 src/Document.cxx ---- a/src/Document.cxx Fri Feb 02 08:37:32 2018 +1100 -+++ b/src/Document.cxx Fri Feb 02 14:34:55 2018 +1100 -@@ -90,7 +90,8 @@ - return 0; - } - --Document::Document() { -+Document::Document(int options) : -+ cb((options & SC_DOCUMENTOPTION_STYLES_NONE) == 0) { - refCount = 0; - #ifdef _WIN32 - eolMode = SC_EOL_CRLF; -diff -r 44ff2195a202 -r 431b814a54a6 src/Document.h ---- a/src/Document.h Fri Feb 02 08:37:32 2018 +1100 -+++ b/src/Document.h Fri Feb 02 14:34:55 2018 +1100 -@@ -265,7 +265,7 @@ - - DecorationList decorations; - -- Document(); -+ Document(int options); - virtual ~Document(); - - int AddRef(); -diff -r 44ff2195a202 -r 431b814a54a6 src/EditModel.cxx ---- a/src/EditModel.cxx Fri Feb 02 08:37:32 2018 +1100 -+++ b/src/EditModel.cxx Fri Feb 02 14:34:55 2018 +1100 -@@ -69,7 +69,7 @@ - hotspot = Range(Sci::invalidPosition); - hoverIndicatorPos = Sci::invalidPosition; - wrapWidth = LineLayout::wrapWidthInfinite; -- pdoc = new Document(); -+ pdoc = new Document(SC_DOCUMENTOPTION_DEFAULT); - pdoc->AddRef(); - } - -diff -r 44ff2195a202 -r 431b814a54a6 src/Editor.cxx ---- a/src/Editor.cxx Fri Feb 02 08:37:32 2018 +1100 -+++ b/src/Editor.cxx Fri Feb 02 14:34:55 2018 +1100 -@@ -5162,7 +5162,7 @@ - pdoc->RemoveWatcher(this, 0); - pdoc->Release(); - if (document == NULL) { -- pdoc = new Document(); -+ pdoc = new Document(SC_DOCUMENTOPTION_DEFAULT); - } else { - pdoc = document; - } -@@ -7554,7 +7554,7 @@ - return 0; - - case SCI_CREATEDOCUMENT: { -- Document *doc = new Document(); -+ Document *doc = new Document(static_cast<int>(lParam)); - doc->AddRef(); - doc->Allocate(static_cast<int>(wParam)); - return reinterpret_cast<sptr_t>(doc); -@@ -7569,7 +7569,7 @@ - break; - - case SCI_CREATELOADER: { -- Document *doc = new Document(); -+ Document *doc = new Document(static_cast<int>(lParam)); - doc->AddRef(); - doc->Allocate(static_cast<int>(wParam)); - doc->SetUndoCollection(false); -diff -r 44ff2195a202 -r 431b814a54a6 test/unit/testCellBuffer.cxx ---- a/test/unit/testCellBuffer.cxx Fri Feb 02 08:37:32 2018 +1100 -+++ b/test/unit/testCellBuffer.cxx Fri Feb 02 14:34:55 2018 +1100 -@@ -25,7 +25,7 @@ - const char sText[] = "Scintilla"; - const Sci::Position sLength = static_cast<Sci::Position>(strlen(sText)); - -- CellBuffer cb; -+ CellBuffer cb(true); - - SECTION("InsertOneLine") { - bool startSequence = false; diff --git a/src/scintilla_backports/6449_1280ef150bbb.patch b/src/scintilla_backports/6449_1280ef150bbb.patch deleted file mode 100644 index 0a8dfb11..00000000 --- a/src/scintilla_backports/6449_1280ef150bbb.patch +++ /dev/null @@ -1,42 +0,0 @@ -# HG changeset patch -# User Dimitar Radev -# Date 1517896632 -39600 -# Node ID 1280ef150bbb364e25d01bf04146305389123e78 -# Parent 431b814a54a62d81c8069655bbbebec7bda782e3 -[Bug #1983] Fix double tap word selection on Windows 10 1709 Fall Creators Update. -Times of observed mouse events went backwards causing unsigned overflow. - -diff -r 431b814a54a6 -r 1280ef150bbb doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Fri Feb 02 14:34:55 2018 +1100 -+++ b/doc/ScintillaHistory.html Tue Feb 06 16:57:12 2018 +1100 -@@ -519,6 +519,7 @@ - </tr><tr> - <td>Georger Araújo</td> - <td>Tobias Kühne</td> -+ <td>Dimitar Radev</td> - </tr> - </table> - <p> -@@ -557,6 +558,10 @@ - Improve VHDL lexer's handling of character literals and escape characters in strings. - </li> - <li> -+ Fix double tap word selection on Windows 10 1709 Fall Creators Update. -+ <a href="http://sourceforge.net/p/scintilla/bugs/1983/">Bug #1983</a>. -+ </li> -+ <li> - Fix closing autocompletion lists on Cocoa for macOS 10.13 where the window - was emptying but staying visible. - <a href="http://sourceforge.net/p/scintilla/bugs/1981/">Bug #1981</a>. -diff -r 431b814a54a6 -r 1280ef150bbb src/Editor.cxx ---- a/src/Editor.cxx Fri Feb 02 14:34:55 2018 +1100 -+++ b/src/Editor.cxx Tue Feb 06 16:57:12 2018 +1100 -@@ -4455,7 +4455,7 @@ - if (shift && !inSelMargin) { - SetSelection(newPos); - } -- if (((curTime - lastClickTime) < Platform::DoubleClickTime()) && Close(pt, lastClick, doubleClickCloseThreshold)) { -+ if ((curTime < (lastClickTime+Platform::DoubleClickTime())) && Close(pt, lastClick, doubleClickCloseThreshold)) { - //Platform::DebugPrintf("Double click %d %d = %d\n", curTime, lastClickTime, curTime - lastClickTime); - SetMouseCapture(true); - FineTickerStart(tickScroll, 100, 10); diff --git a/src/scintilla_backports/6456_eaa6c7fa1a81.patch b/src/scintilla_backports/6456_eaa6c7fa1a81.patch deleted file mode 100644 index 81032495..00000000 --- a/src/scintilla_backports/6456_eaa6c7fa1a81.patch +++ /dev/null @@ -1,56 +0,0 @@ -# HG changeset patch -# User Vicente -# Date 1518837132 -39600 -# Node ID eaa6c7fa1a811bd10abe19124335e984e50a67e5 -# Parent b9e27867752769a2cb7057cab8942baf4850757b -For rectangular selections, pressing Home or End now moves the caret to the Home -or End position instead of the limit of the rectangular selection. - -diff -r b9e278677527 -r eaa6c7fa1a81 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Sat Feb 17 11:28:52 2018 +1100 -+++ b/doc/ScintillaHistory.html Sat Feb 17 14:12:12 2018 +1100 -@@ -540,6 +540,10 @@ - Released 12 February 2018. - </li> - <li> -+ For rectangular selections, pressing Home or End now moves the caret to the Home or End -+ position instead of the limit of the rectangular selection. -+ </li> -+ <li> - SciTE on Windows can execute Python scripts directly by name when on path. - <a href="http://sourceforge.net/p/scintilla/feature-requests/1209/">Feature #1209.</a> - </li> -diff -r b9e278677527 -r eaa6c7fa1a81 src/Editor.cxx ---- a/src/Editor.cxx Sat Feb 17 11:28:52 2018 +1100 -+++ b/src/Editor.cxx Sat Feb 17 14:12:12 2018 +1100 -@@ -3359,8 +3359,19 @@ - SetRectangularRange(); - } else if (sel.IsRectangular()) { - // Not a rectangular extension so switch to stream. -- const SelectionPosition selAtLimit = -- (NaturalDirection(iMessage) > 0) ? sel.Limits().end : sel.Limits().start; -+ SelectionPosition selAtLimit = (NaturalDirection(iMessage) > 0) ? sel.Limits().end : sel.Limits().start; -+ switch (iMessage) { -+ case SCI_HOME: -+ selAtLimit = SelectionPosition( -+ static_cast<Sci::Position>(pdoc->LineStart(pdoc->LineFromPosition(selAtLimit.Position())))); -+ break; -+ case SCI_VCHOME: -+ selAtLimit = SelectionPosition(pdoc->VCHomePosition(selAtLimit.Position())); -+ break; -+ case SCI_LINEEND: -+ selAtLimit = SelectionPosition(pdoc->LineEndPosition(selAtLimit.Position())); -+ break; -+ } - sel.selType = Selection::selStream; - sel.SetSelection(SelectionRange(selAtLimit)); - } else { -@@ -7537,7 +7548,7 @@ - std::vector<EdgeProperties>().swap(vs.theMultiEdge); // Free vector and memory, C++03 compatible - InvalidateStyleRedraw(); - break; -- -+ - case SCI_GETACCESSIBILITY: - return SC_ACCESSIBILITY_DISABLED; - diff --git a/src/scintilla_backports/6458_0a8a766722c0.patch b/src/scintilla_backports/6458_0a8a766722c0.patch deleted file mode 100644 index 64bcb748..00000000 --- a/src/scintilla_backports/6458_0a8a766722c0.patch +++ /dev/null @@ -1,297 +0,0 @@ -# HG changeset patch -# User Mitchell -# Date 1519447387 -39600 -# Node ID 0a8a766722c0bc91e1e2ecd958927a504cea5cac -# Parent 26e7749ba67ae8fc994e2f17c760a65c5d0ca479 -Fix move-extends-selection mode for rectangular and line selections. - -diff -r 26e7749ba67a -r 0a8a766722c0 doc/ScintillaHistory.html ---- a/doc/ScintillaHistory.html Thu Feb 22 08:13:37 2018 +1100 -+++ b/doc/ScintillaHistory.html Sat Feb 24 15:43:07 2018 +1100 -@@ -548,6 +548,9 @@ - <a href="http://sourceforge.net/p/scintilla/bugs/1993/">Bug #1993</a>. - </li> - <li> -+ Fix move-extends-selection mode for rectangular and line selections. -+ </li> -+ <li> - SciTE on Windows can execute Python scripts directly by name when on path. - <a href="http://sourceforge.net/p/scintilla/feature-requests/1209/">Feature #1209.</a> - </li> -diff -r 26e7749ba67a -r 0a8a766722c0 src/Editor.cxx ---- a/src/Editor.cxx Thu Feb 22 08:13:37 2018 +1100 -+++ b/src/Editor.cxx Sat Feb 24 15:43:07 2018 +1100 -@@ -626,26 +626,31 @@ - InvalidateSelection(sel.RangeMain(), true); - } - -+/* For Line selection - the anchor and caret are always -+ at the beginning and end of the region lines. */ -+SelectionRange Editor::LineSelectionRange(SelectionPosition currentPos_, SelectionPosition anchor_) const { -+ if (currentPos_ > anchor_) { -+ anchor_ = SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineStart(pdoc->LineFromPosition(anchor_.Position())))); -+ currentPos_ = SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineEnd(pdoc->LineFromPosition(currentPos_.Position())))); -+ } else { -+ currentPos_ = SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineStart(pdoc->LineFromPosition(currentPos_.Position())))); -+ anchor_ = SelectionPosition(static_cast<Sci::Position>( -+ pdoc->LineEnd(pdoc->LineFromPosition(anchor_.Position())))); -+ } -+ return SelectionRange(currentPos_, anchor_); -+} -+ - void Editor::SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_) { - currentPos_ = ClampPositionIntoDocument(currentPos_); - anchor_ = ClampPositionIntoDocument(anchor_); - Sci::Line currentLine = static_cast<Sci::Line>(pdoc->LineFromPosition(currentPos_.Position())); -- /* For Line selection - ensure the anchor and caret are always -- at the beginning and end of the region lines. */ -+ SelectionRange rangeNew(currentPos_, anchor_); - if (sel.selType == Selection::selLines) { -- if (currentPos_ > anchor_) { -- anchor_ = SelectionPosition(static_cast<Sci::Position>( -- pdoc->LineStart(pdoc->LineFromPosition(anchor_.Position())))); -- currentPos_ = SelectionPosition(static_cast<Sci::Position>( -- pdoc->LineEnd(pdoc->LineFromPosition(currentPos_.Position())))); -- } else { -- currentPos_ = SelectionPosition(static_cast<Sci::Position>( -- pdoc->LineStart(pdoc->LineFromPosition(currentPos_.Position())))); -- anchor_ = SelectionPosition(static_cast<Sci::Position>( -- pdoc->LineEnd(pdoc->LineFromPosition(anchor_.Position())))); -- } -- } -- SelectionRange rangeNew(currentPos_, anchor_); -+ rangeNew = LineSelectionRange(currentPos_, anchor_); -+ } - if (sel.Count() > 1 || !(sel.RangeMain() == rangeNew)) { - InvalidateSelection(rangeNew); - } -@@ -675,6 +680,8 @@ - sel.Rectangular() = - SelectionRange(SelectionPosition(currentPos_), sel.Rectangular().anchor); - SetRectangularRange(); -+ } else if (sel.selType == Selection::selLines) { -+ sel.RangeMain() = LineSelectionRange(currentPos_, sel.RangeMain().anchor); - } else { - sel.RangeMain() = - SelectionRange(SelectionPosition(currentPos_), sel.RangeMain().anchor); -@@ -3120,7 +3127,7 @@ - - void Editor::CursorUpOrDown(int direction, Selection::selTypes selt) { - if ((selt == Selection::noSel) && sel.MoveExtends()) { -- selt = Selection::selStream; -+ selt = !sel.IsRectangular() ? Selection::selStream : Selection::selRectangle; - } - SelectionPosition caretToUse = sel.Range(sel.Main()).caret; - if (sel.IsRectangular()) { -@@ -3142,6 +3149,11 @@ - sel.Rectangular() = SelectionRange(posNew, rangeBase.anchor); - SetRectangularRange(); - MovedCaret(posNew, caretToUse, true); -+ } else if (sel.selType == Selection::selLines && sel.MoveExtends()) { -+ // Calculate new caret position and call SetSelection(), which will ensure whole lines are selected. -+ const SelectionPosition posNew = MovePositionSoVisible( -+ PositionUpOrDown(caretToUse, direction, -1), direction); -+ SetSelection(posNew, sel.Range(sel.Main()).anchor); - } else { - InvalidateWholeSelection(); - if (!additionalSelectionTyping || (sel.IsRectangular())) { -@@ -3263,7 +3275,7 @@ - } - } - --bool IsRectExtend(unsigned int iMessage) { -+bool IsRectExtend(unsigned int iMessage, bool isRectMoveExtends) { - switch (iMessage) { - case SCI_CHARLEFTRECTEXTEND: - case SCI_CHARRIGHTRECTEXTEND: -@@ -3272,6 +3284,19 @@ - case SCI_LINEENDRECTEXTEND: - return true; - default: -+ if (isRectMoveExtends) { -+ // Handle SCI_SETSELECTIONMODE(SC_SEL_RECTANGLE) and subsequent movements. -+ switch (iMessage) { -+ case SCI_CHARLEFTEXTEND: -+ case SCI_CHARRIGHTEXTEND: -+ case SCI_HOMEEXTEND: -+ case SCI_VCHOMEEXTEND: -+ case SCI_LINEENDEXTEND: -+ return true; -+ default: -+ return false; -+ } -+ } - return false; - } - } -@@ -3307,6 +3332,9 @@ - } - - int Editor::HorizontalMove(unsigned int iMessage) { -+ if (sel.selType == Selection::selLines) { -+ return 0; // horizontal moves with line selection have no effect -+ } - if (sel.MoveExtends()) { - iMessage = WithExtends(iMessage); - } -@@ -3319,7 +3347,7 @@ - // Invalidate each of the current selections - InvalidateWholeSelection(); - -- if (IsRectExtend(iMessage)) { -+ if (IsRectExtend(iMessage, sel.IsRectangular() && sel.MoveExtends())) { - const SelectionRange rangeBase = sel.IsRectangular() ? sel.Rectangular() : sel.RangeMain(); - if (!sel.IsRectangular()) { - sel.DropAdditionalRanges(); -@@ -3328,6 +3356,7 @@ - SelectionPosition spCaret = rangeBase.caret; - switch (iMessage) { - case SCI_CHARLEFTRECTEXTEND: -+ case SCI_CHARLEFTEXTEND: // only when sel.IsRectangular() && sel.MoveExtends() - if (pdoc->IsLineEndPosition(spCaret.Position()) && spCaret.VirtualSpace()) { - spCaret.SetVirtualSpace(spCaret.VirtualSpace() - 1); - } else if ((virtualSpaceOptions & SCVS_NOWRAPLINESTART) == 0 || pdoc->GetColumn(spCaret.Position()) > 0) { -@@ -3335,6 +3364,7 @@ - } - break; - case SCI_CHARRIGHTRECTEXTEND: -+ case SCI_CHARRIGHTEXTEND: // only when sel.IsRectangular() && sel.MoveExtends() - if ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) && pdoc->IsLineEndPosition(sel.MainCaret())) { - spCaret.SetVirtualSpace(spCaret.VirtualSpace() + 1); - } else { -@@ -3342,13 +3372,16 @@ - } - break; - case SCI_HOMERECTEXTEND: -+ case SCI_HOMEEXTEND: // only when sel.IsRectangular() && sel.MoveExtends() - spCaret = SelectionPosition( - static_cast<Sci::Position>(pdoc->LineStart(pdoc->LineFromPosition(spCaret.Position())))); - break; - case SCI_VCHOMERECTEXTEND: -+ case SCI_VCHOMEEXTEND: // only when sel.IsRectangular() && sel.MoveExtends() - spCaret = SelectionPosition(pdoc->VCHomePosition(spCaret.Position())); - break; - case SCI_LINEENDRECTEXTEND: -+ case SCI_LINEENDEXTEND: // only when sel.IsRectangular() && sel.MoveExtends() - spCaret = SelectionPosition(pdoc->LineEndPosition(spCaret.Position())); - break; - } -@@ -7615,10 +7648,12 @@ - case SC_SEL_RECTANGLE: - sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selRectangle)); - sel.selType = Selection::selRectangle; -+ sel.Rectangular() = sel.RangeMain(); // adjust current selection - break; - case SC_SEL_LINES: - sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selLines)); - sel.selType = Selection::selLines; -+ SetSelection(sel.RangeMain().caret, sel.RangeMain().anchor); // adjust current selection - break; - case SC_SEL_THIN: - sel.SetMoveExtends(!sel.MoveExtends() || (sel.selType != Selection::selThin)); -diff -r 26e7749ba67a -r 0a8a766722c0 src/Editor.h ---- a/src/Editor.h Thu Feb 22 08:13:37 2018 +1100 -+++ b/src/Editor.h Sat Feb 24 15:43:07 2018 +1100 -@@ -312,6 +312,7 @@ - void ThinRectangularRange(); - void InvalidateSelection(SelectionRange newMain, bool invalidateWholeSelection=false); - void InvalidateWholeSelection(); -+ SelectionRange LineSelectionRange(SelectionPosition currentPos_, SelectionPosition anchor_) const; - void SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_); - void SetSelection(Sci::Position currentPos_, Sci::Position anchor_); - void SetSelection(SelectionPosition currentPos_); -diff -r 26e7749ba67a -r 0a8a766722c0 test/simpleTests.py ---- a/test/simpleTests.py Thu Feb 22 08:13:37 2018 +1100 -+++ b/test/simpleTests.py Sat Feb 24 15:43:07 2018 +1100 -@@ -1466,6 +1466,88 @@ - self.ed.DropSelectionN(0) - self.assertEquals(self.ed.MainSelection, 2) - -+class TestModalSelection(unittest.TestCase): -+ -+ def setUp(self): -+ self.xite = Xite.xiteFrame -+ self.ed = self.xite.ed -+ self.ed.ClearAll() -+ self.ed.EmptyUndoBuffer() -+ # 3 lines of 3 characters -+ t = b"xxx\nxxx\nxxx" -+ self.ed.AddText(len(t), t) -+ -+ def testCharacterSelection(self): -+ self.ed.SetSelection(1, 1) -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 1) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1) -+ self.ed.SelectionMode = self.ed.SC_SEL_STREAM -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 1) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1) -+ self.ed.CharRight() -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 2) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1) -+ self.ed.LineDown() -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 6) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1) -+ self.ed.ClearSelections() -+ -+ def testRectangleSelection(self): -+ self.ed.SetSelection(1, 1) -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 1) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1) -+ self.ed.SelectionMode = self.ed.SC_SEL_RECTANGLE -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 1) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1) -+ self.ed.CharRight() -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 2) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1) -+ self.ed.LineDown() -+ self.assertEquals(self.ed.Selections, 2) -+ self.assertEquals(self.ed.MainSelection, 1) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 2) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1) -+ self.assertEquals(self.ed.GetSelectionNCaret(1), 6) -+ self.assertEquals(self.ed.GetSelectionNAnchor(1), 5) -+ self.ed.ClearSelections() -+ -+ def testLinesSelection(self): -+ self.ed.SetSelection(1, 1) -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 1) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 1) -+ self.ed.SelectionMode = self.ed.SC_SEL_LINES -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 0) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 3) -+ self.ed.CharRight() -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 0) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 3) -+ self.ed.LineDown() -+ self.assertEquals(self.ed.Selections, 1) -+ self.assertEquals(self.ed.MainSelection, 0) -+ self.assertEquals(self.ed.GetSelectionNCaret(0), 7) -+ self.assertEquals(self.ed.GetSelectionNAnchor(0), 0) -+ self.ed.ClearSelections() -+ - class TestStyleAttributes(unittest.TestCase): - """ These tests are just to ensure that the calls set and retrieve values. - They do not check the visual appearance of the style attributes. diff --git a/src/scintilla_backports/revs b/src/scintilla_backports/revs deleted file mode 100644 index 0f94210f..00000000 --- a/src/scintilla_backports/revs +++ /dev/null @@ -1,77 +0,0 @@ -ae52e0c68190 Bug [#1901]. GTK: Fix double scrolling under X11 -7f22895eaddb Bug [#1905]. Fix stream selection mode when moving caret up or down. -809112c81196 Bug [#1907]. GTK: Fix crash after destroying the widget on GTK < 3.3.6 -b82fe8d33961 Fix potential problems with IME on Cocoa when document contains invalid UTF-8. -e12538e52567 Bug [#1910]. GTK a11y: Speed up converting byte offsets to character offsets -b833c0659497 Fix minor issues in interface definitions. -225f39cfd931 For IMEs, do not clear selected text when there is no composition text to show. -6c62b379a52e Avoid potential problems with memcmp reading past end of object. -23546875480b Bug [#1910]. Accessibility support may be queried and, on GTK+, disabled. -559dea66606f Bug [#1910]. Fixed double declaration. -71bee2f06619 Bug [#1910]. Fixed more duplicate code. -8e0cb37c4972 GTK: Fix popup positioning on monitors not positioned at 0,0 -4527b3c217a4 Fix warnings from Visual Studio 2017. -a78e38849624 Fix use-after-free in fold tags when top line folded then new top line inserted. -6cf19f2bf214 Fix difference between right of line end and left of fold tag. -30f1573f17ac Fix 1 pixel unpainted as background. -0253f113f223 Round left and right sides of fold text box to ensure within the allocation. -34665edc7efd For multiphase drawing ensure edges and mark underline drawn over fold tags -2b25287311d0 For single phase drawing ensure edges and mark underline drawn over fold tags -c3bba4a9193e For single phase drawing ensure remainder of line filled -55368b05bb72 Group non-single-phase drawing before text. -b3eaa82b3750 Updated case conversion and character categories to Unicode 9. -a0f26eaf474d Using Sci::Position and Sci::Line to mark variables that are document positions and lines. -284cc3b0e754 Delete declaration of unimplemented method. -c105254dae66 Hide decorations details a little. -152e56f0b392 Prefer standard min/max over Platform's as adapts to changed types. -35d652a3344b Standardize on C++ headers, remove headers that aren't needed and add <cstddef> -47fa874827a5 More encapsulation for Decoration and DecorationList. -67865d8e5a37 Fix DisplayFromPosition pos argument to be correct type. -a1a9cde51997 Added "Reverse Selected Lines" as SCI_LINEREVERSE. -e7ca78c6f29c Prevent warning from MSVC Code Analysis. -797ed6c538fd Added a caret line frame as an alternative visual for highlighting the caret line. -d046ce80d590 Added const where possible. -df221375187c Allowing assigning Windows and ensure cursorLast is initialized. -99e46ea84433 Check index before checking value at index. -84161436cfbc Use same parameter names in declarations and definitions. -c9dcde8a91d3 Drop "virtual" from methods that do not need to be virtual. -150bdfbe2b5a Remove unnecessary casts. -d742ec177a7e Prefer C++ static cast over C-style casts. -20120f9d1698 Use reference for efficiency. -7c132e9340ce For speed, store height of capital letters in FontMeasurements so not -3e2dd5970075 Ensure capitalHeight initialised. -692a54eaa604 Use bool literals true and false instead of 1 and 0. -b8379bec8e70 Fix deprecation of gdk_window_process_updates in GTK+ 3.22 by redrawing instead -044d2d030263 Avoid calling virtual functions in constructors and destructors. -a80a6876c301 Avoid calling virtual functions in destructor. Mark overridden methods. -e4f249dbdc30 Drop reinterpret_cast when can implicit cast to void* or const void*. -1f02cb4a5b26 Bug [#1940]. Canceling modes with the Esc key preserves a rectangular selection. -45f968a6735a More consistent use of size_t when converting Unicode formats. -61adfbe4fa64 Feature [feature-requests:#1187]. Update scroll bar when annotations added, -4bf96081f6e6 Use min and max from std instead of own version from platform. -90741c1cb988 Require GTK+ 2.24 or later. Removes support for earlier versions. -7e28cdba6d61 Implement SCN_AUTOCSELECTIONCHANGE notification. -7030530a9a0f Removed unused functions and methods from Platform.h. -af83baede430 Simplify mouse and keyboard handling by only retaining the 'WithModifiers" form. -82cb780a04d1 Bug [#1949]. Fix drawing failure in wrap mode for delete to start/end of line. -8d56eaef4f0a The default encoding is now UTF-8. -95346e626cf8 Cast between Sci_Position.h types used for lexers and Position.h types used in -79f86be9e988 Redraw when overtype changed so caret change visible even when not blinking. -ebec660dcf48 Bug [#1949]. Fix drawing failure in wrap mode for GTK+ 2.x. -52f12c3eebcd Bug [#1955]. The data parameter to ILoader::AddData made const. -b44bb3627bbd Moved *StyleBits* APIs into deprecated category. -96506cab38bd Bug [#1971]. Fix line selection by clicking in the margin when scrolled. -2db0528f34b5 Bug [#1978]. Minor undefined behaviour fixed. -85205da6ec1b Add SCI_GETMOVEEXTENDSSELECTION. -8760026bba6a Update marshalling of signals from Scintilla, changing deprecated NONE to VOID. -fd2f856b8d58 Use explicit typedefs instead of deprecated derivation from std::iterator. -73343682cbda Start of bidirectional code - implement SCI_SETBIDIRECTIONAL. -ed27432729c3 Use std::abs in preference to abs as std::abs is generic and abs casts to int -92c8f0f1b3e6 Add documentOption argument to SCI_CREATELOADER. -3e3bfe29a819 Extend SplitVector to allow more than 2 billion elements on 64-bit systems. -1bd57324aa36 Templatize Partitioning so it can hold different types. -89d992f380a1 Templatize RunStyles so it can be over ranges of different types and contain -431b814a54a6 Implement SC_DOCUMENTOPTION_STYLES_NONE. -1280ef150bbb [Bug #1983] Fix double tap word selection on Windows 10 1709 Fall Creators Update. -eaa6c7fa1a81 For rectangular selections, pressing Home or End now moves the caret to the Home -0a8a766722c0 Fix move-extends-selection mode for rectangular and line selections. diff --git a/src/textadept.c b/src/textadept.c index 00c080a8..0b325dbd 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -52,7 +52,7 @@ #if GTK #include "ScintillaWidget.h" #elif CURSES -#include "ScintillaTerm.h" +#include "ScintillaCurses.h" #include "cdk_int.h" #include "termkey.h" #endif diff --git a/src/tre.patch b/src/tre.patch deleted file mode 100644 index 61b6535e..00000000 --- a/src/tre.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff -r c8148182a381 lib/tre-config.h ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/lib/tre-config.h Mon Jul 04 13:22:19 2016 -0400 -@@ -0,0 +1,45 @@ -+/* tre-config.h.in. This file has all definitions that are needed in -+ `tre.h'. Note that this file must contain only the bare minimum -+ of definitions without the TRE_ prefix to avoid conflicts between -+ definitions here and definitions included from somewhere else. */ -+ -+/* Define to 1 if you have the <libutf8.h> header file. */ -+#undef HAVE_LIBUTF8_H -+ -+/* Define to 1 if the system has the type `reg_errcode_t'. */ -+#undef HAVE_REG_ERRCODE_T -+ -+/* Define to 1 if you have the <sys/types.h> header file. */ -+#undef HAVE_SYS_TYPES_H -+ -+/* Define to 1 if you have the <wchar.h> header file. */ -+#undef HAVE_WCHAR_H -+ -+/* Define if you want to enable approximate matching functionality. */ -+#undef TRE_APPROX -+ -+/* Define to enable multibyte character set support. */ -+#undef TRE_MULTIBYTE -+ -+/* Define to the absolute path to the system tre.h */ -+#undef TRE_SYSTEM_REGEX_H_PATH -+ -+/* Define to include the system regex.h from tre.h */ -+#undef TRE_USE_SYSTEM_REGEX_H -+ -+/* Define to enable wide character (wchar_t) support. */ -+#undef TRE_WCHAR -+ -+/* TRE version string. */ -+#define TRE_VERSION "0.8.0" -+ -+/* TRE version level 1. */ -+#undef TRE_VERSION_1 -+ -+/* TRE version level 2. */ -+#undef TRE_VERSION_2 -+ -+/* TRE version level 3. */ -+#undef TRE_VERSION_3 -+ -+#define TRE_REGEX_T_FIELD value ---- tre/lib/tre-parse.c.orig 2017-10-26 10:06:49.512031304 -0400 -+++ tre/lib/tre-parse.c 2017-10-26 10:07:01.048160259 -0400 -@@ -1543,7 +1543,7 @@ - ctx->position); - if (!tmp1) - return REG_ESPACE; -- tmp2 = tre_ast_new_literal(ctx->mem, L'\n' + 1, TRE_CHAR_MAX, -+ tmp2 = tre_ast_new_literal(ctx->mem, L'\r' + 1, TRE_CHAR_MAX, - ctx->position + 1); - if (!tmp2) - return REG_ESPACE; ---- tre/lib/tre-match-utils.h.orig 2017-10-26 09:46:14.225633020 -0400 -+++ tre/lib/tre-match-utils.h 2017-10-26 09:46:16.193657010 -0400 -@@ -146,7 +146,7 @@ - && (prev_c != L'\n' || !reg_newline)) \ - || ((assertions & ASSERT_AT_EOL) \ - && (next_c != L'\0' || reg_noteol) \ -- && (next_c != L'\n' || !reg_newline)) \ -+ && ((next_c != L'\r' && next_c != L'\n') || !reg_newline)) \ - || ((assertions & ASSERT_AT_BOW) \ - && (IS_WORD_CHAR(prev_c) || !IS_WORD_CHAR(next_c))) \ - || ((assertions & ASSERT_AT_EOW) \ |