on master help sign in
hack: make queries load relative to source dir for now.
f0d49d3Blaž Hrastnik
helix-core/src/syntax.rs+4−2
@@ -65,12 +65,14 @@ impl LanguageConfiguration {
65 .get_or_init(|| {
65 .get_or_init(|| {
66 // let name = get_language_name(&self.language_id);
66 // let name = get_language_name(&self.language_id);
67
67
68+ let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
69+
68 let highlights_query =
70 let highlights_query =
69− std::fs::read_to_string(self.path.join("queries/highlights.scm"))
71+ std::fs::read_to_string(root.join(&self.path).join("queries/highlights.scm"))
70 .unwrap_or_default();
72 .unwrap_or_default();
71
73
72 let injections_query =
74 let injections_query =
73− std::fs::read_to_string(self.path.join("queries/injections.scm"))
75+ std::fs::read_to_string(root.join(&self.path).join("queries/injections.scm"))
74 .unwrap_or_default();
76 .unwrap_or_default();
75
77
76 let locals_query = "";
78 let locals_query = "";
helix-term/src/ui/editor.rs+2−2
@@ -233,7 +233,7 @@ impl EditorView {
233 // TODO: render also if only one of the ranges is in viewport
233 // TODO: render also if only one of the ranges is in viewport
234 let mut start = view.screen_coords_at_pos(doc, text, selection.anchor);
234 let mut start = view.screen_coords_at_pos(doc, text, selection.anchor);
235 let mut end = view.screen_coords_at_pos(doc, text, selection.head);
235 let mut end = view.screen_coords_at_pos(doc, text, selection.head);
236−
236+
237 let head = end;
237 let head = end;
238
238
239 if selection.head < selection.anchor {
239 if selection.head < selection.anchor {
@@ -282,7 +282,7 @@ impl EditorView {
282 selection_style,
282 selection_style,
283 );
283 );
284 }
284 }
285−
285+
286 // cursor
286 // cursor
287 if let Some(head) = head {
287 if let Some(head) = head {
288 surface.set_style(
288 surface.set_style(