mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
Fix Control+u behaviour
This commit is contained in:
parent
df1c9a1c1f
commit
8478b427f1
6 changed files with 72 additions and 53 deletions
|
@ -9,6 +9,7 @@ v1.unrelease
|
|||
- Fix launching in terminal.
|
||||
- Supports include in config.
|
||||
- Add Control+k remove till eol keybinding.
|
||||
- Change clear line to Control+w and make Control+u remove till sol (matching readline)
|
||||
Removals:
|
||||
- Remove xlib dependency (xcb-xrm)
|
||||
- Remove fuzzy option
|
||||
|
|
|
@ -126,6 +126,8 @@ rofi.kb-remove-char-forward: Delete,Control+d
|
|||
rofi.kb-remove-char-back: BackSpace,Control+h
|
||||
! Delete till the end of line
|
||||
rofi.kb-remove-to-eol: Control+k
|
||||
! Delete till the start of line
|
||||
rofi.kb-remove-to-sol: Control+u
|
||||
! Accept entry
|
||||
rofi.kb-accept-entry: Control+j,Control+m,Return,KP_Enter
|
||||
! Use entered text as command (in ssh/run modi)
|
||||
|
|
|
@ -37,6 +37,8 @@ typedef enum
|
|||
REMOVE_CHAR_BACK,
|
||||
/** Remove till EOL */
|
||||
REMOVE_TO_EOL,
|
||||
/** Remove till SOL */
|
||||
REMOVE_TO_SOL,
|
||||
/** Accept the current selected entry */
|
||||
ACCEPT_ENTRY,
|
||||
ACCEPT_ALT,
|
||||
|
|
|
@ -36,7 +36,7 @@ DefaultBinding bindings[NUM_ABE] =
|
|||
{
|
||||
{ .id = PASTE_PRIMARY, .name = "kb-primary-paste", .keybinding = "Control+Shift+v,Shift+Insert", .comment = "Paste primary selection" },
|
||||
{ .id = PASTE_SECONDARY, .name = "kb-secondary-paste", .keybinding = "Control+v,Insert", .comment = "Paste clipboard" },
|
||||
{ .id = CLEAR_LINE, .name = "kb-clear-line", .keybinding = "Control+u", .comment = "Clear input line" },
|
||||
{ .id = CLEAR_LINE, .name = "kb-clear-line", .keybinding = "Control+w", .comment = "Clear input line" },
|
||||
{ .id = MOVE_FRONT, .name = "kb-move-front", .keybinding = "Control+a", .comment = "Beginning of line" },
|
||||
{ .id = MOVE_END, .name = "kb-move-end", .keybinding = "Control+e", .comment = "End of line" },
|
||||
{ .id = MOVE_WORD_BACK, .name = "kb-move-word-back", .keybinding = "Alt+b", .comment = "Move back one word" },
|
||||
|
@ -48,6 +48,7 @@ DefaultBinding bindings[NUM_ABE] =
|
|||
{ .id = REMOVE_CHAR_FORWARD, .name = "kb-remove-char-forward", .keybinding = "Delete,Control+d", .comment = "Delete next char" },
|
||||
{ .id = REMOVE_CHAR_BACK, .name = "kb-remove-char-back", .keybinding = "BackSpace,Control+h", .comment = "Delete previous char" },
|
||||
{ .id = REMOVE_TO_EOL, .name = "kb-remove-to-eol", .keybinding = "Control+k", .comment = "Delete till the end of line" },
|
||||
{ .id = REMOVE_TO_SOL, .name = "kb-remove-to-sol", .keybinding = "Control+u", .comment = "Delete till the start of line" },
|
||||
{ .id = ACCEPT_ENTRY, .name = "kb-accept-entry", .keybinding = "Control+j,Control+m,Return,KP_Enter", .comment = "Accept entry" },
|
||||
{ .id = ACCEPT_CUSTOM, .name = "kb-accept-custom", .keybinding = "Control+Return", .comment = "Use entered text as command (in ssh/run modi)" },
|
||||
{ .id = ACCEPT_ALT, .name = "kb-accept-alt", .keybinding = "Shift+Return", .comment = "Use alternate accept command." },
|
||||
|
|
|
@ -544,6 +544,15 @@ static void textbox_cursor_del_eol ( textbox *tb )
|
|||
}
|
||||
}
|
||||
}
|
||||
static void textbox_cursor_del_sol ( textbox *tb )
|
||||
{
|
||||
if ( tb->cursor >= 0 ) {
|
||||
int length = tb->cursor;
|
||||
if ( length >= 0 ) {
|
||||
textbox_delete ( tb, 0, length );
|
||||
}
|
||||
}
|
||||
}
|
||||
static void textbox_cursor_del_word ( textbox *tb )
|
||||
{
|
||||
if ( tb->cursor >= 0 ) {
|
||||
|
@ -599,6 +608,9 @@ int textbox_keybinding ( textbox *tb, KeyBindingAction action )
|
|||
case REMOVE_TO_EOL:
|
||||
textbox_cursor_del_eol ( tb );
|
||||
return 1;
|
||||
case REMOVE_TO_SOL:
|
||||
textbox_cursor_del_sol ( tb );
|
||||
return 1;
|
||||
// Delete or Ctrl-D
|
||||
case REMOVE_CHAR_FORWARD:
|
||||
textbox_cursor_del ( tb );
|
||||
|
|
|
@ -1439,6 +1439,7 @@ gboolean rofi_view_trigger_action ( RofiViewState *state, KeyBindingAction actio
|
|||
case MOVE_FRONT:
|
||||
case MOVE_END:
|
||||
case REMOVE_TO_EOL:
|
||||
case REMOVE_TO_SOL:
|
||||
case REMOVE_WORD_BACK:
|
||||
case REMOVE_WORD_FORWARD:
|
||||
case REMOVE_CHAR_FORWARD:
|
||||
|
|
Loading…
Reference in a new issue