]> git.mdlowis.com Git - archive/afm.git/commitdiff
minor tweaks
authora bellenir <a@bellenir.com>
Sun, 3 Aug 2014 04:43:05 +0000 (04:43 +0000)
committera bellenir <a@bellenir.com>
Sun, 3 Aug 2014 04:43:05 +0000 (04:43 +0000)
source/input.c
source/screen.c

index b2df36c946a87cec750b665a64d9815f82b8f76f..372fa2d280b96c536cf88892527920cc3e9cd9fe 100644 (file)
@@ -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);
index e9847e833f67a6487857fb73a7a242ae36435a6b..bd2eb8e29b9d94533229d4ad26fa1494d1a5c185 100644 (file)
@@ -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);