(text)
| 17486 | return newParticle |
| 17487 | } |
| 17488 | pasteText(text) { |
| 17489 | const parent = this.parent |
| 17490 | const index = this.index |
| 17491 | const newParticles = new Particle(text) |
| 17492 | const firstParticle = newParticles.particleAt(0) |
| 17493 | if (firstParticle) { |
| 17494 | this.setLine(firstParticle.getLine()) |
| 17495 | if (firstParticle.length) this.setSubparticles(firstParticle.subparticlesToString()) |
| 17496 | } else { |
| 17497 | this.setLine("") |
| 17498 | } |
| 17499 | newParticles.forEach((subparticle, subparticleIndex) => { |
| 17500 | if (!subparticleIndex) |
| 17501 | // skip first |
| 17502 | return true |
| 17503 | parent.insertLineAndSubparticles(subparticle.getLine(), subparticle.subparticlesToString(), index + subparticleIndex) |
| 17504 | }) |
| 17505 | return this |
| 17506 | } |
| 17507 | templateToString(obj) { |
| 17508 | // todo: compile/cache for perf? |
| 17509 | const particle = this.clone() |
no test coverage detected