aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Selection.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-07-06 01:15:56 +0000
committernyamatongwe <unknown>2009-07-06 01:15:56 +0000
commite77dc4242312ae3f0832020e2c8ce13e3fe9ca8e (patch)
tree12d2094c439cb0b1ed83f860c7987296796dbe90 /src/Selection.cxx
parentf53369ae920abe49f59c1aa5b0a878cf444d39e1 (diff)
downloadscintilla-mirror-e77dc4242312ae3f0832020e2c8ce13e3fe9ca8e.tar.gz
Allow drag and drop in virtual space.
Diffstat (limited to 'src/Selection.cxx')
-rw-r--r--src/Selection.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Selection.cxx b/src/Selection.cxx
index 224fafc69..715319602 100644
--- a/src/Selection.cxx
+++ b/src/Selection.cxx
@@ -70,6 +70,26 @@ int SelectionRange::Length() const {
}
}
+#ifdef NEEDED
+// Like Length but takes virtual space into account
+int SelectionRange::Width() const {
+ SelectionPosition first;
+ SelectionPosition last;
+ if (anchor > caret) {
+ first = caret;
+ last = anchor;
+ } else {
+ first = anchor;
+ last = caret;
+ }
+ if (first.Position() == last.Position()) {
+ return last.VirtualSpace() - first.VirtualSpace();
+ } else {
+ return last.Position() - first.Position() + last.VirtualSpace();
+ }
+}
+#endif
+
bool SelectionRange::Contains(int pos) const {
if (anchor > caret)
return (pos >= caret.Position()) && (pos <= anchor.Position());