@@ -21,7 +21,6 @@ use helix_view::{
21 document::{Mode, SCRATCH_BUFFER_NAME},
21 document::{Mode, SCRATCH_BUFFER_NAME},
22 editor::CursorShapeConfig,
22 editor::CursorShapeConfig,
23 graphics::{CursorKind, Modifier, Rect, Style},
23 graphics::{CursorKind, Modifier, Rect, Style},
25 input::KeyEvent,
24 input::KeyEvent,
26 keyboard::{KeyCode, KeyModifiers},
25 keyboard::{KeyCode, KeyModifiers},
27 Document, Editor, Theme, View,
26 Document, Editor, Theme, View,
@@ -37,7 +36,6 @@ pub struct EditorView {
37 last_insert: (commands::MappableCommand, Vec<KeyEvent>),
36 last_insert: (commands::MappableCommand, Vec<KeyEvent>),
38 pub(crate) completion: Option<Completion>,
37 pub(crate) completion: Option<Completion>,
39 spinners: ProgressSpinners,
38 spinners: ProgressSpinners,
40− autoinfo: Option<Info>,
43impl Default for EditorView {
41impl Default for EditorView {
@@ -54,7 +52,6 @@ impl EditorView {
54 last_insert: (commands::MappableCommand::normal_mode, Vec::new()),
52 last_insert: (commands::MappableCommand::normal_mode, Vec::new()),
55 completion: None,
53 completion: None,
56 spinners: ProgressSpinners::default(),
54 spinners: ProgressSpinners::default(),
@@ -678,13 +675,13 @@ impl EditorView {
678 cxt: &mut commands::Context,
675 cxt: &mut commands::Context,
679 event: KeyEvent,
676 event: KeyEvent,
680 ) -> Option<KeymapResult> {
677 ) -> Option<KeymapResult> {
681− self.autoinfo = None;
678+ cxt.editor.autoinfo = None;
682 let key_result = self.keymaps.get_mut(&mode).unwrap().get(event);
679 let key_result = self.keymaps.get_mut(&mode).unwrap().get(event);
683− self.autoinfo = key_result.sticky.map(|node| node.infobox());
680+ cxt.editor.autoinfo = key_result.sticky.map(|node| node.infobox());
685 match &key_result.kind {
682 match &key_result.kind {
686 KeymapResultKind::Matched(command) => command.execute(cxt),
683 KeymapResultKind::Matched(command) => command.execute(cxt),
687− KeymapResultKind::Pending(node) => self.autoinfo = Some(node.infobox()),
684+ KeymapResultKind::Pending(node) => cxt.editor.autoinfo = Some(node.infobox()),
688 KeymapResultKind::MatchedSequence(commands) => {
685 KeymapResultKind::MatchedSequence(commands) => {
689 for command in commands {
686 for command in commands {
690 command.execute(cxt);
687 command.execute(cxt);
@@ -1093,8 +1090,9 @@ impl Component for EditorView {
1095 if cx.editor.config.auto_info {
1092 if cx.editor.config.auto_info {
1096− if let Some(ref mut info) = self.autoinfo {
1093+ if let Some(mut info) = cx.editor.autoinfo.take() {
1097 info.render(area, surface, cx);
1094 info.render(area, surface, cx);
1095+ cx.editor.autoinfo = Some(info)