From: a bellenir Date: Sun, 3 Aug 2014 04:43:05 +0000 (+0000) Subject: minor tweaks X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=39d165889a561adbf2cb96a054c0d0e8cad971ed;p=archive%2Fafm.git minor tweaks --- diff --git a/source/input.c b/source/input.c index b2df36c..372fa2d 100644 --- a/source/input.c +++ b/source/input.c @@ -118,8 +118,7 @@ void input_handle_key(char ch) { } /* Escape key puts us back into normal mode */ - if (ch == ESC) - { + if (ch == ESC) { Key_Buffer[0] = '\0'; state_set_mode(MODE_NORMAL); } @@ -181,8 +180,7 @@ static void normal_mode(void) { static void search_mode(void) { size_t len = strlen(Key_Buffer); char prev = Key_Buffer[len-1]; - if (prev == '\n') - { + if (prev == '\n') { handle_cd(); Key_Buffer[0] = '\n'; state_set_mode(MODE_NORMAL); diff --git a/source/screen.c b/source/screen.c index e9847e8..bd2eb8e 100644 --- a/source/screen.c +++ b/source/screen.c @@ -87,13 +87,14 @@ void screen_close(void) { static void screen_place_windows(void) { Frame_T* p_frame; int id, pos, lines, cols; - int num_frames = list_size(Frame_List); + int num_sub_frames = list_size(Frame_List) - 1; list_node_t* p_node; getmaxyx(stdscr, lines, cols); + lines-=STATUS_LINE_MARGIN; /* Print the master frame */ p_frame = list_at(Frame_List,0)->contents; frame_move(p_frame, 0, 0); - frame_resize(p_frame, lines-STATUS_LINE_MARGIN, (num_frames > 1) ? cols/2 : cols); + frame_resize(p_frame, lines, (num_sub_frames > 0) ? cols/2 : cols); frame_draw(p_frame); /* Print any other frames we might have */ @@ -102,8 +103,8 @@ static void screen_place_windows(void) { id = 1; while(p_node != NULL) { /* Get the frame and it's properties */ - int remain = ((lines - STATUS_LINE_MARGIN) % (num_frames-1)); - int height = ((lines - STATUS_LINE_MARGIN) / (num_frames-1)) + (id <= remain ? 1 : 0); + int remain = (lines % num_sub_frames); + int height = (lines / num_sub_frames) + (id <= remain ? 1 : 0); p_frame = p_node->contents; /* Place the frame */ frame_move(p_frame, pos, cols/2);