mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+ upd: Scintilla current GitHub mirror dev
This commit is contained in:
parent
9eb1f4bb8b
commit
a901a905bd
@ -273,12 +273,11 @@
|
||||
<td>○ <a class="toc" href="#ByCharacterOrCodeUnit">By character or UTF-16 code unit</a></td>
|
||||
|
||||
<td>○ <a class="toc" href="#MultipleSelectionAndVirtualSpace">Multiple Selection and Virtual Space</a></td>
|
||||
scrolling</a></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>○ <a class="toc" href="#ScrollingAndAutomaticScrolling">Scrolling and automatic
|
||||
<td>○ <a class="toc" href="#ScrollingAndAutomaticScrolling">Scrolling and automatic scrolling</a></td>
|
||||
|
||||
<td>○ <a class="toc" href="#WhiteSpace">White space</a></td>
|
||||
|
||||
|
||||
@ -567,6 +567,10 @@
|
||||
Lexer added for X12.
|
||||
<a href="https://sourceforge.net/p/scintilla/feature-requests/1280/">Feature #1280</a>.
|
||||
</li>
|
||||
<li>
|
||||
VB lexer adds support for VB2017 binary literal &B and digit separators 123_456.
|
||||
<a href="https://sourceforge.net/p/scintilla/feature-requests/1288/">Feature #1288</a>.
|
||||
</li>
|
||||
<li>
|
||||
Improved performance of line folding code on large files when no folds are contracted.
|
||||
This improves the time taken to open or close large files.
|
||||
|
||||
@ -53,7 +53,7 @@ static inline bool IsANumberChar(int ch) {
|
||||
// but probably enough in most cases.
|
||||
return (ch < 0x80) &&
|
||||
(isdigit(ch) || toupper(ch) == 'E' ||
|
||||
ch == '.' || ch == '-' || ch == '+');
|
||||
ch == '.' || ch == '-' || ch == '+' || ch == '_');
|
||||
}
|
||||
|
||||
static void ColouriseVBDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
|
||||
@ -199,6 +199,10 @@ static void ColouriseVBDoc(Sci_PositionU startPos, Sci_Position length, int init
|
||||
// Octal number
|
||||
sc.SetState(SCE_B_NUMBER);
|
||||
sc.Forward();
|
||||
} else if (sc.ch == '&' && tolower(sc.chNext) == 'b') {
|
||||
// Binary number
|
||||
sc.SetState(SCE_B_NUMBER);
|
||||
sc.Forward();
|
||||
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||
sc.SetState(SCE_B_NUMBER);
|
||||
} else if (IsAWordStart(sc.ch) || (sc.ch == '[')) {
|
||||
|
||||
@ -5899,15 +5899,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
pdoc->LineStart(static_cast<Sci::Line>(wParam));
|
||||
const Sci::Position lineEnd =
|
||||
pdoc->LineStart(static_cast<Sci::Line>(wParam + 1));
|
||||
// not NUL terminated
|
||||
const Sci::Position len = lineEnd - lineStart;
|
||||
if (lParam == 0) {
|
||||
return lineEnd - lineStart;
|
||||
return len;
|
||||
}
|
||||
char *ptr = CharPtrFromSPtr(lParam);
|
||||
Sci::Position iPlace = 0;
|
||||
for (Sci::Position iChar = lineStart; iChar < lineEnd; iChar++) {
|
||||
ptr[iPlace++] = pdoc->CharAt(iChar);
|
||||
}
|
||||
return iPlace;
|
||||
pdoc->GetCharRange(ptr, lineStart, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
case SCI_GETLINECOUNT:
|
||||
@ -5941,10 +5940,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
return selectedText.LengthWithTerminator();
|
||||
} else {
|
||||
char *ptr = CharPtrFromSPtr(lParam);
|
||||
size_t iChar = 0;
|
||||
if (selectedText.Length()) {
|
||||
for (; iChar < selectedText.LengthWithTerminator(); iChar++)
|
||||
ptr[iChar] = selectedText.Data()[iChar];
|
||||
size_t iChar = selectedText.Length();
|
||||
if (iChar) {
|
||||
memcpy(ptr, selectedText.Data(), iChar);
|
||||
ptr[iChar++] = '\0';
|
||||
} else {
|
||||
ptr[0] = '\0';
|
||||
}
|
||||
@ -6375,8 +6374,8 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
if (lParam == 0)
|
||||
return 0;
|
||||
Sci_TextRange *tr = static_cast<Sci_TextRange *>(PtrFromSPtr(lParam));
|
||||
int iPlace = 0;
|
||||
for (long iChar = tr->chrg.cpMin; iChar < tr->chrg.cpMax; iChar++) {
|
||||
Sci::Position iPlace = 0;
|
||||
for (Sci::Position iChar = tr->chrg.cpMin; iChar < tr->chrg.cpMax; iChar++) {
|
||||
tr->lpstrText[iPlace++] = pdoc->CharAt(iChar);
|
||||
tr->lpstrText[iPlace++] = pdoc->StyleAt(iChar);
|
||||
}
|
||||
@ -6453,11 +6452,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
}
|
||||
PLATFORM_ASSERT(wParam > 0);
|
||||
char *ptr = CharPtrFromSPtr(lParam);
|
||||
unsigned int iPlace = 0;
|
||||
for (Sci::Position iChar = lineStart; iChar < lineEnd && iPlace < wParam - 1; iChar++) {
|
||||
ptr[iPlace++] = pdoc->CharAt(iChar);
|
||||
}
|
||||
ptr[iPlace] = '\0';
|
||||
const Sci::Position len = std::min<uptr_t>(lineEnd - lineStart, wParam - 1);
|
||||
pdoc->GetCharRange(ptr, lineStart, len);
|
||||
ptr[len] = '\0';
|
||||
return sel.MainCaret() - lineStart;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user