Lines Matching refs:end
164 function string_del(str, start, end) {
165 return str.slice(0, start) + str.slice(end, str.length);
247 _index: { start: 0, end: 0 },
273 const b = this._index.end;
284 this._index.start = this._index.end = i;
290 this._index.end = b;
295 if (this._index.start == this._index.end) {
300 index = dx < 0 ? this._index.start : this._index.end;
305 let index = (dy < 0) ? this._index.start : this._index.end;
355 r.textRange = { start: r.offsets[0], end: r.offsets[r.offsets.length-1] };
364 _deleteRange: function(start, end) {
365 ASSERT(start >= 0 && end <= this._text.length);
366 ASSERT(start <= end);
367 if (start === end) {
371 this._delete_style_range(start, end);
373 this._text = string_del(this._text, start, end);
377 if (start == this._index.end) {
391 this._deleteRange(start, this._index.end);
393 this._index.start = this._index.end = start;
398 if (this._index.start != this._index.end) {
410 this._index.start = this._index.end = index + len;
434 let end = 0;
436 while (r.textRange.end <= start) {
449 end = Math.min(r.textRange.end, s_end);
451 LOG('New range: ', start, end,
452 'from run', r.textRange.start, r.textRange.end,
456 if (r.textRange.start >= end) {
457 start = end;
470 if (start > r.textRange.start || end < r.textRange.end) {
480 if (r.offsets[i] >= end) {
508 start = end;
531 _delete_style_range: function(start, end) {
535 // [..................] start...end
541 let N = end - start;
570 applyStyleToRange: function(style, start, end) {
571 if (start > end) { [start, end] = [end, start]; }
572 ASSERT(start >= 0 && end <= this._text.length);
573 if (start === end) {
577 LOG('trying to apply', style, start, end);
584 end -= this._styles[i]._length;
596 end -= start;
601 while (end >= this._styles[i]._length) {
604 end -= this._styles[i]._length;
606 if (end == 0) {
611 if (end > 0) {
614 ns._length = end;
615 s._length -= end; // trim the (unchanged) tail
629 this.applyStyleToRange(style, this._index.start, this._index.end);