mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-05 23:25:47 +01:00
Simplify some overwrought optional arg handling in StatusLine updaters.
--HG-- extra : rebase_source : 08270edb93ef96cb00d8b16239ff29d61f2299cb
This commit is contained in:
@@ -152,9 +152,10 @@ const StatusLine = Module("statusline", {
|
||||
* along with multi-key mappings.
|
||||
*
|
||||
* @param {string} buffer
|
||||
* @optional
|
||||
*/
|
||||
updateInputBuffer: function updateInputBuffer(buffer) {
|
||||
if (!buffer || typeof buffer != "string")
|
||||
if (buffer == null)
|
||||
buffer = "";
|
||||
|
||||
this.widgets.inputbuffer.value = buffer;
|
||||
@@ -199,10 +200,10 @@ const StatusLine = Module("statusline", {
|
||||
/**
|
||||
* Display the correct tabcount (e.g., [1/5]) on the status bar.
|
||||
*
|
||||
* @param {bool} delayed When true, update count after a
|
||||
* brief timeout. Useful in the many cases when an
|
||||
* event that triggers an update is broadcast before
|
||||
* the tab state is fully updated.
|
||||
* @param {boolean} delayed When true, update count after a brief timeout.
|
||||
* Useful in the many cases when an event that triggers an update is
|
||||
* broadcast before the tab state is fully updated.
|
||||
* @optional
|
||||
*/
|
||||
updateTabCount: function updateTabCount(delayed) {
|
||||
if (dactyl.has("tabs")) {
|
||||
@@ -224,10 +225,11 @@ const StatusLine = Module("statusline", {
|
||||
* Display the main content's vertical scroll position in the status
|
||||
* bar.
|
||||
*
|
||||
* @param {number} percent The position, as a percentage. @optional
|
||||
* @param {number} percent The position, as a percentage.
|
||||
* @optional
|
||||
*/
|
||||
updateBufferPosition: function updateBufferPosition(percent) {
|
||||
if (typeof percent != "number") {
|
||||
if (percent == null) {
|
||||
let win = document.commandDispatcher.focusedWindow;
|
||||
if (!win)
|
||||
return;
|
||||
|
||||
@@ -11,6 +11,8 @@ ARCHITECTURE:
|
||||
Unfortunately, nearly all of the parsers are lacking in some way, bloated to
|
||||
hell, and/or lack support for JS 1.8. --Kris
|
||||
|
||||
- unify the disgusting hodge podge of contract specification styles
|
||||
|
||||
REFACTORING:
|
||||
- remove unnecessary usage of "self"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user