Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Execute custom user commands or scripts on a variety of rofi events #2053

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions source/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,13 +1302,15 @@ static void selection_changed_user_callback(unsigned int index, RofiViewState *s
if (config.on_selection_changed == NULL)
return;

static int last_index = -1;
static unsigned int last_index = UINT32_MAX;
giomatfois62 marked this conversation as resolved.
Show resolved Hide resolved
if (index >= state->filtered_lines)
return;
if (last_index != index) {
last_index = index;

unsigned int real_index = state->line_map[index];
if (last_index != real_index) {
last_index = real_index;
int fstate = 0;
char *text = mode_get_display_value(state->sw, state->line_map[index],
char *text = mode_get_display_value(state->sw, real_index,
&fstate, NULL, TRUE);
char **args = NULL;
int argv = 0;
Expand Down
Loading