// Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
// Copyright (c) 2010 by anekos <anekos@snca.net>
-// Copyright (c) 2010-2013 Kris Maglione <maglione.k at Gmail>
+// Copyright (c) 2010-2014 Kris Maglione <maglione.k at Gmail>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
},
/** @property {boolean} True if there are no abbreviations. */
- get empty() !values(this._store).nth(util.identity, 0),
+ get empty() !values(this._store).find(util.identity),
/**
* Adds a new abbreviation.
*/
get: function (mode, lhs) {
let abbrevs = this._store[mode];
- return abbrevs && Set.has(abbrevs, lhs) ? abbrevs[lhs] : null;
+ return abbrevs && hasOwnProperty(abbrevs, lhs) ? abbrevs[lhs]
+ : null;
},
/**
get userHives() this.allHives.filter(h => h !== this.builtin),
- get: deprecated("group.abbrevs.get", { get: function get() this.user.closure.get }),
- set: deprecated("group.abbrevs.set", { get: function set() this.user.closure.set }),
- remove: deprecated("group.abbrevs.remove", { get: function remove() this.user.closure.remove }),
- removeAll: deprecated("group.abbrevs.clear", { get: function removeAll() this.user.closure.clear }),
+ get: deprecated("group.abbrevs.get", { get: function get() this.user.bound.get }),
+ set: deprecated("group.abbrevs.set", { get: function set() this.user.bound.set }),
+ remove: deprecated("group.abbrevs.remove", { get: function remove() this.user.bound.remove }),
+ removeAll: deprecated("group.abbrevs.clear", { get: function removeAll() this.user.bound.clear }),
/**
* Returns the abbreviation for the given *mode* if *text* matches the
let match = this._match.exec(text);
if (match)
return this.hives.map(h => h.get(mode, match[2] || match[4] || match[6]))
- .nth(util.identity, 0);
+ .find(util.identity);
return null;
},
let hives = (hives || this.userHives).filter(h => !h.empty);
function abbrevs(hive)
- hive.merged.filter(ab => (ab.inModes(modes) && ab.lhs.indexOf(lhs) == 0));
+ hive.merged.filter(ab => (ab.inModes(modes) && ab.lhs.startsWith(lhs)));
let list = ["table", {},
["tr", { highlight: "Title" },