Skip to content

Commit

Permalink
Add Codacy integration and fix code style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
coditva committed Nov 21, 2017
1 parent 79bd68d commit 99d64c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# A Vim Story
_A ncurses based game for learning Vim_

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/053e7aa12d05484fbe77a521bb2d4f34)](https://www.codacy.com/app/UtkarshMe/A-Vim-Story?utm_source=github.com&utm_medium=referral&utm_content=UtkarshMe/A-Vim-Story&utm_campaign=Badge_Grade)



### Overview
Expand Down
3 changes: 1 addition & 2 deletions src/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ command_t action_make_move(const map_t *map)
int loop = 1;
int multiplier = 0;
input_key_t key;
int touched;
command_t command;

/* calculate the update */
Expand All @@ -51,7 +50,7 @@ command_t action_make_move(const map_t *map)

/* 1 if the real x of cursor is touched and thus has to be changed.
* a successful change of x by a key can do that */
touched = 0;
int touched = 0;

if (!key_unlocked(key)) {
key = interface_input_key();
Expand Down
12 changes: 4 additions & 8 deletions src/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,11 @@ void interface_display_clear()

void interface_display_menu(enum menu_item selected)
{
int x = 0;
enum menu_item y = 0;

wclear(menu_window);
box(menu_window, '|', '-'); /* create a box around the window */

for (; y < MENU_SIZE; ++y) {
x = MENU_PADDING + ( MENU_WIDTH - strlen(menu_label[y]) ) / 2;
for (enum menu_item y = 0; y < MENU_SIZE; ++y) {
int x = MENU_PADDING + ( MENU_WIDTH - strlen(menu_label[y]) ) / 2;

if (y == selected) wstandout(menu_window);
mvwprintw(menu_window, y + 1 + MENU_PADDING - 1, x, menu_label[y]);
Expand Down Expand Up @@ -266,9 +263,8 @@ input_key_t interface_input_key()

char * interface_input_command()
{
char *line;
char *line = NULL;
int line_size = 100;
int key;
int loop = 1;
int i = 0;

Expand All @@ -281,7 +277,7 @@ char * interface_input_command()
mvwprintw(command_window, 0, 0, ":");

while (loop) {
key = mvwgetch(command_window, 0, i + 1);
int key = mvwgetch(command_window, 0, i + 1);
switch (key) {

/* backspace */
Expand Down

0 comments on commit 99d64c2

Please sign in to comment.