UNPKG

much

Version:

Pager with depth support for JavaScript source code

17 lines (13 loc) 372 B
'use strict'; module.exports = function (screen) { screen.key('escape', function () { if (screen.data.escapeLock) return; screen.data.escapeLock = true; screen.once('keypress', function () { // Ensure that escape handler gets the message first. process.nextTick(function () { screen.data.escapeLock = false; }); }); }); };