Thumbnail

rani/cscroll.git

Clone URL: https://git.buni.party/rani/cscroll.git

commit 3f98ba7de29ce1099552fffffc6bc5666139d068 Author: Raniconduh <clagv.randomgames@gmail.com> Date: Sat Oct 30 12:49:20 2021 +0000 added emacs bindings to prompt() Update README.md added space bar to prompt() diff --git a/README.md b/README.md index 4f6d5de..5e96c38 100644 --- a/README.md +++ b/README.md @@ -3512 +3516 @@ Files that are executable but have another identifier will keep the identifier b  * `g`: Place cursor on first file  * `G`: Place cursor on last file  * `.`: Toggle whether or not to show dot files -* `d`: Delete the file the cursor is on (a prompt will be shown first) +* `d`: Delete the file the cursor is on (a [prompt](#options-prompt) will be shown first)  * `m`: Mark the file the cursor is on  * `:`: Open a commands prompt ([see 'Command Prompt' section](#command-prompt))  * `/`: Search for a file in the current directory using a POSIX regex  * `q`: Quit   +#### Options Prompt + +An options prompt will pop up in the center of the screen with text at the top of the popup and one or more options at the bottom. To move the cursor to the left, any of the left or up keys will work. To move it to the right, any of the down or right keys (except for enter) will work. To select the current option, press either the space bar or the enter key.The `q` key will quit the prompt without selecting an option. +  #### Command Prompt    The command prompt will show up upon pressing `:` and the prompt itself is prefixed with a colon. Here you may enter multi-character commands. Available commands are: diff --git a/src/io.c b/src/io.c index 581b3e2..9b63a38 100644 --- a/src/io.c +++ b/src/io.c @@ -20717 +20722 @@ char * prompt(char * t, char ** args) {   switch (c) {   case ARROW_UP:   case ARROW_LEFT: + case CTRL_P: + case CTRL_B:   case 'h':   case 'k':   if (cursor > 1) cursor--;   break;   case ARROW_DOWN:   case ARROW_RIGHT: + case CTRL_N: + case CTRL_F:   case 'l':   case 'j':   if ((unsigned)cursor < argcount) cursor++;   break;   case '\n': + case ' ':   delwin(w);   return args[cursor - 1];   case 'q':