From 4586f5aa1d78451bade67e6443e910fc5492feaa Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 9 Apr 2013 13:52:53 +1000 Subject: Automate updating download links in script. --- src/LexGen.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') diff --git a/src/LexGen.py b/src/LexGen.py index d03c4a24a..233aeeb33 100755 --- a/src/LexGen.py +++ b/src/LexGen.py @@ -261,6 +261,23 @@ def UpdateLineInFile(path, linePrefix, lineReplace): contents = NATIVE.join(lines) + NATIVE UpdateFile(path, contents) +host = "prdownloads.sourceforge.net/" +def UpdateDownloadLinks(path, version): + lines = [] + with open(path, "r") as f: + for l in f.readlines(): + l = l.rstrip() + if host in l: + start, prd, rest = l.partition(host) + pth, dot, ending = rest.partition(".") + pthNew = pth[:-3] + version.rstrip() + lineWithNewVersion = start + prd +pthNew + dot + ending + lines.append(lineWithNewVersion) + else: + lines.append(l) + contents = NATIVE.join(lines) + NATIVE + UpdateFile(path, contents) + def UpdateVersionNumbers(root): with open(root + "scintilla/version.txt") as f: version = f.read() @@ -279,6 +296,7 @@ def UpdateVersionNumbers(root): "VERSION = " + versionDotted) UpdateLineInFile(root + "scintilla/doc/ScintillaDownload.html", " Release", " Release " + versionDotted) + UpdateDownloadLinks(root + "scintilla/doc/ScintillaDownload.html", version) UpdateLineInFile(root + "scintilla/doc/index.html", ' Release version', ' Release version ' + versionDotted + '
') @@ -290,6 +308,7 @@ def UpdateVersionNumbers(root): "#define VERSION_WORDS " + versionCommad) UpdateLineInFile(root + "scite/doc/SciTEDownload.html", " Release", " Release " + versionDotted) + UpdateDownloadLinks(root + "scite/doc/SciTEDownload.html", version) UpdateLineInFile(root + "scite/doc/SciTE.html", ' Release version', ' Release version ' + versionDotted + '
') -- cgit v1.2.3 From 9e2240700ad781f374a857fd05da3908307aa0cb Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 9 Apr 2013 14:24:51 +1000 Subject: Slightly better behaviour for regular expression search in DBCS: ensure end of match range is not in the middle of a character. --- src/Document.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/Document.cxx b/src/Document.cxx index b75c754ac..56785af78 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2236,6 +2236,8 @@ long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s int success = search.Execute(di, startOfLine, endOfLine); if (success) { pos = search.bopat[0]; + // Ensure only whole characters selected + search.eopat[0] = doc->MovePositionOutsideChar(search.eopat[0], 1, false); lenRet = search.eopat[0] - search.bopat[0]; // There can be only one start of a line, so no need to look for last match in line if ((increment == -1) && (s[0] != '^')) { -- cgit v1.2.3