shithub: orca

Download patch

ref: 84869b49a69e6e18062c12ff8459eef2e9b2da37
parent: ea9682b12b2f563cbc92a795fe1818119d5c0240
author: cancel <cancel@cancel.fm>
date: Tue Dec 18 00:10:02 EST 2018

Add more save as logic

--- a/term_util.c
+++ b/term_util.c
@@ -416,7 +416,6 @@
   case CTRL_PLUS('h'):
     form_driver(qf->ncurses_form, REQ_DEL_PREV);
     return false;
-  case ' ':
   case '\r':
   case KEY_ENTER: {
     out_action->any.type = Qform_action_type_submitted;
--- a/tui_main.c
+++ b/tui_main.c
@@ -1985,10 +1985,15 @@
           case Qform_action_type_submitted: {
             switch (qform_id(qf)) {
             case Save_as_form_id: {
-              if (qform_get_text_line(qf, Save_as_name_id, &file_name)) {
-                fprintf(stderr, "new file name: %s\n", file_name.str);
-                ged_state.filename = file_name.str;
+              Heapstr temp_name;
+              heapstr_init(&temp_name);
+              if (qform_get_text_line(qf, Save_as_name_id, &temp_name) &&
+                  heapstr_len(&temp_name) > 0) {
+                qnav_stack_pop();
+                fprintf(stderr, "new file name: %s\n", temp_name.str);
+                // ged_state.filename = file_name.str;
               }
+              heapstr_deinit(&temp_name);
             } break;
             }
           } break;