@@ -711,6 +711,30 @@ impl EditorView {
711 event: KeyEvent,
711 event: KeyEvent,
712 ) -> Option<KeymapResult> {
712 ) -> Option<KeymapResult> {
713 self.autoinfo = None;
713 self.autoinfo = None;
715+ if cxt.editor.variables.is_some() {
718+ code: KeyCode::Char('h'),
721+ cxt.editor.variables_page = cxt.editor.variables_page.saturating_sub(1);
724+ code: KeyCode::Char('l'),
727+ cxt.editor.variables_page = cxt.editor.variables_page.saturating_add(1);
730+ code: KeyCode::Esc, ..
732+ cxt.editor.variables = None;
714 match self.keymaps.get_mut(&mode).unwrap().get(event) {
738 match self.keymaps.get_mut(&mode).unwrap().get(event) {
715 KeymapResult::Matched(command) => command.execute(cxt),
739 KeymapResult::Matched(command) => command.execute(cxt),
716 KeymapResult::Pending(node) => self.autoinfo = Some(node.into()),
740 KeymapResult::Pending(node) => self.autoinfo = Some(node.into()),
@@ -1084,6 +1108,35 @@ impl Component for EditorView {
1111+ if let Some(ref vars) = cx.editor.variables {
1112+ let mut text = String::new();
1113+ let mut height = 0;
1114+ let mut max_len = 0;
1117+ let num_vars = vars.len();
1118+ let start = (per_page * cx.editor.variables_page).min(num_vars);
1119+ let end = (start + per_page).min(num_vars);
1120+ for line in vars[start..end].to_vec() {
1121+ max_len = max_len.max(line.len() as u16);
1123+ text.push_str(&line);
1126+ if vars.len() > per_page {
1127+ text += "\nMove h, l";
1131+ let mut info = Info {
1132+ height: 20.min(height + 2),
1133+ width: 70.min(max_len),
1134+ title: format!("{} variables", num_vars),
1135+ text: text + "\nExit Esc",
1137+ info.render(area, surface, cx);
1087 if let Some(ref mut info) = self.autoinfo {
1140 if let Some(ref mut info) = self.autoinfo {
1088 info.render(area, surface, cx);
1141 info.render(area, surface, cx);