mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-16 15:05:46 +01:00
Normalise the count arg of map actions with Math.max.
Passing an arg object to these actions as is done for commands might be better.
This commit is contained in:
@@ -663,22 +663,22 @@ function History() //{{{
|
||||
|
||||
mappings.add(myModes,
|
||||
["<C-o>"], "Go to an older position in the jump list",
|
||||
function (count) { history.stepTo(-(count > 1 ? count : 1)); },
|
||||
function (count) { history.stepTo(-Math.max(count, 1)); },
|
||||
{ flags: Mappings.flags.COUNT });
|
||||
|
||||
mappings.add(myModes,
|
||||
["<C-i>"], "Go to a newer position in the jump list",
|
||||
function (count) { history.stepTo(count > 1 ? count : 1); },
|
||||
function (count) { history.stepTo(Math.max(count, 1)); },
|
||||
{ flags: Mappings.flags.COUNT });
|
||||
|
||||
mappings.add(myModes,
|
||||
["H", "<A-Left>", "<M-Left>"], "Go back in the browser history",
|
||||
function (count) { history.stepTo(-(count > 1 ? count : 1)); },
|
||||
function (count) { history.stepTo(-Math.max(count, 1)); },
|
||||
{ flags: Mappings.flags.COUNT });
|
||||
|
||||
mappings.add(myModes,
|
||||
["L", "<A-Right>", "<M-Right>"], "Go forward in the browser history",
|
||||
function (count) { history.stepTo(count > 1 ? count : 1); },
|
||||
function (count) { history.stepTo(Math.max(count, 1)); },
|
||||
{ flags: Mappings.flags.COUNT });
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////}}}
|
||||
|
||||
@@ -226,12 +226,12 @@ const config = { //{{{
|
||||
|
||||
mappings.add([modes.NORMAL],
|
||||
["<C-a>"], "Increment last number in URL",
|
||||
function (count) { incrementURL(count > 1 ? count : 1); },
|
||||
function (count) { incrementURL(Math.max(count, 1)); },
|
||||
{ flags: Mappings.flags.COUNT });
|
||||
|
||||
mappings.add([modes.NORMAL],
|
||||
["<C-x>"], "Decrement last number in URL",
|
||||
function (count) { incrementURL(-(count > 1 ? count : 1)); },
|
||||
function (count) { incrementURL(-Math.max(count, 1)); },
|
||||
{ flags: Mappings.flags.COUNT });
|
||||
|
||||
mappings.add([modes.NORMAL], ["~"],
|
||||
|
||||
Reference in New Issue
Block a user