link from a piece table cursor object back to the containing piece table

This commit is contained in:
josh committed 2016-08-04 22:19:13 -04:00
1 parent 728e389c1e
commit abf853e1ba
2 files changed
+4

No files matched your search

+1
View File
@@ -42,6 +42,7 @@ std::shared_ptr<PieceTable::Cursor> PieceTable::add_cursor()
{ {
auto cursor = std::make_shared<Cursor>(); auto cursor = std::make_shared<Cursor>();
cursor->piece_table = this;
cursor->piece = start_piece->next; cursor->piece = start_piece->next;
cursor->line_number = 0u; cursor->line_number = 0u;
cursor->offset = 0u; cursor->offset = 0u;
+3
View File
@@ -49,6 +49,9 @@ public:
struct Cursor struct Cursor
{ {
/** The piece table the cursor belongs to. */
PieceTable * piece_table;
/** The piece. */ /** The piece. */
Piece * piece; Piece * piece;