Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cursor issues #19

Merged
merged 2 commits into from
Apr 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void cursor_move_up(Cursor* cursor) {
}

void cursor_move_down(Cursor* cursor) {
if (cursor->y == (LINES - 2)) { // Take box lines into account
if (cursor->y == (LINES - 5)) { // Take box lines into account
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are to check against the border size and the status window size? Should those values be calculated and set in frontend.c or somewhere else?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since @MatthewBeaudouinLafon won't have time to assess this I'll merge it in now. I added the issue as #24.

return;
}
cursor->y++;
Expand All @@ -35,7 +35,7 @@ void cursor_move_left(Cursor* cursor) {
}

void cursor_move_right(Cursor* cursor) {
if (cursor->x == (COLS - 2)) { // Take box lines into account
if (cursor->x == (COLS - 3)) { // Take box lines into account
return;
}
cursor->x++;
Expand Down
5 changes: 5 additions & 0 deletions src/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ int main(int argc, char *argv[]) {
char test_msg[] = "Test mode";
print_status(test_msg, status_win);


// Move cursor to starting location and redraw
wmove(canvas_win, cursor_y_to_canvas(cursor), cursor_x_to_canvas(cursor));
wrefresh(status_win);
wrefresh(canvas_win); // Refresh Canvas last so it gets the cursor


//// Main loop
int last_arrow_direction = KEY_RIGHT;
Expand Down