Lines Matching refs:text
200 text, // initial text in the textarea
226 text = target.value;
238 sel = text.slice(selStart, selEnd);
242 sel = range.text;
246 selEnd = tempRange.text.length;
254 preNewlines = text.slice(0, selStart).split(newline).length - 1;
278 if (selStart === 0 || text.charAt(selStart - 1) === '\n') {
289 startLine = text.lastIndexOf('\n', selStart - 1) + 1;
293 if (selEnd === text.length || text.charAt(selEnd) === '\n') {
296 } else if (text.charAt(selEnd - 1) === '\n') {
303 endLine = text.indexOf('\n', selEnd);
305 endLine = text.length;
315 target.value = text.slice(0, startLine) + tab +
316 text.slice(startLine, endLine).replace(/\n/g, function () {
319 }) + text.slice(endLine);
337 if (text.slice(startLine).indexOf(tab) === 0) {
349 … target.value = text.slice(0, startLine) + text.slice(startLine + preTab, selStart) +
353 }) + text.slice(selEnd);
377 range.text = tab;
380 target.value = text.slice(0, selStart) + tab + text.slice(selEnd);
388 if (text.slice(selStart - tabLen).indexOf(tab) === 0) {
389 target.value = text.slice(0, selStart - tabLen) + text.slice(selStart);
409 if (selStart === 0 || text.charAt(selStart - 1) === '\n') {
417 startLine = text.lastIndexOf('\n', selStart - 1) + 1;
420 endLine = text.indexOf('\n', selStart);
424 endLine = text.length;
428 whitespace = text.slice(startLine, endLine).match(/^[ \t]*/)[0];
440 range.text = '\n' + whitespace;
444 target.value = text.slice(0, selStart) + '\n' + whitespace + text.slice(selEnd);