add column to a PieceTable::Cursor

This commit is contained in:
Josh Holtrop 2016-08-01 21:47:40 -04:00
parent 11cac3c8b5
commit 728e389c1e
2 changed files with 6 additions and 2 deletions

View File

@ -43,8 +43,9 @@ std::shared_ptr<PieceTable::Cursor> PieceTable::add_cursor()
auto cursor = std::make_shared<Cursor>();
cursor->piece = start_piece->next;
cursor->line_number = 1u;
cursor->line_number = 0u;
cursor->offset = 0u;
cursor->column = 0u;
m_cursors.push_back(cursor);

View File

@ -55,8 +55,11 @@ public:
/** Byte offset within the piece. */
uint32_t offset;
/** Line number the cursor is on. */
/** Line number the cursor is on (0 based). */
uint32_t line_number;
/** Virtual column (0 based). */
uint32_t column;
};
PieceTable(const uint8_t * file_buffer, unsigned long file_buffer_size);