diff --git a/doc/rofi-manpage.markdown b/doc/rofi-manpage.markdown index 4108ef90..47105d68 100644 --- a/doc/rofi-manpage.markdown +++ b/doc/rofi-manpage.markdown @@ -370,6 +370,7 @@ Rofi supports the following keybindings: * `Page Down`: Go to the next page * `Ctrl-Page Up`: Go to the previous column * `Ctrl-Page Down`: Go to the next column +* `Ctrl-Enter`: Use entered text as command (in ssh/run dialog) * `?`: Switch to the next modi. The list can be customized with the `-switchers` argument. * `ctrl-/`: Switch to the previous modi. The list can be customized with the `-switchers` argument. * `Ctrl-space`: Set selected item as input text. diff --git a/doc/rofi.1 b/doc/rofi.1 index 45e88f7f..74eca53b 100644 --- a/doc/rofi.1 +++ b/doc/rofi.1 @@ -478,6 +478,8 @@ Rofi supports the following keybindings: .IP \(bu 2 \fB\fCCtrl\-Page Down\fR: Go to the next column .IP \(bu 2 +\fB\fCCtrl\-Enter\fR: Use entered text as command (in ssh/run dialog) +.IP \(bu 2 \fB\fC?\fR: Switch to the next modi. The list can be customized with the \fB\fC\-switchers\fR argument. .IP \(bu 2 \fB\fCctrl\-/\fR: Switch to the previous modi. The list can be customized with the \fB\fC\-switchers\fR argument. @@ -496,14 +498,18 @@ Try using a mono\-space font. .SH WEBSITE .PP \fBrofi\fP website can be found at here -\[la]https://davedavenport.github.io/rofi/\[ra] +.UR https://davedavenport.github.io/rofi/ +.UE .PP \fBrofi\fP bugtracker can be found here -\[la]https://github.com/DaveDavenport/rofi/issues\[ra] +.UR https://github.com/DaveDavenport/rofi/issues +.UE .SH AUTHOR .PP Qball Cow -\[la]qball@gmpclient.org\[ra] +.MT qball@gmpclient.org +.ME .PP Original code based on work by: Sean Pringle -\[la]sean.pringle@gmail.com\[ra] +.MT sean.pringle@gmail.com +.ME diff --git a/source/rofi.c b/source/rofi.c index b2efb1fd..5fa89ffc 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1650,17 +1650,13 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom } // If a valid item is selected, return that.. - if ( rc != -2 - && state.selected < state.filtered_lines && state.filtered[state.selected] != NULL ) { - state.retv = MENU_OK; + if ( state.selected < state.filtered_lines && state.filtered[state.selected] != NULL ) { *( state.selected_line ) = state.line_map[state.selected]; - } - // Either: - // Ctrl+Enter was used to force using custom input (-2) - // or - // No item selected, but user entered something - else if ( strlen ( state.text->text ) > 0 ) { - state.retv = MENU_CUSTOM_INPUT; + if ( strlen( state.text->text ) > 0 && rc == -2 ) { + state.retv = MENU_CUSTOM_INPUT; + } else { + state.retv = MENU_OK; + } } // Nothing entered and nothing selected. else{ @@ -1899,7 +1895,7 @@ SwitcherMode run_switcher_window ( char **input, G_GNUC_UNUSED void *data ) else if ( mretv == MENU_QUICK_SWITCH ) { retv = selected_line; } - else if ( mretv == MENU_OK && list[selected_line] ) { + else if ( ( mretv == MENU_OK || mretv == MENU_CUSTOM_INPUT ) && list[selected_line] ) { #ifdef HAVE_I3_IPC_H if ( config_i3_mode ) {