Skip to content

Commit

Permalink
vis: more cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Jan 14, 2016
1 parent 9a72fab commit 3a058c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions vis-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,13 @@ extern Movement vis_motions[VIS_MOVE_INVALID];
extern Operator vis_operators[VIS_OP_INVALID];
extern TextObject vis_textobjects[VIS_TEXTOBJECT_INVALID];

void action_do(Vis *vis, Action *a);

void macro_operator_stop(Vis *vis);
void macro_operator_record(Vis *vis);

void action_do(Vis *vis, Action *a);
void action_reset(Action*);

void mode_set(Vis *vis, Mode *new_mode);
Mode *mode_get(Vis *vis, enum VisMode mode);

void window_selection_save(Win *win);

Expand Down
6 changes: 5 additions & 1 deletion vis-modes.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "vis-core.h"
#include "util.h"

Mode *mode_get(Vis *vis, enum VisMode mode) {
static Mode *mode_get(Vis *vis, enum VisMode mode) {
if (mode < LENGTH(vis_modes))
return &vis_modes[mode];
return NULL;
Expand All @@ -20,6 +20,10 @@ void mode_set(Vis *vis, Mode *new_mode) {
vis->win->ui->draw_status(vis->win->ui);
}

void vis_mode_switch(Vis *vis, enum VisMode mode) {
mode_set(vis, &vis_modes[mode]);
}

static bool mode_map(Mode *mode, const char *key, const KeyBinding *binding) {
if (!mode)
return false;
Expand Down
4 changes: 0 additions & 4 deletions vis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,10 +1030,6 @@ int vis_run(Vis *vis, int argc, char *argv[]) {
return vis->exit_status;
}

void vis_mode_switch(Vis *vis, enum VisMode mode) {
mode_set(vis, &vis_modes[mode]);
}

static Macro *macro_get(Vis *vis, enum VisMacro m) {
if (m == VIS_MACRO_LAST_RECORDED)
return vis->last_recording;
Expand Down

0 comments on commit 3a058c2

Please sign in to comment.