1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-01-27 15:25:24 -05:00

Add option to enable the kb-delete-entry in script mode (#2087)

* Add option to enable the `kb-delete-entry` in script mode

* Remove `use-delete` option
This commit is contained in:
Tiou Lims 2025-01-23 01:12:27 +08:00 committed by GitHub
parent 5b95abce92
commit 5870040256
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -59,6 +59,7 @@ An integer number with the current state:
- **0**: Initial call of script.
- **1**: Selected an entry.
- **2**: Selected a custom entry.
- **3**: Deleted an entry.
- **10-28**: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
### `ROFI_INFO`
@ -109,7 +110,7 @@ The following extra options exists:
- **keep-selection**: If set, the selection is not moved to the first entry,
but the current position is maintained. The filter is cleared.
- **keep-filter**: If set, the filter is not cleared.
- **keep-filter**: If set, the filter is not cleared.
- **new-selection**: If `keep-selection` is set, this allows you to override
the selected entry (absolute position).

View file

@ -348,6 +348,10 @@ static ModeMode script_mode_result(Mode *sw, int mretv, char **input,
retv = (mretv & MENU_LOWER_MASK);
return retv;
}
} else if ((mretv & MENU_ENTRY_DELETE) && selected_line != UINT32_MAX) {
script_mode_reset_highlight(sw);
new_list = execute_executor(sw, rmpd->cmd_list[selected_line].entry, &new_length,
3, &(rmpd->cmd_list[selected_line]));
} else if ((mretv & MENU_OK) && rmpd->cmd_list[selected_line].entry != NULL) {
if (rmpd->cmd_list[selected_line].nonselectable) {
return RELOAD_DIALOG;