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

This commit is contained in:
Josh Holtrop 2016-08-04 22:19:13 -04:00
parent 728e389c1e
commit abf853e1ba
2 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,7 @@ std::shared_ptr<PieceTable::Cursor> PieceTable::add_cursor()
{
auto cursor = std::make_shared<Cursor>();
cursor->piece_table = this;
cursor->piece = start_piece->next;
cursor->line_number = 0u;
cursor->offset = 0u;

View File

@ -49,6 +49,9 @@ public:
struct Cursor
{
/** The piece table the cursor belongs to. */
PieceTable * piece_table;
/** The piece. */
Piece * piece;