Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
Update help_button.cpp
Browse files Browse the repository at this point in the history
Using string similarity instead of equality leads to help button opening similarly-named pages instead of correct ones.
Examples: button in "Shift Times" opens "Spell checker" and that in "Select Lines" opens "Shift Times"
  • Loading branch information
Setsugennoao committed Aug 2, 2021
1 parent be4c38e commit 3797d95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/help_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static const char *pages[][2] = {
namespace {
const char *url(const char *page) {
auto it = std::lower_bound(std::begin(pages), std::end(pages), page, [](const char *pair[], const char *page) {
return strcmp(pair[0], page) < 0;
return strcmp(pair[0], page) == 0;
});
return it == std::end(pages) ? nullptr : (*it)[1];
}
Expand Down

0 comments on commit 3797d95

Please sign in to comment.