summaryrefslogtreecommitdiff
path: root/helix-core/src/selection.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-22 03:18:48 +0000
committerBlaž Hrastnik2021-03-22 03:22:33 +0000
commit71999cce43b3750362cdea534c12cbf320d2677b (patch)
treeee0ce3fcc192e1d85861b08442109125415b8df0 /helix-core/src/selection.rs
parenta32806b4901dfbb85fdc6c043515033afcbdb9a7 (diff)
Implement auto-pairs behavior for open and close.
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r--helix-core/src/selection.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs
index 91edcf81..2e7104cd 100644
--- a/helix-core/src/selection.rs
+++ b/helix-core/src/selection.rs
@@ -180,6 +180,10 @@ impl Selection {
&self.ranges
}
+ pub fn primary_index(&self) -> usize {
+ self.primary_index
+ }
+
#[must_use]
/// Constructs a selection holding a single range.
pub fn single(anchor: usize, head: usize) -> Self {