From 767e31bb1fb118e8a58da4fd9f1fa133e066caa1 Mon Sep 17 00:00:00 2001 From: Mitchell Foral Date: Mon, 20 Nov 2017 12:24:51 +1100 Subject: Backport: Add SCI_GETMOVEEXTENDSSELECTION. Backport of changeset 6418:85205da6ec1b. --- doc/ScintillaDoc.html | 5 +++++ doc/ScintillaHistory.html | 4 ++++ include/Scintilla.h | 1 + include/Scintilla.iface | 3 +++ src/Editor.cxx | 2 ++ 5 files changed, 15 insertions(+) diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 42242c606..df08b19da 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -1220,6 +1220,7 @@ struct Sci_TextToFind { SCI_SELECTIONISRECTANGLE → bool
SCI_SETSELECTIONMODE(int selectionMode)
SCI_GETSELECTIONMODE → int
+ SCI_GETMOVEEXTENDSSELECTION → bool
SCI_GETLINESELSTARTPOSITION(int line) → position
SCI_GETLINESELENDPOSITION(int line) → position
SCI_MOVECARETINSIDEVIEW
@@ -1423,6 +1424,10 @@ struct Sci_TextToFind { SC_SEL_THIN is the mode after a rectangular selection has been typed into and ensures that no characters are selected.

+

SCI_GETMOVEEXTENDSSELECTION → bool
+ This returns 1 if regular caret moves will extend or reduce the selection, 0 if not. + SCI_SETSELECTIONMODE toggles this setting between on and off.

+

SCI_GETLINESELSTARTPOSITION(int line) → position
SCI_GETLINESELENDPOSITION(int line) → position
Retrieve the position of the start and end of the selection at the given line with diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 88c0c8cbb..7de16f4df 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -565,6 +565,10 @@ The Scintilla namespace is always active for internal symbols and for the lexer and document interfaces.

  • + Add SCI_GETMOVEEXTENDSSELECTION to allow applications to add more + complex selection commands. +
  • +
  • Fix HTML lexer handling of Django so that nesting a {{ }} or {% %} Django tag inside of a {# #} Django comment does not break highlighting of rest of file
  • diff --git a/include/Scintilla.h b/include/Scintilla.h index be858af7c..6039f30d8 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -760,6 +760,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_SEL_THIN 3 #define SCI_SETSELECTIONMODE 2422 #define SCI_GETSELECTIONMODE 2423 +#define SCI_GETMOVEEXTENDSSELECTION 2706 #define SCI_GETLINESELSTARTPOSITION 2424 #define SCI_GETLINESELENDPOSITION 2425 #define SCI_LINEDOWNRECTEXTEND 2426 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 6a23999d7..0af6c211a 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -1971,6 +1971,9 @@ set void SetSelectionMode=2422(int selectionMode,) # Get the mode of the current selection. get int GetSelectionMode=2423(,) +# Get whether or not regular caret moves will extend or reduce the selection. +get bool GetMoveExtendsSelection=2706(,) + # Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). fun position GetLineSelStartPosition=2424(int line,) diff --git a/src/Editor.cxx b/src/Editor.cxx index 80b1d7ad3..8125d322b 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -7623,6 +7623,8 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { default: // ?! return SC_SEL_STREAM; } + case SCI_GETMOVEEXTENDSSELECTION: + return sel.MoveExtends(); case SCI_GETLINESELSTARTPOSITION: case SCI_GETLINESELENDPOSITION: { SelectionSegment segmentLine( -- cgit v1.2.3