aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-10-07 05:06:25 +0000
committerGitHub2020-10-07 05:06:25 +0000
commit6848702b1f09dc1a4e8d2e3067d3b45b3421d403 (patch)
tree18cc823d2a5dfd0b09b5802f6eb11c978080df36 /helix-core
parentb7e1c0cf8253703a5eeb8453de23c8d0a6137ef1 (diff)
parent7f07e6676801be72e5a58b5612893c7d16f94a64 (diff)
Merge pull request #3 from helix-editor/goto-implementation
Goto mode implementation
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/state.rs4
-rw-r--r--helix-core/src/syntax.rs2
2 files changed, 2 insertions, 4 deletions
diff --git a/helix-core/src/state.rs b/helix-core/src/state.rs
index 36ca221c..047ff83d 100644
--- a/helix-core/src/state.rs
+++ b/helix-core/src/state.rs
@@ -9,6 +9,7 @@ use std::path::PathBuf;
pub enum Mode {
Normal,
Insert,
+ Goto,
}
/// A state represents the current editor state of a single buffer.
@@ -287,9 +288,6 @@ impl State {
}
}
-/// Coordinates are a 0-indexed line and column pair.
-pub type Coords = (usize, usize); // line, col
-
/// Convert a character index to (line, column) coordinates.
pub fn coords_at_pos(text: &RopeSlice, pos: usize) -> Position {
let line = text.char_to_line(pos);
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 638ec8ee..3e5927e5 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -312,7 +312,7 @@ pub struct LanguageLayer {
tree: Option<Tree>,
}
-use crate::state::{coords_at_pos, Coords};
+use crate::state::coords_at_pos;
use crate::transaction::{ChangeSet, Operation};
use crate::Tendril;