aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2011-01-31 09:45:58 +1100
committernyamatongwe <unknown>2011-01-31 09:45:58 +1100
commit2a416ea050312210207908161150335326fb94bd (patch)
treecb104697c782e3be1e89927bb6685506e9b55747 /src
parent201f983949deb606ea73180328d3399b582ccd1e (diff)
downloadscintilla-mirror-2a416ea050312210207908161150335326fb94bd.tar.gz
Comments.
Diffstat (limited to 'src')
-rw-r--r--src/Partitioning.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Partitioning.h b/src/Partitioning.h
index 17925b926..07f3c5d7b 100644
--- a/src/Partitioning.h
+++ b/src/Partitioning.h
@@ -42,6 +42,10 @@ public:
/// Divide an interval into multiple partitions.
/// Useful for breaking a document down into sections such as lines.
+/// A 0 length interval has a single 0 length partition, numbered 0
+/// If interval not 0 length then each partition non-zero length
+/// When needed, positions after the interval are considered part of the last partition
+/// but the end of the last partition can be found with PositionFromPartition(last+1).
class Partitioning {
private:
@@ -153,6 +157,7 @@ public:
return pos;
}
+ /// Return value in range [0 .. Partitions() - 1] even for arguments outside interval
int PartitionFromPosition(int pos) const {
if (body->Length() <= 1)
return 0;