use textSpanEnd instead of handrolled version
This commit is contained in:
parent
d3a2dc0c64
commit
66a91c33fb
|
@ -1836,11 +1836,10 @@ module ts {
|
|||
? sourceFile.text.substr(0, textChangeRange.span.start)
|
||||
: "";
|
||||
|
||||
let textChangeRangeEnd = textChangeRange.span.start + textChangeRange.span.length;
|
||||
// grab the fragment from the end of the span till the end of the original text
|
||||
let suffix = textChangeRangeEnd !== sourceFile.text.length
|
||||
? sourceFile.text.substr(textChangeRangeEnd)
|
||||
: "";
|
||||
let suffix = textSpanEnd(textChangeRange.span) !== sourceFile.text.length
|
||||
? sourceFile.text.substr(textSpanEnd(textChangeRange.span))
|
||||
: "";
|
||||
|
||||
if (textChangeRange.newLength === 0) {
|
||||
// edit was a deletion - just combine prefix and suffix
|
||||
|
|
Loading…
Reference in a new issue