add column to a PieceTable::Cursor
This commit is contained in:
parent
11cac3c8b5
commit
728e389c1e
@ -43,8 +43,9 @@ std::shared_ptr<PieceTable::Cursor> PieceTable::add_cursor()
|
|||||||
auto cursor = std::make_shared<Cursor>();
|
auto cursor = std::make_shared<Cursor>();
|
||||||
|
|
||||||
cursor->piece = start_piece->next;
|
cursor->piece = start_piece->next;
|
||||||
cursor->line_number = 1u;
|
cursor->line_number = 0u;
|
||||||
cursor->offset = 0u;
|
cursor->offset = 0u;
|
||||||
|
cursor->column = 0u;
|
||||||
|
|
||||||
m_cursors.push_back(cursor);
|
m_cursors.push_back(cursor);
|
||||||
|
|
||||||
|
@ -55,8 +55,11 @@ public:
|
|||||||
/** Byte offset within the piece. */
|
/** Byte offset within the piece. */
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
|
|
||||||
/** Line number the cursor is on. */
|
/** Line number the cursor is on (0 based). */
|
||||||
uint32_t line_number;
|
uint32_t line_number;
|
||||||
|
|
||||||
|
/** Virtual column (0 based). */
|
||||||
|
uint32_t column;
|
||||||
};
|
};
|
||||||
|
|
||||||
PieceTable(const uint8_t * file_buffer, unsigned long file_buffer_size);
|
PieceTable(const uint8_t * file_buffer, unsigned long file_buffer_size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user