+upd: Scintilla v5.3.5

This commit is contained in:
METANEOCORTEX\Kotti 2023-06-19 12:51:42 +02:00
parent 1c5f9f8080
commit 60f6f13d64
10 changed files with 201 additions and 24 deletions

View File

@ -4879,7 +4879,74 @@ struct Sci_TextToFindFull {
A windowed IME <code>SC_IME_WINDOWED</code> (0) may be more similar in appearance and
behaviour to the IME in other applications.
An inline IME <code>SC_IME_INLINE</code> (1) may work better with some Scintilla features such as
rectangular and multiple selection.</p>
rectangular and multiple selection, with IME interactions such as retrieve-surrounding or reconversion feature.</p>
<table class="standard" summary="IME input method">
<caption>IME input method support (O=present, X=absent)</caption>
<thead align="left">
<tr>
<th>IME input method</th>
<th>Windows</th>
<th>Gtk</th>
<th>Qt</th>
<th>macOS</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<th align="left"><code>SC_IME_WINDOWED</code></th>
<td>O</td>
<td>O</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<th align="left"><code>SC_IME_INLINE</code></th>
<td>O</td>
<td>O</td>
<td>O</td>
<td>O</td>
</tr>
</tbody>
</table>
<p></p>
<table class="standard" summary="IME interaction">
<caption>IME interaction support</caption>
<thead align="left">
<tr>
<th>IME interaction</th>
<th>Windows</th>
<th>Gtk</th>
<th>Qt</th>
<th>macOS</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<th align="left">Retrieve Surrounding</th>
<td>O</td>
<td>O</td>
<td>O</td>
<td>O</td>
</tr>
<tr>
<th align="left">Reconversion</th>
<td>O</td>
<td>O</td>
<td>O</td>
<td>O</td>
</tr>
<tr>
<th align="left">Delete Surrounding</th>
<td>O</td>
<td>O</td>
<td>X</td>
<td>O</td>
</tr>
</tbody>
</table>
<p>The windowed behaviour can be chosen with <code>SCI_SETIMEINTERACTION(SC_IME_WINDOWED)</code>
and the inline behaviour with <code>SCI_SETIMEINTERACTION(SC_IME_INLINE)</code>.
Scintilla may ignore this call in some cases. For example, the inline behaviour might only be supported for some languages.</p>

View File

@ -26,9 +26,9 @@
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr>
<td>
<font size="4"> <a href="https://www.scintilla.org/scintilla534.zip">
<font size="4"> <a href="https://www.scintilla.org/scintilla535.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/scintilla534.tgz">
<a href="https://www.scintilla.org/scintilla535.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
@ -42,7 +42,7 @@
containing very few restrictions.
</p>
<h3>
Release 5.3.4
Release 5.3.5
</h3>
<h4>
Source Code
@ -50,8 +50,8 @@
The source code package contains all of the source code for Scintilla but no binary
executable code and is available in
<ul>
<li><a href="https://www.scintilla.org/scintilla534.zip">zip format</a> (1.4M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla534.tgz">tgz format</a> (1.3M) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/scintilla535.zip">zip format</a> (1.4M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla535.tgz">tgz format</a> (1.3M) commonly used on Linux and compatible operating systems</li>
</ul>
Instructions for building on both Windows and Linux are included in the readme file.
<h4>

View File

@ -576,21 +576,61 @@
<td>Ferdinand Oeinck</td>
<td>Michael Heath</td>
<td>Enrico Tröger</td>
</tr><tr>
<td>Chengzhi Li</td>
</tr>
</table>
<h2>Releases</h2>
<h3>
<a href="https://www.scintilla.org/scintilla536.zip">Release 5.3.6</a>
</h3>
<ul>
<li>
Released 31 May 2023.
</li>
<li>
Redraw calltip after showing as didn't update when size of new text exactly same as
previous.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1486/">Feature #1486</a>.
</li>
<li>
On Win32 hide cursor when typing if that system preference has been chosen.
<a href="https://sourceforge.net/p/scintilla/bugs/2333/">Bug #2333</a>.
</li>
<li>
On Qt, for IMEs, update micro focus when selection changes.
This may move the location of IME popups to align with the caret.
</li>
<li>
On Qt, implement replacement for IMEs which may help with actions like reconversion.
This is similar to delete-surrounding on GTK.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/scintilla535.zip">Release 5.3.5</a>
</h3>
<ul>
<li>
Released 8 March 2023.
Released 31 May 2023.
</li>
<li>
On Win32, implement IME context sensitivity with IMR_DOCUMENTFEED.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1310/">Feature #1310</a>.
</li>
<li>
On Win32 remove dependence on MSIMG32.DLL by replacing AlphaBlend
by GdiAlphaBlend.
<a href="https://sourceforge.net/p/scintilla/bugs/1923/">Bug #1923</a>.
</li>
<li>
On Qt, stop movement of IME candidate box.
</li>
<li>
On Qt, report correct caret position within paragraph for IME retrieve surrounding text.
</li>
<li>
On Qt for Cocoa, fix crash in entry of multi-character strings with IME.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/scintilla534.zip">Release 5.3.4</a>

View File

@ -9,7 +9,7 @@
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
<meta name="Description"
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
<meta name="Date.Modified" content="20230308" />
<meta name="Date.Modified" content="20230531" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
.logo {
@ -60,8 +60,8 @@
GTK, and macOS</font>
</td>
<td width="40%" align="right">
<font color="#FFCC99" size="3"> Release version 5.3.4<br />
Site last modified March 8 2023</font>
<font color="#FFCC99" size="3"> Release version 5.3.5<br />
Site last modified May 31 2023</font>
</td>
<td width="20%">
&nbsp;
@ -76,12 +76,12 @@
</tr>
</table>
<ul id="versionlist">
<li>Version 5.3.5 improves IME support on Win32 and Qt.</li>
<li>Version 5.3.4 adds multithreaded wrapping.</li>
<li>Version 5.3.3 fixes minor bugs in APIs and platform layers.</li>
<li>Version 5.3.2 adds SCI_REPLACETARGETMINIMAL to modify text without marking unchanged start and end text in change history.</li>
<li>Version 5.3.1 can represent invisible text with a character to simplify editing and provide summarized views.</li>
<li>Version 5.3.0 adds change history.</li>
<li>Version 5.2.4 fixes failures on GTK with multi-threaded layout.</li>
</ul>
<ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>

View File

@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/kkos/oniguruma.svg?branch=master)](https://travis-ci.org/kkos/oniguruma)
[![Code Quality: Cpp](https://img.shields.io/lgtm/grade/cpp/g/kkos/oniguruma.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kkos/oniguruma/context:cpp)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/kkos/oniguruma.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kkos/oniguruma/alerts)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/oniguruma.svg)](https://oss-fuzz-build-logs.storage.googleapis.com/index.html#oniguruma)
[![TrustInSoft CI](https://ci.trust-in-soft.com/projects/kkos/oniguruma.svg?branch=master)](https://ci.trust-in-soft.com/projects/kkos/oniguruma)

View File

@ -15,11 +15,11 @@ def HeaderFromIncludeLine(s):
return s.strip()[1:].strip()[7:].strip()
def ExtractHeaders(file):
with file.open(encoding="cp437") as infile:
with file.open(encoding="iso-8859-1") as infile:
return [HeaderFromIncludeLine(h) for h in infile if IsHeader(h)]
def ExtractWithPrefix(file, prefix):
with file.open(encoding="cp437") as infile:
with file.open(encoding="iso-8859-1") as infile:
return [s.strip()[len(prefix):] for s in infile if s.startswith(prefix)]
def ExcludeName(name, excludes):

View File

@ -517,6 +517,7 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) {
CreateCallTipWindow(rc);
ct.wCallTip.SetPositionRelative(rc, &wMain);
ct.wCallTip.Show();
ct.wCallTip.InvalidateAll();
}
void ScintillaBase::CallTipClick() {

View File

@ -1 +1 @@
534
535

View File

@ -6,8 +6,8 @@
#include <windows.h>
#define VERSION_SCINTILLA "5.3.4"
#define VERSION_WORDS 5, 3, 4, 0
#define VERSION_SCINTILLA "5.3.5"
#define VERSION_WORDS 5, 3, 5, 0
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_WORDS

View File

@ -335,6 +335,8 @@ class ScintillaWin :
bool capturedMouse;
bool trackedMouseLeave;
BOOL typingWithoutCursor;
bool cursorIsHidden;
SetCoalescableTimerSig SetCoalescableTimerFn;
unsigned int linesPerScroll; ///< Intellimouse support
@ -418,6 +420,7 @@ class ScintillaWin :
void ImeStartComposition();
void ImeEndComposition();
LRESULT ImeOnReconvert(LPARAM lParam);
LRESULT ImeOnDocumentFeed(LPARAM lParam) const;
sptr_t HandleCompositionWindowed(uptr_t wParam, sptr_t lParam);
sptr_t HandleCompositionInline(uptr_t wParam, sptr_t lParam);
static bool KoreanIME() noexcept;
@ -446,6 +449,7 @@ class ScintillaWin :
void SetMouseCapture(bool on) override;
bool HaveMouseCapture() override;
void SetTrackMouseLeaveEvent(bool on) noexcept;
void HideCursorIfPreferred() noexcept;
void UpdateBaseElements() override;
bool PaintContains(PRectangle rc) const noexcept override;
void ScrollText(Sci::Line linesToMove) override;
@ -475,7 +479,7 @@ class ScintillaWin :
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
void ClaimSelection() override;
void GetIntelliMouseParameters() noexcept;
void GetMouseParameters() noexcept;
void CopyToGlobal(GlobalMemory &gmUnicode, const SelectionText &selectedText);
void CopyToClipboard(const SelectionText &selectedText) override;
void ScrollMessage(WPARAM wParam);
@ -560,6 +564,8 @@ ScintillaWin::ScintillaWin(HWND hwnd) {
capturedMouse = false;
trackedMouseLeave = false;
typingWithoutCursor = false;
cursorIsHidden = false;
SetCoalescableTimerFn = nullptr;
linesPerScroll = 0;
@ -1269,6 +1275,7 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
}
view.imeCaretBlockOverride = false;
HideCursorIfPreferred();
if (lParam & GCS_RESULTSTR) {
AddWString(imc.GetCompositionString(GCS_RESULTSTR), CharacterSource::ImeResult);
@ -1597,6 +1604,7 @@ sptr_t ScintillaWin::MouseMessage(unsigned int iMessage, uptr_t wParam, sptr_t l
break;
case WM_MOUSEMOVE: {
cursorIsHidden = false; // to be shown by ButtonMoveWithModifiers
const Point pt = PointFromLParam(lParam);
// Windows might send WM_MOUSEMOVE even though the mouse has not been moved:
@ -1733,6 +1741,7 @@ sptr_t ScintillaWin::KeyMessage(unsigned int iMessage, uptr_t wParam, sptr_t lPa
return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
case WM_CHAR:
HideCursorIfPreferred();
if (((wParam >= 128) || !iscntrl(static_cast<int>(wParam))) || !lastKeyDownConsumed) {
wchar_t wcs[3] = { static_cast<wchar_t>(wParam), 0 };
unsigned int wclen = 1;
@ -1814,6 +1823,9 @@ sptr_t ScintillaWin::IMEMessage(unsigned int iMessage, uptr_t wParam, sptr_t lPa
if (wParam == IMR_RECONVERTSTRING) {
return ImeOnReconvert(lParam);
}
if (wParam == IMR_DOCUMENTFEED) {
return ImeOnDocumentFeed(lParam);
}
return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
}
@ -2042,7 +2054,7 @@ sptr_t ScintillaWin::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) {
ctrlID = ::GetDlgCtrlID(HwndFromWindow(wMain));
UpdateBaseElements();
// Get Intellimouse scroll line parameters
GetIntelliMouseParameters();
GetMouseParameters();
::RegisterDragDrop(MainHWND(), &dt);
break;
@ -2100,10 +2112,12 @@ sptr_t ScintillaWin::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) {
case WM_SETCURSOR:
if (LOWORD(lParam) == HTCLIENT) {
POINT pt;
if (::GetCursorPos(&pt)) {
::ScreenToClient(MainHWND(), &pt);
DisplayCursor(ContextCursor(PointFromPOINT(pt)));
if (!cursorIsHidden) {
POINT pt;
if (::GetCursorPos(&pt)) {
::ScreenToClient(MainHWND(), &pt);
DisplayCursor(ContextCursor(PointFromPOINT(pt)));
}
}
return TRUE;
} else {
@ -2126,7 +2140,7 @@ sptr_t ScintillaWin::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) {
#endif
UpdateBaseElements();
// Get Intellimouse scroll line parameters
GetIntelliMouseParameters();
GetMouseParameters();
InvalidateStyleRedraw();
break;
@ -2370,6 +2384,14 @@ void ScintillaWin::SetTrackMouseLeaveEvent(bool on) noexcept {
trackedMouseLeave = on;
}
void ScintillaWin::HideCursorIfPreferred() noexcept {
// SPI_GETMOUSEVANISH from OS.
if (typingWithoutCursor && !cursorIsHidden) {
::SetCursor(NULL);
cursorIsHidden = true;
}
}
void ScintillaWin::UpdateBaseElements() {
struct ElementToIndex { Element element; int nIndex; };
const ElementToIndex eti[] = {
@ -3178,13 +3200,58 @@ LRESULT ScintillaWin::ImeOnReconvert(LPARAM lParam) {
return rcSize;
}
void ScintillaWin::GetIntelliMouseParameters() noexcept {
LRESULT ScintillaWin::ImeOnDocumentFeed(LPARAM lParam) const {
// This is called while typing preedit string in.
// So there is no selection.
// Limit feed within one line without EOL.
// Look around: lineStart |<-- |compStart| - caret - compEnd| -->| lineEnd.
const Sci::Position curPos = CurrentPosition();
const Sci::Line curLine = pdoc->SciLineFromPosition(curPos);
const Sci::Position lineStart = pdoc->LineStart(curLine);
const Sci::Position lineEnd = pdoc->LineEnd(curLine);
const std::wstring rcFeed = StringDecode(RangeText(lineStart, lineEnd), CodePageOfDocument());
const int rcFeedLen = static_cast<int>(rcFeed.length()) * sizeof(wchar_t);
const int rcSize = sizeof(RECONVERTSTRING) + rcFeedLen + sizeof(wchar_t);
RECONVERTSTRING *rc = static_cast<RECONVERTSTRING *>(PtrFromSPtr(lParam));
if (!rc)
return rcSize;
wchar_t *rcFeedStart = reinterpret_cast<wchar_t*>(rc + 1);
memcpy(rcFeedStart, &rcFeed[0], rcFeedLen);
IMContext imc(MainHWND());
if (!imc.hIMC)
return 0;
const size_t compStrLen = imc.GetCompositionString(GCS_COMPSTR).size();
const int imeCaretPos = imc.GetImeCaretPos();
const Sci::Position compStart = pdoc->GetRelativePositionUTF16(curPos, -imeCaretPos);
const Sci::Position compStrOffset = pdoc->CountUTF16(lineStart, compStart);
// Fill in reconvert structure.
// Let IME to decide what the target is.
rc->dwVersion = 0; //constant
rc->dwStrLen = static_cast<DWORD>(rcFeed.length());
rc->dwStrOffset = sizeof(RECONVERTSTRING); //constant
rc->dwCompStrLen = static_cast<DWORD>(compStrLen);
rc->dwCompStrOffset = static_cast<DWORD>(compStrOffset) * sizeof(wchar_t);
rc->dwTargetStrLen = rc->dwCompStrLen;
rc->dwTargetStrOffset = rc->dwCompStrOffset;
return rcSize; // MS API says reconv structure to be returned.
}
void ScintillaWin::GetMouseParameters() noexcept {
// This retrieves the number of lines per scroll as configured in the Mouse Properties sheet in Control Panel
::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &linesPerScroll, 0);
if (!::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &charsPerScroll, 0)) {
// no horizontal scrolling configuration on Windows XP
charsPerScroll = (linesPerScroll == WHEEL_PAGESCROLL) ? 3 : linesPerScroll;
}
::SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &typingWithoutCursor, 0);
}
void ScintillaWin::CopyToGlobal(GlobalMemory &gmUnicode, const SelectionText &selectedText) {