Fix refactoring artifacts.

This commit is contained in:
Claas Augner 2016-12-28 22:37:07 +01:00
parent 1a5fcb72d3
commit ba2db48dbb
No known key found for this signature in database
GPG Key ID: 63E8BCF5EB1A35AE
1 changed files with 2 additions and 2 deletions

View File

@ -537,14 +537,14 @@ export default Ember.Component.extend({
// Remember cursor/selection.
const selectionStart = textarea.selectionStart;
const selectionEnd = textarea.selectionEnd;
const needleEnd = needleStart + oldValue.length;
const needleEnd = needleStart + oldVal.length;
const replacementEnd = needleStart + newVal.length;
// Replace value (side effect: cursor at end).
this.set('value', val.replace(oldVal, newVal));
// Determine cursor/selection.
const newSelectionStart, newSelectionEnd;
let newSelectionStart, newSelectionEnd;
if (selectionEnd <= needleEnd) {
// Selection before needle.
newSelectionStart = selectionStart;