Skip to content

Commit

Permalink
mousequery: give explicit feedback when enabling/disabling sub-features
Browse files Browse the repository at this point in the history
The behavior of this plugin is somewhat unintuitive - "mousequery edge" disables
the edge-scrolling feature instead of enabling it. This should avoid confusion
without breaking compatibility with existing init scripts.
  • Loading branch information
lethosor committed May 13, 2019
1 parent 32a0ab9 commit f2bd697
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugins/mousequery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,26 +836,35 @@ static command_result mousequery_cmd(color_ostream &out, vector <string> & param
else if (cmd[0] == 'p')
{
plugin_enabled = (state == "enable");
out << "mousequery: plugin " << (plugin_enabled ? "enabled" : "disabled") << endl;
}
else if (cmd[0] == 'r')
{
rbutton_enabled = (state == "enable");
out << "mousequery: rbutton " << (rbutton_enabled ? "enabled" : "disabled") << endl;
}
else if (cmd[0] == 't')
{
tracking_enabled = (state == "enable");
if (!tracking_enabled)
if (!tracking_enabled) {
out << "mousequery: edge scrolling disabled" << endl;
active_scrolling = false;
}
out << "mousequery: tracking " << (tracking_enabled ? "enabled" : "disabled") << endl;
}
else if (cmd[0] == 'e')
{
active_scrolling = (state == "enable");
if (active_scrolling)
if (active_scrolling) {
out << "mousequery: tracking enabled" << endl;
tracking_enabled = true;
}
out << "mousequery: edge scrolling " << (active_scrolling ? "enabled" : "disabled") << endl;
}
else if (cmd[0] == 'l')
{
live_view = (state == "enable");
out << "mousequery: live view " << (live_view ? "enabled" : "disabled") << endl;
}
else if (cmd == "drag")
{
Expand Down

0 comments on commit f2bd697

Please sign in to comment.