Unnamed repository; edit this file 'description' to name the repository.
it compiles!
Blaž Hrastnik 2022-05-01
parent afcb78a · commit d151567
-rw-r--r--helix-view/src/commands/typed.rs2
-rw-r--r--helix-view/src/compositor.rs1
-rw-r--r--helix-view/src/keymap/default.rs18
-rw-r--r--helix-view/src/ui/editor.rs6
4 files changed, 18 insertions, 9 deletions
diff --git a/helix-view/src/commands/typed.rs b/helix-view/src/commands/typed.rs
index 3e8a8c29..c5e78d97 100644
--- a/helix-view/src/commands/typed.rs
+++ b/helix-view/src/commands/typed.rs
@@ -994,6 +994,7 @@ fn set_option(
};
let config = serde_json::from_value(config).map_err(field_error)?;
+ #[cfg(feature = "tokio")]
cx.editor
.config_events
.0
@@ -1121,6 +1122,7 @@ fn refresh_config(
_args: &[Cow<str>],
_event: PromptEvent,
) -> anyhow::Result<()> {
+ #[cfg(feature = "tokio")]
cx.editor.config_events.0.send(ConfigEvent::Refresh)?;
Ok(())
}
diff --git a/helix-view/src/compositor.rs b/helix-view/src/compositor.rs
index e367e54e..f3e6e093 100644
--- a/helix-view/src/compositor.rs
+++ b/helix-view/src/compositor.rs
@@ -190,6 +190,7 @@ impl Compositor {
}
}
+ #[cfg(feature = "term")]
pub fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
for layer in self.layers.iter().rev() {
if let (Some(pos), kind) = layer.cursor(area, editor) {
diff --git a/helix-view/src/keymap/default.rs b/helix-view/src/keymap/default.rs
index a1037beb..60bc5452 100644
--- a/helix-view/src/keymap/default.rs
+++ b/helix-view/src/keymap/default.rs
@@ -43,10 +43,10 @@ pub fn default() -> HashMap<Mode, Keymap> {
"h" => goto_line_start,
"l" => goto_line_end,
"s" => goto_first_nonwhitespace,
- "d" => goto_definition,
- "y" => goto_type_definition,
- "r" => goto_reference,
- "i" => goto_implementation,
+ // "d" => goto_definition,
+ // "y" => goto_type_definition,
+ // "r" => goto_reference,
+ // "i" => goto_implementation,
"t" => goto_window_top,
"c" => goto_window_center,
"b" => goto_window_bottom,
@@ -198,9 +198,9 @@ pub fn default() -> HashMap<Mode, Keymap> {
"f" => file_picker,
"F" => file_picker_in_current_directory,
"b" => buffer_picker,
- "s" => symbol_picker,
- "S" => workspace_symbol_picker,
- "a" => code_action,
+ // "s" => symbol_picker,
+ // "S" => workspace_symbol_picker,
+ // "a" => code_action,
"'" => last_picker,
"w" => { "Window"
"C-w" | "w" => rotate_view,
@@ -225,8 +225,8 @@ pub fn default() -> HashMap<Mode, Keymap> {
"P" => paste_clipboard_before,
"R" => replace_selections_with_clipboard,
"/" => global_search,
- "k" => hover,
- "r" => rename_symbol,
+ // "k" => hover,
+ // "r" => rename_symbol,
"?" => command_palette,
},
"z" => { "View"
diff --git a/helix-view/src/ui/editor.rs b/helix-view/src/ui/editor.rs
index 2287a064..0d4136b5 100644
--- a/helix-view/src/ui/editor.rs
+++ b/helix-view/src/ui/editor.rs
@@ -55,6 +55,7 @@ impl EditorView {
keymaps,
on_next_key: None,
last_insert: (commands::MappableCommand::normal_mode, Vec::new()),
+ #[cfg(feature = "term")]
completion: None,
spinners: ProgressSpinners::default(),
}
@@ -1189,6 +1190,7 @@ impl Component for EditorView {
EventResult::Consumed(None)
}
Event::Key(mut key) => {
+ #[cfg(feature = "term")]
cx.editor.reset_idle_timer();
canonicalize_key(&mut key);
@@ -1206,6 +1208,7 @@ impl Component for EditorView {
Mode::Insert => {
// let completion swallow the event if necessary
let mut consumed = false;
+ #[cfg(feature = "term")]
if let Some(completion) = &mut self.completion {
// use a fake context here
let mut cx = Context {
@@ -1226,6 +1229,7 @@ impl Component for EditorView {
// if completion didn't take the event, we pass it onto commands
if !consumed {
+ #[cfg(feature = "term")]
if let Some(compl) = cx.editor.last_completion.take() {
self.last_insert.1.push(InsertEvent::CompletionApply(compl));
}
@@ -1236,6 +1240,7 @@ impl Component for EditorView {
self.last_insert.1.push(InsertEvent::Key(key));
// lastly we recalculate completion
+ #[cfg(feature = "term")]
if let Some(completion) = &mut self.completion {
completion.update(&mut cx);
if completion.is_empty() {
@@ -1283,6 +1288,7 @@ impl Component for EditorView {
};
self.last_insert.1.clear();
}
+ #[cfg(feature = "term")]
(Mode::Insert, Mode::Normal) => {
// if exiting insert mode, remove completion
self.completion = None;