aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-04-07 09:05:59 +0000
committerBlaž Hrastnik2021-04-07 09:05:59 +0000
commitf0d49d3ca4535a8c22a4ca4038e889560723ec74 (patch)
treee7ce3b4eb4ab38308dfabecf44aae0f592baab01
parent12961d657f9ca78f54156457ed27732e60992734 (diff)
hack: make queries load relative to source dir for now.
We want to provide a runtime dir later on.
-rw-r--r--helix-core/src/syntax.rs6
-rw-r--r--helix-term/src/ui/editor.rs4
2 files changed, 6 insertions, 4 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 6d6fe648..e108d030 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -65,12 +65,14 @@ impl LanguageConfiguration {
.get_or_init(|| {
// let name = get_language_name(&self.language_id);
+ let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
+
let highlights_query =
- std::fs::read_to_string(self.path.join("queries/highlights.scm"))
+ std::fs::read_to_string(root.join(&self.path).join("queries/highlights.scm"))
.unwrap_or_default();
let injections_query =
- std::fs::read_to_string(self.path.join("queries/injections.scm"))
+ std::fs::read_to_string(root.join(&self.path).join("queries/injections.scm"))
.unwrap_or_default();
let locals_query = "";
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 67f5cf84..726d0d95 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -233,7 +233,7 @@ impl EditorView {
// TODO: render also if only one of the ranges is in viewport
let mut start = view.screen_coords_at_pos(doc, text, selection.anchor);
let mut end = view.screen_coords_at_pos(doc, text, selection.head);
-
+
let head = end;
if selection.head < selection.anchor {
@@ -282,7 +282,7 @@ impl EditorView {
selection_style,
);
}
-
+
// cursor
if let Some(head) = head {
surface.set_style(