Lines Matching refs:line

275 				// The source line was a history line and has been copied
288 TerminalLine* line = _HistoryLineAt(row, lineBuffer);
289 return line != NULL && column > 0 && column < line->length
290 && line->cells[column - 1].attributes.IsWidth();
299 TerminalLine* line = _HistoryLineAt(row, lineBuffer);
300 if (line == NULL)
303 if (column < 0 || column >= line->length)
306 if (column > 0 && line->cells[column - 1].attributes.IsWidth())
309 TerminalCell& cell = line->cells[column];
322 TerminalLine* line = _HistoryLineAt(row, lineBuffer);
323 if (line == NULL || column < 0)
328 TerminalCell& cell = line->cells[c];
342 TerminalLine* line = _HistoryLineAt(row, lineBuffer);
343 if (line == NULL)
346 if (lastColumn >= line->length)
347 lastColumn = line->length - 1;
351 attributes = line->cells[column].attributes;
354 TerminalCell& cell = line->cells[column];
383 // get all but the last line
385 TerminalLine* line = _GetPartialLineString(string, pos.y, pos.x,
387 if (line != NULL && !line->softBreak)
393 // get the last line, if not empty
408 TerminalLine* line = _HistoryLineAt(y, lineBuffer);
409 if (line == NULL || x < 0 || x >= fWidth)
412 if (x >= line->length) {
413 // beyond the end of the line -- select all space
417 _start.SetTo(line->length, y);
422 if (x > 0 && line->cells[x - 1].attributes.IsWidth())
426 int type = classifier->Classify(line->cells[x].character);
434 TermPos end(x + (line->cells[x].attributes.IsWidth()
438 if (!_PreviousLinePos(lineBuffer, line, previousPos)
439 || classifier->Classify(line->cells[previousPos.x].character)
448 line = _HistoryLineAt(end.y, lineBuffer);
452 if (!_NormalizeLinePos(lineBuffer, line, nextPos))
455 if (classifier->Classify(line->cells[nextPos.x].character) != type)
458 nextPos.x += line->cells[nextPos.x].attributes.IsWidth()
473 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer);
474 if (line == NULL || pos.x < 0 || pos.x >= fWidth)
477 return _PreviousLinePos(lineBuffer, line, pos);
485 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer);
486 if (line == NULL || pos.x < 0 || pos.x > fWidth)
489 if (!_NormalizeLinePos(lineBuffer, line, pos))
492 pos.x += line->cells[pos.x].attributes.IsWidth() ? FULL_WIDTH : HALF_WIDTH;
493 return !normalize || _NormalizeLinePos(lineBuffer, line, pos);
501 TerminalLine* line = _HistoryLineAt(index, lineBuffer);
502 return line != NULL ? line->length : 0;
510 TerminalLine* line = _HistoryLineAt(index, lineBuffer);
511 if (line != NULL)
512 attr = line->attributes;
528 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer);
529 if (line != NULL) {
531 while (line != NULL && pos.x >= line->length && line->softBreak) {
534 line = _HistoryLineAt(pos.y, lineBuffer);
537 if (pos.x > line->length)
538 pos.x = line->length;
645 TerminalLine* line = _LineAt(fCursor.y);
646 line->cells[fCursor.x].character = c;
647 line->cells[fCursor.x].attributes = fAttributes;
648 line->cells[fCursor.x].attributes.state |= (width == FULL_WIDTH ? A_WIDTH : 0);
650 if (line->length < fCursor.x + width)
651 line->length = fCursor.x + width;
679 TerminalLine *line = _LineAt(y);
681 line->cells[x].character = c;
682 line->cells[x].attributes = attributes;
684 line->length = fWidth / width;
694 TerminalLine* line = _LineAt(fCursor.y);
696 line->attributes = fAttributes;
697 line->softBreak = false;
749 // Ensure x stayx within the line bounds
753 TerminalLine* line = _LineAt(fCursor.y);
755 if (line->length <= i) {
756 line->cells[i].character = ' ';
757 line->cells[i].attributes = fAttributes;
761 if (line->length < fCursor.x)
762 line->length = fCursor.x;
779 // Ensure x stays within the line bounds
818 TerminalLine* line = _LineAt(fCursor.y);
820 line->cells[i].character = kSpaceChar;
821 line->cells[i].attributes = line->cells[fCursor.x - 1].attributes;
823 line->attributes = fAttributes;
833 TerminalLine* line = _LineAt(fCursor.y);
837 line->cells[i].attributes = fAttributes;
839 line->attributes = fAttributes;
843 end = min_c(first + numChars, line->length);
844 if (first > 0 && line->cells[first - 1].attributes.IsWidth())
846 if (end > 0 && line->cells[end - 1].attributes.IsWidth())
850 line->cells[i].character = kSpaceChar;
851 line->cells[i].attributes = fAttributes;
867 // Delete the chars on the cursor line before (and including) the cursor.
868 TerminalLine* line = _LineAt(fCursor.y);
869 if (fCursor.x < line->length) {
871 if (line->cells[fCursor.x].attributes.IsWidth())
874 line->cells[i].attributes = fAttributes;
875 line->cells[i].character = kSpaceChar;
878 line->Clear(fAttributes, fWidth);
893 // Delete the chars on the cursor line after (and including) the cursor.
911 TerminalLine* line = _LineAt(fCursor.y);
912 if (fCursor.x < line->length) {
913 if (fCursor.x + numChars < line->length) {
914 int32 left = line->length - fCursor.x - numChars;
915 memmove(line->cells + fCursor.x, line->cells + fCursor.x + numChars,
917 line->length = fCursor.x + left;
920 line->cells[fCursor.x + left + i].attributes = fAttributes;
923 for (int i = 0; i < line->length - fCursor.x; i++)
924 line->cells[fCursor.x + i].attributes = fAttributes;
926 line->length = fCursor.x;
939 TerminalLine* line = _LineAt(fCursor.y);
942 line->cells[i].attributes = fAttributes;
944 if (first <= line->length) {
945 line->length = first;
946 line->attributes = fAttributes;
1122 TerminalLine* line = _LineAt(i);
1123 if (line->length > 0) {
1129 line->Clear(fAttributes, fWidth);
1166 TerminalLine* line = fHistory->GetTerminalLineAt(i, lineBuffer);
1167 if (line->length > width)
1168 _TruncateLine(line, width);
1169 history->AddLine(line);
1213 TerminalLine* line = _LineAt(i);
1215 _TruncateLine(line, width);
1216 fHistory->AddLine(line);
1274 // The width changes. We have to allocate a new line array, a new history
1318 // Clear a new dest line before using it. If we're about to
1319 // overwrite an previously written line, we push it to the
1359 // of line.
1398 // If the last source line had a soft break, the last dest line
1415 // Move the line we're going to clear to the history, if that's a
1416 // line we've written earlier.
1417 TerminalLine* line = screen[i % height];
1419 history->AddLine(line);
1420 line->Clear(fAttributes, width);
1598 TerminalLine* line = _LineAt(fCursor.y);
1599 line->softBreak = true;
1612 TerminalLine* line = _LineAt(fCursor.y);
1613 if (line->length < fCursor.x)
1614 for (int32 i = line->length; i < fCursor.x; i++)
1615 line->cells[i].character = kSpaceChar;
1620 BasicTerminalBuffer::_TruncateLine(TerminalLine* line, int32 length)
1622 if (line->length <= length)
1625 if (length > 0 && line->cells[length - 1].attributes.IsWidth())
1628 line->length = length;
1636 TerminalLine* line = _LineAt(fCursor.y);
1638 int32 toMove = min_c(line->length - fCursor.x, fWidth - fCursor.x - width);
1640 memmove(line->cells + fCursor.x + width,
1641 line->cells + fCursor.x, toMove * sizeof(TerminalCell));
1644 line->length = min_c(line->length + width, fWidth);
1655 TerminalLine* line = _HistoryLineAt(row, lineBuffer);
1656 if (line == NULL)
1659 if (endColumn > line->length)
1660 endColumn = line->length;
1663 const TerminalCell& cell = line->cells[x];
1670 return line;
1682 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer);
1687 line = _HistoryLineAt(pos.y, lineBuffer);
1688 if (line == NULL)
1691 pos.x = line->length;
1692 if (line->softBreak) {
1699 c = line->cells[pos.x].character;
1712 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer);
1713 if (line == NULL)
1716 if (pos.x >= line->length) {
1723 c = line->cells[pos.x].character;
1726 while (line != NULL && pos.x >= line->length && line->softBreak) {
1729 line = _HistoryLineAt(pos.y, lineBuffer);
1738 TerminalLine*& line, TermPos& pos) const
1741 // Hit the beginning of the line -- continue at the end of the
1742 // previous line, if it soft-breaks.
1744 if ((line = _HistoryLineAt(pos.y, lineBuffer)) == NULL
1745 || !line->softBreak || line->length == 0) {
1748 pos.x = line->length - 1;
1750 if (pos.x > 0 && line->cells[pos.x - 1].attributes.IsWidth())
1759 TerminalLine*& line, TermPos& pos) const
1761 if (pos.x < line->length)
1764 // Hit the end of the line -- if it soft-breaks continue with the
1765 // next line.
1766 if (!line->softBreak)
1771 line = _HistoryLineAt(pos.y, lineBuffer);
1772 return line != NULL;
1800 TerminalLine* line = dumpHistory
1804 if (line == NULL) {
1805 fprintf(fileOut, "line: %d is NULL!!!\n", i);
1810 i, line->length, line->attributes.state);
1811 for (int j = 0; j < line->length; j++)
1812 if (line->cells[j].character.bytes[0] != 0)
1813 fwrite(line->cells[j].character.bytes, 1,
1814 line->cells[j].character.ByteCount(), fileOut);
1820 (line->cells[j].attributes.state >> s) & 0x0F);