xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 8260fcdd3e1dcdf949c33330aed9472fb5685e25

Add handling of Enter/Escape keys to prompts
Thanks to laur89, Alexandre Viau and multiple other users who asked
about this.
Author: xaizek
Author date (UTC): 2024-10-20 09:07
Committer name: xaizek
Committer date (UTC): 2024-10-20 13:52
Parent(s): 5cdbfd79a0d176af7515617b92cdfc7dade9a5fc
Signing key: 99DC5E4DB05F6BE2
Tree: 460676227d546cbf1b218753a2b839f18785fcd7
File Lines added Lines deleted
ChangeLog 2 2
src/modes/dialogs/msg_dialog.c 5 5
File ChangeLog changed (mode: 100644) (index a986eb6ff..398a281f9)
76 76 being non empty instead of converting it to an integer). Thanks to being non empty instead of converting it to an integer). Thanks to
77 77 justpretending2. justpretending2.
78 78
79 Added handling of Escape to error dialogs. Thanks to laur89, Alexandre
80 Viau and multiple other users who asked about this.
79 Added handling of Enter/Escape keys to prompts and error dialogs. Thanks
80 to laur89, Alexandre Viau and multiple other users who asked about this.
81 81
82 82 Don't draw right padding on a truncated rightmost column of a transposed Don't draw right padding on a truncated rightmost column of a transposed
83 83 ls-like view. ls-like view.
File src/modes/dialogs/msg_dialog.c changed (mode: 100644) (index ad8cdc50b..2f908a8db)
... ... prompt_msg(const char title[], const char message[])
362 362 .message = message, .message = message,
363 363 }, },
364 364 .kind = D_QUERY_CENTER_EACH, .kind = D_QUERY_CENTER_EACH,
365 .accept_mask = MASK(DR_YES, DR_NO),
365 .accept_mask = MASK(DR_OK, DR_YES, DR_CLOSE, DR_NO),
366 366 }; };
367 367 prompt_msg_internal(&data); prompt_msg_internal(&data);
368 return (data.result == DR_YES);
368 return ONE_OF(data.result, DR_OK, DR_YES);
369 369 } }
370 370
371 371 int int
 
... ... get_control_msg(const dialog_data_t *data)
510 510 { {
511 511 if(data->details.variants == NULL) if(data->details.variants == NULL)
512 512 { {
513 return "Enter [y]es or [n]o";
513 return "[y]es/Enter or [n]o/Escape";
514 514 } }
515 515
516 516 return get_custom_control_msg(data->details.variants); return get_custom_control_msg(data->details.variants);
 
... ... confirm_deletion(char *files[], int nfiles, int use_trash)
786 786 .message = msg, .message = msg,
787 787 }, },
788 788 .kind = D_QUERY_CENTER_FIRST, .kind = D_QUERY_CENTER_FIRST,
789 .accept_mask = MASK(DR_YES, DR_NO),
789 .accept_mask = MASK(DR_OK, DR_YES, DR_CLOSE, DR_NO),
790 790 }; };
791 791 prompt_msg_internal(&data); prompt_msg_internal(&data);
792 792 free(msg); free(msg);
793 793
794 if(data.result != DR_YES)
794 if(!ONE_OF(data.result, DR_OK, DR_YES))
795 795 { {
796 796 return 0; return 0;
797 797 } }
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master