Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Update Lodash -> 3.10.0 #11474

Merged
merged 6 commits into from
Jul 31, 2015
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/command/KeyBindingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ define(function (require, exports, module) {
// Ensure that the first letter of the key name is in upper case and the rest are
// in lower case. i.e. 'a' => 'A' and 'up' => 'Up'
if (/^[a-z]/i.test(key)) {
key = key.charAt(0).toUpperCase() + key.substr(1).toLowerCase();
key = _.capitalize(key.toLowerCase());
}

// Also make sure that the second word of PageUp/PageDown has the first letter in upper case.
if (/^Page/.test(key)) {
key = key.replace(/(up|down)$/, function (match, p1) {
return p1.charAt(0).toUpperCase() + p1.substr(1);
return _.capitalize(p1);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/command/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ define(function (require, exports, module) {
menu = getMenu(id);

_.forEach(menuItemMap, function (value, key) {
if (key.substring(0, id.length) === id) {
if (_.startsWith(key, id)) {
if (value.isDivider) {
menu.removeMenuDivider(key);
} else {
Expand Down
11 changes: 1 addition & 10 deletions src/extensions/default/JavaScriptCodeHints/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,7 @@ define(function (require, exports, module) {
}

// trim leading and trailing string literal delimiters from the query
if (query.indexOf(HintUtils.SINGLE_QUOTE) === 0 ||
query.indexOf(HintUtils.DOUBLE_QUOTE) === 0) {
trimmedQuery = query.substring(1);
if (trimmedQuery.lastIndexOf(HintUtils.DOUBLE_QUOTE) === trimmedQuery.length - 1 ||
trimmedQuery.lastIndexOf(HintUtils.SINGLE_QUOTE) === trimmedQuery.length - 1) {
trimmedQuery = trimmedQuery.substring(0, trimmedQuery.length - 1);
}
} else {
trimmedQuery = query;
}
trimmedQuery = _.trim(query, HintUtils.SINGLE_QUOTE + HintUtils.DOUBLE_QUOTE);

if (hints) {
formattedHints = formatHints(hints, trimmedQuery);
Expand Down
2 changes: 1 addition & 1 deletion src/language/CodeInspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ define(function (require, exports, module) {
(error.pos.line + 1) > 0 &&
(error.codeSnippet = currentDoc.getLine(error.pos.line)) !== undefined) {
error.friendlyLine = error.pos.line + 1;
error.codeSnippet = error.codeSnippet.substr(0, Math.min(175, error.codeSnippet.length)); // limit snippet width
error.codeSnippet = error.codeSnippet.substr(0, 175); // limit snippet width
}

if (error.type !== Type.META) {
Expand Down
2 changes: 1 addition & 1 deletion src/preferences/PreferencesBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ define(function (require, exports, module) {
prefix = this.prefix;

var onlyWithPrefix = function (id) {
if (id.substr(0, prefix.length) === prefix) {
if (_.startsWith(id, prefix)) {
return true;
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/preferences/PreferencesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ define(function (require, exports, module) {
if (before === -1) {
before = scopeOrder.length - 2;
}
newScopeOrder = _.first(scopeOrder, before);
newScopeOrder = _.take(scopeOrder, before);
newScopeOrder.push("project");
newScopeOrder.push.apply(newScopeOrder, _.rest(scopeOrder, before));
newScopeOrder.push.apply(newScopeOrder, _.drop(scopeOrder, before));
} else {
newScopeOrder = _.without(scopeOrder, "project");
}
Expand Down
4 changes: 2 additions & 2 deletions src/project/FileTreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ define(function (require, exports, module) {
var aArgs = _.flatten([{
href: "#",
className: fileClasses
}, this.getIcons(), name, extension], true);
}, this.getIcons(), name, extension]);
nameDisplay = DOM.a.apply(DOM.a, aArgs);
}

Expand Down Expand Up @@ -702,7 +702,7 @@ define(function (require, exports, module) {
var aArgs = _.flatten([{
href: "#",
className: directoryClasses
}, this.getIcons()], true);
}, this.getIcons()]);
if (!entry.get("rename")) {
aArgs.push(this.props.name);
}
Expand Down
2 changes: 1 addition & 1 deletion src/search/FindInFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ define(function (require, exports, module) {

if (highlightEndCh <= MAX_DISPLAY_LENGTH) {
// Don't store more than 200 chars per line
line = line.substr(0, Math.min(MAX_DISPLAY_LENGTH, line.length));
line = line.substr(0, line.length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the limit removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it was meant to be the other way round.
I've just pushed a fix.

} else if (totalMatchLength > MAX_DISPLAY_LENGTH) {
// impossible to display the whole match
line = line.substr(ch, ch + MAX_DISPLAY_LENGTH);
Expand Down
146 changes: 94 additions & 52 deletions src/thirdparty/lodash.js

Large diffs are not rendered by default.