Skip to content

Commit

Permalink
Sync Scintilla section changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Dec 10, 2023
1 parent 3c0ff96 commit 7ea3149
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 61 deletions.
12 changes: 12 additions & 0 deletions scintilla/call/ScintillaCall.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2286,10 +2286,18 @@ void ScintillaCall::SetSelectionMode(Scintilla::SelectionMode selectionMode) {
Call(Message::SetSelectionMode, static_cast<uintptr_t>(selectionMode));
}

void ScintillaCall::ChangeSelectionMode(Scintilla::SelectionMode selectionMode) {
Call(Message::ChangeSelectionMode, static_cast<uintptr_t>(selectionMode));
}

SelectionMode ScintillaCall::SelectionMode() {
return static_cast<Scintilla::SelectionMode>(Call(Message::GetSelectionMode));
}

void ScintillaCall::SetMoveExtendsSelection(bool moveExtendsSelection) {
Call(Message::SetMoveExtendsSelection, moveExtendsSelection);
}

bool ScintillaCall::MoveExtendsSelection() {
return Call(Message::GetMoveExtendsSelection);
}
Expand Down Expand Up @@ -2786,6 +2794,10 @@ void ScintillaCall::AddSelection(Position caret, Position anchor) {
Call(Message::AddSelection, caret, anchor);
}

int ScintillaCall::SelectionFromPoint(int x, int y) {
return static_cast<int>(Call(Message::SelectionFromPoint, x, y));
}

void ScintillaCall::DropSelectionN(int selection) {
Call(Message::DropSelectionN, selection);
}
Expand Down
5 changes: 4 additions & 1 deletion scintilla/include/Scintilla.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
#define SCI_AUTOCGETOPTIONS 2639
#define SCI_AUTOCSETDROPRESTOFWORD 2270
#define SCI_AUTOCGETDROPRESTOFWORD 2271
#define SCI_SETAUTOINSERTMASK 2474
#define SCI_SETAUTOINSERTMASK 2109
#define SCI_REGISTERIMAGE 2405
#define SCI_CLEARREGISTEREDIMAGES 2408
#define SCI_AUTOCGETTYPESEPARATOR 2285
Expand Down Expand Up @@ -869,7 +869,9 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
#define SC_SEL_LINES 2
#define SC_SEL_THIN 3
#define SCI_SETSELECTIONMODE 2422
#define SCI_CHANGESELECTIONMODE 2659
#define SCI_GETSELECTIONMODE 2423
#define SCI_SETMOVEEXTENDSSELECTION 2719
#define SCI_GETMOVEEXTENDSSELECTION 2706
#define SCI_GETLINESELSTARTPOSITION 2424
#define SCI_GETLINESELENDPOSITION 2425
Expand Down Expand Up @@ -1011,6 +1013,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
#define SCI_CLEARSELECTIONS 2571
#define SCI_SETSELECTION 2572
#define SCI_ADDSELECTION 2573
#define SCI_SELECTIONFROMPOINT 2474
#define SCI_DROPSELECTIONN 2671
#define SCI_SETMAINSELECTION 2574
#define SCI_GETMAINSELECTION 2575
Expand Down
12 changes: 11 additions & 1 deletion scintilla/include/Scintilla.iface
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ set void AutoCSetDropRestOfWord=2270(bool dropRestOfWord,)
get bool AutoCGetDropRestOfWord=2271(,)

# Set auto insert mask
set void SetAutoInsertMask=2474(int mask,)
set void SetAutoInsertMask=2109(int mask,)

# Register an XPM image for use in autocompletion lists.
fun void RegisterImage=2405(int type, string xpmData)
Expand Down Expand Up @@ -2426,9 +2426,16 @@ val SC_SEL_THIN=3
# by lines (SC_SEL_LINES).
set void SetSelectionMode=2422(SelectionMode selectionMode,)

# Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or
# by lines (SC_SEL_LINES) without changing MoveExtendsSelection.
fun void ChangeSelectionMode=2659(SelectionMode selectionMode,)

# Get the mode of the current selection.
get SelectionMode GetSelectionMode=2423(,)

# Set whether or not regular caret moves will extend or reduce the selection.
set void SetMoveExtendsSelection=2719(bool moveExtendsSelection,)

# Get whether or not regular caret moves will extend or reduce the selection.
get bool GetMoveExtendsSelection=2706(,)

Expand Down Expand Up @@ -2857,6 +2864,9 @@ fun void SetSelection=2572(position caret, position anchor)
# Add a selection
fun void AddSelection=2573(position caret, position anchor)

# Find the selection index for a point. -1 when not at a selection.
fun int SelectionFromPoint=2474(int x, int y)

# Drop one selection
fun void DropSelectionN=2671(int selection,)

Expand Down
3 changes: 3 additions & 0 deletions scintilla/include/ScintillaCall.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ class ScintillaCall {
void CopyRange(Position start, Position end);
void CopyText(Position length, const char *text);
void SetSelectionMode(Scintilla::SelectionMode selectionMode);
void ChangeSelectionMode(Scintilla::SelectionMode selectionMode);
Scintilla::SelectionMode SelectionMode();
void SetMoveExtendsSelection(bool moveExtendsSelection);
bool MoveExtendsSelection();
Position GetLineSelStartPosition(Line line);
Position GetLineSelEndPosition(Line line);
Expand Down Expand Up @@ -741,6 +743,7 @@ class ScintillaCall {
void ClearSelections();
void SetSelection(Position caret, Position anchor);
void AddSelection(Position caret, Position anchor);
int SelectionFromPoint(int x, int y);
void DropSelectionN(int selection);
void SetMainSelection(int selection);
int MainSelection();
Expand Down
5 changes: 4 additions & 1 deletion scintilla/include/ScintillaMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ enum class Message {
AutoCGetOptions = 2639,
AutoCSetDropRestOfWord = 2270,
AutoCGetDropRestOfWord = 2271,
SetAutoInsertMask = 2474,
SetAutoInsertMask = 2109,
RegisterImage = 2405,
ClearRegisteredImages = 2408,
AutoCGetTypeSeparator = 2285,
Expand Down Expand Up @@ -539,7 +539,9 @@ enum class Message {
CopyRange = 2419,
CopyText = 2420,
SetSelectionMode = 2422,
ChangeSelectionMode = 2659,
GetSelectionMode = 2423,
SetMoveExtendsSelection = 2719,
GetMoveExtendsSelection = 2706,
GetLineSelStartPosition = 2424,
GetLineSelEndPosition = 2425,
Expand Down Expand Up @@ -655,6 +657,7 @@ enum class Message {
ClearSelections = 2571,
SetSelection = 2572,
AddSelection = 2573,
SelectionFromPoint = 2474,
DropSelectionN = 2671,
SetMainSelection = 2574,
GetMainSelection = 2575,
Expand Down
4 changes: 4 additions & 0 deletions scintilla/src/CellBuffer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <cstring>
#include <cstdio>
#include <cstdarg>
#include <climits>

#include <stdexcept>
#include <string>
Expand Down Expand Up @@ -758,6 +759,9 @@ const char *CellBuffer::DeleteChars(Sci::Position position, Sci::Position delete
}

void CellBuffer::Allocate(Sci::Position newSize) {
//if (!largeDocument && (newSize > INT32_MAX)) {
// throw std::runtime_error("CellBuffer::Allocate: size of standard document limited to 2G.");
//}
substance.ReAllocate(newSize);
if (hasStyles) {
style.ReAllocate(newSize);
Expand Down
Loading

0 comments on commit 7ea3149

Please sign in to comment.