commit - bcb0b0730e139513b6c811bed3691bcb1a0df8b6
commit + 2a4ad912778b9a50549895b89878409e93ee511c
blob - 7232a73b78c8c4262349f3b0883d4d5b7623dce9
blob + f457beff8813c978f4b910ba50c4a1b4bf8fcad2
--- ui.c
+++ ui.c
static void cmd_scroll_down(int);
static void cmd_scroll_up(int);
static void cmd_kill_telescope(int);
+static void cmd_push_button(int);
+static void cmd_unbound(int);
static struct line *nth_line(struct tab*, size_t);
static struct tab *current_tab(void);
static void dispatch_stdio(int, short, void*);
{ 'K', cmd_scroll_up, },
{ 'q', cmd_kill_telescope, },
+ { CTRL('m'), cmd_push_button, },
{ 0, NULL, },
};
}
static void
+cmd_push_button(int k)
+{
+ struct tab *tab;
+ struct line *l;
+ size_t nth;
+
+ tab = current_tab();
+
+ nth = tab->s->line_off + tab->s->curs_y;
+ if (nth > tab->s->line_max)
+ return;
+ l = nth_line(tab, nth);
+ message("Enter on line: \"%s\"", l->line ? l->line : "");
+}
+
+static void
cmd_unbound(int k)
{
message("%c is undefined", k);