aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Selection.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2009-07-06 01:15:56 +0000
committernyamatongwe <devnull@localhost>2009-07-06 01:15:56 +0000
commita2aad3f4adca979ad4da66764655b94bae648574 (patch)
tree12d2094c439cb0b1ed83f860c7987296796dbe90 /src/Selection.cxx
parent4d7826e0c459803b8ee9d5947c70d9bab048fe19 (diff)
downloadscintilla-mirror-a2aad3f4adca979ad4da66764655b94bae648574.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());