aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-06-14 14:30:17 +1000
committernyamatongwe <devnull@localhost>2011-06-14 14:30:17 +1000
commit0a344acd1fcde52c19ef729e2d352b4faf6230e3 (patch)
treedb881ed37e63dd115abd70293872684b7d4f64f8
parente97276184dc260742cf34229395753caf12c43bb (diff)
downloadscintilla-mirror-0a344acd1fcde52c19ef729e2d352b4faf6230e3.tar.gz
Add SCI_SETEMPTYSELECTION. Feature #3314877.
From Marko Njezic.
-rw-r--r--doc/ScintillaDoc.html6
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface3
-rw-r--r--src/Editor.cxx4
4 files changed, 13 insertions, 1 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 8446cf895..1e541bbb8 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -79,7 +79,7 @@
<h1>Scintilla Documentation</h1>
- <p>Last edited 13/June/2011 NH</p>
+ <p>Last edited 13/June/2011 MNJ</p>
<p>There is <a class="jump" href="Design.html">an overview of the internal design of
Scintilla</a>.<br />
@@ -1077,6 +1077,7 @@ struct Sci_TextToFind {
<a class="message" href="#SCI_GETSELECTIONSTART">SCI_GETSELECTIONSTART</a><br />
<a class="message" href="#SCI_SETSELECTIONEND">SCI_SETSELECTIONEND(int position)</a><br />
<a class="message" href="#SCI_GETSELECTIONEND">SCI_GETSELECTIONEND</a><br />
+ <a class="message" href="#SCI_SETEMPTYSELECTION">SCI_SETEMPTYSELECTION(int pos)</a><br />
<a class="message" href="#SCI_SELECTALL">SCI_SELECTALL</a><br />
<a class="message" href="#SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION(int position)</a><br />
<a class="message" href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(int line)</a><br />
@@ -1229,6 +1230,9 @@ struct Sci_TextToFind {
current position or the anchor position. <code>SCI_GETSELECTIONEND</code> returns the larger of
the two values.</p>
+ <p><b id="SCI_SETEMPTYSELECTION">SCI_SETEMPTYSELECTION(int pos)</b><br />
+ This removes any selection and sets the caret at <code>pos</code>. The caret is not scrolled into view.</p>
+
<p><b id="SCI_SELECTALL">SCI_SELECTALL</b><br />
This selects all the text in the document. The current position is not scrolled into view.</p>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index d1f3c9dd2..6c0c7342d 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -333,6 +333,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_GETSELECTIONSTART 2143
#define SCI_SETSELECTIONEND 2144
#define SCI_GETSELECTIONEND 2145
+#define SCI_SETEMPTYSELECTION 2556
#define SCI_SETPRINTMAGNIFICATION 2146
#define SCI_GETPRINTMAGNIFICATION 2147
#define SC_PRINT_NORMAL 0
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 6bfac5d98..f21ee3e42 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -800,6 +800,9 @@ set void SetSelectionEnd=2144(position pos,)
# Returns the position at the end of the selection.
get position GetSelectionEnd=2145(,)
+# Set caret to a position, while removing any existing selection.
+fun void SetEmptySelection=2556(position pos,)
+
# Sets the print magnification added to the point size of each style for printing.
set void SetPrintMagnification=2146(int magnification,)
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 3f6e533b6..14d2b2673 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -7482,6 +7482,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_GETSELECTIONEND:
return sel.LimitsForRectangularElseMain().end.Position();
+ case SCI_SETEMPTYSELECTION:
+ SetEmptySelection(wParam);
+ break;
+
case SCI_SETPRINTMAGNIFICATION:
printMagnification = wParam;
break;