diff options
author | nyamatongwe <devnull@localhost> | 2012-07-16 14:06:12 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2012-07-16 14:06:12 +1000 |
commit | 28359bf31e4f696901245bc955df74fd8bdda4bf (patch) | |
tree | 2746673017edb8885bdb9f1cd1951cc8ef61e0e6 | |
parent | b0e22b26c6466160870dc6d0c4acb634bd27b943 (diff) | |
download | scintilla-mirror-28359bf31e4f696901245bc955df74fd8bdda4bf.tar.gz |
Implement SCI_GETSELECTIONEMPTY API. Bug #3543121.
-rw-r--r-- | doc/ScintillaDoc.html | 9 | ||||
-rw-r--r-- | include/Scintilla.h | 1 | ||||
-rw-r--r-- | include/Scintilla.iface | 3 | ||||
-rw-r--r-- | src/Editor.cxx | 3 |
4 files changed, 14 insertions, 2 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 0fe4b05c7..2ab2d7f03 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -911,8 +911,8 @@ struct Sci_TextToFind { pasting from the clipboard into the document, and clearing the document. <code>SCI_CANPASTE</code> returns non-zero if the document isn't read-only and if the selection doesn't contain protected text. If you need a "can copy" or "can cut", use - <code>SCI_GETSELECTIONSTART()-SCI_GETSELECTIONEND()</code>, which will be non-zero if you can - copy or cut to the clipboard.</p> + <code>SCI_GETSELECTIONEMPTY()</code>, which will be zero if there are any non-empty + selection ranges implying that a copy or cut to the clipboard should work.</p> <p>GTK+ does not really support <code>SCI_CANPASTE</code> and always returns <code>TRUE</code> unless the document is read-only.</p> @@ -1504,6 +1504,7 @@ struct Sci_TextToFind { <br /> <a class="message" href="#SCI_GETSELECTIONS">SCI_GETSELECTIONS</a><br /> + <a class="message" href="#SCI_GETSELECTIONEMPTY">SCI_GETSELECTIONEMPTY</a><br /> <a class="message" href="#SCI_CLEARSELECTIONS">SCI_CLEARSELECTIONS</a><br /> <a class="message" href="#SCI_SETSELECTION">SCI_SETSELECTION(int caret, int anchor)</a><br /> <a class="message" href="#SCI_ADDSELECTION">SCI_ADDSELECTION(int caret, int anchor)</a><br /> @@ -1615,6 +1616,10 @@ struct Sci_TextToFind { Return the number of selections currently active.</p> <p> + <b id="SCI_GETSELECTIONEMPTY">SCI_GETSELECTIONEMPTY</b><br /> + Return 1 if every selected range is empty else 0.</p> + + <p> <b id="SCI_CLEARSELECTIONS">SCI_CLEARSELECTIONS</b><br /> Set a single empty selection at 0 as the only selection.</p> diff --git a/include/Scintilla.h b/include/Scintilla.h index 3cacd5310..52d6eed15 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -787,6 +787,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETADDITIONALCARETSVISIBLE 2608 #define SCI_GETADDITIONALCARETSVISIBLE 2609 #define SCI_GETSELECTIONS 2570 +#define SCI_GETSELECTIONEMPTY 2650 #define SCI_CLEARSELECTIONS 2571 #define SCI_SETSELECTION 2572 #define SCI_ADDSELECTION 2573 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 0456615e2..ef35fe6a4 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -2100,6 +2100,9 @@ get bool GetAdditionalCaretsVisible=2609(,) # How many selections are there? get int GetSelections=2570(,) +# Is every selected range empty? +get bool GetSelectionEmpty=2650(,) + # Clear selections to a single empty stream selection fun void ClearSelections=2571(,) diff --git a/src/Editor.cxx b/src/Editor.cxx index f3c7709a0..3fabf1ab7 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -9147,6 +9147,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_GETSELECTIONS: return sel.Count(); + case SCI_GETSELECTIONEMPTY: + return sel.Empty(); + case SCI_CLEARSELECTIONS: sel.Clear(); Redraw(); |