From ec391b6bfe8d87f4fb1bbb2a4e6033eaad9f4672 Mon Sep 17 00:00:00 2001
From: mitchell <70453897+667e-11@users.noreply.github.com>
Date: Mon, 12 Mar 2018 18:20:24 -0400
Subject: Start using Scintilla's LongTerm3, which now includes Scintillua and
Scinterm. Since LongTerm3 requires a C++11 compiler, GCC 4.9+ is required.
Since C++11 includes regex capability, drop TRE dependency.
---
CHANGELOG.md | 9 +-
FAQ.md | 15 +
TECHNOLOGY.md | 16 +-
doc/manual.md | 254 +-
init.lua | 2 +
scripts/backport.sh | 75 -
scripts/gen_iface.lua | 2 +-
src/Makefile | 163 +-
src/scintilla.patch | 161 -
src/scintilla_backports/6095_ae52e0c68190.patch | 43 -
src/scintilla_backports/6097_7f22895eaddb.patch | 34 -
src/scintilla_backports/6099_809112c81196.patch | 45 -
src/scintilla_backports/6101_b82fe8d33961.patch | 94 -
src/scintilla_backports/6102_e12538e52567.patch | 61 -
src/scintilla_backports/6108_b833c0659497.patch | 74 -
src/scintilla_backports/6111_225f39cfd931.patch | 101 -
src/scintilla_backports/6116_6c62b379a52e.patch | 59 -
src/scintilla_backports/6117_23546875480b.patch | 313 -
src/scintilla_backports/6118_559dea66606f.patch | 20 -
src/scintilla_backports/6119_71bee2f06619.patch | 24 -
src/scintilla_backports/6120_8e0cb37c4972.patch | 71 -
src/scintilla_backports/6124_4527b3c217a4.patch | 43 -
src/scintilla_backports/6131_a78e38849624.patch | 56 -
src/scintilla_backports/6132_6cf19f2bf214.patch | 19 -
src/scintilla_backports/6133_30f1573f17ac.patch | 19 -
src/scintilla_backports/6134_0253f113f223.patch | 36 -
src/scintilla_backports/6135_34665edc7efd.patch | 20 -
src/scintilla_backports/6136_2b25287311d0.patch | 43 -
src/scintilla_backports/6137_c3bba4a9193e.patch | 20 -
src/scintilla_backports/6138_55368b05bb72.patch | 40 -
src/scintilla_backports/6145_b3eaa82b3750.patch | 1426 -----
src/scintilla_backports/6153_a0f26eaf474d.patch | 7832 -----------------------
src/scintilla_backports/6154_284cc3b0e754.patch | 18 -
src/scintilla_backports/6155_c105254dae66.patch | 95 -
src/scintilla_backports/6156_152e56f0b392.patch | 239 -
src/scintilla_backports/6157_35d652a3344b.patch | 881 ---
src/scintilla_backports/6158_47fa874827a5.patch | 280 -
src/scintilla_backports/6159_67865d8e5a37.patch | 31 -
src/scintilla_backports/6160_a1a9cde51997.patch | 142 -
src/scintilla_backports/6161_e7ca78c6f29c.patch | 27 -
src/scintilla_backports/6167_797ed6c538fd.patch | 296 -
src/scintilla_backports/6168_d046ce80d590.patch | 2631 --------
src/scintilla_backports/6170_df221375187c.patch | 25 -
src/scintilla_backports/6171_99e46ea84433.patch | 25 -
src/scintilla_backports/6172_84161436cfbc.patch | 491 --
src/scintilla_backports/6173_c9dcde8a91d3.patch | 23 -
src/scintilla_backports/6174_150bdfbe2b5a.patch | 28 -
src/scintilla_backports/6175_d742ec177a7e.patch | 167 -
src/scintilla_backports/6176_20120f9d1698.patch | 19 -
src/scintilla_backports/6182_7c132e9340ce.patch | 43 -
src/scintilla_backports/6183_3e2dd5970075.patch | 18 -
src/scintilla_backports/6184_692a54eaa604.patch | 92 -
src/scintilla_backports/6185_b8379bec8e70.patch | 35 -
src/scintilla_backports/6186_044d2d030263.patch | 218 -
src/scintilla_backports/6187_a80a6876c301.patch | 91 -
src/scintilla_backports/6196_e4f249dbdc30.patch | 28 -
src/scintilla_backports/6215_1f02cb4a5b26.patch | 33 -
src/scintilla_backports/6222_45f968a6735a.patch | 222 -
src/scintilla_backports/6231_61adfbe4fa64.patch | 44 -
src/scintilla_backports/6301_4bf96081f6e6.patch | 214 -
src/scintilla_backports/6305_90741c1cb988.patch | 188 -
src/scintilla_backports/6310_7e28cdba6d61.patch | 695 --
src/scintilla_backports/6311_7030530a9a0f.patch | 1480 -----
src/scintilla_backports/6314_af83baede430.patch | 535 --
src/scintilla_backports/6317_82cb780a04d1.patch | 53 -
src/scintilla_backports/6323_8d56eaef4f0a.patch | 69 -
src/scintilla_backports/6327_95346e626cf8.patch | 1794 ------
src/scintilla_backports/6339_79f86be9e988.patch | 51 -
src/scintilla_backports/6340_ebec660dcf48.patch | 35 -
src/scintilla_backports/6342_52f12c3eebcd.patch | 69 -
src/scintilla_backports/6379_b44bb3627bbd.patch | 131 -
src/scintilla_backports/6388_96506cab38bd.patch | 33 -
src/scintilla_backports/6397_2db0528f34b5.patch | 33 -
src/scintilla_backports/6418_85205da6ec1b.patch | 79 -
src/scintilla_backports/6419_8760026bba6a.patch | 142 -
src/scintilla_backports/6421_fd2f856b8d58.patch | 68 -
src/scintilla_backports/6425_73343682cbda.patch | 170 -
src/scintilla_backports/6434_ed27432729c3.patch | 50 -
src/scintilla_backports/6441_92c8f0f1b3e6.patch | 157 -
src/scintilla_backports/6442_3e3bfe29a819.patch | 319 -
src/scintilla_backports/6444_1bd57324aa36.patch | 279 -
src/scintilla_backports/6445_89d992f380a1.patch | 418 --
src/scintilla_backports/6448_431b814a54a6.patch | 307 -
src/scintilla_backports/6449_1280ef150bbb.patch | 42 -
src/scintilla_backports/6456_eaa6c7fa1a81.patch | 56 -
src/scintilla_backports/6458_0a8a766722c0.patch | 297 -
src/scintilla_backports/revs | 77 -
src/textadept.c | 2 +-
src/tre.patch | 71 -
themes/light.lua | 2 +-
90 files changed, 128 insertions(+), 25220 deletions(-)
delete mode 100755 scripts/backport.sh
delete mode 100644 src/scintilla_backports/6095_ae52e0c68190.patch
delete mode 100644 src/scintilla_backports/6097_7f22895eaddb.patch
delete mode 100644 src/scintilla_backports/6099_809112c81196.patch
delete mode 100644 src/scintilla_backports/6101_b82fe8d33961.patch
delete mode 100644 src/scintilla_backports/6102_e12538e52567.patch
delete mode 100644 src/scintilla_backports/6108_b833c0659497.patch
delete mode 100644 src/scintilla_backports/6111_225f39cfd931.patch
delete mode 100644 src/scintilla_backports/6116_6c62b379a52e.patch
delete mode 100644 src/scintilla_backports/6117_23546875480b.patch
delete mode 100644 src/scintilla_backports/6118_559dea66606f.patch
delete mode 100644 src/scintilla_backports/6119_71bee2f06619.patch
delete mode 100644 src/scintilla_backports/6120_8e0cb37c4972.patch
delete mode 100644 src/scintilla_backports/6124_4527b3c217a4.patch
delete mode 100644 src/scintilla_backports/6131_a78e38849624.patch
delete mode 100644 src/scintilla_backports/6132_6cf19f2bf214.patch
delete mode 100644 src/scintilla_backports/6133_30f1573f17ac.patch
delete mode 100644 src/scintilla_backports/6134_0253f113f223.patch
delete mode 100644 src/scintilla_backports/6135_34665edc7efd.patch
delete mode 100644 src/scintilla_backports/6136_2b25287311d0.patch
delete mode 100644 src/scintilla_backports/6137_c3bba4a9193e.patch
delete mode 100644 src/scintilla_backports/6138_55368b05bb72.patch
delete mode 100644 src/scintilla_backports/6145_b3eaa82b3750.patch
delete mode 100644 src/scintilla_backports/6153_a0f26eaf474d.patch
delete mode 100644 src/scintilla_backports/6154_284cc3b0e754.patch
delete mode 100644 src/scintilla_backports/6155_c105254dae66.patch
delete mode 100644 src/scintilla_backports/6156_152e56f0b392.patch
delete mode 100644 src/scintilla_backports/6157_35d652a3344b.patch
delete mode 100644 src/scintilla_backports/6158_47fa874827a5.patch
delete mode 100644 src/scintilla_backports/6159_67865d8e5a37.patch
delete mode 100644 src/scintilla_backports/6160_a1a9cde51997.patch
delete mode 100644 src/scintilla_backports/6161_e7ca78c6f29c.patch
delete mode 100644 src/scintilla_backports/6167_797ed6c538fd.patch
delete mode 100644 src/scintilla_backports/6168_d046ce80d590.patch
delete mode 100644 src/scintilla_backports/6170_df221375187c.patch
delete mode 100644 src/scintilla_backports/6171_99e46ea84433.patch
delete mode 100644 src/scintilla_backports/6172_84161436cfbc.patch
delete mode 100644 src/scintilla_backports/6173_c9dcde8a91d3.patch
delete mode 100644 src/scintilla_backports/6174_150bdfbe2b5a.patch
delete mode 100644 src/scintilla_backports/6175_d742ec177a7e.patch
delete mode 100644 src/scintilla_backports/6176_20120f9d1698.patch
delete mode 100644 src/scintilla_backports/6182_7c132e9340ce.patch
delete mode 100644 src/scintilla_backports/6183_3e2dd5970075.patch
delete mode 100644 src/scintilla_backports/6184_692a54eaa604.patch
delete mode 100644 src/scintilla_backports/6185_b8379bec8e70.patch
delete mode 100644 src/scintilla_backports/6186_044d2d030263.patch
delete mode 100644 src/scintilla_backports/6187_a80a6876c301.patch
delete mode 100644 src/scintilla_backports/6196_e4f249dbdc30.patch
delete mode 100644 src/scintilla_backports/6215_1f02cb4a5b26.patch
delete mode 100644 src/scintilla_backports/6222_45f968a6735a.patch
delete mode 100644 src/scintilla_backports/6231_61adfbe4fa64.patch
delete mode 100644 src/scintilla_backports/6301_4bf96081f6e6.patch
delete mode 100644 src/scintilla_backports/6305_90741c1cb988.patch
delete mode 100644 src/scintilla_backports/6310_7e28cdba6d61.patch
delete mode 100644 src/scintilla_backports/6311_7030530a9a0f.patch
delete mode 100644 src/scintilla_backports/6314_af83baede430.patch
delete mode 100644 src/scintilla_backports/6317_82cb780a04d1.patch
delete mode 100644 src/scintilla_backports/6323_8d56eaef4f0a.patch
delete mode 100644 src/scintilla_backports/6327_95346e626cf8.patch
delete mode 100644 src/scintilla_backports/6339_79f86be9e988.patch
delete mode 100644 src/scintilla_backports/6340_ebec660dcf48.patch
delete mode 100644 src/scintilla_backports/6342_52f12c3eebcd.patch
delete mode 100644 src/scintilla_backports/6379_b44bb3627bbd.patch
delete mode 100644 src/scintilla_backports/6388_96506cab38bd.patch
delete mode 100644 src/scintilla_backports/6397_2db0528f34b5.patch
delete mode 100644 src/scintilla_backports/6418_85205da6ec1b.patch
delete mode 100644 src/scintilla_backports/6419_8760026bba6a.patch
delete mode 100644 src/scintilla_backports/6421_fd2f856b8d58.patch
delete mode 100644 src/scintilla_backports/6425_73343682cbda.patch
delete mode 100644 src/scintilla_backports/6434_ed27432729c3.patch
delete mode 100644 src/scintilla_backports/6441_92c8f0f1b3e6.patch
delete mode 100644 src/scintilla_backports/6442_3e3bfe29a819.patch
delete mode 100644 src/scintilla_backports/6444_1bd57324aa36.patch
delete mode 100644 src/scintilla_backports/6445_89d992f380a1.patch
delete mode 100644 src/scintilla_backports/6448_431b814a54a6.patch
delete mode 100644 src/scintilla_backports/6449_1280ef150bbb.patch
delete mode 100644 src/scintilla_backports/6456_eaa6c7fa1a81.patch
delete mode 100644 src/scintilla_backports/6458_0a8a766722c0.patch
delete mode 100644 src/scintilla_backports/revs
delete mode 100644 src/tre.patch
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 78353f71..30ea58c5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -696,7 +696,7 @@ Changes:
* Disabled `textadept.run.CHECK_SYNTAX` by default.
* Updated to [lspawn][] 1.5.
* Updated to [Scintilla][] 3.6.5.
-* Updated to [Scinterm][] 1.8.
+* Updated to Scinterm 1.8.
[Textadept 8.7 -- Win32]: download/textadept_8.7.win32.zip
[Textadept 8.7 -- Mac OSX Intel 10.5+]: download/textadept_8.7.osx.zip
@@ -718,7 +718,6 @@ Changes:
[`textadept.editing.enclose()`]: api.html#textadept.editing.enclose
[lspawn]: http://foicica.com/hg/lspawn
[Scintilla]: http://scintilla.org
-[Scinterm]: http://foicica.com/scinterm
## 8.6 (01 Mar 2016)
@@ -760,7 +759,7 @@ Changes:
[stateful lexers][].
* Updated to [lspawn][] 1.4.
* Updated to [Scintilla][] 3.6.3.
-* Updated to [Scinterm][] 1.7.
+* Updated to Scinterm 1.7.
[Textadept 8.6 -- Win32]: download/textadept_8.6.win32.zip
[Textadept 8.6 -- Mac OSX Intel 10.5+]: download/textadept_8.6.osx.zip
@@ -779,7 +778,6 @@ Changes:
[stateful lexers]: api.html#lexer.Lexers.with.Complex.State
[lspawn]: http://foicica.com/hg/lspawn
[Scintilla]: http://scintilla.org
-[Scinterm]: http://foicica.com/scinterm
## 8.5 (01 Jan 2016)
@@ -4053,7 +4051,7 @@ Bugfixes:
Changes:
-* Updated to the new [Scintillua][] that does not required patched Scintilla.
+* Updated to the new Scintillua that does not required patched Scintilla.
* Updated to [Scintilla][] 2.21.
[Textadept 3.2 -- Win32]: download/textadept_3.2.win32.zip
@@ -4066,7 +4064,6 @@ Changes:
[PGP -- 3.2 Linux]: download/textadept_3.2.tgz.asc
[PGP -- 3.2 Linux x86_64]: download/textadept_3.2.x86_64.tgz.asc
[PGP -- 3.2 Source]: download/textadept_3.2.src.zip.asc
-[Scintillua]: http://foicica.com/scintillua
[Scintilla]: http://scintilla.org
## 3.1 (21 Aug 2010)
diff --git a/FAQ.md b/FAQ.md
index ae043cc1..b7ecf567 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -16,6 +16,21 @@ that had a noticible difference between the two. *textadept* is recommended.
- - -
+**Q:**
+If Textadept is so minimalist, why are the downloads around 10MB in size and the
+unzipped folders 10s of MBs in size?
+
+**A:**
+Each download contains 4 executables: 2 GUI versions and 2 terminal versions
+(each version uses either Lua or LuaJIT). Furthermore, the Windows and OSX
+packages bundle in GTK+ runtimes, accounting for some 3/4 of the total
+application size. (GTK+ is the cross-platform GUI toolkit Textadept uses.)
+Finally, starting in version 10, in order to be able to run on older Linux
+systems whose libstdc++ does not support newer C++11 symbols, the Linux
+executables statically link in a newer version of libstdc++.
+
+- - -
+
**Q:**
On Linux I get a `error while loading shared libraries: : cannot open`
`shared object file: No such file or directory` when trying to run Textadept.
diff --git a/TECHNOLOGY.md b/TECHNOLOGY.md
index 06044914..309a9f11 100644
--- a/TECHNOLOGY.md
+++ b/TECHNOLOGY.md
@@ -31,17 +31,6 @@ Textadept's core text editing component is Scintilla.
=[Scintilla][] - Scintilla=
Textadept uses Scintilla as its core text editing component.
-=[TRE][] - Regular Expression Library=
- Textadept replaces Scintilla's bare-bones Regex capabilities with TRE.
- Approximate matching is not turned on.
-
-=[Scinterm][]\* - Scintilla for curses=
- Textadept uses Scinterm as its core text editing component for the terminal
- version.
-
-=[Scintillua][]\* - Dynamic Lua LPeg Lexers for Scintilla=
- Textadept uses Scintillua and its lexers for highlighting source code.
-
## Scripting
Textadept uses Lua as its scripting language. The editor is primarily written in
@@ -55,7 +44,7 @@ Lua and includes a few external libraries.
Textadept optionally uses LuaJIT as a substitute for vanilla Lua.
=[LPeg][] - Parsing Expression Grammars for Lua=
- Textadept uses LPeg in its Scintillua lexers.
+ Textadept uses LPeg in its Scintilla lexers.
=[LuaFileSystem][] - Library for accessing directories and file attributes=
Textadept uses LFS for accessing the host filesystem.
@@ -67,11 +56,8 @@ Lua and includes a few external libraries.
[GTK+]: http://www.gtk.org
[Scintilla]: http://scintilla.org
-[TRE]: https://github.com/laurikari/tre
[Lua]: http://www.lua.org
[LuaJIT]: http://luajit.org
-[Scintillua]: http://foicica.com/scintillua
-[Scinterm]: http://foicica.com/scinterm
[LPeg]: http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html
[LuaFileSystem]: http://keplerproject.github.io/luafilesystem/
[lspawn]: http://foicica.com/hg/lspawn
diff --git a/doc/manual.md b/doc/manual.md
index aa3d7013..b57b964a 100644
--- a/doc/manual.md
+++ b/doc/manual.md
@@ -1618,8 +1618,9 @@ as running it.
### Requirements for Linux and BSD
-First, Linux and BSD systems need either the [GNU C compiler][] (*gcc*) or
-[Clang][] (*clang*), as well as [GNU Make][] (*make* or *gmake*). BSD users
+First, Linux and BSD systems need either the [GNU C compiler][] (*gcc*) version
+4.9 or later (circa early 2014) or [Clang][] (*clang*), [libstdc++][] 4.9 or
+later (circa early 2014), and [GNU Make][] (*make* or *gmake*). BSD users
additionally need to have [pkg-config][] and [libiconv][] installed. All of
these should be available for your distribution through a package manager. For
example, Ubuntu includes these tools in the "build-essential" package.
@@ -1639,6 +1640,7 @@ users _also_ need "libncursesw5-dev".)
[GNU C compiler]: http://gcc.gnu.org
[Clang]: http://clang.llvm.org/
+[libstdc++]: http://gcc.gnu.org
[GNU Make]: http://www.gnu.org/software/make/
[pkg-config]: http://www.freedesktop.org/wiki/Software/pkg-config/
[libiconv]: http://www.gnu.org/software/libiconv/
@@ -1649,15 +1651,18 @@ users _also_ need "libncursesw5-dev".)
Compiling Textadept on Windows is no longer supported. The preferred way to
compile for Windows is cross-compiling from Linux. In order to do so, you need
-[MinGW][] with the Windows header files. Your package manager should offer them.
+[MinGW][] or [mingw-w64][] version 4.9 or later with the Windows header files.
+Your package manager should offer them.
Note: compiling on Windows requires a C compiler that supports the C99 standard,
-the [GTK+ for Windows bundle][] (2.24 is recommended), and
+a C++ compiler that supports the C++11 standard, a C++ standard library that
+supports C++11, the [GTK+ for Windows bundle][] version 2.24, and
[libiconv for Windows][] (the "Developer files" and "Binaries" zip files). The
terminal (pdcurses) version requires my [win32curses bundle][] instead of GTK+
and libiconv.
[MinGW]: http://mingw.org
+[mingw-w64]: http://mingw-w64.org/
[GTK+ for Windows bundle]: http://www.gtk.org/download/windows.php
[libiconv for Windows]: http://gnuwin32.sourceforge.net/packages/libiconv.htm
[win32curses bundle]: download/win32curses.zip
@@ -1665,10 +1670,15 @@ and libiconv.
### Requirements for Mac OSX
Compiling Textadept on Mac OSX is no longer supported. The preferred way is
-cross-compiling from Linux. In order to do so, you need the
-[Apple Cross-compiler][] binaries.
+cross-compiling from Linux. In order to do so, you need install an [OSX cross
+toolchain][] _with GCC_ version 4.9 or later. You will need to run
+`./build_binutils.sh` _before_ `./build_gcc.sh`. OSX SDK tarballs like
+*MacOSX10.5.tar.gz* can be found readily on the internet.
-[Apple Cross-compiler]: https://launchpad.net/~flosoft/+archive/cross-apple
+Note that building an OSX toolchain can easily take 30 minutes or more and
+ultimately consume nearly 3.5GB of disk space.
+
+[OSX cross toolchain]: https://github.com/tpoechtrager/osxcross
## Compiling
@@ -1729,12 +1739,13 @@ Similarly, `make curses` and `make curses install` installs the curses version.
When cross-compiling from within Linux, first make a note of your MinGW
compiler names. You may have to either modify the `CROSS` variable in the
-"win32" block of *src/Makefile* or append something like "CROSS=i486-mingw32-"
-when running `make`. After considering your MinGW compiler names, run
-`make win32-deps` or `make CROSS=i486-mingw32- win32-deps` to prepare the build
-environment followed by `make win32` or `make CROSS=i486-mingw32- win32` to
-build *../textadept.exe* and *../textadeptjit.exe*. Finally, copy the dll files
-from *src/win32gtk/bin/* to the directory containing the Textadept executables.
+"win32" block of *src/Makefile* or append something like
+"CROSS=i586-mingw32msvc-" when running `make`. After considering your MinGW
+compiler names, run `make win32-deps` or
+`make CROSS=i586-mingw32msvc- win32-deps` to prepare the build environment
+followed by `make win32` or `make CROSS=i586-mingw32msvc- win32` to build
+*../textadept.exe* and *../textadeptjit.exe*. Finally, copy the dll files from
+*src/win32gtk/bin/* to the directory containing the Textadept executables.
Similarly for the terminal version, run `make win32-curses` or its variant as
suggested above to build *../textadept-curses.exe* and
@@ -1869,210 +1880,12 @@ Textadept has a [mailing list][] and a [wiki][].
## Regular Expressions
-Textadept uses [TRE][] as its regular expression library. TRE is a "lightweight,
-robust, and efficient POSIX compliant regexp matching library".
-
-The following is from the [TRE Regexp Syntax][].
-
-This section describes the POSIX 1003.2 extended RE (ERE) syntax as implemented
-by TRE, and the TRE extensions to the ERE syntax. A simple Extended Backus-Naur
-Form (EBNF) style notation is used to describe the grammar.
+Textadept's regular expressions are based on the C++11 standard for ECMAScript.
+There are a number of references for this syntax on the internet including:
-**Alternation operator**
-
- extended-regexp ::= branch
- | extended-regexp "|" branch
-
-An extended regexp (ERE) is one or more branches, separated by `|`. An ERE
-matches anything that matches one or more of the branches.
-
-**Catenation of REs**
-
- branch ::= piece
- | branch piece
-
-A branch is one or more pieces concatenated. It matches a match for the first
-piece, followed by a match for the second piece, and so on.
-
- piece ::= atom
- | atom repeat-operator
- | atom approx-settings
-
-A piece is an atom possibly followed by a repeat operator or an expression
-controlling approximate matching parameters for the atom.
-
- atom ::= "(" extended-regexp ")"
- | bracket-expression
- | "."
- | assertion
- | literal
- | back-reference
- | "(?#" comment-text ")"
- | "(?" options ")" extended-regexp
- | "(?" options ":" extended-regexp ")"
-
-An atom is either an ERE enclosed in parenthesis, a bracket expression, a `.`
-(period), an assertion, or a literal.
-
-The dot (`.`) matches any single character.
-
-Comment-text can contain any characters except for a closing parenthesis `)`.
-The text in the comment is completely ignored by the regex parser and it used
-solely for readability purposes.
-
-**Repeat operators**
-
- repeat-operator ::= "*"
- | "+"
- | "?"
- | bound
- | "*?"
- | "+?"
- | "??"
- | bound ?
-
-An atom followed by `*` matches a sequence of 0 or more matches of the atom. `+`
-is similar to `*`, matching a sequence of 1 or more matches of the atom. An atom
-followed by `?` matches a sequence of 0 or 1 matches of the atom.
-
-A bound is one of the following, where *m* and *n* are unsigned decimal integers
-between 0 and `RE_DUP_MAX`:
-
-1. {*m*,*n*}
-2. {*m*,}
-3. {*m*}
-
-An atom followed by [1] matches a sequence of *m* through *n* (inclusive)
-matches of the atom. An atom followed by [2] matches a sequence of *m* or more
-matches of the atom. An atom followed by [3] matches a sequence of exactly *m*
-matches of the atom.
-
-Adding a `?` to a repeat operator makes the subexpression minimal, or
-non-greedy. Normally a repeated expression is greedy, that is, it matches as
-many characters as possible. A non-greedy subexpression matches as few
-characters as possible. Note that this does not (always) mean the same thing as
-matching as many or few repetitions as possible.
-
-**Bracket expressions**
-
- bracket-expression ::= "[" item+ "]"
- | "[^" item+ "]"
-
-A bracket expression specifies a set of characters by enclosing a nonempty list
-of items in brackets. Normally anything matching any item in the list is
-matched. If the list begins with `^` the meaning is negated; any character
-matching no item in the list is matched.
-
-An item is any of the following:
-
-* A single character, matching that character.
-* Two characters separated by `-`. This is shorthand for the full range of
- characters between those two (inclusive) in the collating sequence. For
- example, `[0-9]` in ASCII matches any decimal digit.
-* A collating element enclosed in `[.` and `.]`, matching the collating element.
- This can be used to include a literal `-` or a multi-character collating
- element in the list.
-* A collating element enclosed in `[=` and `=]` (an equivalence class), matching
- all collating elements with the same primary collation weight as that element,
- including the element itself.
-* The name of a character class enclosed in `[:` and `:]`, matching any
- character belonging to the class. The set of valid names depends on the
- `LC_CTYPE` category of the current locale, but the following names are valid
- in all locales:
- + `alnum` -- alphanumeric characters
- + `alpha` -- alphabetic characters
- + `blank` -- blank characters
- + `cntrl` -- control characters
- + `digit` -- decimal digits (0 through 9)
- + `graph` -- all printable characters except space
- + `lower` -- lower-case letters
- + `print` -- printable characters including space
- + `punct` -- printable characters not space or alphanumeric
- + `space` -- white-space characters
- + `upper` -- upper case letters
- + `xdigit` -- hexadecimal digits
-
-To include a literal `-` in the list, make it either the first or last item, the
-second endpoint of a range, or enclose it in `[.` and `.]` to make it a
-collating element. To include a literal `]` in the list, make it either the
-first item, the second endpoint of a range, or enclose it in `[.` and `.]`. To
-use a literal `-` as the first endpoint of a range, enclose it in `[.` and `.].`
-
-**Assertions**
-
- assertion ::= "^"
- | "$"
- | "\" assertion-character
-
-The expressions `^` and `$` are called "left anchor" and "right anchor",
-respectively. The left anchor matches the empty string at the beginning of the
-string. The right anchor matches the empty string at the end of the string.
-
-An assertion-character can be any of the following:
-
-* `<` -- Beginning of word
-* `>` -- End of word
-* `b` -- Word boundary
-* `B` -- Non-word boundary
-* `d` -- Digit character (equivalent to `[[:digit:]]`)
-* `D` -- Non-digit character (equivalent to `[^[:digit:]]`)
-* `s` -- Space character (equivalent to `[[:space:]]`)
-* `S` -- Non-space character (equivalent to `[^[:space:]]`)
-* `w` -- Word character (equivalent to `[[:alnum:]_]`)
-* `W` -- Non-word character (equivalent to `[^[:alnum:]_]`)
-
-**Literals**
-
- literal ::= ordinary-character
- | "\x" ["1"-"9" "a"-"f" "A"-"F"]{0,2}
- | "\x{" ["1"-"9" "a"-"f" "A"-"F"]* "}"
- | "\" character
-
-A literal is either an ordinary character (a character that has no other
-significance in the context), an 8 bit hexadecimal encoded character (e.g.
-`\x1B`), a wide hexadecimal encoded character (e.g. `\x{263a}`), or an escaped
-character. An escaped character is a `\` followed by any character, and matches
-that character. Escaping can be used to match characters which have a special
-meaning in regexp syntax. A `\` cannot be the last character of an ERE. Escaping
-also allows you to include a few non-printable characters in the regular
-expression. These special escape sequences include:
-
-* `\a` -- Bell character (ASCII code 7)
-* `\e` -- Escape character (ASCII code 27)
-* `\f` -- Form-feed character (ASCII code 12)
-* `\n` -- New-line/line-feed character (ASCII code 10)
-* `\r` -- Carriage return character (ASCII code 13)
-* `\t` -- Horizontal tab character (ASCII code 9)
-
-An ordinary character is just a single character with no other significance, and
-matches that character. A `{` followed by something else than a digit is
-considered an ordinary character.
-
-**Back references**
-
- back-reference ::= "\" ["1"-"9"]
-
-A back reference is a backslash followed by a single non-zero decimal digit *d*.
-It matches the same sequence of characters matched by the *d*th parenthesized
-subexpression.
-
-**Options**
-
- options ::= ["i" "n" "r" "U"]* ("-" ["i" "n" "r" "U"]*)?
-
-Options allow compile time options to be turned on/off for particular parts of
-the regular expression. If the option is specified in the first section, it is
-turned on. If it is specified in the second section (after the `-`), it is
-turned off.
-
-* `i` -- Case insensitive.
-* `n` -- Forces special handling of the new line character.
-* `r` -- Causes the regex to be matched in a right associative manner rather than
- the normal left associative manner.
-* `U` -- Forces repetition operators to be non-greedy unless a `?` is appended.
-
-[TRE]: https://github.com/laurikari/tre
-[TRE Regexp Syntax]: http://laurikari.net/tre/documentation/regex-syntax/
+* [ECMAScript syntax C++ reference](http://www.cplusplus.com/reference/regex/ECMAScript/)
+* [Modified ECMAScript regular expression grammar](http://en.cppreference.com/w/cpp/regex/ecmascript)
+* [Regular Expressions (C++)](https://docs.microsoft.com/en-us/cpp/standard-library/regular-expressions-cpp)
## Lua Patterns
@@ -2277,12 +2090,19 @@ Simply copying the contents of your *~/.textadept/properties.lua* into
Lexers are now written in a more object-oriented way. Legacy lexers are still
supported, but it is recommended that you [migrate them][].
+[migrate them]: api.html#lexer.Migrating.Legacy.Lexers
+
#### Key Bindings Changes
The terminal version's key sequence for `Ctrl+Space` is now `'c '` instead of
`'c@'`.
-[migrate them]: api.html#lexer.Migrating.Legacy.Lexers
+#### Regex Changes
+
+Textadept now uses [C++11's ECMAScript regex syntax](#Regular.Expressions)
+instead of [TRE][].
+
+[TRE]: https://github.com/laurikari/tre
### Textadept 8 to 9
diff --git a/init.lua b/init.lua
index 8d150b01..db06d1a8 100644
--- a/init.lua
+++ b/init.lua
@@ -73,6 +73,8 @@ end
local buffer = buffer
buffer.set_theme(not CURSES and 'light' or 'term')
+buffer.FIND_REGEXP = buffer.FIND_REGEXP + buffer.FIND_CXX11REGEX
+
-- Multiple Selection and Virtual Space
buffer.multiple_selection = true
buffer.additional_selection_typing = true
diff --git a/scripts/backport.sh b/scripts/backport.sh
deleted file mode 100755
index c72603e8..00000000
--- a/scripts/backport.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-# Scintilla backport utility.
-# Interactively prompts for patches to backport.
-
-cd ../src/scintilla
-
-tip=`hg log | head -n1 | awk '{print $2}' | cut -d: -f1`
-if [ -z "$1" ]; then
- last=`ls -r ../scintilla_backports/*.patch|head -n1|cut -d/ -f3|cut -d_ -f1`
- last=`expr $last + 1`
-else
- last=$1
-fi
-for rev in `seq $last $tip`; do
- # Show revision information.
- echo Revision: $rev
- echo Message : `hg export -r $rev | grep -v "^#" -m1`
- echo Files:
- hg export -r $rev | grep "^diff" | cut -d ' ' -f6 | sed -e 's/^/\t/'
- # Prompt with action.
- read -p "Attempt dry-run patch? [y/n/m/q] " input
- if [ "$input" = "m" ]; then
- # Show more revision information.
- hg export -r $rev
- read -p "Attempt dry-run patch? [y/n/q] " input
- fi;
- case $input in
- y)
- # Apply patch (dry run).
- hg export -r $rev | patch -p1 --dry-run
- read -p "Add patch to backports? [y/n/m/q] " input
- if [ "$input" = "m" ]; then
- # Show more revision information.
- hg export -r $rev
- read -p "Add patch to backports? [y/n/e/q] " input
- while [ "$input" = "e" ]; do
- if [ -z "`ls /tmp/$rev_*.patch 2>/dev/null`" ]; then
- hg export -o "/tmp/%R_%h.patch" $rev
- fi
- ta -n -f /tmp/$rev_*.patch \
- -e "textadept.editing.strip_trailing_spaces=false"
- cat /tmp/$rev_*.patch | patch -p1 --dry-run
- read -p "Add patch to backports? [y/n/e/q] " input
- done
- fi;
- case $input in
- y)
- # Add patch to '../scintilla_backports' and update 'revs' file.
- if [ -z "`ls /tmp/$rev_*.patch 2>/dev/null`" ]; then
- hg export -r $rev | patch -p1
- hg export -o "../scintilla_backports/%R_%h.patch" $rev
- else
- mv /tmp/$rev_*.patch ../scintilla_backports/
- fi
- hash=`hg export -r $rev | grep -m1 "Node" | cut -d ' ' -f4 | head -c12`
- line=`hg export -r $rev | grep -v "^#" -m1`
- echo "$hash $line" >> ../scintilla_backports/revs
- echo "Added ../scintilla_backports/$rev_$hash.patch"
- echo "$hash $line";;
- n)
- rm -f /tmp/$rev_*.patch;;
- # continue to next revision
- *)
- rm -f /tmp/$rev_*.patch
- echo Quitting
- exit 0;;
- esac;;
- n)
- ;; # continue to next revision
- *)
- echo Quitting
- exit 0;;
- esac
- echo -------------------------------------------------------------------------
-done
diff --git a/scripts/gen_iface.lua b/scripts/gen_iface.lua
index 2b34bbc1..7c9acb9d 100755
--- a/scripts/gen_iface.lua
+++ b/scripts/gen_iface.lua
@@ -77,7 +77,7 @@ for line in io.lines('../src/scintilla/include/Scintilla.iface') do
::continue::
end
--- Add mouse events from Scinterm manually.
+-- Add mouse events from Scintilla curses manually.
constants[#constants + 1] = 'MOUSE_PRESS=1'
constants[#constants + 1] = 'MOUSE_DRAG=2'
constants[#constants + 1] = 'MOUSE_RELEASE=3'
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 $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(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(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
-# 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 @@
-
-
-
-+
-+ -
-+ Released 19 February 2017.
-+
-+ -
-+ Fix to prevent double scrolling on GTK+ with X11.
-+ Bug #1901.
-+
-+
-+
-
-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
-# 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.
-
- -
-+ Fix to stream selection mode when moving caret up or down.
-+ Bug #1905.
-+
-+ -
- Fix to prevent double scrolling on GTK+ with X11.
- Bug #1901.
-
-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
-# 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 @@
- Bug #1915.
-
- -
-+ Fix crash in accessibility code on GTK+ < 3.3.6 caused by previous bug fix.
-+ Bug #1907.
-+
-+ -
- Fix to prevent double scrolling on GTK+ with X11.
- Bug #1901.
-
-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
-# 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(&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 @@
- Bug #1881.
-
- -
-+ Fix potential problems with IME on Cocoa when document contains invalid
-+ UTF-8.
-+
-+ -
- Fix crash on Cocoa with OS X 10.9 due to accessibility API not available.
- Bug #1915.
-
-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
-
- #include
-+#include
-
- #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(text.c_str());
-+ size_t remaining = text.size();
-+ while (remaining > 0) {
-+ const int utf8Status = UTF8Classify(us, static_cast(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(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
-# 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(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 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(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
-# 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.
-
- -
-+ For IMEs, do not clear selected text when there is no composition text to show.
-+
-+ -
- Fix to stream selection mode when moving caret up or down.
- Bug #1905.
-
-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 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 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 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
-# 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:
- // at 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 searchThing(lengthFind * UTF8MaxBytes * maxFoldingExpansion + 1);
-+ std::vector searchThing((lengthFind+1) * UTF8MaxBytes * maxFoldingExpansion + 1);
- const int lenSearch = static_cast(
- pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind));
- char bytes[UTF8MaxBytes + 1];
-@@ -1914,6 +1914,8 @@
- break;
- const int lenFlat = static_cast(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(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 searchThing(lengthFind * maxBytesCharacter * maxFoldingExpansion + 1);
-+ std::vector searchThing((lengthFind+1) * maxBytesCharacter * maxFoldingExpansion + 1);
- const int lenSearch = static_cast(
- 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(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(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
-# 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 @@
-
- ○ Long lines |
-
-+ ○ Accessibility |
-+
- ○ Lexer |
-
-+
-+
-+
- ○ Lexer objects |
-
--
--
--
- ○ Notifications |
-
-- ○ Accessibility |
--
- ○ Images |
-
-
-@@ -6511,6 +6511,60 @@
- of a space character in STYLE_DEFAULT
. All the edges can be cleared with
- SCI_MULTIEDGECLEARALL
.
-
-+ Accessibility
-+
-+ 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.
-+
-+
-+ SCI_SETACCESSIBILITY(int accessibility)
-+ SCI_GETACCESSIBILITY → int
-+
-+
-+ SCI_SETACCESSIBILITY(int accessibility)
-+ SCI_GETACCESSIBILITY → int
-+ These messages may enable or disable accessibility and report its current status.
-+
-+ On most platforms, accessibility is either implemented or not implemented and this can be
-+ discovered with SCI_GETACCESSIBILITY
with
-+ SCI_SETACCESSIBILITY
performing no action.
-+ On GTK+, there are storage and performance costs to accessibility, so it can be disabled
-+ by calling SCI_SETACCESSIBILITY
.
-+
-+
-+
-+
-+
-+ Symbol |
-+
-+ Value |
-+
-+ Accessibility status |
-+
-+
-+
-+
-+
-+ SC_ACCESSIBILITY_DISABLED |
-+
-+ 0 |
-+
-+ Accessibility is disabled. |
-+
-+
-+
-+ SC_ACCESSIBILITY_ENABLED |
-+
-+ 1 |
-+
-+ Accessibility is enabled. |
-+
-+
-+
-+
- Lexer
-
- If you define the symbol SCI_LEXER
when building Scintilla, (this is sometimes
-@@ -7891,15 +7945,6 @@
- SCN_AUTOCSELECTION
- notification.
-
-- Accessibility
--
-- 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.
--
--
- Images
-
- Two formats are supported for images used in margin markers and autocompletion lists, RGBA and XPM.
-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.
-
-
-+ Accessibility support may be queried with SCI_GETACCESSIBILITY.
-+ On GTK+, accessibility may be disabled by calling SCI_SETACCESSIBILITY.
-+
-+
- Lexer added for "indent" language which is styled as plain text but folded by indentation level.
-
-
-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(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 character_offsets;
-
-+ // cache holding character offset for each line start, see CharacterOffsetFromByteOffset()
-+ std::vector character_offsets;
-+
- // cached length of the deletion, in characters (see Notify())
- int deletionLengthChar;
- // local state for comparing
- Position old_pos;
- std::vector 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().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(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
-# 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 character_offsets;
-
-- // cache holding character offset for each line start, see CharacterOffsetFromByteOffset()
-- std::vector 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
-# 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(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
-# 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(pt.y) << 16) | static_cast(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
-# 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(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(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(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
-# 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.
-
-
-+ Fix to crash with fold tags where line inserted at start.
-+
-+
- Fix to stream selection mode when moving caret up or down.
- Bug #1905.
-
-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
-# 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(ll->positions[ll->numCharsInLine] - subLineStart) + spaceWidth + virtualSpace;
-+ rcSegment.left = xStart + static_cast(ll->positions[ll->numCharsInLine] - subLineStart) + virtualSpace + vsDraw.aveCharWidth;
- rcSegment.right = rcSegment.left + static_cast(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
-# 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
-# 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(rcSegment.left), static_cast(rcSegment.top));
-- surface->LineTo(static_cast(rcSegment.left), static_cast(rcSegment.bottom));
-- surface->MoveTo(static_cast(rcSegment.right), static_cast(rcSegment.top));
-- surface->LineTo(static_cast(rcSegment.right), static_cast(rcSegment.bottom));
-- surface->MoveTo(static_cast(rcSegment.left), static_cast(rcSegment.top));
-- surface->LineTo(static_cast(rcSegment.right), static_cast(rcSegment.top));
-- surface->MoveTo(static_cast(rcSegment.left), static_cast(rcSegment.bottom - 1));
-- surface->LineTo(static_cast(rcSegment.right), static_cast(rcSegment.bottom - 1));
-+ PRectangle rcBox = rcSegment;
-+ rcBox.left = static_cast(RoundXYPosition(rcSegment.left));
-+ rcBox.right = static_cast(RoundXYPosition(rcSegment.right));
-+ surface->MoveTo(static_cast(rcBox.left), static_cast(rcBox.top));
-+ surface->LineTo(static_cast(rcBox.left), static_cast(rcBox.bottom));
-+ surface->MoveTo(static_cast(rcBox.right), static_cast(rcBox.top));
-+ surface->LineTo(static_cast(rcBox.right), static_cast(rcBox.bottom));
-+ surface->MoveTo(static_cast(rcBox.left), static_cast(rcBox.top));
-+ surface->LineTo(static_cast(rcBox.right), static_cast(rcBox.top));
-+ surface->MoveTo(static_cast(rcBox.left), static_cast(rcBox.bottom - 1));
-+ surface->LineTo(static_cast(rcBox.right), static_cast(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
-# 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(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
-# 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
-# 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
-# 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(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(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(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
-# 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.
-
-
-+ Updated case conversion and character categories to Unicode 9.
-+
-+
-+
-+
-+ -
-+ Released 21 March 2017.
-+
-+ -
- Requires a C++11 compiler. GCC 4.8 and MSVC 2015 are supported.
-
- -
-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
-# 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 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(len));
-+ scia->InsertStringUTF8(bytePosition, text, static_cast(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(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 character_offsets;
-+ std::vector 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 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(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(substance.ValueAt(position-2)),
- static_cast(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 *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; jInsertLine(line);
- }
- }
-
--void Document::RemoveLine(int line) {
-+void Document::RemoveLine(Sci::Line line) {
- for (int j=0; jRemoveLine(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(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(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(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(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(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(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(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(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(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(leadByte),0,0,0};
- for (int b=1; b(start+b));
-+ charBytes[b] = cb.CharAt(static_cast(start+b));
- int utf8status = UTF8Classify(reinterpret_cast(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(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(linebuf.length()));
-+ static_cast(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(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 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(perLineData[ldState])->GetLineState(line);
- }
-
--int Document::GetMaxLineState() {
-+Sci::Line Document::GetMaxLineState() {
- return static_cast(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(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(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(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(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(perLineData[ldMargin])->ClearAll();
- }
-
--StyledText Document::AnnotationStyledText(int line) const {
-+StyledText Document::AnnotationStyledText(Sci::Line line) const {
- LineAnnotation *pla = static_cast(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(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(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(perLineData[ldAnnotation])->SetStyles(line, styles);
- }
- }
-
--int Document::AnnotationLines(int line) const {
-+int Document::AnnotationLines(Sci::Line line) const {
- return static_cast(perLineData[ldAnnotation])->Lines(line);
- }
-
- void Document::AnnotationClearAll() {
-- int maxEditorLine = LinesTotal();
-- for (int l=0; l(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 {
- 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 {
- // 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 {
- 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(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(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(x + tabWidthMinimumPixels));
- if (next > 0)
- return static_cast(next);
- return (static_cast((x + tabWidthMinimumPixels) / tabWidth) + 1) * tabWidth;
- }
-
--bool EditView::ClearTabstops(int line) {
-+bool EditView::ClearTabstops(Sci::Line line) {
- LineTabstops *lt = static_cast(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(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(floor(pt.y / vs.lineHeight));
-+ Sci::Line visibleLine = static_cast(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(pt.x + subLineStart),
-+ const Sci::Position positionInLine = ll->FindPositionFromX(static_cast(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(rcSegment.top), start + 2, static_cast(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; eolPosnumCharsInLine; eolPos++) {
-+ for (Sci::Position eolPos = ll->numCharsBeforeEOL; eolPosnumCharsInLine; eolPos++) {
- rcSegment.left = xStart + ll->positions[eolPos] - static_cast(subLineStart)+virtualSpace;
- rcSegment.right = xStart + ll->positions[eolPos + 1] - static_cast(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(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; (rInLine(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(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(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(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 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(pfr->chrg.cpMin));
-- int linePrintLast = linePrintStart + (pfr->rc.bottom - pfr->rc.top) / vsPrint.lineHeight - 1;
-+ Sci::Line linePrintStart = model.pdoc->LineFromPosition(static_cast(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(pfr->chrg.cpMax));
-+ Sci::Line linePrintMax = model.pdoc->LineFromPosition(static_cast(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(pfr->chrg.cpMin);
-+ Sci::Position nPrintPos = static_cast(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(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(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(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; rLineFromPosition(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::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(selectedText.length());
-- int pos = static_cast(pdoc->FindText(searchStart, searchEnd,
-+ Sci::Position lengthFound = static_cast(selectedText.length());
-+ Sci::Position pos = static_cast(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(pt.x) + xOffset;
--}
--
--void Editor::ScrollTo(int line, bool moveThumb) {
-- int topLineNew = Platform::Clamp(line, 0, MaxScrollPos());
-+ lastXChosen = static_cast(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(rcClient.top) + (LinesOnScreen() - 1) * vs.lineHeight;
-+ Sci::Position yOfLastLineFullyDisplayed = static_cast(rcClient.top) + (LinesOnScreen() - 1) * vs.lineHeight;
- MovePositionTo(SPositionFromLocation(
- Point::FromInts(lastXChosen - xOffset, static_cast(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(ptAnchor.x + xOffset - rcClient.right) + 1;
-- int maxOffset = static_cast(pt.x + xOffset - rcClient.left) - 1;
-+ int minOffset = static_cast(ptAnchor.x + xOffset - rcClient.right) + 1;
-+ int maxOffset = static_cast(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(rcText.Width());
-+ scrollWidth = xOffset + static_cast(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(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(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; rDeleteChars(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; rDeleteChars(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(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(currentNoVS.Start().Position() + firstDifference),
-- static_cast(rangeBytes - firstDifference - endDifferenceText));
-- const int lengthChange = static_cast(lastDifferenceMapped - firstDifference + 1);
-- const int lengthInserted = pdoc->InsertString(
-+ static_cast(currentNoVS.Start().Position() + firstDifference),
-+ static_cast(rangeBytes - firstDifference - endDifferenceText));
-+ const Sci::Position lengthChange = static_cast(lastDifferenceMapped - firstDifference + 1);
-+ const Sci::Position lengthInserted = pdoc->InsertString(
- static_cast(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(sMapped.size() - sText.size()) + lengthInserted - lengthChange;
-+ Sci::Position diffSizes = static_cast(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(lineCurrent.length()));
-- pdoc->DeleteChars(startPrevious, static_cast(linePrevious.length()));
-- startCurrent -= static_cast(linePrevious.length());
-+ pdoc->DeleteChars(startCurrent, static_cast(lineCurrent.length()));
-+ pdoc->DeleteChars(startPrevious, static_cast(linePrevious.length()));
-+ startCurrent -= static_cast(linePrevious.length());
-
- startCurrent += pdoc->InsertString(startPrevious, lineCurrent.c_str(),
-- static_cast(lineCurrent.length()));
-+ static_cast(lineCurrent.length()));
- pdoc->InsertString(startCurrent, linePrevious.c_str(),
-- static_cast(linePrevious.length()));
-+ static_cast(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(text.length()));
-+ pdoc->InsertString(end.Position() + lengthInserted, text.c_str(), static_cast(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(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(pt.y) + (1 + skipLines) * direction * vs.lineHeight;
-+ const Sci::Line newY = static_cast(pt.y) + (1 + skipLines) * direction * vs.lineHeight;
- if (lastX < 0) {
-- lastX = static_cast(pt.x) + xOffset;
-+ lastX = static_cast(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; rLineFromPosition(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(spaceText.length()));
-+ const Sci::Position lengthInserted = pdoc->InsertString(caretPosition, spaceText.c_str(),
-+ static_cast(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(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(ft->chrg.cpMin),
-- static_cast(ft->chrg.cpMax),
-+ static_cast(ft->chrg.cpMin),
-+ static_cast(ft->chrg.cpMax),
- ft->lpstrText,
- static_cast(wParam),
- &lengthFound);
-@@ -4000,7 +4001,7 @@
-
- const char *txt = reinterpret_cast(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(convertedText.length()));
-+ PasteRectangular(position, convertedText.c_str(), static_cast(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(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; rLineFromPosition(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(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(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(drag.Length()));
- newPos.Add(-static_cast(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(rcArea.bottom - 1) / vs.lineHeight + 1;
-+ Sci::Line lineAfter = TopLineOfMain() + static_cast(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(secondsAllowed / pdoc->durationStyleOneLine),
-+ const Sci::Line linesToStyle = Platform::Clamp(static_cast(secondsAllowed / pdoc->durationStyleOneLine),
- 10, 0x10000);
-- const int stylingMaxLine = std::min(
-- static_cast(pdoc->LineFromPosition(pdoc->GetEndStyled()) + linesToStyle),
-+ const Sci::Line stylingMaxLine = std::min(
-+ static_cast(pdoc->LineFromPosition(pdoc->GetEndStyled()) + linesToStyle),
- pdoc->LinesTotal());
-- return std::min(static_cast(pdoc->LineStart(stylingMaxLine)), posMax);
-+ return std::min(static_cast(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; lineLinesTotal(); line++) {
-+ for (Sci::Line line=start; lineLinesTotal(); 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; lineLinesTotal(); line++) {
-+ for (Sci::Line line=0; lineLinesTotal(); 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; lineLinesTotal();) {
-+Sci::Line Editor::ContractedFoldNext(Sci::Line lineStart) const {
-+ for (Sci::Line line = lineStart; lineLinesTotal();) {
- 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(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(wParam));
-- int lineEnd = pdoc->LineStart(static_cast(wParam + 1));
-+ Sci::Position lineStart = pdoc->LineStart(static_cast(wParam));
-+ Sci::Position lineEnd = pdoc->LineStart(static_cast(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(wParam);
-- int nEnd = static_cast(lParam);
-+ Sci::Position nStart = static_cast(wParam);
-+ Sci::Position nEnd = static_cast(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(wParam) > pdoc->LinesTotal())
-+ if (static_cast(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(wParam));
-+ return ReplaceTarget(false, CharPtrFromSPtr(lParam), static_cast(wParam));
-
- case SCI_REPLACETARGETRE:
- PLATFORM_ASSERT(lParam);
-- return ReplaceTarget(true, CharPtrFromSPtr(lParam), static_cast(wParam));
-+ return ReplaceTarget(true, CharPtrFromSPtr(lParam), static_cast(wParam));
-
- case SCI_SEARCHINTARGET:
- PLATFORM_ASSERT(lParam);
-- return SearchInTarget(CharPtrFromSPtr(lParam), static_cast(wParam));
-+ return SearchInTarget(CharPtrFromSPtr(lParam), static_cast(wParam));
-
- case SCI_SETSEARCHFLAGS:
- searchFlags = static_cast(wParam);
-@@ -6016,8 +6017,8 @@
- return Platform::Clamp(pdoc->GetRelativePosition(static_cast(wParam), static_cast(lParam)), 0, pdoc->Length());
-
- case SCI_LINESCROLL:
-- ScrollTo(topLine + static_cast(lParam));
-- HorizontalScrollTo(xOffset + static_cast(wParam)* static_cast(vs.spaceWidth));
-+ ScrollTo(topLine + static_cast(lParam));
-+ HorizontalScrollTo(xOffset + static_cast(wParam) * static_cast(vs.spaceWidth));
- return 1;
-
- case SCI_SETXOFFSET:
-@@ -6072,7 +6073,7 @@
- if (lParam == 0)
- return 0;
- Sci_TextRange *tr = reinterpret_cast(lParam);
-- int cpMax = static_cast(tr->chrg.cpMax);
-+ Sci::Position cpMax = static_cast(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(wParam));
-+ const Sci::Position lengthInserted = pdoc->InsertString(
-+ CurrentPosition(), CharPtrFromSPtr(lParam), static_cast(wParam));
- SetEmptySelection(sel.MainCaret() + lengthInserted);
- return 0;
- }
-
- case SCI_ADDSTYLEDTEXT:
- if (lParam)
-- AddStyledText(CharPtrFromSPtr(lParam), static_cast(wParam));
-+ AddStyledText(CharPtrFromSPtr(lParam), static_cast(wParam));
- return 0;
-
- case SCI_INSERTTEXT: {
- if (lParam == 0)
- return 0;
-- int insertPos = static_cast(wParam);
-+ Sci::Position insertPos = static_cast(wParam);
- if (static_cast(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(wParam));
-+ pdoc->Allocate(static_cast(wParam));
- break;
-
- case SCI_GETCHARAT:
-- return pdoc->CharAt(static_cast(wParam));
-+ return pdoc->CharAt(static_cast(wParam));
-
- case SCI_SETCURRENTPOS:
- if (sel.IsRectangular()) {
-@@ -6233,7 +6234,7 @@
- SetRectangularRange();
- Redraw();
- } else {
-- SetSelection(static_cast(wParam), sel.MainAnchor());
-+ SetSelection(static_cast(wParam), sel.MainAnchor());
- }
- break;
-
-@@ -6242,11 +6243,11 @@
-
- case SCI_SETANCHOR:
- if (sel.IsRectangular()) {
-- sel.Rectangular().anchor.SetPosition(static_cast