aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/position.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-05-25 04:02:21 +0000
committerBlaž Hrastnik2020-05-25 04:02:21 +0000
commit44ff4d3c1f5da05e57ce99ba9d67b80a334def83 (patch)
tree232b8eebab7f709eaf84b8649791a6c74448bfdb /helix-core/src/position.rs
parent240e5f4e3d27415b792776dd126d15302d53e83b (diff)
Implement a new core based on CodeMirror.
Diffstat (limited to 'helix-core/src/position.rs')
-rw-r--r--helix-core/src/position.rs27
1 files changed, 0 insertions, 27 deletions
diff --git a/helix-core/src/position.rs b/helix-core/src/position.rs
deleted file mode 100644
index 8c82b83b..00000000
--- a/helix-core/src/position.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-/// Represents a single point in a text buffer. Zero indexed.
-#[derive(Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
-pub struct Position {
- pub row: usize,
- pub col: usize,
-}
-
-impl Position {
- pub fn new(row: usize, col: usize) -> Self {
- Self { row, col }
- }
-
- pub fn is_zero(self) -> bool {
- self.row == 0 && self.col == 0
- }
-}
-
-#[cfg(test)]
-mod test {
- use super::*;
-
- #[test]
- fn test_ordering() {
- // (0, 5) is less than (1, 0 w v f)
- assert!(Position::new(0, 5) < Position::new(1, 0));
- }
-}