void view_putstr(View* view, char* str);
void view_append(View* view, char* str);
char* view_getstr(View* view, Sel* sel);
+char* view_getcmd(View* view);
char* view_getctx(View* view);
void view_scroll(View* view, int move);
void view_scrollpage(View* view, int move);
return str;
}
+char* view_getcmd(View* view) {
+ Sel sel = view->selection;
+ buf_getword(&(view->buffer), riscmd, &sel);
+ sel.end++;
+ return view_getstr(view, &sel);
+}
+
char* view_getctx(View* view) {
if (0 == num_selected(view->selection)) {
selcontext(view, &(view->selection));
}
static void execute(void) {
- char* str = view_getstr(currview(), NULL);
+ char* str = view_getcmd(currview());
if (str) exec(str);
free(str);
}