mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-12 20:25:48 -06:00
use textSpanEnd instead of handrolled version
This commit is contained in:
parent
845820dfe9
commit
1f35f194d2
@ -1835,11 +1835,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…
x
Reference in New Issue
Block a user