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

Allow removing single patterns from default selection #5588

Merged
merged 1 commit into from Aug 16, 2018

Conversation

asdil12
Copy link
Member

@asdil12 asdil12 commented Aug 15, 2018

@@ -185,11 +186,19 @@ sub run {
die "looping for too long" unless ($counter--);
my $needs_to_be_selected;
my $ret = check_screen('on-pattern', 1);
my $current_pattern = 'UNKNOWN_PATTERN';

if ($ret) { # unneedled pattern
for my $wp (keys %wanted_patterns) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we need to rename wanted_patterns to something else, as now we have unwanted patterns there as well. But I like the idea!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to %patterns

Copy link
Member

@rwx788 rwx788 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


if ($ret) { # unneedled pattern
for my $wp (keys %wanted_patterns) {
for my $wp (keys %patterns) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you renamed "wanted_patterns" to "patterns" which makes perfect sense to me. Maybe you also will change "wp" to pattern ?

}

my $counter = 80;
while (1) {
die "looping for too long" unless ($counter--);
my $needs_to_be_selected;
my $ret = check_screen('on-pattern', 1);
my $current_pattern = 'UNKNOWN_PATTERN';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure that I understand purpose of this variable. Looks like you use it to detect if PATTERNS variable has at least one pattern to select and it is not default, right ?

}

my $counter = 80;
while (1) {
die "looping for too long" unless ($counter--);
my $needs_to_be_selected;
my $ret = check_screen('on-pattern', 1);
# this variable will only be updated when the pattern list entry is under the cursor
# and the pattern is in the PATTERNS variable and there is a needle for that entry
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants