mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 10:17:59 +01:00
Fix <C-u> and <C-d> (durka42).
This commit is contained in:
@@ -277,14 +277,21 @@ function Buffer() //{{{
|
|||||||
},
|
},
|
||||||
{ flags: Mappings.flags.COUNT });
|
{ flags: Mappings.flags.COUNT });
|
||||||
|
|
||||||
|
function scrollByScrollSize(count, direction)
|
||||||
|
{
|
||||||
|
if (count > 0)
|
||||||
|
options["scroll"] = count;
|
||||||
|
buffer.scrollByScrollSize(direction);
|
||||||
|
}
|
||||||
|
|
||||||
mappings.add(myModes, ["<C-d>"],
|
mappings.add(myModes, ["<C-d>"],
|
||||||
"Scroll window downwards in the buffer",
|
"Scroll window downwards in the buffer",
|
||||||
function (count) { buffer.scrollByScrollSize(count); },
|
function (count) { scrollByScrollSize(count, true); },
|
||||||
{ flags: Mappings.flags.COUNT });
|
{ flags: Mappings.flags.COUNT });
|
||||||
|
|
||||||
mappings.add(myModes, ["<C-u>"],
|
mappings.add(myModes, ["<C-u>"],
|
||||||
"Scroll window upwards in the buffer",
|
"Scroll window upwards in the buffer",
|
||||||
function (count) { buffer.scrollByScrollSize(-count); },
|
function (count) { scrollByScrollSize(count, false); },
|
||||||
{ flags: Mappings.flags.COUNT });
|
{ flags: Mappings.flags.COUNT });
|
||||||
|
|
||||||
mappings.add(myModes, ["<C-b>", "<PageUp>", "<S-Space>"],
|
mappings.add(myModes, ["<C-b>", "<PageUp>", "<S-Space>"],
|
||||||
@@ -1307,17 +1314,19 @@ function Buffer() //{{{
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scrolls the buffer vertically <b>count</b> * 'scroll' rows.
|
* Scrolls the buffer vertically 'scroll' lines.
|
||||||
*
|
*
|
||||||
* @param {number} count The multiple of 'scroll' lines to scroll. A
|
* @param {boolean} direction The direction to scroll. If true then
|
||||||
* positive value scrolls down and a negative value up.
|
* scroll up and if false scroll down.
|
||||||
|
* @param {number} count The multiple of 'scroll' lines to scroll.
|
||||||
|
* @optional
|
||||||
*/
|
*/
|
||||||
scrollByScrollSize: function (count)
|
scrollByScrollSize: function (direction, count)
|
||||||
{
|
{
|
||||||
if (count > 0)
|
direction = direction ? 1 : -1;
|
||||||
options["scroll"] = count;
|
count = count || 1;
|
||||||
|
|
||||||
let win = findScrollableWindow();
|
let win = findScrollableWindow();
|
||||||
|
|
||||||
checkScrollYBounds(win, direction);
|
checkScrollYBounds(win, direction);
|
||||||
|
|
||||||
if (options["scroll"] > 0)
|
if (options["scroll"] > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user